vendor.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  15. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  16. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  17. return this;
  18. }();
  19. var key = ['w', 'x'].join('');
  20. var oldWx = target[key];
  21. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  22. function isWxKey(key) {
  23. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  24. return false;
  25. }
  26. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  27. }
  28. function initWx() {
  29. var newWx = {};
  30. for (var _key in oldWx) {
  31. if (isWxKey(_key)) {
  32. // TODO wrapper function
  33. newWx[_key] = oldWx[_key];
  34. }
  35. }
  36. return newWx;
  37. }
  38. target[key] = initWx();
  39. var _default = target[key];
  40. exports.default = _default;
  41. /***/ }),
  42. /* 2 */
  43. /*!************************************************************!*\
  44. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  45. \************************************************************/
  46. /*! no static exports found */
  47. /***/ (function(module, exports, __webpack_require__) {
  48. "use strict";
  49. /* WEBPACK VAR INJECTION */(function(wx, global) {
  50. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  51. Object.defineProperty(exports, "__esModule", {
  52. value: true
  53. });
  54. exports.createApp = createApp;
  55. exports.createComponent = createComponent;
  56. exports.createPage = createPage;
  57. exports.createPlugin = createPlugin;
  58. exports.createSubpackageApp = createSubpackageApp;
  59. exports.default = void 0;
  60. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  61. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  62. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  63. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  64. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  65. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  66. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  67. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  68. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  69. var realAtob;
  70. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  71. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  72. if (typeof atob !== 'function') {
  73. realAtob = function realAtob(str) {
  74. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  75. if (!b64re.test(str)) {
  76. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  77. }
  78. // Adding the padding if missing, for semplicity
  79. str += '=='.slice(2 - (str.length & 3));
  80. var bitmap;
  81. var result = '';
  82. var r1;
  83. var r2;
  84. var i = 0;
  85. for (; i < str.length;) {
  86. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  87. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  88. }
  89. return result;
  90. };
  91. } else {
  92. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  93. realAtob = atob;
  94. }
  95. function b64DecodeUnicode(str) {
  96. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  97. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  98. }).join(''));
  99. }
  100. function getCurrentUserInfo() {
  101. var token = wx.getStorageSync('uni_id_token') || '';
  102. var tokenArr = token.split('.');
  103. if (!token || tokenArr.length !== 3) {
  104. return {
  105. uid: null,
  106. role: [],
  107. permission: [],
  108. tokenExpired: 0
  109. };
  110. }
  111. var userInfo;
  112. try {
  113. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  114. } catch (error) {
  115. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  116. }
  117. userInfo.tokenExpired = userInfo.exp * 1000;
  118. delete userInfo.exp;
  119. delete userInfo.iat;
  120. return userInfo;
  121. }
  122. function uniIdMixin(Vue) {
  123. Vue.prototype.uniIDHasRole = function (roleId) {
  124. var _getCurrentUserInfo = getCurrentUserInfo(),
  125. role = _getCurrentUserInfo.role;
  126. return role.indexOf(roleId) > -1;
  127. };
  128. Vue.prototype.uniIDHasPermission = function (permissionId) {
  129. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  130. permission = _getCurrentUserInfo2.permission;
  131. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  132. };
  133. Vue.prototype.uniIDTokenValid = function () {
  134. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  135. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  136. return tokenExpired > Date.now();
  137. };
  138. }
  139. var _toString = Object.prototype.toString;
  140. var hasOwnProperty = Object.prototype.hasOwnProperty;
  141. function isFn(fn) {
  142. return typeof fn === 'function';
  143. }
  144. function isStr(str) {
  145. return typeof str === 'string';
  146. }
  147. function isObject(obj) {
  148. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  149. }
  150. function isPlainObject(obj) {
  151. return _toString.call(obj) === '[object Object]';
  152. }
  153. function hasOwn(obj, key) {
  154. return hasOwnProperty.call(obj, key);
  155. }
  156. function noop() {}
  157. /**
  158. * Create a cached version of a pure function.
  159. */
  160. function cached(fn) {
  161. var cache = Object.create(null);
  162. return function cachedFn(str) {
  163. var hit = cache[str];
  164. return hit || (cache[str] = fn(str));
  165. };
  166. }
  167. /**
  168. * Camelize a hyphen-delimited string.
  169. */
  170. var camelizeRE = /-(\w)/g;
  171. var camelize = cached(function (str) {
  172. return str.replace(camelizeRE, function (_, c) {
  173. return c ? c.toUpperCase() : '';
  174. });
  175. });
  176. function sortObject(obj) {
  177. var sortObj = {};
  178. if (isPlainObject(obj)) {
  179. Object.keys(obj).sort().forEach(function (key) {
  180. sortObj[key] = obj[key];
  181. });
  182. }
  183. return !Object.keys(sortObj) ? obj : sortObj;
  184. }
  185. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  186. var globalInterceptors = {};
  187. var scopedInterceptors = {};
  188. function mergeHook(parentVal, childVal) {
  189. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  190. return res ? dedupeHooks(res) : res;
  191. }
  192. function dedupeHooks(hooks) {
  193. var res = [];
  194. for (var i = 0; i < hooks.length; i++) {
  195. if (res.indexOf(hooks[i]) === -1) {
  196. res.push(hooks[i]);
  197. }
  198. }
  199. return res;
  200. }
  201. function removeHook(hooks, hook) {
  202. var index = hooks.indexOf(hook);
  203. if (index !== -1) {
  204. hooks.splice(index, 1);
  205. }
  206. }
  207. function mergeInterceptorHook(interceptor, option) {
  208. Object.keys(option).forEach(function (hook) {
  209. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  210. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  211. }
  212. });
  213. }
  214. function removeInterceptorHook(interceptor, option) {
  215. if (!interceptor || !option) {
  216. return;
  217. }
  218. Object.keys(option).forEach(function (hook) {
  219. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  220. removeHook(interceptor[hook], option[hook]);
  221. }
  222. });
  223. }
  224. function addInterceptor(method, option) {
  225. if (typeof method === 'string' && isPlainObject(option)) {
  226. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  227. } else if (isPlainObject(method)) {
  228. mergeInterceptorHook(globalInterceptors, method);
  229. }
  230. }
  231. function removeInterceptor(method, option) {
  232. if (typeof method === 'string') {
  233. if (isPlainObject(option)) {
  234. removeInterceptorHook(scopedInterceptors[method], option);
  235. } else {
  236. delete scopedInterceptors[method];
  237. }
  238. } else if (isPlainObject(method)) {
  239. removeInterceptorHook(globalInterceptors, method);
  240. }
  241. }
  242. function wrapperHook(hook) {
  243. return function (data) {
  244. return hook(data) || data;
  245. };
  246. }
  247. function isPromise(obj) {
  248. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  249. }
  250. function queue(hooks, data) {
  251. var promise = false;
  252. for (var i = 0; i < hooks.length; i++) {
  253. var hook = hooks[i];
  254. if (promise) {
  255. promise = Promise.resolve(wrapperHook(hook));
  256. } else {
  257. var res = hook(data);
  258. if (isPromise(res)) {
  259. promise = Promise.resolve(res);
  260. }
  261. if (res === false) {
  262. return {
  263. then: function then() {}
  264. };
  265. }
  266. }
  267. }
  268. return promise || {
  269. then: function then(callback) {
  270. return callback(data);
  271. }
  272. };
  273. }
  274. function wrapperOptions(interceptor) {
  275. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  276. ['success', 'fail', 'complete'].forEach(function (name) {
  277. if (Array.isArray(interceptor[name])) {
  278. var oldCallback = options[name];
  279. options[name] = function callbackInterceptor(res) {
  280. queue(interceptor[name], res).then(function (res) {
  281. /* eslint-disable no-mixed-operators */
  282. return isFn(oldCallback) && oldCallback(res) || res;
  283. });
  284. };
  285. }
  286. });
  287. return options;
  288. }
  289. function wrapperReturnValue(method, returnValue) {
  290. var returnValueHooks = [];
  291. if (Array.isArray(globalInterceptors.returnValue)) {
  292. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  293. }
  294. var interceptor = scopedInterceptors[method];
  295. if (interceptor && Array.isArray(interceptor.returnValue)) {
  296. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  297. }
  298. returnValueHooks.forEach(function (hook) {
  299. returnValue = hook(returnValue) || returnValue;
  300. });
  301. return returnValue;
  302. }
  303. function getApiInterceptorHooks(method) {
  304. var interceptor = Object.create(null);
  305. Object.keys(globalInterceptors).forEach(function (hook) {
  306. if (hook !== 'returnValue') {
  307. interceptor[hook] = globalInterceptors[hook].slice();
  308. }
  309. });
  310. var scopedInterceptor = scopedInterceptors[method];
  311. if (scopedInterceptor) {
  312. Object.keys(scopedInterceptor).forEach(function (hook) {
  313. if (hook !== 'returnValue') {
  314. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  315. }
  316. });
  317. }
  318. return interceptor;
  319. }
  320. function invokeApi(method, api, options) {
  321. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  322. params[_key - 3] = arguments[_key];
  323. }
  324. var interceptor = getApiInterceptorHooks(method);
  325. if (interceptor && Object.keys(interceptor).length) {
  326. if (Array.isArray(interceptor.invoke)) {
  327. var res = queue(interceptor.invoke, options);
  328. return res.then(function (options) {
  329. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  330. });
  331. } else {
  332. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  333. }
  334. }
  335. return api.apply(void 0, [options].concat(params));
  336. }
  337. var promiseInterceptor = {
  338. returnValue: function returnValue(res) {
  339. if (!isPromise(res)) {
  340. return res;
  341. }
  342. return new Promise(function (resolve, reject) {
  343. res.then(function (res) {
  344. if (res[0]) {
  345. reject(res[0]);
  346. } else {
  347. resolve(res[1]);
  348. }
  349. });
  350. });
  351. }
  352. };
  353. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  354. var CONTEXT_API_RE = /^create|Manager$/;
  355. // Context例外情况
  356. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  357. // 同步例外情况
  358. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  359. var CALLBACK_API_RE = /^on|^off/;
  360. function isContextApi(name) {
  361. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  362. }
  363. function isSyncApi(name) {
  364. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  365. }
  366. function isCallbackApi(name) {
  367. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  368. }
  369. function handlePromise(promise) {
  370. return promise.then(function (data) {
  371. return [null, data];
  372. }).catch(function (err) {
  373. return [err];
  374. });
  375. }
  376. function shouldPromise(name) {
  377. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  378. return false;
  379. }
  380. return true;
  381. }
  382. /* eslint-disable no-extend-native */
  383. if (!Promise.prototype.finally) {
  384. Promise.prototype.finally = function (callback) {
  385. var promise = this.constructor;
  386. return this.then(function (value) {
  387. return promise.resolve(callback()).then(function () {
  388. return value;
  389. });
  390. }, function (reason) {
  391. return promise.resolve(callback()).then(function () {
  392. throw reason;
  393. });
  394. });
  395. };
  396. }
  397. function promisify(name, api) {
  398. if (!shouldPromise(name) || !isFn(api)) {
  399. return api;
  400. }
  401. return function promiseApi() {
  402. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  403. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  404. params[_key2 - 1] = arguments[_key2];
  405. }
  406. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  407. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  408. }
  409. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  410. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  411. success: resolve,
  412. fail: reject
  413. })].concat(params));
  414. })));
  415. };
  416. }
  417. var EPS = 1e-4;
  418. var BASE_DEVICE_WIDTH = 750;
  419. var isIOS = false;
  420. var deviceWidth = 0;
  421. var deviceDPR = 0;
  422. function checkDeviceWidth() {
  423. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  424. platform = _wx$getSystemInfoSync.platform,
  425. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  426. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  427. deviceWidth = windowWidth;
  428. deviceDPR = pixelRatio;
  429. isIOS = platform === 'ios';
  430. }
  431. function upx2px(number, newDeviceWidth) {
  432. if (deviceWidth === 0) {
  433. checkDeviceWidth();
  434. }
  435. number = Number(number);
  436. if (number === 0) {
  437. return 0;
  438. }
  439. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  440. if (result < 0) {
  441. result = -result;
  442. }
  443. result = Math.floor(result + EPS);
  444. if (result === 0) {
  445. if (deviceDPR === 1 || !isIOS) {
  446. result = 1;
  447. } else {
  448. result = 0.5;
  449. }
  450. }
  451. return number < 0 ? -result : result;
  452. }
  453. var LOCALE_ZH_HANS = 'zh-Hans';
  454. var LOCALE_ZH_HANT = 'zh-Hant';
  455. var LOCALE_EN = 'en';
  456. var LOCALE_FR = 'fr';
  457. var LOCALE_ES = 'es';
  458. var messages = {};
  459. var locale;
  460. {
  461. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  462. }
  463. function initI18nMessages() {
  464. if (!isEnableLocale()) {
  465. return;
  466. }
  467. var localeKeys = Object.keys(__uniConfig.locales);
  468. if (localeKeys.length) {
  469. localeKeys.forEach(function (locale) {
  470. var curMessages = messages[locale];
  471. var userMessages = __uniConfig.locales[locale];
  472. if (curMessages) {
  473. Object.assign(curMessages, userMessages);
  474. } else {
  475. messages[locale] = userMessages;
  476. }
  477. });
  478. }
  479. }
  480. initI18nMessages();
  481. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  482. var t = i18n.t;
  483. var i18nMixin = i18n.mixin = {
  484. beforeCreate: function beforeCreate() {
  485. var _this = this;
  486. var unwatch = i18n.i18n.watchLocale(function () {
  487. _this.$forceUpdate();
  488. });
  489. this.$once('hook:beforeDestroy', function () {
  490. unwatch();
  491. });
  492. },
  493. methods: {
  494. $$t: function $$t(key, values) {
  495. return t(key, values);
  496. }
  497. }
  498. };
  499. var setLocale = i18n.setLocale;
  500. var getLocale = i18n.getLocale;
  501. function initAppLocale(Vue, appVm, locale) {
  502. var state = Vue.observable({
  503. locale: locale || i18n.getLocale()
  504. });
  505. var localeWatchers = [];
  506. appVm.$watchLocale = function (fn) {
  507. localeWatchers.push(fn);
  508. };
  509. Object.defineProperty(appVm, '$locale', {
  510. get: function get() {
  511. return state.locale;
  512. },
  513. set: function set(v) {
  514. state.locale = v;
  515. localeWatchers.forEach(function (watch) {
  516. return watch(v);
  517. });
  518. }
  519. });
  520. }
  521. function isEnableLocale() {
  522. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  523. }
  524. function include(str, parts) {
  525. return !!parts.find(function (part) {
  526. return str.indexOf(part) !== -1;
  527. });
  528. }
  529. function startsWith(str, parts) {
  530. return parts.find(function (part) {
  531. return str.indexOf(part) === 0;
  532. });
  533. }
  534. function normalizeLocale(locale, messages) {
  535. if (!locale) {
  536. return;
  537. }
  538. locale = locale.trim().replace(/_/g, '-');
  539. if (messages && messages[locale]) {
  540. return locale;
  541. }
  542. locale = locale.toLowerCase();
  543. if (locale === 'chinese') {
  544. // 支付宝
  545. return LOCALE_ZH_HANS;
  546. }
  547. if (locale.indexOf('zh') === 0) {
  548. if (locale.indexOf('-hans') > -1) {
  549. return LOCALE_ZH_HANS;
  550. }
  551. if (locale.indexOf('-hant') > -1) {
  552. return LOCALE_ZH_HANT;
  553. }
  554. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  555. return LOCALE_ZH_HANT;
  556. }
  557. return LOCALE_ZH_HANS;
  558. }
  559. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  560. if (lang) {
  561. return lang;
  562. }
  563. }
  564. // export function initI18n() {
  565. // const localeKeys = Object.keys(__uniConfig.locales || {})
  566. // if (localeKeys.length) {
  567. // localeKeys.forEach((locale) =>
  568. // i18n.add(locale, __uniConfig.locales[locale])
  569. // )
  570. // }
  571. // }
  572. function getLocale$1() {
  573. // 优先使用 $locale
  574. if (isFn(getApp)) {
  575. var app = getApp({
  576. allowDefault: true
  577. });
  578. if (app && app.$vm) {
  579. return app.$vm.$locale;
  580. }
  581. }
  582. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  583. }
  584. function setLocale$1(locale) {
  585. var app = isFn(getApp) ? getApp() : false;
  586. if (!app) {
  587. return false;
  588. }
  589. var oldLocale = app.$vm.$locale;
  590. if (oldLocale !== locale) {
  591. app.$vm.$locale = locale;
  592. onLocaleChangeCallbacks.forEach(function (fn) {
  593. return fn({
  594. locale: locale
  595. });
  596. });
  597. return true;
  598. }
  599. return false;
  600. }
  601. var onLocaleChangeCallbacks = [];
  602. function onLocaleChange(fn) {
  603. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  604. onLocaleChangeCallbacks.push(fn);
  605. }
  606. }
  607. if (typeof global !== 'undefined') {
  608. global.getLocale = getLocale$1;
  609. }
  610. var interceptors = {
  611. promiseInterceptor: promiseInterceptor
  612. };
  613. var baseApi = /*#__PURE__*/Object.freeze({
  614. __proto__: null,
  615. upx2px: upx2px,
  616. getLocale: getLocale$1,
  617. setLocale: setLocale$1,
  618. onLocaleChange: onLocaleChange,
  619. addInterceptor: addInterceptor,
  620. removeInterceptor: removeInterceptor,
  621. interceptors: interceptors
  622. });
  623. function findExistsPageIndex(url) {
  624. var pages = getCurrentPages();
  625. var len = pages.length;
  626. while (len--) {
  627. var page = pages[len];
  628. if (page.$page && page.$page.fullPath === url) {
  629. return len;
  630. }
  631. }
  632. return -1;
  633. }
  634. var redirectTo = {
  635. name: function name(fromArgs) {
  636. if (fromArgs.exists === 'back' && fromArgs.delta) {
  637. return 'navigateBack';
  638. }
  639. return 'redirectTo';
  640. },
  641. args: function args(fromArgs) {
  642. if (fromArgs.exists === 'back' && fromArgs.url) {
  643. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  644. if (existsPageIndex !== -1) {
  645. var delta = getCurrentPages().length - 1 - existsPageIndex;
  646. if (delta > 0) {
  647. fromArgs.delta = delta;
  648. }
  649. }
  650. }
  651. }
  652. };
  653. var previewImage = {
  654. args: function args(fromArgs) {
  655. var currentIndex = parseInt(fromArgs.current);
  656. if (isNaN(currentIndex)) {
  657. return;
  658. }
  659. var urls = fromArgs.urls;
  660. if (!Array.isArray(urls)) {
  661. return;
  662. }
  663. var len = urls.length;
  664. if (!len) {
  665. return;
  666. }
  667. if (currentIndex < 0) {
  668. currentIndex = 0;
  669. } else if (currentIndex >= len) {
  670. currentIndex = len - 1;
  671. }
  672. if (currentIndex > 0) {
  673. fromArgs.current = urls[currentIndex];
  674. fromArgs.urls = urls.filter(function (item, index) {
  675. return index < currentIndex ? item !== urls[currentIndex] : true;
  676. });
  677. } else {
  678. fromArgs.current = urls[0];
  679. }
  680. return {
  681. indicator: false,
  682. loop: false
  683. };
  684. }
  685. };
  686. var UUID_KEY = '__DC_STAT_UUID';
  687. var deviceId;
  688. function useDeviceId(result) {
  689. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  690. if (!deviceId) {
  691. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  692. wx.setStorage({
  693. key: UUID_KEY,
  694. data: deviceId
  695. });
  696. }
  697. result.deviceId = deviceId;
  698. }
  699. function addSafeAreaInsets(result) {
  700. if (result.safeArea) {
  701. var safeArea = result.safeArea;
  702. result.safeAreaInsets = {
  703. top: safeArea.top,
  704. left: safeArea.left,
  705. right: result.windowWidth - safeArea.right,
  706. bottom: result.screenHeight - safeArea.bottom
  707. };
  708. }
  709. }
  710. function populateParameters(result) {
  711. var _result$brand = result.brand,
  712. brand = _result$brand === void 0 ? '' : _result$brand,
  713. _result$model = result.model,
  714. model = _result$model === void 0 ? '' : _result$model,
  715. _result$system = result.system,
  716. system = _result$system === void 0 ? '' : _result$system,
  717. _result$language = result.language,
  718. language = _result$language === void 0 ? '' : _result$language,
  719. theme = result.theme,
  720. version = result.version,
  721. platform = result.platform,
  722. fontSizeSetting = result.fontSizeSetting,
  723. SDKVersion = result.SDKVersion,
  724. pixelRatio = result.pixelRatio,
  725. deviceOrientation = result.deviceOrientation;
  726. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  727. var extraParam = {};
  728. // osName osVersion
  729. var osName = '';
  730. var osVersion = '';
  731. {
  732. osName = system.split(' ')[0] || '';
  733. osVersion = system.split(' ')[1] || '';
  734. }
  735. var hostVersion = version;
  736. // deviceType
  737. var deviceType = getGetDeviceType(result, model);
  738. // deviceModel
  739. var deviceBrand = getDeviceBrand(brand);
  740. // hostName
  741. var _hostName = getHostName(result);
  742. // deviceOrientation
  743. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  744. // devicePixelRatio
  745. var _devicePixelRatio = pixelRatio;
  746. // SDKVersion
  747. var _SDKVersion = SDKVersion;
  748. // hostLanguage
  749. var hostLanguage = language.replace(/_/g, '-');
  750. // wx.getAccountInfoSync
  751. var parameters = {
  752. appId: "__UNI__524F1F7",
  753. appName: "broke_news_wx",
  754. appVersion: "1.0.0",
  755. appVersionCode: "100",
  756. appLanguage: getAppLanguage(hostLanguage),
  757. uniCompileVersion: "3.7.9",
  758. uniRuntimeVersion: "3.7.9",
  759. uniPlatform: undefined || "mp-weixin",
  760. deviceBrand: deviceBrand,
  761. deviceModel: model,
  762. deviceType: deviceType,
  763. devicePixelRatio: _devicePixelRatio,
  764. deviceOrientation: _deviceOrientation,
  765. osName: osName.toLocaleLowerCase(),
  766. osVersion: osVersion,
  767. hostTheme: theme,
  768. hostVersion: hostVersion,
  769. hostLanguage: hostLanguage,
  770. hostName: _hostName,
  771. hostSDKVersion: _SDKVersion,
  772. hostFontSizeSetting: fontSizeSetting,
  773. windowTop: 0,
  774. windowBottom: 0,
  775. // TODO
  776. osLanguage: undefined,
  777. osTheme: undefined,
  778. ua: undefined,
  779. hostPackageName: undefined,
  780. browserName: undefined,
  781. browserVersion: undefined
  782. };
  783. Object.assign(result, parameters, extraParam);
  784. }
  785. function getGetDeviceType(result, model) {
  786. var deviceType = result.deviceType || 'phone';
  787. {
  788. var deviceTypeMaps = {
  789. ipad: 'pad',
  790. windows: 'pc',
  791. mac: 'pc'
  792. };
  793. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  794. var _model = model.toLocaleLowerCase();
  795. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  796. var _m = deviceTypeMapsKeys[index];
  797. if (_model.indexOf(_m) !== -1) {
  798. deviceType = deviceTypeMaps[_m];
  799. break;
  800. }
  801. }
  802. }
  803. return deviceType;
  804. }
  805. function getDeviceBrand(brand) {
  806. var deviceBrand = brand;
  807. if (deviceBrand) {
  808. deviceBrand = brand.toLocaleLowerCase();
  809. }
  810. return deviceBrand;
  811. }
  812. function getAppLanguage(defaultLanguage) {
  813. return getLocale$1 ? getLocale$1() : defaultLanguage;
  814. }
  815. function getHostName(result) {
  816. var _platform = 'WeChat';
  817. var _hostName = result.hostName || _platform; // mp-jd
  818. {
  819. if (result.environment) {
  820. _hostName = result.environment;
  821. } else if (result.host && result.host.env) {
  822. _hostName = result.host.env;
  823. }
  824. }
  825. return _hostName;
  826. }
  827. var getSystemInfo = {
  828. returnValue: function returnValue(result) {
  829. useDeviceId(result);
  830. addSafeAreaInsets(result);
  831. populateParameters(result);
  832. }
  833. };
  834. var showActionSheet = {
  835. args: function args(fromArgs) {
  836. if ((0, _typeof2.default)(fromArgs) === 'object') {
  837. fromArgs.alertText = fromArgs.title;
  838. }
  839. }
  840. };
  841. var getAppBaseInfo = {
  842. returnValue: function returnValue(result) {
  843. var _result = result,
  844. version = _result.version,
  845. language = _result.language,
  846. SDKVersion = _result.SDKVersion,
  847. theme = _result.theme;
  848. var _hostName = getHostName(result);
  849. var hostLanguage = language.replace('_', '-');
  850. result = sortObject(Object.assign(result, {
  851. appId: "__UNI__524F1F7",
  852. appName: "broke_news_wx",
  853. appVersion: "1.0.0",
  854. appVersionCode: "100",
  855. appLanguage: getAppLanguage(hostLanguage),
  856. hostVersion: version,
  857. hostLanguage: hostLanguage,
  858. hostName: _hostName,
  859. hostSDKVersion: SDKVersion,
  860. hostTheme: theme
  861. }));
  862. }
  863. };
  864. var getDeviceInfo = {
  865. returnValue: function returnValue(result) {
  866. var _result2 = result,
  867. brand = _result2.brand,
  868. model = _result2.model;
  869. var deviceType = getGetDeviceType(result, model);
  870. var deviceBrand = getDeviceBrand(brand);
  871. useDeviceId(result);
  872. result = sortObject(Object.assign(result, {
  873. deviceType: deviceType,
  874. deviceBrand: deviceBrand,
  875. deviceModel: model
  876. }));
  877. }
  878. };
  879. var getWindowInfo = {
  880. returnValue: function returnValue(result) {
  881. addSafeAreaInsets(result);
  882. result = sortObject(Object.assign(result, {
  883. windowTop: 0,
  884. windowBottom: 0
  885. }));
  886. }
  887. };
  888. var getAppAuthorizeSetting = {
  889. returnValue: function returnValue(result) {
  890. var locationReducedAccuracy = result.locationReducedAccuracy;
  891. result.locationAccuracy = 'unsupported';
  892. if (locationReducedAccuracy === true) {
  893. result.locationAccuracy = 'reduced';
  894. } else if (locationReducedAccuracy === false) {
  895. result.locationAccuracy = 'full';
  896. }
  897. }
  898. };
  899. // import navigateTo from 'uni-helpers/navigate-to'
  900. var compressImage = {
  901. args: function args(fromArgs) {
  902. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  903. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  904. fromArgs.compressHeight = fromArgs.compressedHeight;
  905. }
  906. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  907. fromArgs.compressWidth = fromArgs.compressedWidth;
  908. }
  909. }
  910. };
  911. var protocols = {
  912. redirectTo: redirectTo,
  913. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  914. previewImage: previewImage,
  915. getSystemInfo: getSystemInfo,
  916. getSystemInfoSync: getSystemInfo,
  917. showActionSheet: showActionSheet,
  918. getAppBaseInfo: getAppBaseInfo,
  919. getDeviceInfo: getDeviceInfo,
  920. getWindowInfo: getWindowInfo,
  921. getAppAuthorizeSetting: getAppAuthorizeSetting,
  922. compressImage: compressImage
  923. };
  924. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  925. var canIUses = [];
  926. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  927. function processCallback(methodName, method, returnValue) {
  928. return function (res) {
  929. return method(processReturnValue(methodName, res, returnValue));
  930. };
  931. }
  932. function processArgs(methodName, fromArgs) {
  933. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  934. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  935. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  936. if (isPlainObject(fromArgs)) {
  937. // 一般 api 的参数解析
  938. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  939. if (isFn(argsOption)) {
  940. argsOption = argsOption(fromArgs, toArgs) || {};
  941. }
  942. for (var key in fromArgs) {
  943. if (hasOwn(argsOption, key)) {
  944. var keyOption = argsOption[key];
  945. if (isFn(keyOption)) {
  946. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  947. }
  948. if (!keyOption) {
  949. // 不支持的参数
  950. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  951. } else if (isStr(keyOption)) {
  952. // 重写参数 key
  953. toArgs[keyOption] = fromArgs[key];
  954. } else if (isPlainObject(keyOption)) {
  955. // {name:newName,value:value}可重新指定参数 key:value
  956. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  957. }
  958. } else if (CALLBACKS.indexOf(key) !== -1) {
  959. if (isFn(fromArgs[key])) {
  960. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  961. }
  962. } else {
  963. if (!keepFromArgs) {
  964. toArgs[key] = fromArgs[key];
  965. }
  966. }
  967. }
  968. return toArgs;
  969. } else if (isFn(fromArgs)) {
  970. fromArgs = processCallback(methodName, fromArgs, returnValue);
  971. }
  972. return fromArgs;
  973. }
  974. function processReturnValue(methodName, res, returnValue) {
  975. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  976. if (isFn(protocols.returnValue)) {
  977. // 处理通用 returnValue
  978. res = protocols.returnValue(methodName, res);
  979. }
  980. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  981. }
  982. function wrapper(methodName, method) {
  983. if (hasOwn(protocols, methodName)) {
  984. var protocol = protocols[methodName];
  985. if (!protocol) {
  986. // 暂不支持的 api
  987. return function () {
  988. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  989. };
  990. }
  991. return function (arg1, arg2) {
  992. // 目前 api 最多两个参数
  993. var options = protocol;
  994. if (isFn(protocol)) {
  995. options = protocol(arg1);
  996. }
  997. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  998. var args = [arg1];
  999. if (typeof arg2 !== 'undefined') {
  1000. args.push(arg2);
  1001. }
  1002. if (isFn(options.name)) {
  1003. methodName = options.name(arg1);
  1004. } else if (isStr(options.name)) {
  1005. methodName = options.name;
  1006. }
  1007. var returnValue = wx[methodName].apply(wx, args);
  1008. if (isSyncApi(methodName)) {
  1009. // 同步 api
  1010. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1011. }
  1012. return returnValue;
  1013. };
  1014. }
  1015. return method;
  1016. }
  1017. var todoApis = Object.create(null);
  1018. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1019. function createTodoApi(name) {
  1020. return function todoApi(_ref) {
  1021. var fail = _ref.fail,
  1022. complete = _ref.complete;
  1023. var res = {
  1024. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1025. };
  1026. isFn(fail) && fail(res);
  1027. isFn(complete) && complete(res);
  1028. };
  1029. }
  1030. TODOS.forEach(function (name) {
  1031. todoApis[name] = createTodoApi(name);
  1032. });
  1033. var providers = {
  1034. oauth: ['weixin'],
  1035. share: ['weixin'],
  1036. payment: ['wxpay'],
  1037. push: ['weixin']
  1038. };
  1039. function getProvider(_ref2) {
  1040. var service = _ref2.service,
  1041. success = _ref2.success,
  1042. fail = _ref2.fail,
  1043. complete = _ref2.complete;
  1044. var res = false;
  1045. if (providers[service]) {
  1046. res = {
  1047. errMsg: 'getProvider:ok',
  1048. service: service,
  1049. provider: providers[service]
  1050. };
  1051. isFn(success) && success(res);
  1052. } else {
  1053. res = {
  1054. errMsg: 'getProvider:fail service not found'
  1055. };
  1056. isFn(fail) && fail(res);
  1057. }
  1058. isFn(complete) && complete(res);
  1059. }
  1060. var extraApi = /*#__PURE__*/Object.freeze({
  1061. __proto__: null,
  1062. getProvider: getProvider
  1063. });
  1064. var getEmitter = function () {
  1065. var Emitter;
  1066. return function getUniEmitter() {
  1067. if (!Emitter) {
  1068. Emitter = new _vue.default();
  1069. }
  1070. return Emitter;
  1071. };
  1072. }();
  1073. function apply(ctx, method, args) {
  1074. return ctx[method].apply(ctx, args);
  1075. }
  1076. function $on() {
  1077. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1078. }
  1079. function $off() {
  1080. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1081. }
  1082. function $once() {
  1083. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1084. }
  1085. function $emit() {
  1086. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1087. }
  1088. var eventApi = /*#__PURE__*/Object.freeze({
  1089. __proto__: null,
  1090. $on: $on,
  1091. $off: $off,
  1092. $once: $once,
  1093. $emit: $emit
  1094. });
  1095. /**
  1096. * 框架内 try-catch
  1097. */
  1098. /**
  1099. * 开发者 try-catch
  1100. */
  1101. function tryCatch(fn) {
  1102. return function () {
  1103. try {
  1104. return fn.apply(fn, arguments);
  1105. } catch (e) {
  1106. // TODO
  1107. console.error(e);
  1108. }
  1109. };
  1110. }
  1111. function getApiCallbacks(params) {
  1112. var apiCallbacks = {};
  1113. for (var name in params) {
  1114. var param = params[name];
  1115. if (isFn(param)) {
  1116. apiCallbacks[name] = tryCatch(param);
  1117. delete params[name];
  1118. }
  1119. }
  1120. return apiCallbacks;
  1121. }
  1122. var cid;
  1123. var cidErrMsg;
  1124. var enabled;
  1125. function normalizePushMessage(message) {
  1126. try {
  1127. return JSON.parse(message);
  1128. } catch (e) {}
  1129. return message;
  1130. }
  1131. function invokePushCallback(args) {
  1132. if (args.type === 'enabled') {
  1133. enabled = true;
  1134. } else if (args.type === 'clientId') {
  1135. cid = args.cid;
  1136. cidErrMsg = args.errMsg;
  1137. invokeGetPushCidCallbacks(cid, args.errMsg);
  1138. } else if (args.type === 'pushMsg') {
  1139. var message = {
  1140. type: 'receive',
  1141. data: normalizePushMessage(args.message)
  1142. };
  1143. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1144. var callback = onPushMessageCallbacks[i];
  1145. callback(message);
  1146. // 该消息已被阻止
  1147. if (message.stopped) {
  1148. break;
  1149. }
  1150. }
  1151. } else if (args.type === 'click') {
  1152. onPushMessageCallbacks.forEach(function (callback) {
  1153. callback({
  1154. type: 'click',
  1155. data: normalizePushMessage(args.message)
  1156. });
  1157. });
  1158. }
  1159. }
  1160. var getPushCidCallbacks = [];
  1161. function invokeGetPushCidCallbacks(cid, errMsg) {
  1162. getPushCidCallbacks.forEach(function (callback) {
  1163. callback(cid, errMsg);
  1164. });
  1165. getPushCidCallbacks.length = 0;
  1166. }
  1167. function getPushClientId(args) {
  1168. if (!isPlainObject(args)) {
  1169. args = {};
  1170. }
  1171. var _getApiCallbacks = getApiCallbacks(args),
  1172. success = _getApiCallbacks.success,
  1173. fail = _getApiCallbacks.fail,
  1174. complete = _getApiCallbacks.complete;
  1175. var hasSuccess = isFn(success);
  1176. var hasFail = isFn(fail);
  1177. var hasComplete = isFn(complete);
  1178. Promise.resolve().then(function () {
  1179. if (typeof enabled === 'undefined') {
  1180. enabled = false;
  1181. cid = '';
  1182. cidErrMsg = 'uniPush is not enabled';
  1183. }
  1184. getPushCidCallbacks.push(function (cid, errMsg) {
  1185. var res;
  1186. if (cid) {
  1187. res = {
  1188. errMsg: 'getPushClientId:ok',
  1189. cid: cid
  1190. };
  1191. hasSuccess && success(res);
  1192. } else {
  1193. res = {
  1194. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1195. };
  1196. hasFail && fail(res);
  1197. }
  1198. hasComplete && complete(res);
  1199. });
  1200. if (typeof cid !== 'undefined') {
  1201. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1202. }
  1203. });
  1204. }
  1205. var onPushMessageCallbacks = [];
  1206. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1207. var onPushMessage = function onPushMessage(fn) {
  1208. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1209. onPushMessageCallbacks.push(fn);
  1210. }
  1211. };
  1212. var offPushMessage = function offPushMessage(fn) {
  1213. if (!fn) {
  1214. onPushMessageCallbacks.length = 0;
  1215. } else {
  1216. var index = onPushMessageCallbacks.indexOf(fn);
  1217. if (index > -1) {
  1218. onPushMessageCallbacks.splice(index, 1);
  1219. }
  1220. }
  1221. };
  1222. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1223. if (!baseInfo) {
  1224. baseInfo = wx.getSystemInfoSync();
  1225. }
  1226. var host = baseInfo ? baseInfo.host : null;
  1227. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1228. var api = /*#__PURE__*/Object.freeze({
  1229. __proto__: null,
  1230. shareVideoMessage: shareVideoMessage,
  1231. getPushClientId: getPushClientId,
  1232. onPushMessage: onPushMessage,
  1233. offPushMessage: offPushMessage,
  1234. invokePushCallback: invokePushCallback
  1235. });
  1236. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1237. function findVmByVueId(vm, vuePid) {
  1238. var $children = vm.$children;
  1239. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1240. for (var i = $children.length - 1; i >= 0; i--) {
  1241. var childVm = $children[i];
  1242. if (childVm.$scope._$vueId === vuePid) {
  1243. return childVm;
  1244. }
  1245. }
  1246. // 反向递归查找
  1247. var parentVm;
  1248. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1249. parentVm = findVmByVueId($children[_i], vuePid);
  1250. if (parentVm) {
  1251. return parentVm;
  1252. }
  1253. }
  1254. }
  1255. function initBehavior(options) {
  1256. return Behavior(options);
  1257. }
  1258. function isPage() {
  1259. return !!this.route;
  1260. }
  1261. function initRelation(detail) {
  1262. this.triggerEvent('__l', detail);
  1263. }
  1264. function selectAllComponents(mpInstance, selector, $refs) {
  1265. var components = mpInstance.selectAllComponents(selector) || [];
  1266. components.forEach(function (component) {
  1267. var ref = component.dataset.ref;
  1268. $refs[ref] = component.$vm || toSkip(component);
  1269. {
  1270. if (component.dataset.vueGeneric === 'scoped') {
  1271. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1272. selectAllComponents(scopedComponent, selector, $refs);
  1273. });
  1274. }
  1275. }
  1276. });
  1277. }
  1278. function syncRefs(refs, newRefs) {
  1279. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1280. var newKeys = Object.keys(newRefs);
  1281. newKeys.forEach(function (key) {
  1282. var oldValue = refs[key];
  1283. var newValue = newRefs[key];
  1284. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1285. return oldValue.includes(value);
  1286. })) {
  1287. return;
  1288. }
  1289. refs[key] = newValue;
  1290. oldKeys.delete(key);
  1291. });
  1292. oldKeys.forEach(function (key) {
  1293. delete refs[key];
  1294. });
  1295. return refs;
  1296. }
  1297. function initRefs(vm) {
  1298. var mpInstance = vm.$scope;
  1299. var refs = {};
  1300. Object.defineProperty(vm, '$refs', {
  1301. get: function get() {
  1302. var $refs = {};
  1303. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1304. // TODO 暂不考虑 for 中的 scoped
  1305. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1306. forComponents.forEach(function (component) {
  1307. var ref = component.dataset.ref;
  1308. if (!$refs[ref]) {
  1309. $refs[ref] = [];
  1310. }
  1311. $refs[ref].push(component.$vm || toSkip(component));
  1312. });
  1313. return syncRefs(refs, $refs);
  1314. }
  1315. });
  1316. }
  1317. function handleLink(event) {
  1318. var _ref3 = event.detail || event.value,
  1319. vuePid = _ref3.vuePid,
  1320. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1321. var parentVm;
  1322. if (vuePid) {
  1323. parentVm = findVmByVueId(this.$vm, vuePid);
  1324. }
  1325. if (!parentVm) {
  1326. parentVm = this.$vm;
  1327. }
  1328. vueOptions.parent = parentVm;
  1329. }
  1330. function markMPComponent(component) {
  1331. // 在 Vue 中标记为小程序组件
  1332. var IS_MP = '__v_isMPComponent';
  1333. Object.defineProperty(component, IS_MP, {
  1334. configurable: true,
  1335. enumerable: false,
  1336. value: true
  1337. });
  1338. return component;
  1339. }
  1340. function toSkip(obj) {
  1341. var OB = '__ob__';
  1342. var SKIP = '__v_skip';
  1343. if (isObject(obj) && Object.isExtensible(obj)) {
  1344. // 避免被 @vue/composition-api 观测
  1345. Object.defineProperty(obj, OB, {
  1346. configurable: true,
  1347. enumerable: false,
  1348. value: (0, _defineProperty2.default)({}, SKIP, true)
  1349. });
  1350. }
  1351. return obj;
  1352. }
  1353. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1354. function initWorkletMethods(mpMethods, vueMethods) {
  1355. if (vueMethods) {
  1356. Object.keys(vueMethods).forEach(function (name) {
  1357. var matches = name.match(WORKLET_RE);
  1358. if (matches) {
  1359. var workletName = matches[1];
  1360. mpMethods[name] = vueMethods[name];
  1361. mpMethods[workletName] = vueMethods[workletName];
  1362. }
  1363. });
  1364. }
  1365. }
  1366. var MPPage = Page;
  1367. var MPComponent = Component;
  1368. var customizeRE = /:/g;
  1369. var customize = cached(function (str) {
  1370. return camelize(str.replace(customizeRE, '-'));
  1371. });
  1372. function initTriggerEvent(mpInstance) {
  1373. var oldTriggerEvent = mpInstance.triggerEvent;
  1374. var newTriggerEvent = function newTriggerEvent(event) {
  1375. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1376. args[_key3 - 1] = arguments[_key3];
  1377. }
  1378. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1379. if (this.$vm || this.dataset && this.dataset.comType) {
  1380. event = customize(event);
  1381. } else {
  1382. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1383. var newEvent = customize(event);
  1384. if (newEvent !== event) {
  1385. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1386. }
  1387. }
  1388. return oldTriggerEvent.apply(this, [event].concat(args));
  1389. };
  1390. try {
  1391. // 京东小程序 triggerEvent 为只读
  1392. mpInstance.triggerEvent = newTriggerEvent;
  1393. } catch (error) {
  1394. mpInstance._triggerEvent = newTriggerEvent;
  1395. }
  1396. }
  1397. function initHook(name, options, isComponent) {
  1398. var oldHook = options[name];
  1399. options[name] = function () {
  1400. markMPComponent(this);
  1401. initTriggerEvent(this);
  1402. if (oldHook) {
  1403. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1404. args[_key4] = arguments[_key4];
  1405. }
  1406. return oldHook.apply(this, args);
  1407. }
  1408. };
  1409. }
  1410. if (!MPPage.__$wrappered) {
  1411. MPPage.__$wrappered = true;
  1412. Page = function Page() {
  1413. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1414. initHook('onLoad', options);
  1415. return MPPage(options);
  1416. };
  1417. Page.after = MPPage.after;
  1418. Component = function Component() {
  1419. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1420. initHook('created', options);
  1421. return MPComponent(options);
  1422. };
  1423. }
  1424. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1425. function initMocks(vm, mocks) {
  1426. var mpInstance = vm.$mp[vm.mpType];
  1427. mocks.forEach(function (mock) {
  1428. if (hasOwn(mpInstance, mock)) {
  1429. vm[mock] = mpInstance[mock];
  1430. }
  1431. });
  1432. }
  1433. function hasHook(hook, vueOptions) {
  1434. if (!vueOptions) {
  1435. return true;
  1436. }
  1437. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1438. return true;
  1439. }
  1440. vueOptions = vueOptions.default || vueOptions;
  1441. if (isFn(vueOptions)) {
  1442. if (isFn(vueOptions.extendOptions[hook])) {
  1443. return true;
  1444. }
  1445. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1446. return true;
  1447. }
  1448. return false;
  1449. }
  1450. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1451. return true;
  1452. }
  1453. var mixins = vueOptions.mixins;
  1454. if (Array.isArray(mixins)) {
  1455. return !!mixins.find(function (mixin) {
  1456. return hasHook(hook, mixin);
  1457. });
  1458. }
  1459. }
  1460. function initHooks(mpOptions, hooks, vueOptions) {
  1461. hooks.forEach(function (hook) {
  1462. if (hasHook(hook, vueOptions)) {
  1463. mpOptions[hook] = function (args) {
  1464. return this.$vm && this.$vm.__call_hook(hook, args);
  1465. };
  1466. }
  1467. });
  1468. }
  1469. function initUnknownHooks(mpOptions, vueOptions) {
  1470. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1471. findHooks(vueOptions).forEach(function (hook) {
  1472. return initHook$1(mpOptions, hook, excludes);
  1473. });
  1474. }
  1475. function findHooks(vueOptions) {
  1476. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1477. if (vueOptions) {
  1478. Object.keys(vueOptions).forEach(function (name) {
  1479. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1480. hooks.push(name);
  1481. }
  1482. });
  1483. }
  1484. return hooks;
  1485. }
  1486. function initHook$1(mpOptions, hook, excludes) {
  1487. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1488. mpOptions[hook] = function (args) {
  1489. return this.$vm && this.$vm.__call_hook(hook, args);
  1490. };
  1491. }
  1492. }
  1493. function initVueComponent(Vue, vueOptions) {
  1494. vueOptions = vueOptions.default || vueOptions;
  1495. var VueComponent;
  1496. if (isFn(vueOptions)) {
  1497. VueComponent = vueOptions;
  1498. } else {
  1499. VueComponent = Vue.extend(vueOptions);
  1500. }
  1501. vueOptions = VueComponent.options;
  1502. return [VueComponent, vueOptions];
  1503. }
  1504. function initSlots(vm, vueSlots) {
  1505. if (Array.isArray(vueSlots) && vueSlots.length) {
  1506. var $slots = Object.create(null);
  1507. vueSlots.forEach(function (slotName) {
  1508. $slots[slotName] = true;
  1509. });
  1510. vm.$scopedSlots = vm.$slots = $slots;
  1511. }
  1512. }
  1513. function initVueIds(vueIds, mpInstance) {
  1514. vueIds = (vueIds || '').split(',');
  1515. var len = vueIds.length;
  1516. if (len === 1) {
  1517. mpInstance._$vueId = vueIds[0];
  1518. } else if (len === 2) {
  1519. mpInstance._$vueId = vueIds[0];
  1520. mpInstance._$vuePid = vueIds[1];
  1521. }
  1522. }
  1523. function initData(vueOptions, context) {
  1524. var data = vueOptions.data || {};
  1525. var methods = vueOptions.methods || {};
  1526. if (typeof data === 'function') {
  1527. try {
  1528. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1529. } catch (e) {
  1530. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1531. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1532. }
  1533. }
  1534. } else {
  1535. try {
  1536. // 对 data 格式化
  1537. data = JSON.parse(JSON.stringify(data));
  1538. } catch (e) {}
  1539. }
  1540. if (!isPlainObject(data)) {
  1541. data = {};
  1542. }
  1543. Object.keys(methods).forEach(function (methodName) {
  1544. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1545. data[methodName] = methods[methodName];
  1546. }
  1547. });
  1548. return data;
  1549. }
  1550. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1551. function createObserver(name) {
  1552. return function observer(newVal, oldVal) {
  1553. if (this.$vm) {
  1554. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1555. }
  1556. };
  1557. }
  1558. function initBehaviors(vueOptions, initBehavior) {
  1559. var vueBehaviors = vueOptions.behaviors;
  1560. var vueExtends = vueOptions.extends;
  1561. var vueMixins = vueOptions.mixins;
  1562. var vueProps = vueOptions.props;
  1563. if (!vueProps) {
  1564. vueOptions.props = vueProps = [];
  1565. }
  1566. var behaviors = [];
  1567. if (Array.isArray(vueBehaviors)) {
  1568. vueBehaviors.forEach(function (behavior) {
  1569. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1570. if (behavior === 'uni://form-field') {
  1571. if (Array.isArray(vueProps)) {
  1572. vueProps.push('name');
  1573. vueProps.push('value');
  1574. } else {
  1575. vueProps.name = {
  1576. type: String,
  1577. default: ''
  1578. };
  1579. vueProps.value = {
  1580. type: [String, Number, Boolean, Array, Object, Date],
  1581. default: ''
  1582. };
  1583. }
  1584. }
  1585. });
  1586. }
  1587. if (isPlainObject(vueExtends) && vueExtends.props) {
  1588. behaviors.push(initBehavior({
  1589. properties: initProperties(vueExtends.props, true)
  1590. }));
  1591. }
  1592. if (Array.isArray(vueMixins)) {
  1593. vueMixins.forEach(function (vueMixin) {
  1594. if (isPlainObject(vueMixin) && vueMixin.props) {
  1595. behaviors.push(initBehavior({
  1596. properties: initProperties(vueMixin.props, true)
  1597. }));
  1598. }
  1599. });
  1600. }
  1601. return behaviors;
  1602. }
  1603. function parsePropType(key, type, defaultValue, file) {
  1604. // [String]=>String
  1605. if (Array.isArray(type) && type.length === 1) {
  1606. return type[0];
  1607. }
  1608. return type;
  1609. }
  1610. function initProperties(props) {
  1611. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1612. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1613. var options = arguments.length > 3 ? arguments[3] : undefined;
  1614. var properties = {};
  1615. if (!isBehavior) {
  1616. properties.vueId = {
  1617. type: String,
  1618. value: ''
  1619. };
  1620. {
  1621. if (options.virtualHost) {
  1622. properties.virtualHostStyle = {
  1623. type: null,
  1624. value: ''
  1625. };
  1626. properties.virtualHostClass = {
  1627. type: null,
  1628. value: ''
  1629. };
  1630. }
  1631. }
  1632. // scopedSlotsCompiler auto
  1633. properties.scopedSlotsCompiler = {
  1634. type: String,
  1635. value: ''
  1636. };
  1637. properties.vueSlots = {
  1638. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1639. type: null,
  1640. value: [],
  1641. observer: function observer(newVal, oldVal) {
  1642. var $slots = Object.create(null);
  1643. newVal.forEach(function (slotName) {
  1644. $slots[slotName] = true;
  1645. });
  1646. this.setData({
  1647. $slots: $slots
  1648. });
  1649. }
  1650. };
  1651. }
  1652. if (Array.isArray(props)) {
  1653. // ['title']
  1654. props.forEach(function (key) {
  1655. properties[key] = {
  1656. type: null,
  1657. observer: createObserver(key)
  1658. };
  1659. });
  1660. } else if (isPlainObject(props)) {
  1661. // {title:{type:String,default:''},content:String}
  1662. Object.keys(props).forEach(function (key) {
  1663. var opts = props[key];
  1664. if (isPlainObject(opts)) {
  1665. // title:{type:String,default:''}
  1666. var value = opts.default;
  1667. if (isFn(value)) {
  1668. value = value();
  1669. }
  1670. opts.type = parsePropType(key, opts.type);
  1671. properties[key] = {
  1672. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1673. value: value,
  1674. observer: createObserver(key)
  1675. };
  1676. } else {
  1677. // content:String
  1678. var type = parsePropType(key, opts);
  1679. properties[key] = {
  1680. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1681. observer: createObserver(key)
  1682. };
  1683. }
  1684. });
  1685. }
  1686. return properties;
  1687. }
  1688. function wrapper$1(event) {
  1689. // TODO 又得兼容 mpvue 的 mp 对象
  1690. try {
  1691. event.mp = JSON.parse(JSON.stringify(event));
  1692. } catch (e) {}
  1693. event.stopPropagation = noop;
  1694. event.preventDefault = noop;
  1695. event.target = event.target || {};
  1696. if (!hasOwn(event, 'detail')) {
  1697. event.detail = {};
  1698. }
  1699. if (hasOwn(event, 'markerId')) {
  1700. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1701. event.detail.markerId = event.markerId;
  1702. }
  1703. if (isPlainObject(event.detail)) {
  1704. event.target = Object.assign({}, event.target, event.detail);
  1705. }
  1706. return event;
  1707. }
  1708. function getExtraValue(vm, dataPathsArray) {
  1709. var context = vm;
  1710. dataPathsArray.forEach(function (dataPathArray) {
  1711. var dataPath = dataPathArray[0];
  1712. var value = dataPathArray[2];
  1713. if (dataPath || typeof value !== 'undefined') {
  1714. // ['','',index,'disable']
  1715. var propPath = dataPathArray[1];
  1716. var valuePath = dataPathArray[3];
  1717. var vFor;
  1718. if (Number.isInteger(dataPath)) {
  1719. vFor = dataPath;
  1720. } else if (!dataPath) {
  1721. vFor = context;
  1722. } else if (typeof dataPath === 'string' && dataPath) {
  1723. if (dataPath.indexOf('#s#') === 0) {
  1724. vFor = dataPath.substr(3);
  1725. } else {
  1726. vFor = vm.__get_value(dataPath, context);
  1727. }
  1728. }
  1729. if (Number.isInteger(vFor)) {
  1730. context = value;
  1731. } else if (!propPath) {
  1732. context = vFor[value];
  1733. } else {
  1734. if (Array.isArray(vFor)) {
  1735. context = vFor.find(function (vForItem) {
  1736. return vm.__get_value(propPath, vForItem) === value;
  1737. });
  1738. } else if (isPlainObject(vFor)) {
  1739. context = Object.keys(vFor).find(function (vForKey) {
  1740. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1741. });
  1742. } else {
  1743. console.error('v-for 暂不支持循环数据:', vFor);
  1744. }
  1745. }
  1746. if (valuePath) {
  1747. context = vm.__get_value(valuePath, context);
  1748. }
  1749. }
  1750. });
  1751. return context;
  1752. }
  1753. function processEventExtra(vm, extra, event, __args__) {
  1754. var extraObj = {};
  1755. if (Array.isArray(extra) && extra.length) {
  1756. /**
  1757. *[
  1758. * ['data.items', 'data.id', item.data.id],
  1759. * ['metas', 'id', meta.id]
  1760. *],
  1761. *[
  1762. * ['data.items', 'data.id', item.data.id],
  1763. * ['metas', 'id', meta.id]
  1764. *],
  1765. *'test'
  1766. */
  1767. extra.forEach(function (dataPath, index) {
  1768. if (typeof dataPath === 'string') {
  1769. if (!dataPath) {
  1770. // model,prop.sync
  1771. extraObj['$' + index] = vm;
  1772. } else {
  1773. if (dataPath === '$event') {
  1774. // $event
  1775. extraObj['$' + index] = event;
  1776. } else if (dataPath === 'arguments') {
  1777. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1778. } else if (dataPath.indexOf('$event.') === 0) {
  1779. // $event.target.value
  1780. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1781. } else {
  1782. extraObj['$' + index] = vm.__get_value(dataPath);
  1783. }
  1784. }
  1785. } else {
  1786. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1787. }
  1788. });
  1789. }
  1790. return extraObj;
  1791. }
  1792. function getObjByArray(arr) {
  1793. var obj = {};
  1794. for (var i = 1; i < arr.length; i++) {
  1795. var element = arr[i];
  1796. obj[element[0]] = element[1];
  1797. }
  1798. return obj;
  1799. }
  1800. function processEventArgs(vm, event) {
  1801. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1802. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1803. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1804. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1805. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1806. // fixed 用户直接触发 mpInstance.triggerEvent
  1807. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1808. if (isCustom) {
  1809. // 自定义事件
  1810. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1811. if (!args.length) {
  1812. // 无参数,直接传入 event 或 detail 数组
  1813. if (isCustomMPEvent) {
  1814. return [event];
  1815. }
  1816. return __args__;
  1817. }
  1818. }
  1819. var extraObj = processEventExtra(vm, extra, event, __args__);
  1820. var ret = [];
  1821. args.forEach(function (arg) {
  1822. if (arg === '$event') {
  1823. if (methodName === '__set_model' && !isCustom) {
  1824. // input v-model value
  1825. ret.push(event.target.value);
  1826. } else {
  1827. if (isCustom && !isCustomMPEvent) {
  1828. ret.push(__args__[0]);
  1829. } else {
  1830. // wxcomponent 组件或内置组件
  1831. ret.push(event);
  1832. }
  1833. }
  1834. } else {
  1835. if (Array.isArray(arg) && arg[0] === 'o') {
  1836. ret.push(getObjByArray(arg));
  1837. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1838. ret.push(extraObj[arg]);
  1839. } else {
  1840. ret.push(arg);
  1841. }
  1842. }
  1843. });
  1844. return ret;
  1845. }
  1846. var ONCE = '~';
  1847. var CUSTOM = '^';
  1848. function isMatchEventType(eventType, optType) {
  1849. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1850. }
  1851. function getContextVm(vm) {
  1852. var $parent = vm.$parent;
  1853. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1854. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1855. $parent = $parent.$parent;
  1856. }
  1857. return $parent && $parent.$parent;
  1858. }
  1859. function handleEvent(event) {
  1860. var _this2 = this;
  1861. event = wrapper$1(event);
  1862. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1863. var dataset = (event.currentTarget || event.target).dataset;
  1864. if (!dataset) {
  1865. return console.warn('事件信息不存在');
  1866. }
  1867. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1868. if (!eventOpts) {
  1869. return console.warn('事件信息不存在');
  1870. }
  1871. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1872. var eventType = event.type;
  1873. var ret = [];
  1874. eventOpts.forEach(function (eventOpt) {
  1875. var type = eventOpt[0];
  1876. var eventsArray = eventOpt[1];
  1877. var isCustom = type.charAt(0) === CUSTOM;
  1878. type = isCustom ? type.slice(1) : type;
  1879. var isOnce = type.charAt(0) === ONCE;
  1880. type = isOnce ? type.slice(1) : type;
  1881. if (eventsArray && isMatchEventType(eventType, type)) {
  1882. eventsArray.forEach(function (eventArray) {
  1883. var methodName = eventArray[0];
  1884. if (methodName) {
  1885. var handlerCtx = _this2.$vm;
  1886. if (handlerCtx.$options.generic) {
  1887. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1888. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1889. }
  1890. if (methodName === '$emit') {
  1891. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1892. return;
  1893. }
  1894. var handler = handlerCtx[methodName];
  1895. if (!isFn(handler)) {
  1896. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1897. var path = _this2.route || _this2.is;
  1898. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1899. }
  1900. if (isOnce) {
  1901. if (handler.once) {
  1902. return;
  1903. }
  1904. handler.once = true;
  1905. }
  1906. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1907. params = Array.isArray(params) ? params : [];
  1908. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1909. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1910. // eslint-disable-next-line no-sparse-arrays
  1911. params = params.concat([,,,,,,,,,, event]);
  1912. }
  1913. ret.push(handler.apply(handlerCtx, params));
  1914. }
  1915. });
  1916. }
  1917. });
  1918. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1919. return ret[0];
  1920. }
  1921. }
  1922. var eventChannels = {};
  1923. var eventChannelStack = [];
  1924. function getEventChannel(id) {
  1925. if (id) {
  1926. var eventChannel = eventChannels[id];
  1927. delete eventChannels[id];
  1928. return eventChannel;
  1929. }
  1930. return eventChannelStack.shift();
  1931. }
  1932. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1933. function initEventChannel() {
  1934. _vue.default.prototype.getOpenerEventChannel = function () {
  1935. // 微信小程序使用自身getOpenerEventChannel
  1936. {
  1937. return this.$scope.getOpenerEventChannel();
  1938. }
  1939. };
  1940. var callHook = _vue.default.prototype.__call_hook;
  1941. _vue.default.prototype.__call_hook = function (hook, args) {
  1942. if (hook === 'onLoad' && args && args.__id__) {
  1943. this.__eventChannel__ = getEventChannel(args.__id__);
  1944. delete args.__id__;
  1945. }
  1946. return callHook.call(this, hook, args);
  1947. };
  1948. }
  1949. function initScopedSlotsParams() {
  1950. var center = {};
  1951. var parents = {};
  1952. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1953. var has = center[vueId];
  1954. if (!has) {
  1955. parents[vueId] = this;
  1956. this.$on('hook:destroyed', function () {
  1957. delete parents[vueId];
  1958. });
  1959. }
  1960. return has;
  1961. };
  1962. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1963. var data = center[vueId];
  1964. if (data) {
  1965. var object = data[name] || {};
  1966. return key ? object[key] : object;
  1967. } else {
  1968. parents[vueId] = this;
  1969. this.$on('hook:destroyed', function () {
  1970. delete parents[vueId];
  1971. });
  1972. }
  1973. };
  1974. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1975. var vueIds = this.$options.propsData.vueId;
  1976. if (vueIds) {
  1977. var vueId = vueIds.split(',')[0];
  1978. var object = center[vueId] = center[vueId] || {};
  1979. object[name] = value;
  1980. if (parents[vueId]) {
  1981. parents[vueId].$forceUpdate();
  1982. }
  1983. }
  1984. };
  1985. _vue.default.mixin({
  1986. destroyed: function destroyed() {
  1987. var propsData = this.$options.propsData;
  1988. var vueId = propsData && propsData.vueId;
  1989. if (vueId) {
  1990. delete center[vueId];
  1991. delete parents[vueId];
  1992. }
  1993. }
  1994. });
  1995. }
  1996. function parseBaseApp(vm, _ref4) {
  1997. var mocks = _ref4.mocks,
  1998. initRefs = _ref4.initRefs;
  1999. initEventChannel();
  2000. {
  2001. initScopedSlotsParams();
  2002. }
  2003. if (vm.$options.store) {
  2004. _vue.default.prototype.$store = vm.$options.store;
  2005. }
  2006. uniIdMixin(_vue.default);
  2007. _vue.default.prototype.mpHost = "mp-weixin";
  2008. _vue.default.mixin({
  2009. beforeCreate: function beforeCreate() {
  2010. if (!this.$options.mpType) {
  2011. return;
  2012. }
  2013. this.mpType = this.$options.mpType;
  2014. this.$mp = (0, _defineProperty2.default)({
  2015. data: {}
  2016. }, this.mpType, this.$options.mpInstance);
  2017. this.$scope = this.$options.mpInstance;
  2018. delete this.$options.mpType;
  2019. delete this.$options.mpInstance;
  2020. if (this.mpType === 'page' && typeof getApp === 'function') {
  2021. // hack vue-i18n
  2022. var app = getApp();
  2023. if (app.$vm && app.$vm.$i18n) {
  2024. this._i18n = app.$vm.$i18n;
  2025. }
  2026. }
  2027. if (this.mpType !== 'app') {
  2028. initRefs(this);
  2029. initMocks(this, mocks);
  2030. }
  2031. }
  2032. });
  2033. var appOptions = {
  2034. onLaunch: function onLaunch(args) {
  2035. if (this.$vm) {
  2036. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2037. return;
  2038. }
  2039. {
  2040. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2041. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2042. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2043. }
  2044. }
  2045. this.$vm = vm;
  2046. this.$vm.$mp = {
  2047. app: this
  2048. };
  2049. this.$vm.$scope = this;
  2050. // vm 上也挂载 globalData
  2051. this.$vm.globalData = this.globalData;
  2052. this.$vm._isMounted = true;
  2053. this.$vm.__call_hook('mounted', args);
  2054. this.$vm.__call_hook('onLaunch', args);
  2055. }
  2056. };
  2057. // 兼容旧版本 globalData
  2058. appOptions.globalData = vm.$options.globalData || {};
  2059. // 将 methods 中的方法挂在 getApp() 中
  2060. var methods = vm.$options.methods;
  2061. if (methods) {
  2062. Object.keys(methods).forEach(function (name) {
  2063. appOptions[name] = methods[name];
  2064. });
  2065. }
  2066. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2067. initHooks(appOptions, hooks);
  2068. initUnknownHooks(appOptions, vm.$options);
  2069. return appOptions;
  2070. }
  2071. function parseApp(vm) {
  2072. return parseBaseApp(vm, {
  2073. mocks: mocks,
  2074. initRefs: initRefs
  2075. });
  2076. }
  2077. function createApp(vm) {
  2078. App(parseApp(vm));
  2079. return vm;
  2080. }
  2081. var encodeReserveRE = /[!'()*]/g;
  2082. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2083. return '%' + c.charCodeAt(0).toString(16);
  2084. };
  2085. var commaRE = /%2C/g;
  2086. // fixed encodeURIComponent which is more conformant to RFC3986:
  2087. // - escapes [!'()*]
  2088. // - preserve commas
  2089. var encode = function encode(str) {
  2090. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2091. };
  2092. function stringifyQuery(obj) {
  2093. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2094. var res = obj ? Object.keys(obj).map(function (key) {
  2095. var val = obj[key];
  2096. if (val === undefined) {
  2097. return '';
  2098. }
  2099. if (val === null) {
  2100. return encodeStr(key);
  2101. }
  2102. if (Array.isArray(val)) {
  2103. var result = [];
  2104. val.forEach(function (val2) {
  2105. if (val2 === undefined) {
  2106. return;
  2107. }
  2108. if (val2 === null) {
  2109. result.push(encodeStr(key));
  2110. } else {
  2111. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2112. }
  2113. });
  2114. return result.join('&');
  2115. }
  2116. return encodeStr(key) + '=' + encodeStr(val);
  2117. }).filter(function (x) {
  2118. return x.length > 0;
  2119. }).join('&') : null;
  2120. return res ? "?".concat(res) : '';
  2121. }
  2122. function parseBaseComponent(vueComponentOptions) {
  2123. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2124. isPage = _ref5.isPage,
  2125. initRelation = _ref5.initRelation;
  2126. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2127. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2128. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2129. VueComponent = _initVueComponent2[0],
  2130. vueOptions = _initVueComponent2[1];
  2131. var options = _objectSpread({
  2132. multipleSlots: true,
  2133. addGlobalClass: true
  2134. }, vueOptions.options || {});
  2135. {
  2136. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2137. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2138. Object.assign(options, vueOptions['mp-weixin'].options);
  2139. }
  2140. }
  2141. var componentOptions = {
  2142. options: options,
  2143. data: initData(vueOptions, _vue.default.prototype),
  2144. behaviors: initBehaviors(vueOptions, initBehavior),
  2145. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2146. lifetimes: {
  2147. attached: function attached() {
  2148. var properties = this.properties;
  2149. var options = {
  2150. mpType: isPage.call(this) ? 'page' : 'component',
  2151. mpInstance: this,
  2152. propsData: properties
  2153. };
  2154. initVueIds(properties.vueId, this);
  2155. // 处理父子关系
  2156. initRelation.call(this, {
  2157. vuePid: this._$vuePid,
  2158. vueOptions: options
  2159. });
  2160. // 初始化 vue 实例
  2161. this.$vm = new VueComponent(options);
  2162. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2163. initSlots(this.$vm, properties.vueSlots);
  2164. // 触发首次 setData
  2165. this.$vm.$mount();
  2166. },
  2167. ready: function ready() {
  2168. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2169. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2170. if (this.$vm) {
  2171. this.$vm._isMounted = true;
  2172. this.$vm.__call_hook('mounted');
  2173. this.$vm.__call_hook('onReady');
  2174. }
  2175. },
  2176. detached: function detached() {
  2177. this.$vm && this.$vm.$destroy();
  2178. }
  2179. },
  2180. pageLifetimes: {
  2181. show: function show(args) {
  2182. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2183. },
  2184. hide: function hide() {
  2185. this.$vm && this.$vm.__call_hook('onPageHide');
  2186. },
  2187. resize: function resize(size) {
  2188. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2189. }
  2190. },
  2191. methods: {
  2192. __l: handleLink,
  2193. __e: handleEvent
  2194. }
  2195. };
  2196. // externalClasses
  2197. if (vueOptions.externalClasses) {
  2198. componentOptions.externalClasses = vueOptions.externalClasses;
  2199. }
  2200. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2201. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2202. componentOptions.methods[callMethod] = function (args) {
  2203. return this.$vm[callMethod](args);
  2204. };
  2205. });
  2206. }
  2207. if (needVueOptions) {
  2208. return [componentOptions, vueOptions, VueComponent];
  2209. }
  2210. if (isPage) {
  2211. return componentOptions;
  2212. }
  2213. return [componentOptions, VueComponent];
  2214. }
  2215. function parseComponent(vueComponentOptions, needVueOptions) {
  2216. return parseBaseComponent(vueComponentOptions, {
  2217. isPage: isPage,
  2218. initRelation: initRelation
  2219. }, needVueOptions);
  2220. }
  2221. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2222. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2223. function parseBasePage(vuePageOptions) {
  2224. var _parseComponent = parseComponent(vuePageOptions, true),
  2225. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2226. pageOptions = _parseComponent2[0],
  2227. vueOptions = _parseComponent2[1];
  2228. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2229. pageOptions.methods.onLoad = function (query) {
  2230. this.options = query;
  2231. var copyQuery = Object.assign({}, query);
  2232. delete copyQuery.__id__;
  2233. this.$page = {
  2234. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2235. };
  2236. this.$vm.$mp.query = query; // 兼容 mpvue
  2237. this.$vm.__call_hook('onLoad', query);
  2238. };
  2239. {
  2240. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2241. }
  2242. {
  2243. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2244. }
  2245. return pageOptions;
  2246. }
  2247. function parsePage(vuePageOptions) {
  2248. return parseBasePage(vuePageOptions);
  2249. }
  2250. function createPage(vuePageOptions) {
  2251. {
  2252. return Component(parsePage(vuePageOptions));
  2253. }
  2254. }
  2255. function createComponent(vueOptions) {
  2256. {
  2257. return Component(parseComponent(vueOptions));
  2258. }
  2259. }
  2260. function createSubpackageApp(vm) {
  2261. var appOptions = parseApp(vm);
  2262. var app = getApp({
  2263. allowDefault: true
  2264. });
  2265. vm.$scope = app;
  2266. var globalData = app.globalData;
  2267. if (globalData) {
  2268. Object.keys(appOptions.globalData).forEach(function (name) {
  2269. if (!hasOwn(globalData, name)) {
  2270. globalData[name] = appOptions.globalData[name];
  2271. }
  2272. });
  2273. }
  2274. Object.keys(appOptions).forEach(function (name) {
  2275. if (!hasOwn(app, name)) {
  2276. app[name] = appOptions[name];
  2277. }
  2278. });
  2279. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2280. wx.onAppShow(function () {
  2281. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2282. args[_key5] = arguments[_key5];
  2283. }
  2284. vm.__call_hook('onShow', args);
  2285. });
  2286. }
  2287. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2288. wx.onAppHide(function () {
  2289. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2290. args[_key6] = arguments[_key6];
  2291. }
  2292. vm.__call_hook('onHide', args);
  2293. });
  2294. }
  2295. if (isFn(appOptions.onLaunch)) {
  2296. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2297. vm.__call_hook('onLaunch', args);
  2298. }
  2299. return vm;
  2300. }
  2301. function createPlugin(vm) {
  2302. var appOptions = parseApp(vm);
  2303. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2304. wx.onAppShow(function () {
  2305. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2306. args[_key7] = arguments[_key7];
  2307. }
  2308. vm.__call_hook('onShow', args);
  2309. });
  2310. }
  2311. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2312. wx.onAppHide(function () {
  2313. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2314. args[_key8] = arguments[_key8];
  2315. }
  2316. vm.__call_hook('onHide', args);
  2317. });
  2318. }
  2319. if (isFn(appOptions.onLaunch)) {
  2320. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2321. vm.__call_hook('onLaunch', args);
  2322. }
  2323. return vm;
  2324. }
  2325. todos.forEach(function (todoApi) {
  2326. protocols[todoApi] = false;
  2327. });
  2328. canIUses.forEach(function (canIUseApi) {
  2329. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2330. if (!wx.canIUse(apiName)) {
  2331. protocols[canIUseApi] = false;
  2332. }
  2333. });
  2334. var uni = {};
  2335. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2336. uni = new Proxy({}, {
  2337. get: function get(target, name) {
  2338. if (hasOwn(target, name)) {
  2339. return target[name];
  2340. }
  2341. if (baseApi[name]) {
  2342. return baseApi[name];
  2343. }
  2344. if (api[name]) {
  2345. return promisify(name, api[name]);
  2346. }
  2347. {
  2348. if (extraApi[name]) {
  2349. return promisify(name, extraApi[name]);
  2350. }
  2351. if (todoApis[name]) {
  2352. return promisify(name, todoApis[name]);
  2353. }
  2354. }
  2355. if (eventApi[name]) {
  2356. return eventApi[name];
  2357. }
  2358. return promisify(name, wrapper(name, wx[name]));
  2359. },
  2360. set: function set(target, name, value) {
  2361. target[name] = value;
  2362. return true;
  2363. }
  2364. });
  2365. } else {
  2366. Object.keys(baseApi).forEach(function (name) {
  2367. uni[name] = baseApi[name];
  2368. });
  2369. {
  2370. Object.keys(todoApis).forEach(function (name) {
  2371. uni[name] = promisify(name, todoApis[name]);
  2372. });
  2373. Object.keys(extraApi).forEach(function (name) {
  2374. uni[name] = promisify(name, todoApis[name]);
  2375. });
  2376. }
  2377. Object.keys(eventApi).forEach(function (name) {
  2378. uni[name] = eventApi[name];
  2379. });
  2380. Object.keys(api).forEach(function (name) {
  2381. uni[name] = promisify(name, api[name]);
  2382. });
  2383. Object.keys(wx).forEach(function (name) {
  2384. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2385. uni[name] = promisify(name, wrapper(name, wx[name]));
  2386. }
  2387. });
  2388. }
  2389. wx.createApp = createApp;
  2390. wx.createPage = createPage;
  2391. wx.createComponent = createComponent;
  2392. wx.createSubpackageApp = createSubpackageApp;
  2393. wx.createPlugin = createPlugin;
  2394. var uni$1 = uni;
  2395. var _default = uni$1;
  2396. exports.default = _default;
  2397. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  2398. /***/ }),
  2399. /* 3 */
  2400. /*!***********************************!*\
  2401. !*** (webpack)/buildin/global.js ***!
  2402. \***********************************/
  2403. /*! no static exports found */
  2404. /***/ (function(module, exports) {
  2405. var g;
  2406. // This works in non-strict mode
  2407. g = (function() {
  2408. return this;
  2409. })();
  2410. try {
  2411. // This works if eval is allowed (see CSP)
  2412. g = g || new Function("return this")();
  2413. } catch (e) {
  2414. // This works if the window reference is available
  2415. if (typeof window === "object") g = window;
  2416. }
  2417. // g can still be undefined, but nothing to do about it...
  2418. // We return undefined, instead of nothing here, so it's
  2419. // easier to handle this case. if(!global) { ...}
  2420. module.exports = g;
  2421. /***/ }),
  2422. /* 4 */
  2423. /*!**********************************************************************!*\
  2424. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2425. \**********************************************************************/
  2426. /*! no static exports found */
  2427. /***/ (function(module, exports) {
  2428. function _interopRequireDefault(obj) {
  2429. return obj && obj.__esModule ? obj : {
  2430. "default": obj
  2431. };
  2432. }
  2433. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2434. /***/ }),
  2435. /* 5 */
  2436. /*!**************************************************************!*\
  2437. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2438. \**************************************************************/
  2439. /*! no static exports found */
  2440. /***/ (function(module, exports, __webpack_require__) {
  2441. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2442. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2443. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2444. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2445. function _slicedToArray(arr, i) {
  2446. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2447. }
  2448. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2449. /***/ }),
  2450. /* 6 */
  2451. /*!***************************************************************!*\
  2452. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2453. \***************************************************************/
  2454. /*! no static exports found */
  2455. /***/ (function(module, exports) {
  2456. function _arrayWithHoles(arr) {
  2457. if (Array.isArray(arr)) return arr;
  2458. }
  2459. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2460. /***/ }),
  2461. /* 7 */
  2462. /*!*********************************************************************!*\
  2463. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2464. \*********************************************************************/
  2465. /*! no static exports found */
  2466. /***/ (function(module, exports) {
  2467. function _iterableToArrayLimit(arr, i) {
  2468. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  2469. if (null != _i) {
  2470. var _s,
  2471. _e,
  2472. _x,
  2473. _r,
  2474. _arr = [],
  2475. _n = !0,
  2476. _d = !1;
  2477. try {
  2478. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  2479. if (Object(_i) !== _i) return;
  2480. _n = !1;
  2481. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  2482. ;
  2483. }
  2484. } catch (err) {
  2485. _d = !0, _e = err;
  2486. } finally {
  2487. try {
  2488. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  2489. } finally {
  2490. if (_d) throw _e;
  2491. }
  2492. }
  2493. return _arr;
  2494. }
  2495. }
  2496. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2497. /***/ }),
  2498. /* 8 */
  2499. /*!***************************************************************************!*\
  2500. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2501. \***************************************************************************/
  2502. /*! no static exports found */
  2503. /***/ (function(module, exports, __webpack_require__) {
  2504. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2505. function _unsupportedIterableToArray(o, minLen) {
  2506. if (!o) return;
  2507. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2508. var n = Object.prototype.toString.call(o).slice(8, -1);
  2509. if (n === "Object" && o.constructor) n = o.constructor.name;
  2510. if (n === "Map" || n === "Set") return Array.from(o);
  2511. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2512. }
  2513. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2514. /***/ }),
  2515. /* 9 */
  2516. /*!*****************************************************************!*\
  2517. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2518. \*****************************************************************/
  2519. /*! no static exports found */
  2520. /***/ (function(module, exports) {
  2521. function _arrayLikeToArray(arr, len) {
  2522. if (len == null || len > arr.length) len = arr.length;
  2523. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2524. arr2[i] = arr[i];
  2525. }
  2526. return arr2;
  2527. }
  2528. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2529. /***/ }),
  2530. /* 10 */
  2531. /*!****************************************************************!*\
  2532. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2533. \****************************************************************/
  2534. /*! no static exports found */
  2535. /***/ (function(module, exports) {
  2536. function _nonIterableRest() {
  2537. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2538. }
  2539. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2540. /***/ }),
  2541. /* 11 */
  2542. /*!***************************************************************!*\
  2543. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2544. \***************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2548. function _defineProperty(obj, key, value) {
  2549. key = toPropertyKey(key);
  2550. if (key in obj) {
  2551. Object.defineProperty(obj, key, {
  2552. value: value,
  2553. enumerable: true,
  2554. configurable: true,
  2555. writable: true
  2556. });
  2557. } else {
  2558. obj[key] = value;
  2559. }
  2560. return obj;
  2561. }
  2562. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2563. /***/ }),
  2564. /* 12 */
  2565. /*!**************************************************************!*\
  2566. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2567. \**************************************************************/
  2568. /*! no static exports found */
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2571. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2572. function _toPropertyKey(arg) {
  2573. var key = toPrimitive(arg, "string");
  2574. return _typeof(key) === "symbol" ? key : String(key);
  2575. }
  2576. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2577. /***/ }),
  2578. /* 13 */
  2579. /*!*******************************************************!*\
  2580. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2581. \*******************************************************/
  2582. /*! no static exports found */
  2583. /***/ (function(module, exports) {
  2584. function _typeof(obj) {
  2585. "@babel/helpers - typeof";
  2586. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2587. return typeof obj;
  2588. } : function (obj) {
  2589. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2590. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2591. }
  2592. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2593. /***/ }),
  2594. /* 14 */
  2595. /*!************************************************************!*\
  2596. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2597. \************************************************************/
  2598. /*! no static exports found */
  2599. /***/ (function(module, exports, __webpack_require__) {
  2600. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2601. function _toPrimitive(input, hint) {
  2602. if (_typeof(input) !== "object" || input === null) return input;
  2603. var prim = input[Symbol.toPrimitive];
  2604. if (prim !== undefined) {
  2605. var res = prim.call(input, hint || "default");
  2606. if (_typeof(res) !== "object") return res;
  2607. throw new TypeError("@@toPrimitive must return a primitive value.");
  2608. }
  2609. return (hint === "string" ? String : Number)(input);
  2610. }
  2611. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2612. /***/ }),
  2613. /* 15 */
  2614. /*!**********************************************************!*\
  2615. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2616. \**********************************************************/
  2617. /*! no static exports found */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2620. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2621. function _construct(Parent, args, Class) {
  2622. if (isNativeReflectConstruct()) {
  2623. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2624. } else {
  2625. module.exports = _construct = function _construct(Parent, args, Class) {
  2626. var a = [null];
  2627. a.push.apply(a, args);
  2628. var Constructor = Function.bind.apply(Parent, a);
  2629. var instance = new Constructor();
  2630. if (Class) setPrototypeOf(instance, Class.prototype);
  2631. return instance;
  2632. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2633. }
  2634. return _construct.apply(null, arguments);
  2635. }
  2636. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2637. /***/ }),
  2638. /* 16 */
  2639. /*!***************************************************************!*\
  2640. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2641. \***************************************************************/
  2642. /*! no static exports found */
  2643. /***/ (function(module, exports) {
  2644. function _setPrototypeOf(o, p) {
  2645. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2646. o.__proto__ = p;
  2647. return o;
  2648. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2649. return _setPrototypeOf(o, p);
  2650. }
  2651. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2652. /***/ }),
  2653. /* 17 */
  2654. /*!*************************************************************************!*\
  2655. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2656. \*************************************************************************/
  2657. /*! no static exports found */
  2658. /***/ (function(module, exports) {
  2659. function _isNativeReflectConstruct() {
  2660. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2661. if (Reflect.construct.sham) return false;
  2662. if (typeof Proxy === "function") return true;
  2663. try {
  2664. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2665. return true;
  2666. } catch (e) {
  2667. return false;
  2668. }
  2669. }
  2670. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2671. /***/ }),
  2672. /* 18 */
  2673. /*!******************************************************************!*\
  2674. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2675. \******************************************************************/
  2676. /*! no static exports found */
  2677. /***/ (function(module, exports, __webpack_require__) {
  2678. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2679. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2680. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2681. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2682. function _toConsumableArray(arr) {
  2683. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2684. }
  2685. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2686. /***/ }),
  2687. /* 19 */
  2688. /*!******************************************************************!*\
  2689. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2690. \******************************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2694. function _arrayWithoutHoles(arr) {
  2695. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2696. }
  2697. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2698. /***/ }),
  2699. /* 20 */
  2700. /*!****************************************************************!*\
  2701. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2702. \****************************************************************/
  2703. /*! no static exports found */
  2704. /***/ (function(module, exports) {
  2705. function _iterableToArray(iter) {
  2706. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2707. }
  2708. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2709. /***/ }),
  2710. /* 21 */
  2711. /*!******************************************************************!*\
  2712. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2713. \******************************************************************/
  2714. /*! no static exports found */
  2715. /***/ (function(module, exports) {
  2716. function _nonIterableSpread() {
  2717. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2718. }
  2719. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2720. /***/ }),
  2721. /* 22 */
  2722. /*!*************************************************************!*\
  2723. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2724. \*************************************************************/
  2725. /*! no static exports found */
  2726. /***/ (function(module, exports, __webpack_require__) {
  2727. "use strict";
  2728. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2729. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2730. Object.defineProperty(exports, "__esModule", {
  2731. value: true
  2732. });
  2733. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2734. exports.compileI18nJsonStr = compileI18nJsonStr;
  2735. exports.hasI18nJson = hasI18nJson;
  2736. exports.initVueI18n = initVueI18n;
  2737. exports.isI18nStr = isI18nStr;
  2738. exports.isString = void 0;
  2739. exports.normalizeLocale = normalizeLocale;
  2740. exports.parseI18nJson = parseI18nJson;
  2741. exports.resolveLocale = resolveLocale;
  2742. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2743. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2744. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2745. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2746. var isArray = Array.isArray;
  2747. var isObject = function isObject(val) {
  2748. return val !== null && (0, _typeof2.default)(val) === 'object';
  2749. };
  2750. var defaultDelimiters = ['{', '}'];
  2751. var BaseFormatter = /*#__PURE__*/function () {
  2752. function BaseFormatter() {
  2753. (0, _classCallCheck2.default)(this, BaseFormatter);
  2754. this._caches = Object.create(null);
  2755. }
  2756. (0, _createClass2.default)(BaseFormatter, [{
  2757. key: "interpolate",
  2758. value: function interpolate(message, values) {
  2759. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2760. if (!values) {
  2761. return [message];
  2762. }
  2763. var tokens = this._caches[message];
  2764. if (!tokens) {
  2765. tokens = parse(message, delimiters);
  2766. this._caches[message] = tokens;
  2767. }
  2768. return compile(tokens, values);
  2769. }
  2770. }]);
  2771. return BaseFormatter;
  2772. }();
  2773. exports.Formatter = BaseFormatter;
  2774. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2775. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2776. function parse(format, _ref) {
  2777. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2778. startDelimiter = _ref2[0],
  2779. endDelimiter = _ref2[1];
  2780. var tokens = [];
  2781. var position = 0;
  2782. var text = '';
  2783. while (position < format.length) {
  2784. var char = format[position++];
  2785. if (char === startDelimiter) {
  2786. if (text) {
  2787. tokens.push({
  2788. type: 'text',
  2789. value: text
  2790. });
  2791. }
  2792. text = '';
  2793. var sub = '';
  2794. char = format[position++];
  2795. while (char !== undefined && char !== endDelimiter) {
  2796. sub += char;
  2797. char = format[position++];
  2798. }
  2799. var isClosed = char === endDelimiter;
  2800. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2801. tokens.push({
  2802. value: sub,
  2803. type: type
  2804. });
  2805. }
  2806. // else if (char === '%') {
  2807. // // when found rails i18n syntax, skip text capture
  2808. // if (format[position] !== '{') {
  2809. // text += char
  2810. // }
  2811. // }
  2812. else {
  2813. text += char;
  2814. }
  2815. }
  2816. text && tokens.push({
  2817. type: 'text',
  2818. value: text
  2819. });
  2820. return tokens;
  2821. }
  2822. function compile(tokens, values) {
  2823. var compiled = [];
  2824. var index = 0;
  2825. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2826. if (mode === 'unknown') {
  2827. return compiled;
  2828. }
  2829. while (index < tokens.length) {
  2830. var token = tokens[index];
  2831. switch (token.type) {
  2832. case 'text':
  2833. compiled.push(token.value);
  2834. break;
  2835. case 'list':
  2836. compiled.push(values[parseInt(token.value, 10)]);
  2837. break;
  2838. case 'named':
  2839. if (mode === 'named') {
  2840. compiled.push(values[token.value]);
  2841. } else {
  2842. if (true) {
  2843. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2844. }
  2845. }
  2846. break;
  2847. case 'unknown':
  2848. if (true) {
  2849. console.warn("Detect 'unknown' type of token!");
  2850. }
  2851. break;
  2852. }
  2853. index++;
  2854. }
  2855. return compiled;
  2856. }
  2857. var LOCALE_ZH_HANS = 'zh-Hans';
  2858. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2859. var LOCALE_ZH_HANT = 'zh-Hant';
  2860. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2861. var LOCALE_EN = 'en';
  2862. exports.LOCALE_EN = LOCALE_EN;
  2863. var LOCALE_FR = 'fr';
  2864. exports.LOCALE_FR = LOCALE_FR;
  2865. var LOCALE_ES = 'es';
  2866. exports.LOCALE_ES = LOCALE_ES;
  2867. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2868. var hasOwn = function hasOwn(val, key) {
  2869. return hasOwnProperty.call(val, key);
  2870. };
  2871. var defaultFormatter = new BaseFormatter();
  2872. function include(str, parts) {
  2873. return !!parts.find(function (part) {
  2874. return str.indexOf(part) !== -1;
  2875. });
  2876. }
  2877. function startsWith(str, parts) {
  2878. return parts.find(function (part) {
  2879. return str.indexOf(part) === 0;
  2880. });
  2881. }
  2882. function normalizeLocale(locale, messages) {
  2883. if (!locale) {
  2884. return;
  2885. }
  2886. locale = locale.trim().replace(/_/g, '-');
  2887. if (messages && messages[locale]) {
  2888. return locale;
  2889. }
  2890. locale = locale.toLowerCase();
  2891. if (locale.indexOf('zh') === 0) {
  2892. if (locale.indexOf('-hans') > -1) {
  2893. return LOCALE_ZH_HANS;
  2894. }
  2895. if (locale.indexOf('-hant') > -1) {
  2896. return LOCALE_ZH_HANT;
  2897. }
  2898. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2899. return LOCALE_ZH_HANT;
  2900. }
  2901. return LOCALE_ZH_HANS;
  2902. }
  2903. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2904. if (lang) {
  2905. return lang;
  2906. }
  2907. }
  2908. var I18n = /*#__PURE__*/function () {
  2909. function I18n(_ref3) {
  2910. var locale = _ref3.locale,
  2911. fallbackLocale = _ref3.fallbackLocale,
  2912. messages = _ref3.messages,
  2913. watcher = _ref3.watcher,
  2914. formater = _ref3.formater;
  2915. (0, _classCallCheck2.default)(this, I18n);
  2916. this.locale = LOCALE_EN;
  2917. this.fallbackLocale = LOCALE_EN;
  2918. this.message = {};
  2919. this.messages = {};
  2920. this.watchers = [];
  2921. if (fallbackLocale) {
  2922. this.fallbackLocale = fallbackLocale;
  2923. }
  2924. this.formater = formater || defaultFormatter;
  2925. this.messages = messages || {};
  2926. this.setLocale(locale || LOCALE_EN);
  2927. if (watcher) {
  2928. this.watchLocale(watcher);
  2929. }
  2930. }
  2931. (0, _createClass2.default)(I18n, [{
  2932. key: "setLocale",
  2933. value: function setLocale(locale) {
  2934. var _this = this;
  2935. var oldLocale = this.locale;
  2936. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2937. if (!this.messages[this.locale]) {
  2938. // 可能初始化时不存在
  2939. this.messages[this.locale] = {};
  2940. }
  2941. this.message = this.messages[this.locale];
  2942. // 仅发生变化时,通知
  2943. if (oldLocale !== this.locale) {
  2944. this.watchers.forEach(function (watcher) {
  2945. watcher(_this.locale, oldLocale);
  2946. });
  2947. }
  2948. }
  2949. }, {
  2950. key: "getLocale",
  2951. value: function getLocale() {
  2952. return this.locale;
  2953. }
  2954. }, {
  2955. key: "watchLocale",
  2956. value: function watchLocale(fn) {
  2957. var _this2 = this;
  2958. var index = this.watchers.push(fn) - 1;
  2959. return function () {
  2960. _this2.watchers.splice(index, 1);
  2961. };
  2962. }
  2963. }, {
  2964. key: "add",
  2965. value: function add(locale, message) {
  2966. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2967. var curMessages = this.messages[locale];
  2968. if (curMessages) {
  2969. if (override) {
  2970. Object.assign(curMessages, message);
  2971. } else {
  2972. Object.keys(message).forEach(function (key) {
  2973. if (!hasOwn(curMessages, key)) {
  2974. curMessages[key] = message[key];
  2975. }
  2976. });
  2977. }
  2978. } else {
  2979. this.messages[locale] = message;
  2980. }
  2981. }
  2982. }, {
  2983. key: "f",
  2984. value: function f(message, values, delimiters) {
  2985. return this.formater.interpolate(message, values, delimiters).join('');
  2986. }
  2987. }, {
  2988. key: "t",
  2989. value: function t(key, locale, values) {
  2990. var message = this.message;
  2991. if (typeof locale === 'string') {
  2992. locale = normalizeLocale(locale, this.messages);
  2993. locale && (message = this.messages[locale]);
  2994. } else {
  2995. values = locale;
  2996. }
  2997. if (!hasOwn(message, key)) {
  2998. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2999. return key;
  3000. }
  3001. return this.formater.interpolate(message[key], values).join('');
  3002. }
  3003. }]);
  3004. return I18n;
  3005. }();
  3006. exports.I18n = I18n;
  3007. function watchAppLocale(appVm, i18n) {
  3008. // 需要保证 watch 的触发在组件渲染之前
  3009. if (appVm.$watchLocale) {
  3010. // vue2
  3011. appVm.$watchLocale(function (newLocale) {
  3012. i18n.setLocale(newLocale);
  3013. });
  3014. } else {
  3015. appVm.$watch(function () {
  3016. return appVm.$locale;
  3017. }, function (newLocale) {
  3018. i18n.setLocale(newLocale);
  3019. });
  3020. }
  3021. }
  3022. function getDefaultLocale() {
  3023. if (typeof uni !== 'undefined' && uni.getLocale) {
  3024. return uni.getLocale();
  3025. }
  3026. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3027. if (typeof global !== 'undefined' && global.getLocale) {
  3028. return global.getLocale();
  3029. }
  3030. return LOCALE_EN;
  3031. }
  3032. function initVueI18n(locale) {
  3033. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3034. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3035. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3036. // 兼容旧版本入参
  3037. if (typeof locale !== 'string') {
  3038. var _ref4 = [messages, locale];
  3039. locale = _ref4[0];
  3040. messages = _ref4[1];
  3041. }
  3042. if (typeof locale !== 'string') {
  3043. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3044. locale = getDefaultLocale();
  3045. }
  3046. if (typeof fallbackLocale !== 'string') {
  3047. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3048. }
  3049. var i18n = new I18n({
  3050. locale: locale,
  3051. fallbackLocale: fallbackLocale,
  3052. messages: messages,
  3053. watcher: watcher
  3054. });
  3055. var _t = function t(key, values) {
  3056. if (typeof getApp !== 'function') {
  3057. // app view
  3058. /* eslint-disable no-func-assign */
  3059. _t = function t(key, values) {
  3060. return i18n.t(key, values);
  3061. };
  3062. } else {
  3063. var isWatchedAppLocale = false;
  3064. _t = function t(key, values) {
  3065. var appVm = getApp().$vm;
  3066. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3067. // options: {
  3068. // type: Array,
  3069. // default () {
  3070. // return [{
  3071. // icon: 'shop',
  3072. // text: t("uni-goods-nav.options.shop"),
  3073. // }, {
  3074. // icon: 'cart',
  3075. // text: t("uni-goods-nav.options.cart")
  3076. // }]
  3077. // }
  3078. // },
  3079. if (appVm) {
  3080. // 触发响应式
  3081. appVm.$locale;
  3082. if (!isWatchedAppLocale) {
  3083. isWatchedAppLocale = true;
  3084. watchAppLocale(appVm, i18n);
  3085. }
  3086. }
  3087. return i18n.t(key, values);
  3088. };
  3089. }
  3090. return _t(key, values);
  3091. };
  3092. return {
  3093. i18n: i18n,
  3094. f: function f(message, values, delimiters) {
  3095. return i18n.f(message, values, delimiters);
  3096. },
  3097. t: function t(key, values) {
  3098. return _t(key, values);
  3099. },
  3100. add: function add(locale, message) {
  3101. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3102. return i18n.add(locale, message, override);
  3103. },
  3104. watch: function watch(fn) {
  3105. return i18n.watchLocale(fn);
  3106. },
  3107. getLocale: function getLocale() {
  3108. return i18n.getLocale();
  3109. },
  3110. setLocale: function setLocale(newLocale) {
  3111. return i18n.setLocale(newLocale);
  3112. }
  3113. };
  3114. }
  3115. var isString = function isString(val) {
  3116. return typeof val === 'string';
  3117. };
  3118. exports.isString = isString;
  3119. var formater;
  3120. function hasI18nJson(jsonObj, delimiters) {
  3121. if (!formater) {
  3122. formater = new BaseFormatter();
  3123. }
  3124. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3125. var value = jsonObj[key];
  3126. if (isString(value)) {
  3127. if (isI18nStr(value, delimiters)) {
  3128. return true;
  3129. }
  3130. } else {
  3131. return hasI18nJson(value, delimiters);
  3132. }
  3133. });
  3134. }
  3135. function parseI18nJson(jsonObj, values, delimiters) {
  3136. if (!formater) {
  3137. formater = new BaseFormatter();
  3138. }
  3139. walkJsonObj(jsonObj, function (jsonObj, key) {
  3140. var value = jsonObj[key];
  3141. if (isString(value)) {
  3142. if (isI18nStr(value, delimiters)) {
  3143. jsonObj[key] = compileStr(value, values, delimiters);
  3144. }
  3145. } else {
  3146. parseI18nJson(value, values, delimiters);
  3147. }
  3148. });
  3149. return jsonObj;
  3150. }
  3151. function compileI18nJsonStr(jsonStr, _ref5) {
  3152. var locale = _ref5.locale,
  3153. locales = _ref5.locales,
  3154. delimiters = _ref5.delimiters;
  3155. if (!isI18nStr(jsonStr, delimiters)) {
  3156. return jsonStr;
  3157. }
  3158. if (!formater) {
  3159. formater = new BaseFormatter();
  3160. }
  3161. var localeValues = [];
  3162. Object.keys(locales).forEach(function (name) {
  3163. if (name !== locale) {
  3164. localeValues.push({
  3165. locale: name,
  3166. values: locales[name]
  3167. });
  3168. }
  3169. });
  3170. localeValues.unshift({
  3171. locale: locale,
  3172. values: locales[locale]
  3173. });
  3174. try {
  3175. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3176. } catch (e) {}
  3177. return jsonStr;
  3178. }
  3179. function isI18nStr(value, delimiters) {
  3180. return value.indexOf(delimiters[0]) > -1;
  3181. }
  3182. function compileStr(value, values, delimiters) {
  3183. return formater.interpolate(value, values, delimiters).join('');
  3184. }
  3185. function compileValue(jsonObj, key, localeValues, delimiters) {
  3186. var value = jsonObj[key];
  3187. if (isString(value)) {
  3188. // 存在国际化
  3189. if (isI18nStr(value, delimiters)) {
  3190. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3191. if (localeValues.length > 1) {
  3192. // 格式化国际化语言
  3193. var valueLocales = jsonObj[key + 'Locales'] = {};
  3194. localeValues.forEach(function (localValue) {
  3195. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3196. });
  3197. }
  3198. }
  3199. } else {
  3200. compileJsonObj(value, localeValues, delimiters);
  3201. }
  3202. }
  3203. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3204. walkJsonObj(jsonObj, function (jsonObj, key) {
  3205. compileValue(jsonObj, key, localeValues, delimiters);
  3206. });
  3207. return jsonObj;
  3208. }
  3209. function walkJsonObj(jsonObj, walk) {
  3210. if (isArray(jsonObj)) {
  3211. for (var i = 0; i < jsonObj.length; i++) {
  3212. if (walk(jsonObj, i)) {
  3213. return true;
  3214. }
  3215. }
  3216. } else if (isObject(jsonObj)) {
  3217. for (var key in jsonObj) {
  3218. if (walk(jsonObj, key)) {
  3219. return true;
  3220. }
  3221. }
  3222. }
  3223. return false;
  3224. }
  3225. function resolveLocale(locales) {
  3226. return function (locale) {
  3227. if (!locale) {
  3228. return locale;
  3229. }
  3230. locale = normalizeLocale(locale) || locale;
  3231. return resolveLocaleChain(locale).find(function (locale) {
  3232. return locales.indexOf(locale) > -1;
  3233. });
  3234. };
  3235. }
  3236. function resolveLocaleChain(locale) {
  3237. var chain = [];
  3238. var tokens = locale.split('-');
  3239. while (tokens.length) {
  3240. chain.push(tokens.join('-'));
  3241. tokens.pop();
  3242. }
  3243. return chain;
  3244. }
  3245. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3246. /***/ }),
  3247. /* 23 */
  3248. /*!***************************************************************!*\
  3249. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3250. \***************************************************************/
  3251. /*! no static exports found */
  3252. /***/ (function(module, exports) {
  3253. function _classCallCheck(instance, Constructor) {
  3254. if (!(instance instanceof Constructor)) {
  3255. throw new TypeError("Cannot call a class as a function");
  3256. }
  3257. }
  3258. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3259. /***/ }),
  3260. /* 24 */
  3261. /*!************************************************************!*\
  3262. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3263. \************************************************************/
  3264. /*! no static exports found */
  3265. /***/ (function(module, exports, __webpack_require__) {
  3266. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3267. function _defineProperties(target, props) {
  3268. for (var i = 0; i < props.length; i++) {
  3269. var descriptor = props[i];
  3270. descriptor.enumerable = descriptor.enumerable || false;
  3271. descriptor.configurable = true;
  3272. if ("value" in descriptor) descriptor.writable = true;
  3273. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3274. }
  3275. }
  3276. function _createClass(Constructor, protoProps, staticProps) {
  3277. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3278. if (staticProps) _defineProperties(Constructor, staticProps);
  3279. Object.defineProperty(Constructor, "prototype", {
  3280. writable: false
  3281. });
  3282. return Constructor;
  3283. }
  3284. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3285. /***/ }),
  3286. /* 25 */
  3287. /*!******************************************************************************************!*\
  3288. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3289. \******************************************************************************************/
  3290. /*! exports provided: default */
  3291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3292. "use strict";
  3293. __webpack_require__.r(__webpack_exports__);
  3294. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3295. * Vue.js v2.6.11
  3296. * (c) 2014-2022 Evan You
  3297. * Released under the MIT License.
  3298. */
  3299. /* */
  3300. var emptyObject = Object.freeze({});
  3301. // These helpers produce better VM code in JS engines due to their
  3302. // explicitness and function inlining.
  3303. function isUndef (v) {
  3304. return v === undefined || v === null
  3305. }
  3306. function isDef (v) {
  3307. return v !== undefined && v !== null
  3308. }
  3309. function isTrue (v) {
  3310. return v === true
  3311. }
  3312. function isFalse (v) {
  3313. return v === false
  3314. }
  3315. /**
  3316. * Check if value is primitive.
  3317. */
  3318. function isPrimitive (value) {
  3319. return (
  3320. typeof value === 'string' ||
  3321. typeof value === 'number' ||
  3322. // $flow-disable-line
  3323. typeof value === 'symbol' ||
  3324. typeof value === 'boolean'
  3325. )
  3326. }
  3327. /**
  3328. * Quick object check - this is primarily used to tell
  3329. * Objects from primitive values when we know the value
  3330. * is a JSON-compliant type.
  3331. */
  3332. function isObject (obj) {
  3333. return obj !== null && typeof obj === 'object'
  3334. }
  3335. /**
  3336. * Get the raw type string of a value, e.g., [object Object].
  3337. */
  3338. var _toString = Object.prototype.toString;
  3339. function toRawType (value) {
  3340. return _toString.call(value).slice(8, -1)
  3341. }
  3342. /**
  3343. * Strict object type check. Only returns true
  3344. * for plain JavaScript objects.
  3345. */
  3346. function isPlainObject (obj) {
  3347. return _toString.call(obj) === '[object Object]'
  3348. }
  3349. function isRegExp (v) {
  3350. return _toString.call(v) === '[object RegExp]'
  3351. }
  3352. /**
  3353. * Check if val is a valid array index.
  3354. */
  3355. function isValidArrayIndex (val) {
  3356. var n = parseFloat(String(val));
  3357. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3358. }
  3359. function isPromise (val) {
  3360. return (
  3361. isDef(val) &&
  3362. typeof val.then === 'function' &&
  3363. typeof val.catch === 'function'
  3364. )
  3365. }
  3366. /**
  3367. * Convert a value to a string that is actually rendered.
  3368. */
  3369. function toString (val) {
  3370. return val == null
  3371. ? ''
  3372. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3373. ? JSON.stringify(val, null, 2)
  3374. : String(val)
  3375. }
  3376. /**
  3377. * Convert an input value to a number for persistence.
  3378. * If the conversion fails, return original string.
  3379. */
  3380. function toNumber (val) {
  3381. var n = parseFloat(val);
  3382. return isNaN(n) ? val : n
  3383. }
  3384. /**
  3385. * Make a map and return a function for checking if a key
  3386. * is in that map.
  3387. */
  3388. function makeMap (
  3389. str,
  3390. expectsLowerCase
  3391. ) {
  3392. var map = Object.create(null);
  3393. var list = str.split(',');
  3394. for (var i = 0; i < list.length; i++) {
  3395. map[list[i]] = true;
  3396. }
  3397. return expectsLowerCase
  3398. ? function (val) { return map[val.toLowerCase()]; }
  3399. : function (val) { return map[val]; }
  3400. }
  3401. /**
  3402. * Check if a tag is a built-in tag.
  3403. */
  3404. var isBuiltInTag = makeMap('slot,component', true);
  3405. /**
  3406. * Check if an attribute is a reserved attribute.
  3407. */
  3408. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3409. /**
  3410. * Remove an item from an array.
  3411. */
  3412. function remove (arr, item) {
  3413. if (arr.length) {
  3414. var index = arr.indexOf(item);
  3415. if (index > -1) {
  3416. return arr.splice(index, 1)
  3417. }
  3418. }
  3419. }
  3420. /**
  3421. * Check whether an object has the property.
  3422. */
  3423. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3424. function hasOwn (obj, key) {
  3425. return hasOwnProperty.call(obj, key)
  3426. }
  3427. /**
  3428. * Create a cached version of a pure function.
  3429. */
  3430. function cached (fn) {
  3431. var cache = Object.create(null);
  3432. return (function cachedFn (str) {
  3433. var hit = cache[str];
  3434. return hit || (cache[str] = fn(str))
  3435. })
  3436. }
  3437. /**
  3438. * Camelize a hyphen-delimited string.
  3439. */
  3440. var camelizeRE = /-(\w)/g;
  3441. var camelize = cached(function (str) {
  3442. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3443. });
  3444. /**
  3445. * Capitalize a string.
  3446. */
  3447. var capitalize = cached(function (str) {
  3448. return str.charAt(0).toUpperCase() + str.slice(1)
  3449. });
  3450. /**
  3451. * Hyphenate a camelCase string.
  3452. */
  3453. var hyphenateRE = /\B([A-Z])/g;
  3454. var hyphenate = cached(function (str) {
  3455. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3456. });
  3457. /**
  3458. * Simple bind polyfill for environments that do not support it,
  3459. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3460. * since native bind is now performant enough in most browsers.
  3461. * But removing it would mean breaking code that was able to run in
  3462. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3463. */
  3464. /* istanbul ignore next */
  3465. function polyfillBind (fn, ctx) {
  3466. function boundFn (a) {
  3467. var l = arguments.length;
  3468. return l
  3469. ? l > 1
  3470. ? fn.apply(ctx, arguments)
  3471. : fn.call(ctx, a)
  3472. : fn.call(ctx)
  3473. }
  3474. boundFn._length = fn.length;
  3475. return boundFn
  3476. }
  3477. function nativeBind (fn, ctx) {
  3478. return fn.bind(ctx)
  3479. }
  3480. var bind = Function.prototype.bind
  3481. ? nativeBind
  3482. : polyfillBind;
  3483. /**
  3484. * Convert an Array-like object to a real Array.
  3485. */
  3486. function toArray (list, start) {
  3487. start = start || 0;
  3488. var i = list.length - start;
  3489. var ret = new Array(i);
  3490. while (i--) {
  3491. ret[i] = list[i + start];
  3492. }
  3493. return ret
  3494. }
  3495. /**
  3496. * Mix properties into target object.
  3497. */
  3498. function extend (to, _from) {
  3499. for (var key in _from) {
  3500. to[key] = _from[key];
  3501. }
  3502. return to
  3503. }
  3504. /**
  3505. * Merge an Array of Objects into a single Object.
  3506. */
  3507. function toObject (arr) {
  3508. var res = {};
  3509. for (var i = 0; i < arr.length; i++) {
  3510. if (arr[i]) {
  3511. extend(res, arr[i]);
  3512. }
  3513. }
  3514. return res
  3515. }
  3516. /* eslint-disable no-unused-vars */
  3517. /**
  3518. * Perform no operation.
  3519. * Stubbing args to make Flow happy without leaving useless transpiled code
  3520. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3521. */
  3522. function noop (a, b, c) {}
  3523. /**
  3524. * Always return false.
  3525. */
  3526. var no = function (a, b, c) { return false; };
  3527. /* eslint-enable no-unused-vars */
  3528. /**
  3529. * Return the same value.
  3530. */
  3531. var identity = function (_) { return _; };
  3532. /**
  3533. * Check if two values are loosely equal - that is,
  3534. * if they are plain objects, do they have the same shape?
  3535. */
  3536. function looseEqual (a, b) {
  3537. if (a === b) { return true }
  3538. var isObjectA = isObject(a);
  3539. var isObjectB = isObject(b);
  3540. if (isObjectA && isObjectB) {
  3541. try {
  3542. var isArrayA = Array.isArray(a);
  3543. var isArrayB = Array.isArray(b);
  3544. if (isArrayA && isArrayB) {
  3545. return a.length === b.length && a.every(function (e, i) {
  3546. return looseEqual(e, b[i])
  3547. })
  3548. } else if (a instanceof Date && b instanceof Date) {
  3549. return a.getTime() === b.getTime()
  3550. } else if (!isArrayA && !isArrayB) {
  3551. var keysA = Object.keys(a);
  3552. var keysB = Object.keys(b);
  3553. return keysA.length === keysB.length && keysA.every(function (key) {
  3554. return looseEqual(a[key], b[key])
  3555. })
  3556. } else {
  3557. /* istanbul ignore next */
  3558. return false
  3559. }
  3560. } catch (e) {
  3561. /* istanbul ignore next */
  3562. return false
  3563. }
  3564. } else if (!isObjectA && !isObjectB) {
  3565. return String(a) === String(b)
  3566. } else {
  3567. return false
  3568. }
  3569. }
  3570. /**
  3571. * Return the first index at which a loosely equal value can be
  3572. * found in the array (if value is a plain object, the array must
  3573. * contain an object of the same shape), or -1 if it is not present.
  3574. */
  3575. function looseIndexOf (arr, val) {
  3576. for (var i = 0; i < arr.length; i++) {
  3577. if (looseEqual(arr[i], val)) { return i }
  3578. }
  3579. return -1
  3580. }
  3581. /**
  3582. * Ensure a function is called only once.
  3583. */
  3584. function once (fn) {
  3585. var called = false;
  3586. return function () {
  3587. if (!called) {
  3588. called = true;
  3589. fn.apply(this, arguments);
  3590. }
  3591. }
  3592. }
  3593. var ASSET_TYPES = [
  3594. 'component',
  3595. 'directive',
  3596. 'filter'
  3597. ];
  3598. var LIFECYCLE_HOOKS = [
  3599. 'beforeCreate',
  3600. 'created',
  3601. 'beforeMount',
  3602. 'mounted',
  3603. 'beforeUpdate',
  3604. 'updated',
  3605. 'beforeDestroy',
  3606. 'destroyed',
  3607. 'activated',
  3608. 'deactivated',
  3609. 'errorCaptured',
  3610. 'serverPrefetch'
  3611. ];
  3612. /* */
  3613. var config = ({
  3614. /**
  3615. * Option merge strategies (used in core/util/options)
  3616. */
  3617. // $flow-disable-line
  3618. optionMergeStrategies: Object.create(null),
  3619. /**
  3620. * Whether to suppress warnings.
  3621. */
  3622. silent: false,
  3623. /**
  3624. * Show production mode tip message on boot?
  3625. */
  3626. productionTip: "development" !== 'production',
  3627. /**
  3628. * Whether to enable devtools
  3629. */
  3630. devtools: "development" !== 'production',
  3631. /**
  3632. * Whether to record perf
  3633. */
  3634. performance: false,
  3635. /**
  3636. * Error handler for watcher errors
  3637. */
  3638. errorHandler: null,
  3639. /**
  3640. * Warn handler for watcher warns
  3641. */
  3642. warnHandler: null,
  3643. /**
  3644. * Ignore certain custom elements
  3645. */
  3646. ignoredElements: [],
  3647. /**
  3648. * Custom user key aliases for v-on
  3649. */
  3650. // $flow-disable-line
  3651. keyCodes: Object.create(null),
  3652. /**
  3653. * Check if a tag is reserved so that it cannot be registered as a
  3654. * component. This is platform-dependent and may be overwritten.
  3655. */
  3656. isReservedTag: no,
  3657. /**
  3658. * Check if an attribute is reserved so that it cannot be used as a component
  3659. * prop. This is platform-dependent and may be overwritten.
  3660. */
  3661. isReservedAttr: no,
  3662. /**
  3663. * Check if a tag is an unknown element.
  3664. * Platform-dependent.
  3665. */
  3666. isUnknownElement: no,
  3667. /**
  3668. * Get the namespace of an element
  3669. */
  3670. getTagNamespace: noop,
  3671. /**
  3672. * Parse the real tag name for the specific platform.
  3673. */
  3674. parsePlatformTagName: identity,
  3675. /**
  3676. * Check if an attribute must be bound using property, e.g. value
  3677. * Platform-dependent.
  3678. */
  3679. mustUseProp: no,
  3680. /**
  3681. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3682. * This will significantly reduce performance if set to false.
  3683. */
  3684. async: true,
  3685. /**
  3686. * Exposed for legacy reasons
  3687. */
  3688. _lifecycleHooks: LIFECYCLE_HOOKS
  3689. });
  3690. /* */
  3691. /**
  3692. * unicode letters used for parsing html tags, component names and property paths.
  3693. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3694. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3695. */
  3696. 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/;
  3697. /**
  3698. * Check if a string starts with $ or _
  3699. */
  3700. function isReserved (str) {
  3701. var c = (str + '').charCodeAt(0);
  3702. return c === 0x24 || c === 0x5F
  3703. }
  3704. /**
  3705. * Define a property.
  3706. */
  3707. function def (obj, key, val, enumerable) {
  3708. Object.defineProperty(obj, key, {
  3709. value: val,
  3710. enumerable: !!enumerable,
  3711. writable: true,
  3712. configurable: true
  3713. });
  3714. }
  3715. /**
  3716. * Parse simple path.
  3717. */
  3718. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3719. function parsePath (path) {
  3720. if (bailRE.test(path)) {
  3721. return
  3722. }
  3723. var segments = path.split('.');
  3724. return function (obj) {
  3725. for (var i = 0; i < segments.length; i++) {
  3726. if (!obj) { return }
  3727. obj = obj[segments[i]];
  3728. }
  3729. return obj
  3730. }
  3731. }
  3732. /* */
  3733. // can we use __proto__?
  3734. var hasProto = '__proto__' in {};
  3735. // Browser environment sniffing
  3736. var inBrowser = typeof window !== 'undefined';
  3737. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3738. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3739. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3740. var isIE = UA && /msie|trident/.test(UA);
  3741. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3742. var isEdge = UA && UA.indexOf('edge/') > 0;
  3743. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3744. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3745. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3746. var isPhantomJS = UA && /phantomjs/.test(UA);
  3747. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3748. // Firefox has a "watch" function on Object.prototype...
  3749. var nativeWatch = ({}).watch;
  3750. if (inBrowser) {
  3751. try {
  3752. var opts = {};
  3753. Object.defineProperty(opts, 'passive', ({
  3754. get: function get () {
  3755. }
  3756. })); // https://github.com/facebook/flow/issues/285
  3757. window.addEventListener('test-passive', null, opts);
  3758. } catch (e) {}
  3759. }
  3760. // this needs to be lazy-evaled because vue may be required before
  3761. // vue-server-renderer can set VUE_ENV
  3762. var _isServer;
  3763. var isServerRendering = function () {
  3764. if (_isServer === undefined) {
  3765. /* istanbul ignore if */
  3766. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3767. // detect presence of vue-server-renderer and avoid
  3768. // Webpack shimming the process
  3769. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3770. } else {
  3771. _isServer = false;
  3772. }
  3773. }
  3774. return _isServer
  3775. };
  3776. // detect devtools
  3777. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3778. /* istanbul ignore next */
  3779. function isNative (Ctor) {
  3780. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3781. }
  3782. var hasSymbol =
  3783. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3784. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3785. var _Set;
  3786. /* istanbul ignore if */ // $flow-disable-line
  3787. if (typeof Set !== 'undefined' && isNative(Set)) {
  3788. // use native Set when available.
  3789. _Set = Set;
  3790. } else {
  3791. // a non-standard Set polyfill that only works with primitive keys.
  3792. _Set = /*@__PURE__*/(function () {
  3793. function Set () {
  3794. this.set = Object.create(null);
  3795. }
  3796. Set.prototype.has = function has (key) {
  3797. return this.set[key] === true
  3798. };
  3799. Set.prototype.add = function add (key) {
  3800. this.set[key] = true;
  3801. };
  3802. Set.prototype.clear = function clear () {
  3803. this.set = Object.create(null);
  3804. };
  3805. return Set;
  3806. }());
  3807. }
  3808. /* */
  3809. var warn = noop;
  3810. var tip = noop;
  3811. var generateComponentTrace = (noop); // work around flow check
  3812. var formatComponentName = (noop);
  3813. if (true) {
  3814. var hasConsole = typeof console !== 'undefined';
  3815. var classifyRE = /(?:^|[-_])(\w)/g;
  3816. var classify = function (str) { return str
  3817. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3818. .replace(/[-_]/g, ''); };
  3819. warn = function (msg, vm) {
  3820. var trace = vm ? generateComponentTrace(vm) : '';
  3821. if (config.warnHandler) {
  3822. config.warnHandler.call(null, msg, vm, trace);
  3823. } else if (hasConsole && (!config.silent)) {
  3824. console.error(("[Vue warn]: " + msg + trace));
  3825. }
  3826. };
  3827. tip = function (msg, vm) {
  3828. if (hasConsole && (!config.silent)) {
  3829. console.warn("[Vue tip]: " + msg + (
  3830. vm ? generateComponentTrace(vm) : ''
  3831. ));
  3832. }
  3833. };
  3834. formatComponentName = function (vm, includeFile) {
  3835. if (vm.$root === vm) {
  3836. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3837. return ('') + vm.$options.__file
  3838. }
  3839. return '<Root>'
  3840. }
  3841. var options = typeof vm === 'function' && vm.cid != null
  3842. ? vm.options
  3843. : vm._isVue
  3844. ? vm.$options || vm.constructor.options
  3845. : vm;
  3846. var name = options.name || options._componentTag;
  3847. var file = options.__file;
  3848. if (!name && file) {
  3849. var match = file.match(/([^/\\]+)\.vue$/);
  3850. name = match && match[1];
  3851. }
  3852. return (
  3853. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3854. (file && includeFile !== false ? (" at " + file) : '')
  3855. )
  3856. };
  3857. var repeat = function (str, n) {
  3858. var res = '';
  3859. while (n) {
  3860. if (n % 2 === 1) { res += str; }
  3861. if (n > 1) { str += str; }
  3862. n >>= 1;
  3863. }
  3864. return res
  3865. };
  3866. generateComponentTrace = function (vm) {
  3867. if (vm._isVue && vm.$parent) {
  3868. var tree = [];
  3869. var currentRecursiveSequence = 0;
  3870. while (vm && vm.$options.name !== 'PageBody') {
  3871. if (tree.length > 0) {
  3872. var last = tree[tree.length - 1];
  3873. if (last.constructor === vm.constructor) {
  3874. currentRecursiveSequence++;
  3875. vm = vm.$parent;
  3876. continue
  3877. } else if (currentRecursiveSequence > 0) {
  3878. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3879. currentRecursiveSequence = 0;
  3880. }
  3881. }
  3882. !vm.$options.isReserved && tree.push(vm);
  3883. vm = vm.$parent;
  3884. }
  3885. return '\n\nfound in\n\n' + tree
  3886. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3887. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3888. : formatComponentName(vm))); })
  3889. .join('\n')
  3890. } else {
  3891. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3892. }
  3893. };
  3894. }
  3895. /* */
  3896. var uid = 0;
  3897. /**
  3898. * A dep is an observable that can have multiple
  3899. * directives subscribing to it.
  3900. */
  3901. var Dep = function Dep () {
  3902. this.id = uid++;
  3903. this.subs = [];
  3904. };
  3905. Dep.prototype.addSub = function addSub (sub) {
  3906. this.subs.push(sub);
  3907. };
  3908. Dep.prototype.removeSub = function removeSub (sub) {
  3909. remove(this.subs, sub);
  3910. };
  3911. Dep.prototype.depend = function depend () {
  3912. if (Dep.SharedObject.target) {
  3913. Dep.SharedObject.target.addDep(this);
  3914. }
  3915. };
  3916. Dep.prototype.notify = function notify () {
  3917. // stabilize the subscriber list first
  3918. var subs = this.subs.slice();
  3919. if ( true && !config.async) {
  3920. // subs aren't sorted in scheduler if not running async
  3921. // we need to sort them now to make sure they fire in correct
  3922. // order
  3923. subs.sort(function (a, b) { return a.id - b.id; });
  3924. }
  3925. for (var i = 0, l = subs.length; i < l; i++) {
  3926. subs[i].update();
  3927. }
  3928. };
  3929. // The current target watcher being evaluated.
  3930. // This is globally unique because only one watcher
  3931. // can be evaluated at a time.
  3932. // fixed by xxxxxx (nvue shared vuex)
  3933. /* eslint-disable no-undef */
  3934. Dep.SharedObject = {};
  3935. Dep.SharedObject.target = null;
  3936. Dep.SharedObject.targetStack = [];
  3937. function pushTarget (target) {
  3938. Dep.SharedObject.targetStack.push(target);
  3939. Dep.SharedObject.target = target;
  3940. Dep.target = target;
  3941. }
  3942. function popTarget () {
  3943. Dep.SharedObject.targetStack.pop();
  3944. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3945. Dep.target = Dep.SharedObject.target;
  3946. }
  3947. /* */
  3948. var VNode = function VNode (
  3949. tag,
  3950. data,
  3951. children,
  3952. text,
  3953. elm,
  3954. context,
  3955. componentOptions,
  3956. asyncFactory
  3957. ) {
  3958. this.tag = tag;
  3959. this.data = data;
  3960. this.children = children;
  3961. this.text = text;
  3962. this.elm = elm;
  3963. this.ns = undefined;
  3964. this.context = context;
  3965. this.fnContext = undefined;
  3966. this.fnOptions = undefined;
  3967. this.fnScopeId = undefined;
  3968. this.key = data && data.key;
  3969. this.componentOptions = componentOptions;
  3970. this.componentInstance = undefined;
  3971. this.parent = undefined;
  3972. this.raw = false;
  3973. this.isStatic = false;
  3974. this.isRootInsert = true;
  3975. this.isComment = false;
  3976. this.isCloned = false;
  3977. this.isOnce = false;
  3978. this.asyncFactory = asyncFactory;
  3979. this.asyncMeta = undefined;
  3980. this.isAsyncPlaceholder = false;
  3981. };
  3982. var prototypeAccessors = { child: { configurable: true } };
  3983. // DEPRECATED: alias for componentInstance for backwards compat.
  3984. /* istanbul ignore next */
  3985. prototypeAccessors.child.get = function () {
  3986. return this.componentInstance
  3987. };
  3988. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3989. var createEmptyVNode = function (text) {
  3990. if ( text === void 0 ) text = '';
  3991. var node = new VNode();
  3992. node.text = text;
  3993. node.isComment = true;
  3994. return node
  3995. };
  3996. function createTextVNode (val) {
  3997. return new VNode(undefined, undefined, undefined, String(val))
  3998. }
  3999. // optimized shallow clone
  4000. // used for static nodes and slot nodes because they may be reused across
  4001. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4002. // on their elm reference.
  4003. function cloneVNode (vnode) {
  4004. var cloned = new VNode(
  4005. vnode.tag,
  4006. vnode.data,
  4007. // #7975
  4008. // clone children array to avoid mutating original in case of cloning
  4009. // a child.
  4010. vnode.children && vnode.children.slice(),
  4011. vnode.text,
  4012. vnode.elm,
  4013. vnode.context,
  4014. vnode.componentOptions,
  4015. vnode.asyncFactory
  4016. );
  4017. cloned.ns = vnode.ns;
  4018. cloned.isStatic = vnode.isStatic;
  4019. cloned.key = vnode.key;
  4020. cloned.isComment = vnode.isComment;
  4021. cloned.fnContext = vnode.fnContext;
  4022. cloned.fnOptions = vnode.fnOptions;
  4023. cloned.fnScopeId = vnode.fnScopeId;
  4024. cloned.asyncMeta = vnode.asyncMeta;
  4025. cloned.isCloned = true;
  4026. return cloned
  4027. }
  4028. /*
  4029. * not type checking this file because flow doesn't play well with
  4030. * dynamically accessing methods on Array prototype
  4031. */
  4032. var arrayProto = Array.prototype;
  4033. var arrayMethods = Object.create(arrayProto);
  4034. var methodsToPatch = [
  4035. 'push',
  4036. 'pop',
  4037. 'shift',
  4038. 'unshift',
  4039. 'splice',
  4040. 'sort',
  4041. 'reverse'
  4042. ];
  4043. /**
  4044. * Intercept mutating methods and emit events
  4045. */
  4046. methodsToPatch.forEach(function (method) {
  4047. // cache original method
  4048. var original = arrayProto[method];
  4049. def(arrayMethods, method, function mutator () {
  4050. var args = [], len = arguments.length;
  4051. while ( len-- ) args[ len ] = arguments[ len ];
  4052. var result = original.apply(this, args);
  4053. var ob = this.__ob__;
  4054. var inserted;
  4055. switch (method) {
  4056. case 'push':
  4057. case 'unshift':
  4058. inserted = args;
  4059. break
  4060. case 'splice':
  4061. inserted = args.slice(2);
  4062. break
  4063. }
  4064. if (inserted) { ob.observeArray(inserted); }
  4065. // notify change
  4066. ob.dep.notify();
  4067. return result
  4068. });
  4069. });
  4070. /* */
  4071. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4072. /**
  4073. * In some cases we may want to disable observation inside a component's
  4074. * update computation.
  4075. */
  4076. var shouldObserve = true;
  4077. function toggleObserving (value) {
  4078. shouldObserve = value;
  4079. }
  4080. /**
  4081. * Observer class that is attached to each observed
  4082. * object. Once attached, the observer converts the target
  4083. * object's property keys into getter/setters that
  4084. * collect dependencies and dispatch updates.
  4085. */
  4086. var Observer = function Observer (value) {
  4087. this.value = value;
  4088. this.dep = new Dep();
  4089. this.vmCount = 0;
  4090. def(value, '__ob__', this);
  4091. if (Array.isArray(value)) {
  4092. if (hasProto) {
  4093. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4094. if(value.push !== value.__proto__.push){
  4095. copyAugment(value, arrayMethods, arrayKeys);
  4096. } else {
  4097. protoAugment(value, arrayMethods);
  4098. }
  4099. }
  4100. } else {
  4101. copyAugment(value, arrayMethods, arrayKeys);
  4102. }
  4103. this.observeArray(value);
  4104. } else {
  4105. this.walk(value);
  4106. }
  4107. };
  4108. /**
  4109. * Walk through all properties and convert them into
  4110. * getter/setters. This method should only be called when
  4111. * value type is Object.
  4112. */
  4113. Observer.prototype.walk = function walk (obj) {
  4114. var keys = Object.keys(obj);
  4115. for (var i = 0; i < keys.length; i++) {
  4116. defineReactive$$1(obj, keys[i]);
  4117. }
  4118. };
  4119. /**
  4120. * Observe a list of Array items.
  4121. */
  4122. Observer.prototype.observeArray = function observeArray (items) {
  4123. for (var i = 0, l = items.length; i < l; i++) {
  4124. observe(items[i]);
  4125. }
  4126. };
  4127. // helpers
  4128. /**
  4129. * Augment a target Object or Array by intercepting
  4130. * the prototype chain using __proto__
  4131. */
  4132. function protoAugment (target, src) {
  4133. /* eslint-disable no-proto */
  4134. target.__proto__ = src;
  4135. /* eslint-enable no-proto */
  4136. }
  4137. /**
  4138. * Augment a target Object or Array by defining
  4139. * hidden properties.
  4140. */
  4141. /* istanbul ignore next */
  4142. function copyAugment (target, src, keys) {
  4143. for (var i = 0, l = keys.length; i < l; i++) {
  4144. var key = keys[i];
  4145. def(target, key, src[key]);
  4146. }
  4147. }
  4148. /**
  4149. * Attempt to create an observer instance for a value,
  4150. * returns the new observer if successfully observed,
  4151. * or the existing observer if the value already has one.
  4152. */
  4153. function observe (value, asRootData) {
  4154. if (!isObject(value) || value instanceof VNode) {
  4155. return
  4156. }
  4157. var ob;
  4158. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4159. ob = value.__ob__;
  4160. } else if (
  4161. shouldObserve &&
  4162. !isServerRendering() &&
  4163. (Array.isArray(value) || isPlainObject(value)) &&
  4164. Object.isExtensible(value) &&
  4165. !value._isVue &&
  4166. !value.__v_isMPComponent
  4167. ) {
  4168. ob = new Observer(value);
  4169. }
  4170. if (asRootData && ob) {
  4171. ob.vmCount++;
  4172. }
  4173. return ob
  4174. }
  4175. /**
  4176. * Define a reactive property on an Object.
  4177. */
  4178. function defineReactive$$1 (
  4179. obj,
  4180. key,
  4181. val,
  4182. customSetter,
  4183. shallow
  4184. ) {
  4185. var dep = new Dep();
  4186. var property = Object.getOwnPropertyDescriptor(obj, key);
  4187. if (property && property.configurable === false) {
  4188. return
  4189. }
  4190. // cater for pre-defined getter/setters
  4191. var getter = property && property.get;
  4192. var setter = property && property.set;
  4193. if ((!getter || setter) && arguments.length === 2) {
  4194. val = obj[key];
  4195. }
  4196. var childOb = !shallow && observe(val);
  4197. Object.defineProperty(obj, key, {
  4198. enumerable: true,
  4199. configurable: true,
  4200. get: function reactiveGetter () {
  4201. var value = getter ? getter.call(obj) : val;
  4202. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4203. dep.depend();
  4204. if (childOb) {
  4205. childOb.dep.depend();
  4206. if (Array.isArray(value)) {
  4207. dependArray(value);
  4208. }
  4209. }
  4210. }
  4211. return value
  4212. },
  4213. set: function reactiveSetter (newVal) {
  4214. var value = getter ? getter.call(obj) : val;
  4215. /* eslint-disable no-self-compare */
  4216. if (newVal === value || (newVal !== newVal && value !== value)) {
  4217. return
  4218. }
  4219. /* eslint-enable no-self-compare */
  4220. if ( true && customSetter) {
  4221. customSetter();
  4222. }
  4223. // #7981: for accessor properties without setter
  4224. if (getter && !setter) { return }
  4225. if (setter) {
  4226. setter.call(obj, newVal);
  4227. } else {
  4228. val = newVal;
  4229. }
  4230. childOb = !shallow && observe(newVal);
  4231. dep.notify();
  4232. }
  4233. });
  4234. }
  4235. /**
  4236. * Set a property on an object. Adds the new property and
  4237. * triggers change notification if the property doesn't
  4238. * already exist.
  4239. */
  4240. function set (target, key, val) {
  4241. if ( true &&
  4242. (isUndef(target) || isPrimitive(target))
  4243. ) {
  4244. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4245. }
  4246. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4247. target.length = Math.max(target.length, key);
  4248. target.splice(key, 1, val);
  4249. return val
  4250. }
  4251. if (key in target && !(key in Object.prototype)) {
  4252. target[key] = val;
  4253. return val
  4254. }
  4255. var ob = (target).__ob__;
  4256. if (target._isVue || (ob && ob.vmCount)) {
  4257. true && warn(
  4258. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4259. 'at runtime - declare it upfront in the data option.'
  4260. );
  4261. return val
  4262. }
  4263. if (!ob) {
  4264. target[key] = val;
  4265. return val
  4266. }
  4267. defineReactive$$1(ob.value, key, val);
  4268. ob.dep.notify();
  4269. return val
  4270. }
  4271. /**
  4272. * Delete a property and trigger change if necessary.
  4273. */
  4274. function del (target, key) {
  4275. if ( true &&
  4276. (isUndef(target) || isPrimitive(target))
  4277. ) {
  4278. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4279. }
  4280. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4281. target.splice(key, 1);
  4282. return
  4283. }
  4284. var ob = (target).__ob__;
  4285. if (target._isVue || (ob && ob.vmCount)) {
  4286. true && warn(
  4287. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4288. '- just set it to null.'
  4289. );
  4290. return
  4291. }
  4292. if (!hasOwn(target, key)) {
  4293. return
  4294. }
  4295. delete target[key];
  4296. if (!ob) {
  4297. return
  4298. }
  4299. ob.dep.notify();
  4300. }
  4301. /**
  4302. * Collect dependencies on array elements when the array is touched, since
  4303. * we cannot intercept array element access like property getters.
  4304. */
  4305. function dependArray (value) {
  4306. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4307. e = value[i];
  4308. e && e.__ob__ && e.__ob__.dep.depend();
  4309. if (Array.isArray(e)) {
  4310. dependArray(e);
  4311. }
  4312. }
  4313. }
  4314. /* */
  4315. /**
  4316. * Option overwriting strategies are functions that handle
  4317. * how to merge a parent option value and a child option
  4318. * value into the final value.
  4319. */
  4320. var strats = config.optionMergeStrategies;
  4321. /**
  4322. * Options with restrictions
  4323. */
  4324. if (true) {
  4325. strats.el = strats.propsData = function (parent, child, vm, key) {
  4326. if (!vm) {
  4327. warn(
  4328. "option \"" + key + "\" can only be used during instance " +
  4329. 'creation with the `new` keyword.'
  4330. );
  4331. }
  4332. return defaultStrat(parent, child)
  4333. };
  4334. }
  4335. /**
  4336. * Helper that recursively merges two data objects together.
  4337. */
  4338. function mergeData (to, from) {
  4339. if (!from) { return to }
  4340. var key, toVal, fromVal;
  4341. var keys = hasSymbol
  4342. ? Reflect.ownKeys(from)
  4343. : Object.keys(from);
  4344. for (var i = 0; i < keys.length; i++) {
  4345. key = keys[i];
  4346. // in case the object is already observed...
  4347. if (key === '__ob__') { continue }
  4348. toVal = to[key];
  4349. fromVal = from[key];
  4350. if (!hasOwn(to, key)) {
  4351. set(to, key, fromVal);
  4352. } else if (
  4353. toVal !== fromVal &&
  4354. isPlainObject(toVal) &&
  4355. isPlainObject(fromVal)
  4356. ) {
  4357. mergeData(toVal, fromVal);
  4358. }
  4359. }
  4360. return to
  4361. }
  4362. /**
  4363. * Data
  4364. */
  4365. function mergeDataOrFn (
  4366. parentVal,
  4367. childVal,
  4368. vm
  4369. ) {
  4370. if (!vm) {
  4371. // in a Vue.extend merge, both should be functions
  4372. if (!childVal) {
  4373. return parentVal
  4374. }
  4375. if (!parentVal) {
  4376. return childVal
  4377. }
  4378. // when parentVal & childVal are both present,
  4379. // we need to return a function that returns the
  4380. // merged result of both functions... no need to
  4381. // check if parentVal is a function here because
  4382. // it has to be a function to pass previous merges.
  4383. return function mergedDataFn () {
  4384. return mergeData(
  4385. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4386. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4387. )
  4388. }
  4389. } else {
  4390. return function mergedInstanceDataFn () {
  4391. // instance merge
  4392. var instanceData = typeof childVal === 'function'
  4393. ? childVal.call(vm, vm)
  4394. : childVal;
  4395. var defaultData = typeof parentVal === 'function'
  4396. ? parentVal.call(vm, vm)
  4397. : parentVal;
  4398. if (instanceData) {
  4399. return mergeData(instanceData, defaultData)
  4400. } else {
  4401. return defaultData
  4402. }
  4403. }
  4404. }
  4405. }
  4406. strats.data = function (
  4407. parentVal,
  4408. childVal,
  4409. vm
  4410. ) {
  4411. if (!vm) {
  4412. if (childVal && typeof childVal !== 'function') {
  4413. true && warn(
  4414. 'The "data" option should be a function ' +
  4415. 'that returns a per-instance value in component ' +
  4416. 'definitions.',
  4417. vm
  4418. );
  4419. return parentVal
  4420. }
  4421. return mergeDataOrFn(parentVal, childVal)
  4422. }
  4423. return mergeDataOrFn(parentVal, childVal, vm)
  4424. };
  4425. /**
  4426. * Hooks and props are merged as arrays.
  4427. */
  4428. function mergeHook (
  4429. parentVal,
  4430. childVal
  4431. ) {
  4432. var res = childVal
  4433. ? parentVal
  4434. ? parentVal.concat(childVal)
  4435. : Array.isArray(childVal)
  4436. ? childVal
  4437. : [childVal]
  4438. : parentVal;
  4439. return res
  4440. ? dedupeHooks(res)
  4441. : res
  4442. }
  4443. function dedupeHooks (hooks) {
  4444. var res = [];
  4445. for (var i = 0; i < hooks.length; i++) {
  4446. if (res.indexOf(hooks[i]) === -1) {
  4447. res.push(hooks[i]);
  4448. }
  4449. }
  4450. return res
  4451. }
  4452. LIFECYCLE_HOOKS.forEach(function (hook) {
  4453. strats[hook] = mergeHook;
  4454. });
  4455. /**
  4456. * Assets
  4457. *
  4458. * When a vm is present (instance creation), we need to do
  4459. * a three-way merge between constructor options, instance
  4460. * options and parent options.
  4461. */
  4462. function mergeAssets (
  4463. parentVal,
  4464. childVal,
  4465. vm,
  4466. key
  4467. ) {
  4468. var res = Object.create(parentVal || null);
  4469. if (childVal) {
  4470. true && assertObjectType(key, childVal, vm);
  4471. return extend(res, childVal)
  4472. } else {
  4473. return res
  4474. }
  4475. }
  4476. ASSET_TYPES.forEach(function (type) {
  4477. strats[type + 's'] = mergeAssets;
  4478. });
  4479. /**
  4480. * Watchers.
  4481. *
  4482. * Watchers hashes should not overwrite one
  4483. * another, so we merge them as arrays.
  4484. */
  4485. strats.watch = function (
  4486. parentVal,
  4487. childVal,
  4488. vm,
  4489. key
  4490. ) {
  4491. // work around Firefox's Object.prototype.watch...
  4492. if (parentVal === nativeWatch) { parentVal = undefined; }
  4493. if (childVal === nativeWatch) { childVal = undefined; }
  4494. /* istanbul ignore if */
  4495. if (!childVal) { return Object.create(parentVal || null) }
  4496. if (true) {
  4497. assertObjectType(key, childVal, vm);
  4498. }
  4499. if (!parentVal) { return childVal }
  4500. var ret = {};
  4501. extend(ret, parentVal);
  4502. for (var key$1 in childVal) {
  4503. var parent = ret[key$1];
  4504. var child = childVal[key$1];
  4505. if (parent && !Array.isArray(parent)) {
  4506. parent = [parent];
  4507. }
  4508. ret[key$1] = parent
  4509. ? parent.concat(child)
  4510. : Array.isArray(child) ? child : [child];
  4511. }
  4512. return ret
  4513. };
  4514. /**
  4515. * Other object hashes.
  4516. */
  4517. strats.props =
  4518. strats.methods =
  4519. strats.inject =
  4520. strats.computed = function (
  4521. parentVal,
  4522. childVal,
  4523. vm,
  4524. key
  4525. ) {
  4526. if (childVal && "development" !== 'production') {
  4527. assertObjectType(key, childVal, vm);
  4528. }
  4529. if (!parentVal) { return childVal }
  4530. var ret = Object.create(null);
  4531. extend(ret, parentVal);
  4532. if (childVal) { extend(ret, childVal); }
  4533. return ret
  4534. };
  4535. strats.provide = mergeDataOrFn;
  4536. /**
  4537. * Default strategy.
  4538. */
  4539. var defaultStrat = function (parentVal, childVal) {
  4540. return childVal === undefined
  4541. ? parentVal
  4542. : childVal
  4543. };
  4544. /**
  4545. * Validate component names
  4546. */
  4547. function checkComponents (options) {
  4548. for (var key in options.components) {
  4549. validateComponentName(key);
  4550. }
  4551. }
  4552. function validateComponentName (name) {
  4553. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4554. warn(
  4555. 'Invalid component name: "' + name + '". Component names ' +
  4556. 'should conform to valid custom element name in html5 specification.'
  4557. );
  4558. }
  4559. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4560. warn(
  4561. 'Do not use built-in or reserved HTML elements as component ' +
  4562. 'id: ' + name
  4563. );
  4564. }
  4565. }
  4566. /**
  4567. * Ensure all props option syntax are normalized into the
  4568. * Object-based format.
  4569. */
  4570. function normalizeProps (options, vm) {
  4571. var props = options.props;
  4572. if (!props) { return }
  4573. var res = {};
  4574. var i, val, name;
  4575. if (Array.isArray(props)) {
  4576. i = props.length;
  4577. while (i--) {
  4578. val = props[i];
  4579. if (typeof val === 'string') {
  4580. name = camelize(val);
  4581. res[name] = { type: null };
  4582. } else if (true) {
  4583. warn('props must be strings when using array syntax.');
  4584. }
  4585. }
  4586. } else if (isPlainObject(props)) {
  4587. for (var key in props) {
  4588. val = props[key];
  4589. name = camelize(key);
  4590. res[name] = isPlainObject(val)
  4591. ? val
  4592. : { type: val };
  4593. }
  4594. } else if (true) {
  4595. warn(
  4596. "Invalid value for option \"props\": expected an Array or an Object, " +
  4597. "but got " + (toRawType(props)) + ".",
  4598. vm
  4599. );
  4600. }
  4601. options.props = res;
  4602. }
  4603. /**
  4604. * Normalize all injections into Object-based format
  4605. */
  4606. function normalizeInject (options, vm) {
  4607. var inject = options.inject;
  4608. if (!inject) { return }
  4609. var normalized = options.inject = {};
  4610. if (Array.isArray(inject)) {
  4611. for (var i = 0; i < inject.length; i++) {
  4612. normalized[inject[i]] = { from: inject[i] };
  4613. }
  4614. } else if (isPlainObject(inject)) {
  4615. for (var key in inject) {
  4616. var val = inject[key];
  4617. normalized[key] = isPlainObject(val)
  4618. ? extend({ from: key }, val)
  4619. : { from: val };
  4620. }
  4621. } else if (true) {
  4622. warn(
  4623. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4624. "but got " + (toRawType(inject)) + ".",
  4625. vm
  4626. );
  4627. }
  4628. }
  4629. /**
  4630. * Normalize raw function directives into object format.
  4631. */
  4632. function normalizeDirectives (options) {
  4633. var dirs = options.directives;
  4634. if (dirs) {
  4635. for (var key in dirs) {
  4636. var def$$1 = dirs[key];
  4637. if (typeof def$$1 === 'function') {
  4638. dirs[key] = { bind: def$$1, update: def$$1 };
  4639. }
  4640. }
  4641. }
  4642. }
  4643. function assertObjectType (name, value, vm) {
  4644. if (!isPlainObject(value)) {
  4645. warn(
  4646. "Invalid value for option \"" + name + "\": expected an Object, " +
  4647. "but got " + (toRawType(value)) + ".",
  4648. vm
  4649. );
  4650. }
  4651. }
  4652. /**
  4653. * Merge two option objects into a new one.
  4654. * Core utility used in both instantiation and inheritance.
  4655. */
  4656. function mergeOptions (
  4657. parent,
  4658. child,
  4659. vm
  4660. ) {
  4661. if (true) {
  4662. checkComponents(child);
  4663. }
  4664. if (typeof child === 'function') {
  4665. child = child.options;
  4666. }
  4667. normalizeProps(child, vm);
  4668. normalizeInject(child, vm);
  4669. normalizeDirectives(child);
  4670. // Apply extends and mixins on the child options,
  4671. // but only if it is a raw options object that isn't
  4672. // the result of another mergeOptions call.
  4673. // Only merged options has the _base property.
  4674. if (!child._base) {
  4675. if (child.extends) {
  4676. parent = mergeOptions(parent, child.extends, vm);
  4677. }
  4678. if (child.mixins) {
  4679. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4680. parent = mergeOptions(parent, child.mixins[i], vm);
  4681. }
  4682. }
  4683. }
  4684. var options = {};
  4685. var key;
  4686. for (key in parent) {
  4687. mergeField(key);
  4688. }
  4689. for (key in child) {
  4690. if (!hasOwn(parent, key)) {
  4691. mergeField(key);
  4692. }
  4693. }
  4694. function mergeField (key) {
  4695. var strat = strats[key] || defaultStrat;
  4696. options[key] = strat(parent[key], child[key], vm, key);
  4697. }
  4698. return options
  4699. }
  4700. /**
  4701. * Resolve an asset.
  4702. * This function is used because child instances need access
  4703. * to assets defined in its ancestor chain.
  4704. */
  4705. function resolveAsset (
  4706. options,
  4707. type,
  4708. id,
  4709. warnMissing
  4710. ) {
  4711. /* istanbul ignore if */
  4712. if (typeof id !== 'string') {
  4713. return
  4714. }
  4715. var assets = options[type];
  4716. // check local registration variations first
  4717. if (hasOwn(assets, id)) { return assets[id] }
  4718. var camelizedId = camelize(id);
  4719. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4720. var PascalCaseId = capitalize(camelizedId);
  4721. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4722. // fallback to prototype chain
  4723. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4724. if ( true && warnMissing && !res) {
  4725. warn(
  4726. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4727. options
  4728. );
  4729. }
  4730. return res
  4731. }
  4732. /* */
  4733. function validateProp (
  4734. key,
  4735. propOptions,
  4736. propsData,
  4737. vm
  4738. ) {
  4739. var prop = propOptions[key];
  4740. var absent = !hasOwn(propsData, key);
  4741. var value = propsData[key];
  4742. // boolean casting
  4743. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4744. if (booleanIndex > -1) {
  4745. if (absent && !hasOwn(prop, 'default')) {
  4746. value = false;
  4747. } else if (value === '' || value === hyphenate(key)) {
  4748. // only cast empty string / same name to boolean if
  4749. // boolean has higher priority
  4750. var stringIndex = getTypeIndex(String, prop.type);
  4751. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4752. value = true;
  4753. }
  4754. }
  4755. }
  4756. // check default value
  4757. if (value === undefined) {
  4758. value = getPropDefaultValue(vm, prop, key);
  4759. // since the default value is a fresh copy,
  4760. // make sure to observe it.
  4761. var prevShouldObserve = shouldObserve;
  4762. toggleObserving(true);
  4763. observe(value);
  4764. toggleObserving(prevShouldObserve);
  4765. }
  4766. if (
  4767. true
  4768. ) {
  4769. assertProp(prop, key, value, vm, absent);
  4770. }
  4771. return value
  4772. }
  4773. /**
  4774. * Get the default value of a prop.
  4775. */
  4776. function getPropDefaultValue (vm, prop, key) {
  4777. // no default, return undefined
  4778. if (!hasOwn(prop, 'default')) {
  4779. return undefined
  4780. }
  4781. var def = prop.default;
  4782. // warn against non-factory defaults for Object & Array
  4783. if ( true && isObject(def)) {
  4784. warn(
  4785. 'Invalid default value for prop "' + key + '": ' +
  4786. 'Props with type Object/Array must use a factory function ' +
  4787. 'to return the default value.',
  4788. vm
  4789. );
  4790. }
  4791. // the raw prop value was also undefined from previous render,
  4792. // return previous default value to avoid unnecessary watcher trigger
  4793. if (vm && vm.$options.propsData &&
  4794. vm.$options.propsData[key] === undefined &&
  4795. vm._props[key] !== undefined
  4796. ) {
  4797. return vm._props[key]
  4798. }
  4799. // call factory function for non-Function types
  4800. // a value is Function if its prototype is function even across different execution context
  4801. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4802. ? def.call(vm)
  4803. : def
  4804. }
  4805. /**
  4806. * Assert whether a prop is valid.
  4807. */
  4808. function assertProp (
  4809. prop,
  4810. name,
  4811. value,
  4812. vm,
  4813. absent
  4814. ) {
  4815. if (prop.required && absent) {
  4816. warn(
  4817. 'Missing required prop: "' + name + '"',
  4818. vm
  4819. );
  4820. return
  4821. }
  4822. if (value == null && !prop.required) {
  4823. return
  4824. }
  4825. var type = prop.type;
  4826. var valid = !type || type === true;
  4827. var expectedTypes = [];
  4828. if (type) {
  4829. if (!Array.isArray(type)) {
  4830. type = [type];
  4831. }
  4832. for (var i = 0; i < type.length && !valid; i++) {
  4833. var assertedType = assertType(value, type[i]);
  4834. expectedTypes.push(assertedType.expectedType || '');
  4835. valid = assertedType.valid;
  4836. }
  4837. }
  4838. if (!valid) {
  4839. warn(
  4840. getInvalidTypeMessage(name, value, expectedTypes),
  4841. vm
  4842. );
  4843. return
  4844. }
  4845. var validator = prop.validator;
  4846. if (validator) {
  4847. if (!validator(value)) {
  4848. warn(
  4849. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4850. vm
  4851. );
  4852. }
  4853. }
  4854. }
  4855. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4856. function assertType (value, type) {
  4857. var valid;
  4858. var expectedType = getType(type);
  4859. if (simpleCheckRE.test(expectedType)) {
  4860. var t = typeof value;
  4861. valid = t === expectedType.toLowerCase();
  4862. // for primitive wrapper objects
  4863. if (!valid && t === 'object') {
  4864. valid = value instanceof type;
  4865. }
  4866. } else if (expectedType === 'Object') {
  4867. valid = isPlainObject(value);
  4868. } else if (expectedType === 'Array') {
  4869. valid = Array.isArray(value);
  4870. } else {
  4871. valid = value instanceof type;
  4872. }
  4873. return {
  4874. valid: valid,
  4875. expectedType: expectedType
  4876. }
  4877. }
  4878. /**
  4879. * Use function string name to check built-in types,
  4880. * because a simple equality check will fail when running
  4881. * across different vms / iframes.
  4882. */
  4883. function getType (fn) {
  4884. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4885. return match ? match[1] : ''
  4886. }
  4887. function isSameType (a, b) {
  4888. return getType(a) === getType(b)
  4889. }
  4890. function getTypeIndex (type, expectedTypes) {
  4891. if (!Array.isArray(expectedTypes)) {
  4892. return isSameType(expectedTypes, type) ? 0 : -1
  4893. }
  4894. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4895. if (isSameType(expectedTypes[i], type)) {
  4896. return i
  4897. }
  4898. }
  4899. return -1
  4900. }
  4901. function getInvalidTypeMessage (name, value, expectedTypes) {
  4902. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4903. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4904. var expectedType = expectedTypes[0];
  4905. var receivedType = toRawType(value);
  4906. var expectedValue = styleValue(value, expectedType);
  4907. var receivedValue = styleValue(value, receivedType);
  4908. // check if we need to specify expected value
  4909. if (expectedTypes.length === 1 &&
  4910. isExplicable(expectedType) &&
  4911. !isBoolean(expectedType, receivedType)) {
  4912. message += " with value " + expectedValue;
  4913. }
  4914. message += ", got " + receivedType + " ";
  4915. // check if we need to specify received value
  4916. if (isExplicable(receivedType)) {
  4917. message += "with value " + receivedValue + ".";
  4918. }
  4919. return message
  4920. }
  4921. function styleValue (value, type) {
  4922. if (type === 'String') {
  4923. return ("\"" + value + "\"")
  4924. } else if (type === 'Number') {
  4925. return ("" + (Number(value)))
  4926. } else {
  4927. return ("" + value)
  4928. }
  4929. }
  4930. function isExplicable (value) {
  4931. var explicitTypes = ['string', 'number', 'boolean'];
  4932. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4933. }
  4934. function isBoolean () {
  4935. var args = [], len = arguments.length;
  4936. while ( len-- ) args[ len ] = arguments[ len ];
  4937. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4938. }
  4939. /* */
  4940. function handleError (err, vm, info) {
  4941. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4942. // See: https://github.com/vuejs/vuex/issues/1505
  4943. pushTarget();
  4944. try {
  4945. if (vm) {
  4946. var cur = vm;
  4947. while ((cur = cur.$parent)) {
  4948. var hooks = cur.$options.errorCaptured;
  4949. if (hooks) {
  4950. for (var i = 0; i < hooks.length; i++) {
  4951. try {
  4952. var capture = hooks[i].call(cur, err, vm, info) === false;
  4953. if (capture) { return }
  4954. } catch (e) {
  4955. globalHandleError(e, cur, 'errorCaptured hook');
  4956. }
  4957. }
  4958. }
  4959. }
  4960. }
  4961. globalHandleError(err, vm, info);
  4962. } finally {
  4963. popTarget();
  4964. }
  4965. }
  4966. function invokeWithErrorHandling (
  4967. handler,
  4968. context,
  4969. args,
  4970. vm,
  4971. info
  4972. ) {
  4973. var res;
  4974. try {
  4975. res = args ? handler.apply(context, args) : handler.call(context);
  4976. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4977. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4978. // issue #9511
  4979. // avoid catch triggering multiple times when nested calls
  4980. res._handled = true;
  4981. }
  4982. } catch (e) {
  4983. handleError(e, vm, info);
  4984. }
  4985. return res
  4986. }
  4987. function globalHandleError (err, vm, info) {
  4988. if (config.errorHandler) {
  4989. try {
  4990. return config.errorHandler.call(null, err, vm, info)
  4991. } catch (e) {
  4992. // if the user intentionally throws the original error in the handler,
  4993. // do not log it twice
  4994. if (e !== err) {
  4995. logError(e, null, 'config.errorHandler');
  4996. }
  4997. }
  4998. }
  4999. logError(err, vm, info);
  5000. }
  5001. function logError (err, vm, info) {
  5002. if (true) {
  5003. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5004. }
  5005. /* istanbul ignore else */
  5006. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5007. console.error(err);
  5008. } else {
  5009. throw err
  5010. }
  5011. }
  5012. /* */
  5013. var callbacks = [];
  5014. var pending = false;
  5015. function flushCallbacks () {
  5016. pending = false;
  5017. var copies = callbacks.slice(0);
  5018. callbacks.length = 0;
  5019. for (var i = 0; i < copies.length; i++) {
  5020. copies[i]();
  5021. }
  5022. }
  5023. // Here we have async deferring wrappers using microtasks.
  5024. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5025. // However, it has subtle problems when state is changed right before repaint
  5026. // (e.g. #6813, out-in transitions).
  5027. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5028. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5029. // So we now use microtasks everywhere, again.
  5030. // A major drawback of this tradeoff is that there are some scenarios
  5031. // where microtasks have too high a priority and fire in between supposedly
  5032. // sequential events (e.g. #4521, #6690, which have workarounds)
  5033. // or even between bubbling of the same event (#6566).
  5034. var timerFunc;
  5035. // The nextTick behavior leverages the microtask queue, which can be accessed
  5036. // via either native Promise.then or MutationObserver.
  5037. // MutationObserver has wider support, however it is seriously bugged in
  5038. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5039. // completely stops working after triggering a few times... so, if native
  5040. // Promise is available, we will use it:
  5041. /* istanbul ignore next, $flow-disable-line */
  5042. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5043. var p = Promise.resolve();
  5044. timerFunc = function () {
  5045. p.then(flushCallbacks);
  5046. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5047. // it can get stuck in a weird state where callbacks are pushed into the
  5048. // microtask queue but the queue isn't being flushed, until the browser
  5049. // needs to do some other work, e.g. handle a timer. Therefore we can
  5050. // "force" the microtask queue to be flushed by adding an empty timer.
  5051. if (isIOS) { setTimeout(noop); }
  5052. };
  5053. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5054. isNative(MutationObserver) ||
  5055. // PhantomJS and iOS 7.x
  5056. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5057. )) {
  5058. // Use MutationObserver where native Promise is not available,
  5059. // e.g. PhantomJS, iOS7, Android 4.4
  5060. // (#6466 MutationObserver is unreliable in IE11)
  5061. var counter = 1;
  5062. var observer = new MutationObserver(flushCallbacks);
  5063. var textNode = document.createTextNode(String(counter));
  5064. observer.observe(textNode, {
  5065. characterData: true
  5066. });
  5067. timerFunc = function () {
  5068. counter = (counter + 1) % 2;
  5069. textNode.data = String(counter);
  5070. };
  5071. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5072. // Fallback to setImmediate.
  5073. // Technically it leverages the (macro) task queue,
  5074. // but it is still a better choice than setTimeout.
  5075. timerFunc = function () {
  5076. setImmediate(flushCallbacks);
  5077. };
  5078. } else {
  5079. // Fallback to setTimeout.
  5080. timerFunc = function () {
  5081. setTimeout(flushCallbacks, 0);
  5082. };
  5083. }
  5084. function nextTick (cb, ctx) {
  5085. var _resolve;
  5086. callbacks.push(function () {
  5087. if (cb) {
  5088. try {
  5089. cb.call(ctx);
  5090. } catch (e) {
  5091. handleError(e, ctx, 'nextTick');
  5092. }
  5093. } else if (_resolve) {
  5094. _resolve(ctx);
  5095. }
  5096. });
  5097. if (!pending) {
  5098. pending = true;
  5099. timerFunc();
  5100. }
  5101. // $flow-disable-line
  5102. if (!cb && typeof Promise !== 'undefined') {
  5103. return new Promise(function (resolve) {
  5104. _resolve = resolve;
  5105. })
  5106. }
  5107. }
  5108. /* */
  5109. /* not type checking this file because flow doesn't play well with Proxy */
  5110. var initProxy;
  5111. if (true) {
  5112. var allowedGlobals = makeMap(
  5113. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5114. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5115. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5116. 'require' // for Webpack/Browserify
  5117. );
  5118. var warnNonPresent = function (target, key) {
  5119. warn(
  5120. "Property or method \"" + key + "\" is not defined on the instance but " +
  5121. 'referenced during render. Make sure that this property is reactive, ' +
  5122. 'either in the data option, or for class-based components, by ' +
  5123. 'initializing the property. ' +
  5124. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5125. target
  5126. );
  5127. };
  5128. var warnReservedPrefix = function (target, key) {
  5129. warn(
  5130. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5131. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5132. 'prevent conflicts with Vue internals. ' +
  5133. 'See: https://vuejs.org/v2/api/#data',
  5134. target
  5135. );
  5136. };
  5137. var hasProxy =
  5138. typeof Proxy !== 'undefined' && isNative(Proxy);
  5139. if (hasProxy) {
  5140. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5141. config.keyCodes = new Proxy(config.keyCodes, {
  5142. set: function set (target, key, value) {
  5143. if (isBuiltInModifier(key)) {
  5144. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5145. return false
  5146. } else {
  5147. target[key] = value;
  5148. return true
  5149. }
  5150. }
  5151. });
  5152. }
  5153. var hasHandler = {
  5154. has: function has (target, key) {
  5155. var has = key in target;
  5156. var isAllowed = allowedGlobals(key) ||
  5157. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5158. if (!has && !isAllowed) {
  5159. if (key in target.$data) { warnReservedPrefix(target, key); }
  5160. else { warnNonPresent(target, key); }
  5161. }
  5162. return has || !isAllowed
  5163. }
  5164. };
  5165. var getHandler = {
  5166. get: function get (target, key) {
  5167. if (typeof key === 'string' && !(key in target)) {
  5168. if (key in target.$data) { warnReservedPrefix(target, key); }
  5169. else { warnNonPresent(target, key); }
  5170. }
  5171. return target[key]
  5172. }
  5173. };
  5174. initProxy = function initProxy (vm) {
  5175. if (hasProxy) {
  5176. // determine which proxy handler to use
  5177. var options = vm.$options;
  5178. var handlers = options.render && options.render._withStripped
  5179. ? getHandler
  5180. : hasHandler;
  5181. vm._renderProxy = new Proxy(vm, handlers);
  5182. } else {
  5183. vm._renderProxy = vm;
  5184. }
  5185. };
  5186. }
  5187. /* */
  5188. var seenObjects = new _Set();
  5189. /**
  5190. * Recursively traverse an object to evoke all converted
  5191. * getters, so that every nested property inside the object
  5192. * is collected as a "deep" dependency.
  5193. */
  5194. function traverse (val) {
  5195. _traverse(val, seenObjects);
  5196. seenObjects.clear();
  5197. }
  5198. function _traverse (val, seen) {
  5199. var i, keys;
  5200. var isA = Array.isArray(val);
  5201. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5202. return
  5203. }
  5204. if (val.__ob__) {
  5205. var depId = val.__ob__.dep.id;
  5206. if (seen.has(depId)) {
  5207. return
  5208. }
  5209. seen.add(depId);
  5210. }
  5211. if (isA) {
  5212. i = val.length;
  5213. while (i--) { _traverse(val[i], seen); }
  5214. } else {
  5215. keys = Object.keys(val);
  5216. i = keys.length;
  5217. while (i--) { _traverse(val[keys[i]], seen); }
  5218. }
  5219. }
  5220. var mark;
  5221. var measure;
  5222. if (true) {
  5223. var perf = inBrowser && window.performance;
  5224. /* istanbul ignore if */
  5225. if (
  5226. perf &&
  5227. perf.mark &&
  5228. perf.measure &&
  5229. perf.clearMarks &&
  5230. perf.clearMeasures
  5231. ) {
  5232. mark = function (tag) { return perf.mark(tag); };
  5233. measure = function (name, startTag, endTag) {
  5234. perf.measure(name, startTag, endTag);
  5235. perf.clearMarks(startTag);
  5236. perf.clearMarks(endTag);
  5237. // perf.clearMeasures(name)
  5238. };
  5239. }
  5240. }
  5241. /* */
  5242. var normalizeEvent = cached(function (name) {
  5243. var passive = name.charAt(0) === '&';
  5244. name = passive ? name.slice(1) : name;
  5245. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5246. name = once$$1 ? name.slice(1) : name;
  5247. var capture = name.charAt(0) === '!';
  5248. name = capture ? name.slice(1) : name;
  5249. return {
  5250. name: name,
  5251. once: once$$1,
  5252. capture: capture,
  5253. passive: passive
  5254. }
  5255. });
  5256. function createFnInvoker (fns, vm) {
  5257. function invoker () {
  5258. var arguments$1 = arguments;
  5259. var fns = invoker.fns;
  5260. if (Array.isArray(fns)) {
  5261. var cloned = fns.slice();
  5262. for (var i = 0; i < cloned.length; i++) {
  5263. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5264. }
  5265. } else {
  5266. // return handler return value for single handlers
  5267. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5268. }
  5269. }
  5270. invoker.fns = fns;
  5271. return invoker
  5272. }
  5273. function updateListeners (
  5274. on,
  5275. oldOn,
  5276. add,
  5277. remove$$1,
  5278. createOnceHandler,
  5279. vm
  5280. ) {
  5281. var name, def$$1, cur, old, event;
  5282. for (name in on) {
  5283. def$$1 = cur = on[name];
  5284. old = oldOn[name];
  5285. event = normalizeEvent(name);
  5286. if (isUndef(cur)) {
  5287. true && warn(
  5288. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5289. vm
  5290. );
  5291. } else if (isUndef(old)) {
  5292. if (isUndef(cur.fns)) {
  5293. cur = on[name] = createFnInvoker(cur, vm);
  5294. }
  5295. if (isTrue(event.once)) {
  5296. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5297. }
  5298. add(event.name, cur, event.capture, event.passive, event.params);
  5299. } else if (cur !== old) {
  5300. old.fns = cur;
  5301. on[name] = old;
  5302. }
  5303. }
  5304. for (name in oldOn) {
  5305. if (isUndef(on[name])) {
  5306. event = normalizeEvent(name);
  5307. remove$$1(event.name, oldOn[name], event.capture);
  5308. }
  5309. }
  5310. }
  5311. /* */
  5312. /* */
  5313. // fixed by xxxxxx (mp properties)
  5314. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5315. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5316. if (isUndef(propOptions)) {
  5317. return res
  5318. }
  5319. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5320. var attrs = data.attrs;
  5321. var props = data.props;
  5322. if (isDef(attrs) || isDef(props)) {
  5323. for (var key in propOptions) {
  5324. var altKey = hyphenate(key);
  5325. var result = checkProp(res, props, key, altKey, true) ||
  5326. checkProp(res, attrs, key, altKey, false);
  5327. // externalClass
  5328. if (
  5329. result &&
  5330. res[key] &&
  5331. externalClasses.indexOf(altKey) !== -1 &&
  5332. context[camelize(res[key])]
  5333. ) {
  5334. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5335. res[key] = context[camelize(res[key])];
  5336. }
  5337. }
  5338. }
  5339. return res
  5340. }
  5341. function extractPropsFromVNodeData (
  5342. data,
  5343. Ctor,
  5344. tag,
  5345. context// fixed by xxxxxx
  5346. ) {
  5347. // we are only extracting raw values here.
  5348. // validation and default values are handled in the child
  5349. // component itself.
  5350. var propOptions = Ctor.options.props;
  5351. if (isUndef(propOptions)) {
  5352. // fixed by xxxxxx
  5353. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5354. }
  5355. var res = {};
  5356. var attrs = data.attrs;
  5357. var props = data.props;
  5358. if (isDef(attrs) || isDef(props)) {
  5359. for (var key in propOptions) {
  5360. var altKey = hyphenate(key);
  5361. if (true) {
  5362. var keyInLowerCase = key.toLowerCase();
  5363. if (
  5364. key !== keyInLowerCase &&
  5365. attrs && hasOwn(attrs, keyInLowerCase)
  5366. ) {
  5367. tip(
  5368. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5369. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5370. " \"" + key + "\". " +
  5371. "Note that HTML attributes are case-insensitive and camelCased " +
  5372. "props need to use their kebab-case equivalents when using in-DOM " +
  5373. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5374. );
  5375. }
  5376. }
  5377. checkProp(res, props, key, altKey, true) ||
  5378. checkProp(res, attrs, key, altKey, false);
  5379. }
  5380. }
  5381. // fixed by xxxxxx
  5382. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5383. }
  5384. function checkProp (
  5385. res,
  5386. hash,
  5387. key,
  5388. altKey,
  5389. preserve
  5390. ) {
  5391. if (isDef(hash)) {
  5392. if (hasOwn(hash, key)) {
  5393. res[key] = hash[key];
  5394. if (!preserve) {
  5395. delete hash[key];
  5396. }
  5397. return true
  5398. } else if (hasOwn(hash, altKey)) {
  5399. res[key] = hash[altKey];
  5400. if (!preserve) {
  5401. delete hash[altKey];
  5402. }
  5403. return true
  5404. }
  5405. }
  5406. return false
  5407. }
  5408. /* */
  5409. // The template compiler attempts to minimize the need for normalization by
  5410. // statically analyzing the template at compile time.
  5411. //
  5412. // For plain HTML markup, normalization can be completely skipped because the
  5413. // generated render function is guaranteed to return Array<VNode>. There are
  5414. // two cases where extra normalization is needed:
  5415. // 1. When the children contains components - because a functional component
  5416. // may return an Array instead of a single root. In this case, just a simple
  5417. // normalization is needed - if any child is an Array, we flatten the whole
  5418. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5419. // because functional components already normalize their own children.
  5420. function simpleNormalizeChildren (children) {
  5421. for (var i = 0; i < children.length; i++) {
  5422. if (Array.isArray(children[i])) {
  5423. return Array.prototype.concat.apply([], children)
  5424. }
  5425. }
  5426. return children
  5427. }
  5428. // 2. When the children contains constructs that always generated nested Arrays,
  5429. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5430. // with hand-written render functions / JSX. In such cases a full normalization
  5431. // is needed to cater to all possible types of children values.
  5432. function normalizeChildren (children) {
  5433. return isPrimitive(children)
  5434. ? [createTextVNode(children)]
  5435. : Array.isArray(children)
  5436. ? normalizeArrayChildren(children)
  5437. : undefined
  5438. }
  5439. function isTextNode (node) {
  5440. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5441. }
  5442. function normalizeArrayChildren (children, nestedIndex) {
  5443. var res = [];
  5444. var i, c, lastIndex, last;
  5445. for (i = 0; i < children.length; i++) {
  5446. c = children[i];
  5447. if (isUndef(c) || typeof c === 'boolean') { continue }
  5448. lastIndex = res.length - 1;
  5449. last = res[lastIndex];
  5450. // nested
  5451. if (Array.isArray(c)) {
  5452. if (c.length > 0) {
  5453. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5454. // merge adjacent text nodes
  5455. if (isTextNode(c[0]) && isTextNode(last)) {
  5456. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5457. c.shift();
  5458. }
  5459. res.push.apply(res, c);
  5460. }
  5461. } else if (isPrimitive(c)) {
  5462. if (isTextNode(last)) {
  5463. // merge adjacent text nodes
  5464. // this is necessary for SSR hydration because text nodes are
  5465. // essentially merged when rendered to HTML strings
  5466. res[lastIndex] = createTextVNode(last.text + c);
  5467. } else if (c !== '') {
  5468. // convert primitive to vnode
  5469. res.push(createTextVNode(c));
  5470. }
  5471. } else {
  5472. if (isTextNode(c) && isTextNode(last)) {
  5473. // merge adjacent text nodes
  5474. res[lastIndex] = createTextVNode(last.text + c.text);
  5475. } else {
  5476. // default key for nested array children (likely generated by v-for)
  5477. if (isTrue(children._isVList) &&
  5478. isDef(c.tag) &&
  5479. isUndef(c.key) &&
  5480. isDef(nestedIndex)) {
  5481. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5482. }
  5483. res.push(c);
  5484. }
  5485. }
  5486. }
  5487. return res
  5488. }
  5489. /* */
  5490. function initProvide (vm) {
  5491. var provide = vm.$options.provide;
  5492. if (provide) {
  5493. vm._provided = typeof provide === 'function'
  5494. ? provide.call(vm)
  5495. : provide;
  5496. }
  5497. }
  5498. function initInjections (vm) {
  5499. var result = resolveInject(vm.$options.inject, vm);
  5500. if (result) {
  5501. toggleObserving(false);
  5502. Object.keys(result).forEach(function (key) {
  5503. /* istanbul ignore else */
  5504. if (true) {
  5505. defineReactive$$1(vm, key, result[key], function () {
  5506. warn(
  5507. "Avoid mutating an injected value directly since the changes will be " +
  5508. "overwritten whenever the provided component re-renders. " +
  5509. "injection being mutated: \"" + key + "\"",
  5510. vm
  5511. );
  5512. });
  5513. } else {}
  5514. });
  5515. toggleObserving(true);
  5516. }
  5517. }
  5518. function resolveInject (inject, vm) {
  5519. if (inject) {
  5520. // inject is :any because flow is not smart enough to figure out cached
  5521. var result = Object.create(null);
  5522. var keys = hasSymbol
  5523. ? Reflect.ownKeys(inject)
  5524. : Object.keys(inject);
  5525. for (var i = 0; i < keys.length; i++) {
  5526. var key = keys[i];
  5527. // #6574 in case the inject object is observed...
  5528. if (key === '__ob__') { continue }
  5529. var provideKey = inject[key].from;
  5530. var source = vm;
  5531. while (source) {
  5532. if (source._provided && hasOwn(source._provided, provideKey)) {
  5533. result[key] = source._provided[provideKey];
  5534. break
  5535. }
  5536. source = source.$parent;
  5537. }
  5538. if (!source) {
  5539. if ('default' in inject[key]) {
  5540. var provideDefault = inject[key].default;
  5541. result[key] = typeof provideDefault === 'function'
  5542. ? provideDefault.call(vm)
  5543. : provideDefault;
  5544. } else if (true) {
  5545. warn(("Injection \"" + key + "\" not found"), vm);
  5546. }
  5547. }
  5548. }
  5549. return result
  5550. }
  5551. }
  5552. /* */
  5553. /**
  5554. * Runtime helper for resolving raw children VNodes into a slot object.
  5555. */
  5556. function resolveSlots (
  5557. children,
  5558. context
  5559. ) {
  5560. if (!children || !children.length) {
  5561. return {}
  5562. }
  5563. var slots = {};
  5564. for (var i = 0, l = children.length; i < l; i++) {
  5565. var child = children[i];
  5566. var data = child.data;
  5567. // remove slot attribute if the node is resolved as a Vue slot node
  5568. if (data && data.attrs && data.attrs.slot) {
  5569. delete data.attrs.slot;
  5570. }
  5571. // named slots should only be respected if the vnode was rendered in the
  5572. // same context.
  5573. if ((child.context === context || child.fnContext === context) &&
  5574. data && data.slot != null
  5575. ) {
  5576. var name = data.slot;
  5577. var slot = (slots[name] || (slots[name] = []));
  5578. if (child.tag === 'template') {
  5579. slot.push.apply(slot, child.children || []);
  5580. } else {
  5581. slot.push(child);
  5582. }
  5583. } else {
  5584. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5585. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5586. (slots['page'] || (slots['page'] = [])).push(child);
  5587. }else{
  5588. (slots.default || (slots.default = [])).push(child);
  5589. }
  5590. }
  5591. }
  5592. // ignore slots that contains only whitespace
  5593. for (var name$1 in slots) {
  5594. if (slots[name$1].every(isWhitespace)) {
  5595. delete slots[name$1];
  5596. }
  5597. }
  5598. return slots
  5599. }
  5600. function isWhitespace (node) {
  5601. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5602. }
  5603. /* */
  5604. function normalizeScopedSlots (
  5605. slots,
  5606. normalSlots,
  5607. prevSlots
  5608. ) {
  5609. var res;
  5610. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5611. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5612. var key = slots && slots.$key;
  5613. if (!slots) {
  5614. res = {};
  5615. } else if (slots._normalized) {
  5616. // fast path 1: child component re-render only, parent did not change
  5617. return slots._normalized
  5618. } else if (
  5619. isStable &&
  5620. prevSlots &&
  5621. prevSlots !== emptyObject &&
  5622. key === prevSlots.$key &&
  5623. !hasNormalSlots &&
  5624. !prevSlots.$hasNormal
  5625. ) {
  5626. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5627. // only need to normalize once
  5628. return prevSlots
  5629. } else {
  5630. res = {};
  5631. for (var key$1 in slots) {
  5632. if (slots[key$1] && key$1[0] !== '$') {
  5633. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5634. }
  5635. }
  5636. }
  5637. // expose normal slots on scopedSlots
  5638. for (var key$2 in normalSlots) {
  5639. if (!(key$2 in res)) {
  5640. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5641. }
  5642. }
  5643. // avoriaz seems to mock a non-extensible $scopedSlots object
  5644. // and when that is passed down this would cause an error
  5645. if (slots && Object.isExtensible(slots)) {
  5646. (slots)._normalized = res;
  5647. }
  5648. def(res, '$stable', isStable);
  5649. def(res, '$key', key);
  5650. def(res, '$hasNormal', hasNormalSlots);
  5651. return res
  5652. }
  5653. function normalizeScopedSlot(normalSlots, key, fn) {
  5654. var normalized = function () {
  5655. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5656. res = res && typeof res === 'object' && !Array.isArray(res)
  5657. ? [res] // single vnode
  5658. : normalizeChildren(res);
  5659. return res && (
  5660. res.length === 0 ||
  5661. (res.length === 1 && res[0].isComment) // #9658
  5662. ) ? undefined
  5663. : res
  5664. };
  5665. // this is a slot using the new v-slot syntax without scope. although it is
  5666. // compiled as a scoped slot, render fn users would expect it to be present
  5667. // on this.$slots because the usage is semantically a normal slot.
  5668. if (fn.proxy) {
  5669. Object.defineProperty(normalSlots, key, {
  5670. get: normalized,
  5671. enumerable: true,
  5672. configurable: true
  5673. });
  5674. }
  5675. return normalized
  5676. }
  5677. function proxyNormalSlot(slots, key) {
  5678. return function () { return slots[key]; }
  5679. }
  5680. /* */
  5681. /**
  5682. * Runtime helper for rendering v-for lists.
  5683. */
  5684. function renderList (
  5685. val,
  5686. render
  5687. ) {
  5688. var ret, i, l, keys, key;
  5689. if (Array.isArray(val) || typeof val === 'string') {
  5690. ret = new Array(val.length);
  5691. for (i = 0, l = val.length; i < l; i++) {
  5692. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5693. }
  5694. } else if (typeof val === 'number') {
  5695. ret = new Array(val);
  5696. for (i = 0; i < val; i++) {
  5697. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5698. }
  5699. } else if (isObject(val)) {
  5700. if (hasSymbol && val[Symbol.iterator]) {
  5701. ret = [];
  5702. var iterator = val[Symbol.iterator]();
  5703. var result = iterator.next();
  5704. while (!result.done) {
  5705. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5706. result = iterator.next();
  5707. }
  5708. } else {
  5709. keys = Object.keys(val);
  5710. ret = new Array(keys.length);
  5711. for (i = 0, l = keys.length; i < l; i++) {
  5712. key = keys[i];
  5713. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5714. }
  5715. }
  5716. }
  5717. if (!isDef(ret)) {
  5718. ret = [];
  5719. }
  5720. (ret)._isVList = true;
  5721. return ret
  5722. }
  5723. /* */
  5724. /**
  5725. * Runtime helper for rendering <slot>
  5726. */
  5727. function renderSlot (
  5728. name,
  5729. fallback,
  5730. props,
  5731. bindObject
  5732. ) {
  5733. var scopedSlotFn = this.$scopedSlots[name];
  5734. var nodes;
  5735. if (scopedSlotFn) { // scoped slot
  5736. props = props || {};
  5737. if (bindObject) {
  5738. if ( true && !isObject(bindObject)) {
  5739. warn(
  5740. 'slot v-bind without argument expects an Object',
  5741. this
  5742. );
  5743. }
  5744. props = extend(extend({}, bindObject), props);
  5745. }
  5746. // fixed by xxxxxx app-plus scopedSlot
  5747. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5748. } else {
  5749. nodes = this.$slots[name] || fallback;
  5750. }
  5751. var target = props && props.slot;
  5752. if (target) {
  5753. return this.$createElement('template', { slot: target }, nodes)
  5754. } else {
  5755. return nodes
  5756. }
  5757. }
  5758. /* */
  5759. /**
  5760. * Runtime helper for resolving filters
  5761. */
  5762. function resolveFilter (id) {
  5763. return resolveAsset(this.$options, 'filters', id, true) || identity
  5764. }
  5765. /* */
  5766. function isKeyNotMatch (expect, actual) {
  5767. if (Array.isArray(expect)) {
  5768. return expect.indexOf(actual) === -1
  5769. } else {
  5770. return expect !== actual
  5771. }
  5772. }
  5773. /**
  5774. * Runtime helper for checking keyCodes from config.
  5775. * exposed as Vue.prototype._k
  5776. * passing in eventKeyName as last argument separately for backwards compat
  5777. */
  5778. function checkKeyCodes (
  5779. eventKeyCode,
  5780. key,
  5781. builtInKeyCode,
  5782. eventKeyName,
  5783. builtInKeyName
  5784. ) {
  5785. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5786. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5787. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5788. } else if (mappedKeyCode) {
  5789. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5790. } else if (eventKeyName) {
  5791. return hyphenate(eventKeyName) !== key
  5792. }
  5793. }
  5794. /* */
  5795. /**
  5796. * Runtime helper for merging v-bind="object" into a VNode's data.
  5797. */
  5798. function bindObjectProps (
  5799. data,
  5800. tag,
  5801. value,
  5802. asProp,
  5803. isSync
  5804. ) {
  5805. if (value) {
  5806. if (!isObject(value)) {
  5807. true && warn(
  5808. 'v-bind without argument expects an Object or Array value',
  5809. this
  5810. );
  5811. } else {
  5812. if (Array.isArray(value)) {
  5813. value = toObject(value);
  5814. }
  5815. var hash;
  5816. var loop = function ( key ) {
  5817. if (
  5818. key === 'class' ||
  5819. key === 'style' ||
  5820. isReservedAttribute(key)
  5821. ) {
  5822. hash = data;
  5823. } else {
  5824. var type = data.attrs && data.attrs.type;
  5825. hash = asProp || config.mustUseProp(tag, type, key)
  5826. ? data.domProps || (data.domProps = {})
  5827. : data.attrs || (data.attrs = {});
  5828. }
  5829. var camelizedKey = camelize(key);
  5830. var hyphenatedKey = hyphenate(key);
  5831. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5832. hash[key] = value[key];
  5833. if (isSync) {
  5834. var on = data.on || (data.on = {});
  5835. on[("update:" + key)] = function ($event) {
  5836. value[key] = $event;
  5837. };
  5838. }
  5839. }
  5840. };
  5841. for (var key in value) loop( key );
  5842. }
  5843. }
  5844. return data
  5845. }
  5846. /* */
  5847. /**
  5848. * Runtime helper for rendering static trees.
  5849. */
  5850. function renderStatic (
  5851. index,
  5852. isInFor
  5853. ) {
  5854. var cached = this._staticTrees || (this._staticTrees = []);
  5855. var tree = cached[index];
  5856. // if has already-rendered static tree and not inside v-for,
  5857. // we can reuse the same tree.
  5858. if (tree && !isInFor) {
  5859. return tree
  5860. }
  5861. // otherwise, render a fresh tree.
  5862. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5863. this._renderProxy,
  5864. null,
  5865. this // for render fns generated for functional component templates
  5866. );
  5867. markStatic(tree, ("__static__" + index), false);
  5868. return tree
  5869. }
  5870. /**
  5871. * Runtime helper for v-once.
  5872. * Effectively it means marking the node as static with a unique key.
  5873. */
  5874. function markOnce (
  5875. tree,
  5876. index,
  5877. key
  5878. ) {
  5879. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5880. return tree
  5881. }
  5882. function markStatic (
  5883. tree,
  5884. key,
  5885. isOnce
  5886. ) {
  5887. if (Array.isArray(tree)) {
  5888. for (var i = 0; i < tree.length; i++) {
  5889. if (tree[i] && typeof tree[i] !== 'string') {
  5890. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5891. }
  5892. }
  5893. } else {
  5894. markStaticNode(tree, key, isOnce);
  5895. }
  5896. }
  5897. function markStaticNode (node, key, isOnce) {
  5898. node.isStatic = true;
  5899. node.key = key;
  5900. node.isOnce = isOnce;
  5901. }
  5902. /* */
  5903. function bindObjectListeners (data, value) {
  5904. if (value) {
  5905. if (!isPlainObject(value)) {
  5906. true && warn(
  5907. 'v-on without argument expects an Object value',
  5908. this
  5909. );
  5910. } else {
  5911. var on = data.on = data.on ? extend({}, data.on) : {};
  5912. for (var key in value) {
  5913. var existing = on[key];
  5914. var ours = value[key];
  5915. on[key] = existing ? [].concat(existing, ours) : ours;
  5916. }
  5917. }
  5918. }
  5919. return data
  5920. }
  5921. /* */
  5922. function resolveScopedSlots (
  5923. fns, // see flow/vnode
  5924. res,
  5925. // the following are added in 2.6
  5926. hasDynamicKeys,
  5927. contentHashKey
  5928. ) {
  5929. res = res || { $stable: !hasDynamicKeys };
  5930. for (var i = 0; i < fns.length; i++) {
  5931. var slot = fns[i];
  5932. if (Array.isArray(slot)) {
  5933. resolveScopedSlots(slot, res, hasDynamicKeys);
  5934. } else if (slot) {
  5935. // marker for reverse proxying v-slot without scope on this.$slots
  5936. if (slot.proxy) {
  5937. slot.fn.proxy = true;
  5938. }
  5939. res[slot.key] = slot.fn;
  5940. }
  5941. }
  5942. if (contentHashKey) {
  5943. (res).$key = contentHashKey;
  5944. }
  5945. return res
  5946. }
  5947. /* */
  5948. function bindDynamicKeys (baseObj, values) {
  5949. for (var i = 0; i < values.length; i += 2) {
  5950. var key = values[i];
  5951. if (typeof key === 'string' && key) {
  5952. baseObj[values[i]] = values[i + 1];
  5953. } else if ( true && key !== '' && key !== null) {
  5954. // null is a special value for explicitly removing a binding
  5955. warn(
  5956. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5957. this
  5958. );
  5959. }
  5960. }
  5961. return baseObj
  5962. }
  5963. // helper to dynamically append modifier runtime markers to event names.
  5964. // ensure only append when value is already string, otherwise it will be cast
  5965. // to string and cause the type check to miss.
  5966. function prependModifier (value, symbol) {
  5967. return typeof value === 'string' ? symbol + value : value
  5968. }
  5969. /* */
  5970. function installRenderHelpers (target) {
  5971. target._o = markOnce;
  5972. target._n = toNumber;
  5973. target._s = toString;
  5974. target._l = renderList;
  5975. target._t = renderSlot;
  5976. target._q = looseEqual;
  5977. target._i = looseIndexOf;
  5978. target._m = renderStatic;
  5979. target._f = resolveFilter;
  5980. target._k = checkKeyCodes;
  5981. target._b = bindObjectProps;
  5982. target._v = createTextVNode;
  5983. target._e = createEmptyVNode;
  5984. target._u = resolveScopedSlots;
  5985. target._g = bindObjectListeners;
  5986. target._d = bindDynamicKeys;
  5987. target._p = prependModifier;
  5988. }
  5989. /* */
  5990. function FunctionalRenderContext (
  5991. data,
  5992. props,
  5993. children,
  5994. parent,
  5995. Ctor
  5996. ) {
  5997. var this$1 = this;
  5998. var options = Ctor.options;
  5999. // ensure the createElement function in functional components
  6000. // gets a unique context - this is necessary for correct named slot check
  6001. var contextVm;
  6002. if (hasOwn(parent, '_uid')) {
  6003. contextVm = Object.create(parent);
  6004. // $flow-disable-line
  6005. contextVm._original = parent;
  6006. } else {
  6007. // the context vm passed in is a functional context as well.
  6008. // in this case we want to make sure we are able to get a hold to the
  6009. // real context instance.
  6010. contextVm = parent;
  6011. // $flow-disable-line
  6012. parent = parent._original;
  6013. }
  6014. var isCompiled = isTrue(options._compiled);
  6015. var needNormalization = !isCompiled;
  6016. this.data = data;
  6017. this.props = props;
  6018. this.children = children;
  6019. this.parent = parent;
  6020. this.listeners = data.on || emptyObject;
  6021. this.injections = resolveInject(options.inject, parent);
  6022. this.slots = function () {
  6023. if (!this$1.$slots) {
  6024. normalizeScopedSlots(
  6025. data.scopedSlots,
  6026. this$1.$slots = resolveSlots(children, parent)
  6027. );
  6028. }
  6029. return this$1.$slots
  6030. };
  6031. Object.defineProperty(this, 'scopedSlots', ({
  6032. enumerable: true,
  6033. get: function get () {
  6034. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6035. }
  6036. }));
  6037. // support for compiled functional template
  6038. if (isCompiled) {
  6039. // exposing $options for renderStatic()
  6040. this.$options = options;
  6041. // pre-resolve slots for renderSlot()
  6042. this.$slots = this.slots();
  6043. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6044. }
  6045. if (options._scopeId) {
  6046. this._c = function (a, b, c, d) {
  6047. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6048. if (vnode && !Array.isArray(vnode)) {
  6049. vnode.fnScopeId = options._scopeId;
  6050. vnode.fnContext = parent;
  6051. }
  6052. return vnode
  6053. };
  6054. } else {
  6055. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6056. }
  6057. }
  6058. installRenderHelpers(FunctionalRenderContext.prototype);
  6059. function createFunctionalComponent (
  6060. Ctor,
  6061. propsData,
  6062. data,
  6063. contextVm,
  6064. children
  6065. ) {
  6066. var options = Ctor.options;
  6067. var props = {};
  6068. var propOptions = options.props;
  6069. if (isDef(propOptions)) {
  6070. for (var key in propOptions) {
  6071. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6072. }
  6073. } else {
  6074. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6075. if (isDef(data.props)) { mergeProps(props, data.props); }
  6076. }
  6077. var renderContext = new FunctionalRenderContext(
  6078. data,
  6079. props,
  6080. children,
  6081. contextVm,
  6082. Ctor
  6083. );
  6084. var vnode = options.render.call(null, renderContext._c, renderContext);
  6085. if (vnode instanceof VNode) {
  6086. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6087. } else if (Array.isArray(vnode)) {
  6088. var vnodes = normalizeChildren(vnode) || [];
  6089. var res = new Array(vnodes.length);
  6090. for (var i = 0; i < vnodes.length; i++) {
  6091. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6092. }
  6093. return res
  6094. }
  6095. }
  6096. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6097. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6098. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6099. // that should not be matched to match.
  6100. var clone = cloneVNode(vnode);
  6101. clone.fnContext = contextVm;
  6102. clone.fnOptions = options;
  6103. if (true) {
  6104. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6105. }
  6106. if (data.slot) {
  6107. (clone.data || (clone.data = {})).slot = data.slot;
  6108. }
  6109. return clone
  6110. }
  6111. function mergeProps (to, from) {
  6112. for (var key in from) {
  6113. to[camelize(key)] = from[key];
  6114. }
  6115. }
  6116. /* */
  6117. /* */
  6118. /* */
  6119. /* */
  6120. // inline hooks to be invoked on component VNodes during patch
  6121. var componentVNodeHooks = {
  6122. init: function init (vnode, hydrating) {
  6123. if (
  6124. vnode.componentInstance &&
  6125. !vnode.componentInstance._isDestroyed &&
  6126. vnode.data.keepAlive
  6127. ) {
  6128. // kept-alive components, treat as a patch
  6129. var mountedNode = vnode; // work around flow
  6130. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6131. } else {
  6132. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6133. vnode,
  6134. activeInstance
  6135. );
  6136. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6137. }
  6138. },
  6139. prepatch: function prepatch (oldVnode, vnode) {
  6140. var options = vnode.componentOptions;
  6141. var child = vnode.componentInstance = oldVnode.componentInstance;
  6142. updateChildComponent(
  6143. child,
  6144. options.propsData, // updated props
  6145. options.listeners, // updated listeners
  6146. vnode, // new parent vnode
  6147. options.children // new children
  6148. );
  6149. },
  6150. insert: function insert (vnode) {
  6151. var context = vnode.context;
  6152. var componentInstance = vnode.componentInstance;
  6153. if (!componentInstance._isMounted) {
  6154. callHook(componentInstance, 'onServiceCreated');
  6155. callHook(componentInstance, 'onServiceAttached');
  6156. componentInstance._isMounted = true;
  6157. callHook(componentInstance, 'mounted');
  6158. }
  6159. if (vnode.data.keepAlive) {
  6160. if (context._isMounted) {
  6161. // vue-router#1212
  6162. // During updates, a kept-alive component's child components may
  6163. // change, so directly walking the tree here may call activated hooks
  6164. // on incorrect children. Instead we push them into a queue which will
  6165. // be processed after the whole patch process ended.
  6166. queueActivatedComponent(componentInstance);
  6167. } else {
  6168. activateChildComponent(componentInstance, true /* direct */);
  6169. }
  6170. }
  6171. },
  6172. destroy: function destroy (vnode) {
  6173. var componentInstance = vnode.componentInstance;
  6174. if (!componentInstance._isDestroyed) {
  6175. if (!vnode.data.keepAlive) {
  6176. componentInstance.$destroy();
  6177. } else {
  6178. deactivateChildComponent(componentInstance, true /* direct */);
  6179. }
  6180. }
  6181. }
  6182. };
  6183. var hooksToMerge = Object.keys(componentVNodeHooks);
  6184. function createComponent (
  6185. Ctor,
  6186. data,
  6187. context,
  6188. children,
  6189. tag
  6190. ) {
  6191. if (isUndef(Ctor)) {
  6192. return
  6193. }
  6194. var baseCtor = context.$options._base;
  6195. // plain options object: turn it into a constructor
  6196. if (isObject(Ctor)) {
  6197. Ctor = baseCtor.extend(Ctor);
  6198. }
  6199. // if at this stage it's not a constructor or an async component factory,
  6200. // reject.
  6201. if (typeof Ctor !== 'function') {
  6202. if (true) {
  6203. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6204. }
  6205. return
  6206. }
  6207. // async component
  6208. var asyncFactory;
  6209. if (isUndef(Ctor.cid)) {
  6210. asyncFactory = Ctor;
  6211. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6212. if (Ctor === undefined) {
  6213. // return a placeholder node for async component, which is rendered
  6214. // as a comment node but preserves all the raw information for the node.
  6215. // the information will be used for async server-rendering and hydration.
  6216. return createAsyncPlaceholder(
  6217. asyncFactory,
  6218. data,
  6219. context,
  6220. children,
  6221. tag
  6222. )
  6223. }
  6224. }
  6225. data = data || {};
  6226. // resolve constructor options in case global mixins are applied after
  6227. // component constructor creation
  6228. resolveConstructorOptions(Ctor);
  6229. // transform component v-model data into props & events
  6230. if (isDef(data.model)) {
  6231. transformModel(Ctor.options, data);
  6232. }
  6233. // extract props
  6234. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6235. // functional component
  6236. if (isTrue(Ctor.options.functional)) {
  6237. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6238. }
  6239. // extract listeners, since these needs to be treated as
  6240. // child component listeners instead of DOM listeners
  6241. var listeners = data.on;
  6242. // replace with listeners with .native modifier
  6243. // so it gets processed during parent component patch.
  6244. data.on = data.nativeOn;
  6245. if (isTrue(Ctor.options.abstract)) {
  6246. // abstract components do not keep anything
  6247. // other than props & listeners & slot
  6248. // work around flow
  6249. var slot = data.slot;
  6250. data = {};
  6251. if (slot) {
  6252. data.slot = slot;
  6253. }
  6254. }
  6255. // install component management hooks onto the placeholder node
  6256. installComponentHooks(data);
  6257. // return a placeholder vnode
  6258. var name = Ctor.options.name || tag;
  6259. var vnode = new VNode(
  6260. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6261. data, undefined, undefined, undefined, context,
  6262. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6263. asyncFactory
  6264. );
  6265. return vnode
  6266. }
  6267. function createComponentInstanceForVnode (
  6268. vnode, // we know it's MountedComponentVNode but flow doesn't
  6269. parent // activeInstance in lifecycle state
  6270. ) {
  6271. var options = {
  6272. _isComponent: true,
  6273. _parentVnode: vnode,
  6274. parent: parent
  6275. };
  6276. // check inline-template render functions
  6277. var inlineTemplate = vnode.data.inlineTemplate;
  6278. if (isDef(inlineTemplate)) {
  6279. options.render = inlineTemplate.render;
  6280. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6281. }
  6282. return new vnode.componentOptions.Ctor(options)
  6283. }
  6284. function installComponentHooks (data) {
  6285. var hooks = data.hook || (data.hook = {});
  6286. for (var i = 0; i < hooksToMerge.length; i++) {
  6287. var key = hooksToMerge[i];
  6288. var existing = hooks[key];
  6289. var toMerge = componentVNodeHooks[key];
  6290. if (existing !== toMerge && !(existing && existing._merged)) {
  6291. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6292. }
  6293. }
  6294. }
  6295. function mergeHook$1 (f1, f2) {
  6296. var merged = function (a, b) {
  6297. // flow complains about extra args which is why we use any
  6298. f1(a, b);
  6299. f2(a, b);
  6300. };
  6301. merged._merged = true;
  6302. return merged
  6303. }
  6304. // transform component v-model info (value and callback) into
  6305. // prop and event handler respectively.
  6306. function transformModel (options, data) {
  6307. var prop = (options.model && options.model.prop) || 'value';
  6308. var event = (options.model && options.model.event) || 'input'
  6309. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6310. var on = data.on || (data.on = {});
  6311. var existing = on[event];
  6312. var callback = data.model.callback;
  6313. if (isDef(existing)) {
  6314. if (
  6315. Array.isArray(existing)
  6316. ? existing.indexOf(callback) === -1
  6317. : existing !== callback
  6318. ) {
  6319. on[event] = [callback].concat(existing);
  6320. }
  6321. } else {
  6322. on[event] = callback;
  6323. }
  6324. }
  6325. /* */
  6326. var SIMPLE_NORMALIZE = 1;
  6327. var ALWAYS_NORMALIZE = 2;
  6328. // wrapper function for providing a more flexible interface
  6329. // without getting yelled at by flow
  6330. function createElement (
  6331. context,
  6332. tag,
  6333. data,
  6334. children,
  6335. normalizationType,
  6336. alwaysNormalize
  6337. ) {
  6338. if (Array.isArray(data) || isPrimitive(data)) {
  6339. normalizationType = children;
  6340. children = data;
  6341. data = undefined;
  6342. }
  6343. if (isTrue(alwaysNormalize)) {
  6344. normalizationType = ALWAYS_NORMALIZE;
  6345. }
  6346. return _createElement(context, tag, data, children, normalizationType)
  6347. }
  6348. function _createElement (
  6349. context,
  6350. tag,
  6351. data,
  6352. children,
  6353. normalizationType
  6354. ) {
  6355. if (isDef(data) && isDef((data).__ob__)) {
  6356. true && warn(
  6357. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6358. 'Always create fresh vnode data objects in each render!',
  6359. context
  6360. );
  6361. return createEmptyVNode()
  6362. }
  6363. // object syntax in v-bind
  6364. if (isDef(data) && isDef(data.is)) {
  6365. tag = data.is;
  6366. }
  6367. if (!tag) {
  6368. // in case of component :is set to falsy value
  6369. return createEmptyVNode()
  6370. }
  6371. // warn against non-primitive key
  6372. if ( true &&
  6373. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6374. ) {
  6375. {
  6376. warn(
  6377. 'Avoid using non-primitive value as key, ' +
  6378. 'use string/number value instead.',
  6379. context
  6380. );
  6381. }
  6382. }
  6383. // support single function children as default scoped slot
  6384. if (Array.isArray(children) &&
  6385. typeof children[0] === 'function'
  6386. ) {
  6387. data = data || {};
  6388. data.scopedSlots = { default: children[0] };
  6389. children.length = 0;
  6390. }
  6391. if (normalizationType === ALWAYS_NORMALIZE) {
  6392. children = normalizeChildren(children);
  6393. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6394. children = simpleNormalizeChildren(children);
  6395. }
  6396. var vnode, ns;
  6397. if (typeof tag === 'string') {
  6398. var Ctor;
  6399. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6400. if (config.isReservedTag(tag)) {
  6401. // platform built-in elements
  6402. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6403. warn(
  6404. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6405. context
  6406. );
  6407. }
  6408. vnode = new VNode(
  6409. config.parsePlatformTagName(tag), data, children,
  6410. undefined, undefined, context
  6411. );
  6412. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6413. // component
  6414. vnode = createComponent(Ctor, data, context, children, tag);
  6415. } else {
  6416. // unknown or unlisted namespaced elements
  6417. // check at runtime because it may get assigned a namespace when its
  6418. // parent normalizes children
  6419. vnode = new VNode(
  6420. tag, data, children,
  6421. undefined, undefined, context
  6422. );
  6423. }
  6424. } else {
  6425. // direct component options / constructor
  6426. vnode = createComponent(tag, data, context, children);
  6427. }
  6428. if (Array.isArray(vnode)) {
  6429. return vnode
  6430. } else if (isDef(vnode)) {
  6431. if (isDef(ns)) { applyNS(vnode, ns); }
  6432. if (isDef(data)) { registerDeepBindings(data); }
  6433. return vnode
  6434. } else {
  6435. return createEmptyVNode()
  6436. }
  6437. }
  6438. function applyNS (vnode, ns, force) {
  6439. vnode.ns = ns;
  6440. if (vnode.tag === 'foreignObject') {
  6441. // use default namespace inside foreignObject
  6442. ns = undefined;
  6443. force = true;
  6444. }
  6445. if (isDef(vnode.children)) {
  6446. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6447. var child = vnode.children[i];
  6448. if (isDef(child.tag) && (
  6449. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6450. applyNS(child, ns, force);
  6451. }
  6452. }
  6453. }
  6454. }
  6455. // ref #5318
  6456. // necessary to ensure parent re-render when deep bindings like :style and
  6457. // :class are used on slot nodes
  6458. function registerDeepBindings (data) {
  6459. if (isObject(data.style)) {
  6460. traverse(data.style);
  6461. }
  6462. if (isObject(data.class)) {
  6463. traverse(data.class);
  6464. }
  6465. }
  6466. /* */
  6467. function initRender (vm) {
  6468. vm._vnode = null; // the root of the child tree
  6469. vm._staticTrees = null; // v-once cached trees
  6470. var options = vm.$options;
  6471. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6472. var renderContext = parentVnode && parentVnode.context;
  6473. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6474. vm.$scopedSlots = emptyObject;
  6475. // bind the createElement fn to this instance
  6476. // so that we get proper render context inside it.
  6477. // args order: tag, data, children, normalizationType, alwaysNormalize
  6478. // internal version is used by render functions compiled from templates
  6479. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6480. // normalization is always applied for the public version, used in
  6481. // user-written render functions.
  6482. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6483. // $attrs & $listeners are exposed for easier HOC creation.
  6484. // they need to be reactive so that HOCs using them are always updated
  6485. var parentData = parentVnode && parentVnode.data;
  6486. /* istanbul ignore else */
  6487. if (true) {
  6488. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6489. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6490. }, true);
  6491. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6492. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6493. }, true);
  6494. } else {}
  6495. }
  6496. var currentRenderingInstance = null;
  6497. function renderMixin (Vue) {
  6498. // install runtime convenience helpers
  6499. installRenderHelpers(Vue.prototype);
  6500. Vue.prototype.$nextTick = function (fn) {
  6501. return nextTick(fn, this)
  6502. };
  6503. Vue.prototype._render = function () {
  6504. var vm = this;
  6505. var ref = vm.$options;
  6506. var render = ref.render;
  6507. var _parentVnode = ref._parentVnode;
  6508. if (_parentVnode) {
  6509. vm.$scopedSlots = normalizeScopedSlots(
  6510. _parentVnode.data.scopedSlots,
  6511. vm.$slots,
  6512. vm.$scopedSlots
  6513. );
  6514. }
  6515. // set parent vnode. this allows render functions to have access
  6516. // to the data on the placeholder node.
  6517. vm.$vnode = _parentVnode;
  6518. // render self
  6519. var vnode;
  6520. try {
  6521. // There's no need to maintain a stack because all render fns are called
  6522. // separately from one another. Nested component's render fns are called
  6523. // when parent component is patched.
  6524. currentRenderingInstance = vm;
  6525. vnode = render.call(vm._renderProxy, vm.$createElement);
  6526. } catch (e) {
  6527. handleError(e, vm, "render");
  6528. // return error render result,
  6529. // or previous vnode to prevent render error causing blank component
  6530. /* istanbul ignore else */
  6531. if ( true && vm.$options.renderError) {
  6532. try {
  6533. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6534. } catch (e) {
  6535. handleError(e, vm, "renderError");
  6536. vnode = vm._vnode;
  6537. }
  6538. } else {
  6539. vnode = vm._vnode;
  6540. }
  6541. } finally {
  6542. currentRenderingInstance = null;
  6543. }
  6544. // if the returned array contains only a single node, allow it
  6545. if (Array.isArray(vnode) && vnode.length === 1) {
  6546. vnode = vnode[0];
  6547. }
  6548. // return empty vnode in case the render function errored out
  6549. if (!(vnode instanceof VNode)) {
  6550. if ( true && Array.isArray(vnode)) {
  6551. warn(
  6552. 'Multiple root nodes returned from render function. Render function ' +
  6553. 'should return a single root node.',
  6554. vm
  6555. );
  6556. }
  6557. vnode = createEmptyVNode();
  6558. }
  6559. // set parent
  6560. vnode.parent = _parentVnode;
  6561. return vnode
  6562. };
  6563. }
  6564. /* */
  6565. function ensureCtor (comp, base) {
  6566. if (
  6567. comp.__esModule ||
  6568. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6569. ) {
  6570. comp = comp.default;
  6571. }
  6572. return isObject(comp)
  6573. ? base.extend(comp)
  6574. : comp
  6575. }
  6576. function createAsyncPlaceholder (
  6577. factory,
  6578. data,
  6579. context,
  6580. children,
  6581. tag
  6582. ) {
  6583. var node = createEmptyVNode();
  6584. node.asyncFactory = factory;
  6585. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6586. return node
  6587. }
  6588. function resolveAsyncComponent (
  6589. factory,
  6590. baseCtor
  6591. ) {
  6592. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6593. return factory.errorComp
  6594. }
  6595. if (isDef(factory.resolved)) {
  6596. return factory.resolved
  6597. }
  6598. var owner = currentRenderingInstance;
  6599. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6600. // already pending
  6601. factory.owners.push(owner);
  6602. }
  6603. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6604. return factory.loadingComp
  6605. }
  6606. if (owner && !isDef(factory.owners)) {
  6607. var owners = factory.owners = [owner];
  6608. var sync = true;
  6609. var timerLoading = null;
  6610. var timerTimeout = null
  6611. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6612. var forceRender = function (renderCompleted) {
  6613. for (var i = 0, l = owners.length; i < l; i++) {
  6614. (owners[i]).$forceUpdate();
  6615. }
  6616. if (renderCompleted) {
  6617. owners.length = 0;
  6618. if (timerLoading !== null) {
  6619. clearTimeout(timerLoading);
  6620. timerLoading = null;
  6621. }
  6622. if (timerTimeout !== null) {
  6623. clearTimeout(timerTimeout);
  6624. timerTimeout = null;
  6625. }
  6626. }
  6627. };
  6628. var resolve = once(function (res) {
  6629. // cache resolved
  6630. factory.resolved = ensureCtor(res, baseCtor);
  6631. // invoke callbacks only if this is not a synchronous resolve
  6632. // (async resolves are shimmed as synchronous during SSR)
  6633. if (!sync) {
  6634. forceRender(true);
  6635. } else {
  6636. owners.length = 0;
  6637. }
  6638. });
  6639. var reject = once(function (reason) {
  6640. true && warn(
  6641. "Failed to resolve async component: " + (String(factory)) +
  6642. (reason ? ("\nReason: " + reason) : '')
  6643. );
  6644. if (isDef(factory.errorComp)) {
  6645. factory.error = true;
  6646. forceRender(true);
  6647. }
  6648. });
  6649. var res = factory(resolve, reject);
  6650. if (isObject(res)) {
  6651. if (isPromise(res)) {
  6652. // () => Promise
  6653. if (isUndef(factory.resolved)) {
  6654. res.then(resolve, reject);
  6655. }
  6656. } else if (isPromise(res.component)) {
  6657. res.component.then(resolve, reject);
  6658. if (isDef(res.error)) {
  6659. factory.errorComp = ensureCtor(res.error, baseCtor);
  6660. }
  6661. if (isDef(res.loading)) {
  6662. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6663. if (res.delay === 0) {
  6664. factory.loading = true;
  6665. } else {
  6666. timerLoading = setTimeout(function () {
  6667. timerLoading = null;
  6668. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6669. factory.loading = true;
  6670. forceRender(false);
  6671. }
  6672. }, res.delay || 200);
  6673. }
  6674. }
  6675. if (isDef(res.timeout)) {
  6676. timerTimeout = setTimeout(function () {
  6677. timerTimeout = null;
  6678. if (isUndef(factory.resolved)) {
  6679. reject(
  6680. true
  6681. ? ("timeout (" + (res.timeout) + "ms)")
  6682. : undefined
  6683. );
  6684. }
  6685. }, res.timeout);
  6686. }
  6687. }
  6688. }
  6689. sync = false;
  6690. // return in case resolved synchronously
  6691. return factory.loading
  6692. ? factory.loadingComp
  6693. : factory.resolved
  6694. }
  6695. }
  6696. /* */
  6697. function isAsyncPlaceholder (node) {
  6698. return node.isComment && node.asyncFactory
  6699. }
  6700. /* */
  6701. function getFirstComponentChild (children) {
  6702. if (Array.isArray(children)) {
  6703. for (var i = 0; i < children.length; i++) {
  6704. var c = children[i];
  6705. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6706. return c
  6707. }
  6708. }
  6709. }
  6710. }
  6711. /* */
  6712. /* */
  6713. function initEvents (vm) {
  6714. vm._events = Object.create(null);
  6715. vm._hasHookEvent = false;
  6716. // init parent attached events
  6717. var listeners = vm.$options._parentListeners;
  6718. if (listeners) {
  6719. updateComponentListeners(vm, listeners);
  6720. }
  6721. }
  6722. var target;
  6723. function add (event, fn) {
  6724. target.$on(event, fn);
  6725. }
  6726. function remove$1 (event, fn) {
  6727. target.$off(event, fn);
  6728. }
  6729. function createOnceHandler (event, fn) {
  6730. var _target = target;
  6731. return function onceHandler () {
  6732. var res = fn.apply(null, arguments);
  6733. if (res !== null) {
  6734. _target.$off(event, onceHandler);
  6735. }
  6736. }
  6737. }
  6738. function updateComponentListeners (
  6739. vm,
  6740. listeners,
  6741. oldListeners
  6742. ) {
  6743. target = vm;
  6744. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6745. target = undefined;
  6746. }
  6747. function eventsMixin (Vue) {
  6748. var hookRE = /^hook:/;
  6749. Vue.prototype.$on = function (event, fn) {
  6750. var vm = this;
  6751. if (Array.isArray(event)) {
  6752. for (var i = 0, l = event.length; i < l; i++) {
  6753. vm.$on(event[i], fn);
  6754. }
  6755. } else {
  6756. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6757. // optimize hook:event cost by using a boolean flag marked at registration
  6758. // instead of a hash lookup
  6759. if (hookRE.test(event)) {
  6760. vm._hasHookEvent = true;
  6761. }
  6762. }
  6763. return vm
  6764. };
  6765. Vue.prototype.$once = function (event, fn) {
  6766. var vm = this;
  6767. function on () {
  6768. vm.$off(event, on);
  6769. fn.apply(vm, arguments);
  6770. }
  6771. on.fn = fn;
  6772. vm.$on(event, on);
  6773. return vm
  6774. };
  6775. Vue.prototype.$off = function (event, fn) {
  6776. var vm = this;
  6777. // all
  6778. if (!arguments.length) {
  6779. vm._events = Object.create(null);
  6780. return vm
  6781. }
  6782. // array of events
  6783. if (Array.isArray(event)) {
  6784. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6785. vm.$off(event[i$1], fn);
  6786. }
  6787. return vm
  6788. }
  6789. // specific event
  6790. var cbs = vm._events[event];
  6791. if (!cbs) {
  6792. return vm
  6793. }
  6794. if (!fn) {
  6795. vm._events[event] = null;
  6796. return vm
  6797. }
  6798. // specific handler
  6799. var cb;
  6800. var i = cbs.length;
  6801. while (i--) {
  6802. cb = cbs[i];
  6803. if (cb === fn || cb.fn === fn) {
  6804. cbs.splice(i, 1);
  6805. break
  6806. }
  6807. }
  6808. return vm
  6809. };
  6810. Vue.prototype.$emit = function (event) {
  6811. var vm = this;
  6812. if (true) {
  6813. var lowerCaseEvent = event.toLowerCase();
  6814. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6815. tip(
  6816. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6817. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6818. "Note that HTML attributes are case-insensitive and you cannot use " +
  6819. "v-on to listen to camelCase events when using in-DOM templates. " +
  6820. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6821. );
  6822. }
  6823. }
  6824. var cbs = vm._events[event];
  6825. if (cbs) {
  6826. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6827. var args = toArray(arguments, 1);
  6828. var info = "event handler for \"" + event + "\"";
  6829. for (var i = 0, l = cbs.length; i < l; i++) {
  6830. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6831. }
  6832. }
  6833. return vm
  6834. };
  6835. }
  6836. /* */
  6837. var activeInstance = null;
  6838. var isUpdatingChildComponent = false;
  6839. function setActiveInstance(vm) {
  6840. var prevActiveInstance = activeInstance;
  6841. activeInstance = vm;
  6842. return function () {
  6843. activeInstance = prevActiveInstance;
  6844. }
  6845. }
  6846. function initLifecycle (vm) {
  6847. var options = vm.$options;
  6848. // locate first non-abstract parent
  6849. var parent = options.parent;
  6850. if (parent && !options.abstract) {
  6851. while (parent.$options.abstract && parent.$parent) {
  6852. parent = parent.$parent;
  6853. }
  6854. parent.$children.push(vm);
  6855. }
  6856. vm.$parent = parent;
  6857. vm.$root = parent ? parent.$root : vm;
  6858. vm.$children = [];
  6859. vm.$refs = {};
  6860. vm._watcher = null;
  6861. vm._inactive = null;
  6862. vm._directInactive = false;
  6863. vm._isMounted = false;
  6864. vm._isDestroyed = false;
  6865. vm._isBeingDestroyed = false;
  6866. }
  6867. function lifecycleMixin (Vue) {
  6868. Vue.prototype._update = function (vnode, hydrating) {
  6869. var vm = this;
  6870. var prevEl = vm.$el;
  6871. var prevVnode = vm._vnode;
  6872. var restoreActiveInstance = setActiveInstance(vm);
  6873. vm._vnode = vnode;
  6874. // Vue.prototype.__patch__ is injected in entry points
  6875. // based on the rendering backend used.
  6876. if (!prevVnode) {
  6877. // initial render
  6878. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6879. } else {
  6880. // updates
  6881. vm.$el = vm.__patch__(prevVnode, vnode);
  6882. }
  6883. restoreActiveInstance();
  6884. // update __vue__ reference
  6885. if (prevEl) {
  6886. prevEl.__vue__ = null;
  6887. }
  6888. if (vm.$el) {
  6889. vm.$el.__vue__ = vm;
  6890. }
  6891. // if parent is an HOC, update its $el as well
  6892. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6893. vm.$parent.$el = vm.$el;
  6894. }
  6895. // updated hook is called by the scheduler to ensure that children are
  6896. // updated in a parent's updated hook.
  6897. };
  6898. Vue.prototype.$forceUpdate = function () {
  6899. var vm = this;
  6900. if (vm._watcher) {
  6901. vm._watcher.update();
  6902. }
  6903. };
  6904. Vue.prototype.$destroy = function () {
  6905. var vm = this;
  6906. if (vm._isBeingDestroyed) {
  6907. return
  6908. }
  6909. callHook(vm, 'beforeDestroy');
  6910. vm._isBeingDestroyed = true;
  6911. // remove self from parent
  6912. var parent = vm.$parent;
  6913. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6914. remove(parent.$children, vm);
  6915. }
  6916. // teardown watchers
  6917. if (vm._watcher) {
  6918. vm._watcher.teardown();
  6919. }
  6920. var i = vm._watchers.length;
  6921. while (i--) {
  6922. vm._watchers[i].teardown();
  6923. }
  6924. // remove reference from data ob
  6925. // frozen object may not have observer.
  6926. if (vm._data.__ob__) {
  6927. vm._data.__ob__.vmCount--;
  6928. }
  6929. // call the last hook...
  6930. vm._isDestroyed = true;
  6931. // invoke destroy hooks on current rendered tree
  6932. vm.__patch__(vm._vnode, null);
  6933. // fire destroyed hook
  6934. callHook(vm, 'destroyed');
  6935. // turn off all instance listeners.
  6936. vm.$off();
  6937. // remove __vue__ reference
  6938. if (vm.$el) {
  6939. vm.$el.__vue__ = null;
  6940. }
  6941. // release circular reference (#6759)
  6942. if (vm.$vnode) {
  6943. vm.$vnode.parent = null;
  6944. }
  6945. };
  6946. }
  6947. function updateChildComponent (
  6948. vm,
  6949. propsData,
  6950. listeners,
  6951. parentVnode,
  6952. renderChildren
  6953. ) {
  6954. if (true) {
  6955. isUpdatingChildComponent = true;
  6956. }
  6957. // determine whether component has slot children
  6958. // we need to do this before overwriting $options._renderChildren.
  6959. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6960. // dynamic slot names). Static scoped slots compiled from template has the
  6961. // "$stable" marker.
  6962. var newScopedSlots = parentVnode.data.scopedSlots;
  6963. var oldScopedSlots = vm.$scopedSlots;
  6964. var hasDynamicScopedSlot = !!(
  6965. (newScopedSlots && !newScopedSlots.$stable) ||
  6966. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6967. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6968. );
  6969. // Any static slot children from the parent may have changed during parent's
  6970. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6971. // update is necessary to ensure correctness.
  6972. var needsForceUpdate = !!(
  6973. renderChildren || // has new static slots
  6974. vm.$options._renderChildren || // has old static slots
  6975. hasDynamicScopedSlot
  6976. );
  6977. vm.$options._parentVnode = parentVnode;
  6978. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6979. if (vm._vnode) { // update child tree's parent
  6980. vm._vnode.parent = parentVnode;
  6981. }
  6982. vm.$options._renderChildren = renderChildren;
  6983. // update $attrs and $listeners hash
  6984. // these are also reactive so they may trigger child update if the child
  6985. // used them during render
  6986. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6987. vm.$listeners = listeners || emptyObject;
  6988. // update props
  6989. if (propsData && vm.$options.props) {
  6990. toggleObserving(false);
  6991. var props = vm._props;
  6992. var propKeys = vm.$options._propKeys || [];
  6993. for (var i = 0; i < propKeys.length; i++) {
  6994. var key = propKeys[i];
  6995. var propOptions = vm.$options.props; // wtf flow?
  6996. props[key] = validateProp(key, propOptions, propsData, vm);
  6997. }
  6998. toggleObserving(true);
  6999. // keep a copy of raw propsData
  7000. vm.$options.propsData = propsData;
  7001. }
  7002. // fixed by xxxxxx update properties(mp runtime)
  7003. vm._$updateProperties && vm._$updateProperties(vm);
  7004. // update listeners
  7005. listeners = listeners || emptyObject;
  7006. var oldListeners = vm.$options._parentListeners;
  7007. vm.$options._parentListeners = listeners;
  7008. updateComponentListeners(vm, listeners, oldListeners);
  7009. // resolve slots + force update if has children
  7010. if (needsForceUpdate) {
  7011. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7012. vm.$forceUpdate();
  7013. }
  7014. if (true) {
  7015. isUpdatingChildComponent = false;
  7016. }
  7017. }
  7018. function isInInactiveTree (vm) {
  7019. while (vm && (vm = vm.$parent)) {
  7020. if (vm._inactive) { return true }
  7021. }
  7022. return false
  7023. }
  7024. function activateChildComponent (vm, direct) {
  7025. if (direct) {
  7026. vm._directInactive = false;
  7027. if (isInInactiveTree(vm)) {
  7028. return
  7029. }
  7030. } else if (vm._directInactive) {
  7031. return
  7032. }
  7033. if (vm._inactive || vm._inactive === null) {
  7034. vm._inactive = false;
  7035. for (var i = 0; i < vm.$children.length; i++) {
  7036. activateChildComponent(vm.$children[i]);
  7037. }
  7038. callHook(vm, 'activated');
  7039. }
  7040. }
  7041. function deactivateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = true;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. }
  7048. if (!vm._inactive) {
  7049. vm._inactive = true;
  7050. for (var i = 0; i < vm.$children.length; i++) {
  7051. deactivateChildComponent(vm.$children[i]);
  7052. }
  7053. callHook(vm, 'deactivated');
  7054. }
  7055. }
  7056. function callHook (vm, hook) {
  7057. // #7573 disable dep collection when invoking lifecycle hooks
  7058. pushTarget();
  7059. var handlers = vm.$options[hook];
  7060. var info = hook + " hook";
  7061. if (handlers) {
  7062. for (var i = 0, j = handlers.length; i < j; i++) {
  7063. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7064. }
  7065. }
  7066. if (vm._hasHookEvent) {
  7067. vm.$emit('hook:' + hook);
  7068. }
  7069. popTarget();
  7070. }
  7071. /* */
  7072. var MAX_UPDATE_COUNT = 100;
  7073. var queue = [];
  7074. var activatedChildren = [];
  7075. var has = {};
  7076. var circular = {};
  7077. var waiting = false;
  7078. var flushing = false;
  7079. var index = 0;
  7080. /**
  7081. * Reset the scheduler's state.
  7082. */
  7083. function resetSchedulerState () {
  7084. index = queue.length = activatedChildren.length = 0;
  7085. has = {};
  7086. if (true) {
  7087. circular = {};
  7088. }
  7089. waiting = flushing = false;
  7090. }
  7091. // Async edge case #6566 requires saving the timestamp when event listeners are
  7092. // attached. However, calling performance.now() has a perf overhead especially
  7093. // if the page has thousands of event listeners. Instead, we take a timestamp
  7094. // every time the scheduler flushes and use that for all event listeners
  7095. // attached during that flush.
  7096. var currentFlushTimestamp = 0;
  7097. // Async edge case fix requires storing an event listener's attach timestamp.
  7098. var getNow = Date.now;
  7099. // Determine what event timestamp the browser is using. Annoyingly, the
  7100. // timestamp can either be hi-res (relative to page load) or low-res
  7101. // (relative to UNIX epoch), so in order to compare time we have to use the
  7102. // same timestamp type when saving the flush timestamp.
  7103. // All IE versions use low-res event timestamps, and have problematic clock
  7104. // implementations (#9632)
  7105. if (inBrowser && !isIE) {
  7106. var performance = window.performance;
  7107. if (
  7108. performance &&
  7109. typeof performance.now === 'function' &&
  7110. getNow() > document.createEvent('Event').timeStamp
  7111. ) {
  7112. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7113. // smaller than it, it means the event is using a hi-res timestamp,
  7114. // and we need to use the hi-res version for event listener timestamps as
  7115. // well.
  7116. getNow = function () { return performance.now(); };
  7117. }
  7118. }
  7119. /**
  7120. * Flush both queues and run the watchers.
  7121. */
  7122. function flushSchedulerQueue () {
  7123. currentFlushTimestamp = getNow();
  7124. flushing = true;
  7125. var watcher, id;
  7126. // Sort queue before flush.
  7127. // This ensures that:
  7128. // 1. Components are updated from parent to child. (because parent is always
  7129. // created before the child)
  7130. // 2. A component's user watchers are run before its render watcher (because
  7131. // user watchers are created before the render watcher)
  7132. // 3. If a component is destroyed during a parent component's watcher run,
  7133. // its watchers can be skipped.
  7134. queue.sort(function (a, b) { return a.id - b.id; });
  7135. // do not cache length because more watchers might be pushed
  7136. // as we run existing watchers
  7137. for (index = 0; index < queue.length; index++) {
  7138. watcher = queue[index];
  7139. if (watcher.before) {
  7140. watcher.before();
  7141. }
  7142. id = watcher.id;
  7143. has[id] = null;
  7144. watcher.run();
  7145. // in dev build, check and stop circular updates.
  7146. if ( true && has[id] != null) {
  7147. circular[id] = (circular[id] || 0) + 1;
  7148. if (circular[id] > MAX_UPDATE_COUNT) {
  7149. warn(
  7150. 'You may have an infinite update loop ' + (
  7151. watcher.user
  7152. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7153. : "in a component render function."
  7154. ),
  7155. watcher.vm
  7156. );
  7157. break
  7158. }
  7159. }
  7160. }
  7161. // keep copies of post queues before resetting state
  7162. var activatedQueue = activatedChildren.slice();
  7163. var updatedQueue = queue.slice();
  7164. resetSchedulerState();
  7165. // call component updated and activated hooks
  7166. callActivatedHooks(activatedQueue);
  7167. callUpdatedHooks(updatedQueue);
  7168. // devtool hook
  7169. /* istanbul ignore if */
  7170. if (devtools && config.devtools) {
  7171. devtools.emit('flush');
  7172. }
  7173. }
  7174. function callUpdatedHooks (queue) {
  7175. var i = queue.length;
  7176. while (i--) {
  7177. var watcher = queue[i];
  7178. var vm = watcher.vm;
  7179. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7180. callHook(vm, 'updated');
  7181. }
  7182. }
  7183. }
  7184. /**
  7185. * Queue a kept-alive component that was activated during patch.
  7186. * The queue will be processed after the entire tree has been patched.
  7187. */
  7188. function queueActivatedComponent (vm) {
  7189. // setting _inactive to false here so that a render function can
  7190. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7191. vm._inactive = false;
  7192. activatedChildren.push(vm);
  7193. }
  7194. function callActivatedHooks (queue) {
  7195. for (var i = 0; i < queue.length; i++) {
  7196. queue[i]._inactive = true;
  7197. activateChildComponent(queue[i], true /* true */);
  7198. }
  7199. }
  7200. /**
  7201. * Push a watcher into the watcher queue.
  7202. * Jobs with duplicate IDs will be skipped unless it's
  7203. * pushed when the queue is being flushed.
  7204. */
  7205. function queueWatcher (watcher) {
  7206. var id = watcher.id;
  7207. if (has[id] == null) {
  7208. has[id] = true;
  7209. if (!flushing) {
  7210. queue.push(watcher);
  7211. } else {
  7212. // if already flushing, splice the watcher based on its id
  7213. // if already past its id, it will be run next immediately.
  7214. var i = queue.length - 1;
  7215. while (i > index && queue[i].id > watcher.id) {
  7216. i--;
  7217. }
  7218. queue.splice(i + 1, 0, watcher);
  7219. }
  7220. // queue the flush
  7221. if (!waiting) {
  7222. waiting = true;
  7223. if ( true && !config.async) {
  7224. flushSchedulerQueue();
  7225. return
  7226. }
  7227. nextTick(flushSchedulerQueue);
  7228. }
  7229. }
  7230. }
  7231. /* */
  7232. var uid$2 = 0;
  7233. /**
  7234. * A watcher parses an expression, collects dependencies,
  7235. * and fires callback when the expression value changes.
  7236. * This is used for both the $watch() api and directives.
  7237. */
  7238. var Watcher = function Watcher (
  7239. vm,
  7240. expOrFn,
  7241. cb,
  7242. options,
  7243. isRenderWatcher
  7244. ) {
  7245. this.vm = vm;
  7246. if (isRenderWatcher) {
  7247. vm._watcher = this;
  7248. }
  7249. vm._watchers.push(this);
  7250. // options
  7251. if (options) {
  7252. this.deep = !!options.deep;
  7253. this.user = !!options.user;
  7254. this.lazy = !!options.lazy;
  7255. this.sync = !!options.sync;
  7256. this.before = options.before;
  7257. } else {
  7258. this.deep = this.user = this.lazy = this.sync = false;
  7259. }
  7260. this.cb = cb;
  7261. this.id = ++uid$2; // uid for batching
  7262. this.active = true;
  7263. this.dirty = this.lazy; // for lazy watchers
  7264. this.deps = [];
  7265. this.newDeps = [];
  7266. this.depIds = new _Set();
  7267. this.newDepIds = new _Set();
  7268. this.expression = true
  7269. ? expOrFn.toString()
  7270. : undefined;
  7271. // parse expression for getter
  7272. if (typeof expOrFn === 'function') {
  7273. this.getter = expOrFn;
  7274. } else {
  7275. this.getter = parsePath(expOrFn);
  7276. if (!this.getter) {
  7277. this.getter = noop;
  7278. true && warn(
  7279. "Failed watching path: \"" + expOrFn + "\" " +
  7280. 'Watcher only accepts simple dot-delimited paths. ' +
  7281. 'For full control, use a function instead.',
  7282. vm
  7283. );
  7284. }
  7285. }
  7286. this.value = this.lazy
  7287. ? undefined
  7288. : this.get();
  7289. };
  7290. /**
  7291. * Evaluate the getter, and re-collect dependencies.
  7292. */
  7293. Watcher.prototype.get = function get () {
  7294. pushTarget(this);
  7295. var value;
  7296. var vm = this.vm;
  7297. try {
  7298. value = this.getter.call(vm, vm);
  7299. } catch (e) {
  7300. if (this.user) {
  7301. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7302. } else {
  7303. throw e
  7304. }
  7305. } finally {
  7306. // "touch" every property so they are all tracked as
  7307. // dependencies for deep watching
  7308. if (this.deep) {
  7309. traverse(value);
  7310. }
  7311. popTarget();
  7312. this.cleanupDeps();
  7313. }
  7314. return value
  7315. };
  7316. /**
  7317. * Add a dependency to this directive.
  7318. */
  7319. Watcher.prototype.addDep = function addDep (dep) {
  7320. var id = dep.id;
  7321. if (!this.newDepIds.has(id)) {
  7322. this.newDepIds.add(id);
  7323. this.newDeps.push(dep);
  7324. if (!this.depIds.has(id)) {
  7325. dep.addSub(this);
  7326. }
  7327. }
  7328. };
  7329. /**
  7330. * Clean up for dependency collection.
  7331. */
  7332. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7333. var i = this.deps.length;
  7334. while (i--) {
  7335. var dep = this.deps[i];
  7336. if (!this.newDepIds.has(dep.id)) {
  7337. dep.removeSub(this);
  7338. }
  7339. }
  7340. var tmp = this.depIds;
  7341. this.depIds = this.newDepIds;
  7342. this.newDepIds = tmp;
  7343. this.newDepIds.clear();
  7344. tmp = this.deps;
  7345. this.deps = this.newDeps;
  7346. this.newDeps = tmp;
  7347. this.newDeps.length = 0;
  7348. };
  7349. /**
  7350. * Subscriber interface.
  7351. * Will be called when a dependency changes.
  7352. */
  7353. Watcher.prototype.update = function update () {
  7354. /* istanbul ignore else */
  7355. if (this.lazy) {
  7356. this.dirty = true;
  7357. } else if (this.sync) {
  7358. this.run();
  7359. } else {
  7360. queueWatcher(this);
  7361. }
  7362. };
  7363. /**
  7364. * Scheduler job interface.
  7365. * Will be called by the scheduler.
  7366. */
  7367. Watcher.prototype.run = function run () {
  7368. if (this.active) {
  7369. var value = this.get();
  7370. if (
  7371. value !== this.value ||
  7372. // Deep watchers and watchers on Object/Arrays should fire even
  7373. // when the value is the same, because the value may
  7374. // have mutated.
  7375. isObject(value) ||
  7376. this.deep
  7377. ) {
  7378. // set new value
  7379. var oldValue = this.value;
  7380. this.value = value;
  7381. if (this.user) {
  7382. try {
  7383. this.cb.call(this.vm, value, oldValue);
  7384. } catch (e) {
  7385. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7386. }
  7387. } else {
  7388. this.cb.call(this.vm, value, oldValue);
  7389. }
  7390. }
  7391. }
  7392. };
  7393. /**
  7394. * Evaluate the value of the watcher.
  7395. * This only gets called for lazy watchers.
  7396. */
  7397. Watcher.prototype.evaluate = function evaluate () {
  7398. this.value = this.get();
  7399. this.dirty = false;
  7400. };
  7401. /**
  7402. * Depend on all deps collected by this watcher.
  7403. */
  7404. Watcher.prototype.depend = function depend () {
  7405. var i = this.deps.length;
  7406. while (i--) {
  7407. this.deps[i].depend();
  7408. }
  7409. };
  7410. /**
  7411. * Remove self from all dependencies' subscriber list.
  7412. */
  7413. Watcher.prototype.teardown = function teardown () {
  7414. if (this.active) {
  7415. // remove self from vm's watcher list
  7416. // this is a somewhat expensive operation so we skip it
  7417. // if the vm is being destroyed.
  7418. if (!this.vm._isBeingDestroyed) {
  7419. remove(this.vm._watchers, this);
  7420. }
  7421. var i = this.deps.length;
  7422. while (i--) {
  7423. this.deps[i].removeSub(this);
  7424. }
  7425. this.active = false;
  7426. }
  7427. };
  7428. /* */
  7429. var sharedPropertyDefinition = {
  7430. enumerable: true,
  7431. configurable: true,
  7432. get: noop,
  7433. set: noop
  7434. };
  7435. function proxy (target, sourceKey, key) {
  7436. sharedPropertyDefinition.get = function proxyGetter () {
  7437. return this[sourceKey][key]
  7438. };
  7439. sharedPropertyDefinition.set = function proxySetter (val) {
  7440. this[sourceKey][key] = val;
  7441. };
  7442. Object.defineProperty(target, key, sharedPropertyDefinition);
  7443. }
  7444. function initState (vm) {
  7445. vm._watchers = [];
  7446. var opts = vm.$options;
  7447. if (opts.props) { initProps(vm, opts.props); }
  7448. if (opts.methods) { initMethods(vm, opts.methods); }
  7449. if (opts.data) {
  7450. initData(vm);
  7451. } else {
  7452. observe(vm._data = {}, true /* asRootData */);
  7453. }
  7454. if (opts.computed) { initComputed(vm, opts.computed); }
  7455. if (opts.watch && opts.watch !== nativeWatch) {
  7456. initWatch(vm, opts.watch);
  7457. }
  7458. }
  7459. function initProps (vm, propsOptions) {
  7460. var propsData = vm.$options.propsData || {};
  7461. var props = vm._props = {};
  7462. // cache prop keys so that future props updates can iterate using Array
  7463. // instead of dynamic object key enumeration.
  7464. var keys = vm.$options._propKeys = [];
  7465. var isRoot = !vm.$parent;
  7466. // root instance props should be converted
  7467. if (!isRoot) {
  7468. toggleObserving(false);
  7469. }
  7470. var loop = function ( key ) {
  7471. keys.push(key);
  7472. var value = validateProp(key, propsOptions, propsData, vm);
  7473. /* istanbul ignore else */
  7474. if (true) {
  7475. var hyphenatedKey = hyphenate(key);
  7476. if (isReservedAttribute(hyphenatedKey) ||
  7477. config.isReservedAttr(hyphenatedKey)) {
  7478. warn(
  7479. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7480. vm
  7481. );
  7482. }
  7483. defineReactive$$1(props, key, value, function () {
  7484. if (!isRoot && !isUpdatingChildComponent) {
  7485. {
  7486. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7487. return
  7488. }
  7489. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7490. if(
  7491. key === 'value' &&
  7492. Array.isArray(vm.$options.behaviors) &&
  7493. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7494. ){
  7495. return
  7496. }
  7497. if(vm._getFormData){
  7498. return
  7499. }
  7500. var $parent = vm.$parent;
  7501. while($parent){
  7502. if($parent.__next_tick_pending){
  7503. return
  7504. }
  7505. $parent = $parent.$parent;
  7506. }
  7507. }
  7508. warn(
  7509. "Avoid mutating a prop directly since the value will be " +
  7510. "overwritten whenever the parent component re-renders. " +
  7511. "Instead, use a data or computed property based on the prop's " +
  7512. "value. Prop being mutated: \"" + key + "\"",
  7513. vm
  7514. );
  7515. }
  7516. });
  7517. } else {}
  7518. // static props are already proxied on the component's prototype
  7519. // during Vue.extend(). We only need to proxy props defined at
  7520. // instantiation here.
  7521. if (!(key in vm)) {
  7522. proxy(vm, "_props", key);
  7523. }
  7524. };
  7525. for (var key in propsOptions) loop( key );
  7526. toggleObserving(true);
  7527. }
  7528. function initData (vm) {
  7529. var data = vm.$options.data;
  7530. data = vm._data = typeof data === 'function'
  7531. ? getData(data, vm)
  7532. : data || {};
  7533. if (!isPlainObject(data)) {
  7534. data = {};
  7535. true && warn(
  7536. 'data functions should return an object:\n' +
  7537. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7538. vm
  7539. );
  7540. }
  7541. // proxy data on instance
  7542. var keys = Object.keys(data);
  7543. var props = vm.$options.props;
  7544. var methods = vm.$options.methods;
  7545. var i = keys.length;
  7546. while (i--) {
  7547. var key = keys[i];
  7548. if (true) {
  7549. if (methods && hasOwn(methods, key)) {
  7550. warn(
  7551. ("Method \"" + key + "\" has already been defined as a data property."),
  7552. vm
  7553. );
  7554. }
  7555. }
  7556. if (props && hasOwn(props, key)) {
  7557. true && warn(
  7558. "The data property \"" + key + "\" is already declared as a prop. " +
  7559. "Use prop default value instead.",
  7560. vm
  7561. );
  7562. } else if (!isReserved(key)) {
  7563. proxy(vm, "_data", key);
  7564. }
  7565. }
  7566. // observe data
  7567. observe(data, true /* asRootData */);
  7568. }
  7569. function getData (data, vm) {
  7570. // #7573 disable dep collection when invoking data getters
  7571. pushTarget();
  7572. try {
  7573. return data.call(vm, vm)
  7574. } catch (e) {
  7575. handleError(e, vm, "data()");
  7576. return {}
  7577. } finally {
  7578. popTarget();
  7579. }
  7580. }
  7581. var computedWatcherOptions = { lazy: true };
  7582. function initComputed (vm, computed) {
  7583. // $flow-disable-line
  7584. var watchers = vm._computedWatchers = Object.create(null);
  7585. // computed properties are just getters during SSR
  7586. var isSSR = isServerRendering();
  7587. for (var key in computed) {
  7588. var userDef = computed[key];
  7589. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7590. if ( true && getter == null) {
  7591. warn(
  7592. ("Getter is missing for computed property \"" + key + "\"."),
  7593. vm
  7594. );
  7595. }
  7596. if (!isSSR) {
  7597. // create internal watcher for the computed property.
  7598. watchers[key] = new Watcher(
  7599. vm,
  7600. getter || noop,
  7601. noop,
  7602. computedWatcherOptions
  7603. );
  7604. }
  7605. // component-defined computed properties are already defined on the
  7606. // component prototype. We only need to define computed properties defined
  7607. // at instantiation here.
  7608. if (!(key in vm)) {
  7609. defineComputed(vm, key, userDef);
  7610. } else if (true) {
  7611. if (key in vm.$data) {
  7612. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7613. } else if (vm.$options.props && key in vm.$options.props) {
  7614. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7615. }
  7616. }
  7617. }
  7618. }
  7619. function defineComputed (
  7620. target,
  7621. key,
  7622. userDef
  7623. ) {
  7624. var shouldCache = !isServerRendering();
  7625. if (typeof userDef === 'function') {
  7626. sharedPropertyDefinition.get = shouldCache
  7627. ? createComputedGetter(key)
  7628. : createGetterInvoker(userDef);
  7629. sharedPropertyDefinition.set = noop;
  7630. } else {
  7631. sharedPropertyDefinition.get = userDef.get
  7632. ? shouldCache && userDef.cache !== false
  7633. ? createComputedGetter(key)
  7634. : createGetterInvoker(userDef.get)
  7635. : noop;
  7636. sharedPropertyDefinition.set = userDef.set || noop;
  7637. }
  7638. if ( true &&
  7639. sharedPropertyDefinition.set === noop) {
  7640. sharedPropertyDefinition.set = function () {
  7641. warn(
  7642. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7643. this
  7644. );
  7645. };
  7646. }
  7647. Object.defineProperty(target, key, sharedPropertyDefinition);
  7648. }
  7649. function createComputedGetter (key) {
  7650. return function computedGetter () {
  7651. var watcher = this._computedWatchers && this._computedWatchers[key];
  7652. if (watcher) {
  7653. if (watcher.dirty) {
  7654. watcher.evaluate();
  7655. }
  7656. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7657. watcher.depend();
  7658. }
  7659. return watcher.value
  7660. }
  7661. }
  7662. }
  7663. function createGetterInvoker(fn) {
  7664. return function computedGetter () {
  7665. return fn.call(this, this)
  7666. }
  7667. }
  7668. function initMethods (vm, methods) {
  7669. var props = vm.$options.props;
  7670. for (var key in methods) {
  7671. if (true) {
  7672. if (typeof methods[key] !== 'function') {
  7673. warn(
  7674. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7675. "Did you reference the function correctly?",
  7676. vm
  7677. );
  7678. }
  7679. if (props && hasOwn(props, key)) {
  7680. warn(
  7681. ("Method \"" + key + "\" has already been defined as a prop."),
  7682. vm
  7683. );
  7684. }
  7685. if ((key in vm) && isReserved(key)) {
  7686. warn(
  7687. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7688. "Avoid defining component methods that start with _ or $."
  7689. );
  7690. }
  7691. }
  7692. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7693. }
  7694. }
  7695. function initWatch (vm, watch) {
  7696. for (var key in watch) {
  7697. var handler = watch[key];
  7698. if (Array.isArray(handler)) {
  7699. for (var i = 0; i < handler.length; i++) {
  7700. createWatcher(vm, key, handler[i]);
  7701. }
  7702. } else {
  7703. createWatcher(vm, key, handler);
  7704. }
  7705. }
  7706. }
  7707. function createWatcher (
  7708. vm,
  7709. expOrFn,
  7710. handler,
  7711. options
  7712. ) {
  7713. if (isPlainObject(handler)) {
  7714. options = handler;
  7715. handler = handler.handler;
  7716. }
  7717. if (typeof handler === 'string') {
  7718. handler = vm[handler];
  7719. }
  7720. return vm.$watch(expOrFn, handler, options)
  7721. }
  7722. function stateMixin (Vue) {
  7723. // flow somehow has problems with directly declared definition object
  7724. // when using Object.defineProperty, so we have to procedurally build up
  7725. // the object here.
  7726. var dataDef = {};
  7727. dataDef.get = function () { return this._data };
  7728. var propsDef = {};
  7729. propsDef.get = function () { return this._props };
  7730. if (true) {
  7731. dataDef.set = function () {
  7732. warn(
  7733. 'Avoid replacing instance root $data. ' +
  7734. 'Use nested data properties instead.',
  7735. this
  7736. );
  7737. };
  7738. propsDef.set = function () {
  7739. warn("$props is readonly.", this);
  7740. };
  7741. }
  7742. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7743. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7744. Vue.prototype.$set = set;
  7745. Vue.prototype.$delete = del;
  7746. Vue.prototype.$watch = function (
  7747. expOrFn,
  7748. cb,
  7749. options
  7750. ) {
  7751. var vm = this;
  7752. if (isPlainObject(cb)) {
  7753. return createWatcher(vm, expOrFn, cb, options)
  7754. }
  7755. options = options || {};
  7756. options.user = true;
  7757. var watcher = new Watcher(vm, expOrFn, cb, options);
  7758. if (options.immediate) {
  7759. try {
  7760. cb.call(vm, watcher.value);
  7761. } catch (error) {
  7762. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7763. }
  7764. }
  7765. return function unwatchFn () {
  7766. watcher.teardown();
  7767. }
  7768. };
  7769. }
  7770. /* */
  7771. var uid$3 = 0;
  7772. function initMixin (Vue) {
  7773. Vue.prototype._init = function (options) {
  7774. var vm = this;
  7775. // a uid
  7776. vm._uid = uid$3++;
  7777. var startTag, endTag;
  7778. /* istanbul ignore if */
  7779. if ( true && config.performance && mark) {
  7780. startTag = "vue-perf-start:" + (vm._uid);
  7781. endTag = "vue-perf-end:" + (vm._uid);
  7782. mark(startTag);
  7783. }
  7784. // a flag to avoid this being observed
  7785. vm._isVue = true;
  7786. // merge options
  7787. if (options && options._isComponent) {
  7788. // optimize internal component instantiation
  7789. // since dynamic options merging is pretty slow, and none of the
  7790. // internal component options needs special treatment.
  7791. initInternalComponent(vm, options);
  7792. } else {
  7793. vm.$options = mergeOptions(
  7794. resolveConstructorOptions(vm.constructor),
  7795. options || {},
  7796. vm
  7797. );
  7798. }
  7799. /* istanbul ignore else */
  7800. if (true) {
  7801. initProxy(vm);
  7802. } else {}
  7803. // expose real self
  7804. vm._self = vm;
  7805. initLifecycle(vm);
  7806. initEvents(vm);
  7807. initRender(vm);
  7808. callHook(vm, 'beforeCreate');
  7809. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7810. initState(vm);
  7811. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7812. !vm._$fallback && callHook(vm, 'created');
  7813. /* istanbul ignore if */
  7814. if ( true && config.performance && mark) {
  7815. vm._name = formatComponentName(vm, false);
  7816. mark(endTag);
  7817. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7818. }
  7819. if (vm.$options.el) {
  7820. vm.$mount(vm.$options.el);
  7821. }
  7822. };
  7823. }
  7824. function initInternalComponent (vm, options) {
  7825. var opts = vm.$options = Object.create(vm.constructor.options);
  7826. // doing this because it's faster than dynamic enumeration.
  7827. var parentVnode = options._parentVnode;
  7828. opts.parent = options.parent;
  7829. opts._parentVnode = parentVnode;
  7830. var vnodeComponentOptions = parentVnode.componentOptions;
  7831. opts.propsData = vnodeComponentOptions.propsData;
  7832. opts._parentListeners = vnodeComponentOptions.listeners;
  7833. opts._renderChildren = vnodeComponentOptions.children;
  7834. opts._componentTag = vnodeComponentOptions.tag;
  7835. if (options.render) {
  7836. opts.render = options.render;
  7837. opts.staticRenderFns = options.staticRenderFns;
  7838. }
  7839. }
  7840. function resolveConstructorOptions (Ctor) {
  7841. var options = Ctor.options;
  7842. if (Ctor.super) {
  7843. var superOptions = resolveConstructorOptions(Ctor.super);
  7844. var cachedSuperOptions = Ctor.superOptions;
  7845. if (superOptions !== cachedSuperOptions) {
  7846. // super option changed,
  7847. // need to resolve new options.
  7848. Ctor.superOptions = superOptions;
  7849. // check if there are any late-modified/attached options (#4976)
  7850. var modifiedOptions = resolveModifiedOptions(Ctor);
  7851. // update base extend options
  7852. if (modifiedOptions) {
  7853. extend(Ctor.extendOptions, modifiedOptions);
  7854. }
  7855. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7856. if (options.name) {
  7857. options.components[options.name] = Ctor;
  7858. }
  7859. }
  7860. }
  7861. return options
  7862. }
  7863. function resolveModifiedOptions (Ctor) {
  7864. var modified;
  7865. var latest = Ctor.options;
  7866. var sealed = Ctor.sealedOptions;
  7867. for (var key in latest) {
  7868. if (latest[key] !== sealed[key]) {
  7869. if (!modified) { modified = {}; }
  7870. modified[key] = latest[key];
  7871. }
  7872. }
  7873. return modified
  7874. }
  7875. function Vue (options) {
  7876. if ( true &&
  7877. !(this instanceof Vue)
  7878. ) {
  7879. warn('Vue is a constructor and should be called with the `new` keyword');
  7880. }
  7881. this._init(options);
  7882. }
  7883. initMixin(Vue);
  7884. stateMixin(Vue);
  7885. eventsMixin(Vue);
  7886. lifecycleMixin(Vue);
  7887. renderMixin(Vue);
  7888. /* */
  7889. function initUse (Vue) {
  7890. Vue.use = function (plugin) {
  7891. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7892. if (installedPlugins.indexOf(plugin) > -1) {
  7893. return this
  7894. }
  7895. // additional parameters
  7896. var args = toArray(arguments, 1);
  7897. args.unshift(this);
  7898. if (typeof plugin.install === 'function') {
  7899. plugin.install.apply(plugin, args);
  7900. } else if (typeof plugin === 'function') {
  7901. plugin.apply(null, args);
  7902. }
  7903. installedPlugins.push(plugin);
  7904. return this
  7905. };
  7906. }
  7907. /* */
  7908. function initMixin$1 (Vue) {
  7909. Vue.mixin = function (mixin) {
  7910. this.options = mergeOptions(this.options, mixin);
  7911. return this
  7912. };
  7913. }
  7914. /* */
  7915. function initExtend (Vue) {
  7916. /**
  7917. * Each instance constructor, including Vue, has a unique
  7918. * cid. This enables us to create wrapped "child
  7919. * constructors" for prototypal inheritance and cache them.
  7920. */
  7921. Vue.cid = 0;
  7922. var cid = 1;
  7923. /**
  7924. * Class inheritance
  7925. */
  7926. Vue.extend = function (extendOptions) {
  7927. extendOptions = extendOptions || {};
  7928. var Super = this;
  7929. var SuperId = Super.cid;
  7930. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7931. if (cachedCtors[SuperId]) {
  7932. return cachedCtors[SuperId]
  7933. }
  7934. var name = extendOptions.name || Super.options.name;
  7935. if ( true && name) {
  7936. validateComponentName(name);
  7937. }
  7938. var Sub = function VueComponent (options) {
  7939. this._init(options);
  7940. };
  7941. Sub.prototype = Object.create(Super.prototype);
  7942. Sub.prototype.constructor = Sub;
  7943. Sub.cid = cid++;
  7944. Sub.options = mergeOptions(
  7945. Super.options,
  7946. extendOptions
  7947. );
  7948. Sub['super'] = Super;
  7949. // For props and computed properties, we define the proxy getters on
  7950. // the Vue instances at extension time, on the extended prototype. This
  7951. // avoids Object.defineProperty calls for each instance created.
  7952. if (Sub.options.props) {
  7953. initProps$1(Sub);
  7954. }
  7955. if (Sub.options.computed) {
  7956. initComputed$1(Sub);
  7957. }
  7958. // allow further extension/mixin/plugin usage
  7959. Sub.extend = Super.extend;
  7960. Sub.mixin = Super.mixin;
  7961. Sub.use = Super.use;
  7962. // create asset registers, so extended classes
  7963. // can have their private assets too.
  7964. ASSET_TYPES.forEach(function (type) {
  7965. Sub[type] = Super[type];
  7966. });
  7967. // enable recursive self-lookup
  7968. if (name) {
  7969. Sub.options.components[name] = Sub;
  7970. }
  7971. // keep a reference to the super options at extension time.
  7972. // later at instantiation we can check if Super's options have
  7973. // been updated.
  7974. Sub.superOptions = Super.options;
  7975. Sub.extendOptions = extendOptions;
  7976. Sub.sealedOptions = extend({}, Sub.options);
  7977. // cache constructor
  7978. cachedCtors[SuperId] = Sub;
  7979. return Sub
  7980. };
  7981. }
  7982. function initProps$1 (Comp) {
  7983. var props = Comp.options.props;
  7984. for (var key in props) {
  7985. proxy(Comp.prototype, "_props", key);
  7986. }
  7987. }
  7988. function initComputed$1 (Comp) {
  7989. var computed = Comp.options.computed;
  7990. for (var key in computed) {
  7991. defineComputed(Comp.prototype, key, computed[key]);
  7992. }
  7993. }
  7994. /* */
  7995. function initAssetRegisters (Vue) {
  7996. /**
  7997. * Create asset registration methods.
  7998. */
  7999. ASSET_TYPES.forEach(function (type) {
  8000. Vue[type] = function (
  8001. id,
  8002. definition
  8003. ) {
  8004. if (!definition) {
  8005. return this.options[type + 's'][id]
  8006. } else {
  8007. /* istanbul ignore if */
  8008. if ( true && type === 'component') {
  8009. validateComponentName(id);
  8010. }
  8011. if (type === 'component' && isPlainObject(definition)) {
  8012. definition.name = definition.name || id;
  8013. definition = this.options._base.extend(definition);
  8014. }
  8015. if (type === 'directive' && typeof definition === 'function') {
  8016. definition = { bind: definition, update: definition };
  8017. }
  8018. this.options[type + 's'][id] = definition;
  8019. return definition
  8020. }
  8021. };
  8022. });
  8023. }
  8024. /* */
  8025. function getComponentName (opts) {
  8026. return opts && (opts.Ctor.options.name || opts.tag)
  8027. }
  8028. function matches (pattern, name) {
  8029. if (Array.isArray(pattern)) {
  8030. return pattern.indexOf(name) > -1
  8031. } else if (typeof pattern === 'string') {
  8032. return pattern.split(',').indexOf(name) > -1
  8033. } else if (isRegExp(pattern)) {
  8034. return pattern.test(name)
  8035. }
  8036. /* istanbul ignore next */
  8037. return false
  8038. }
  8039. function pruneCache (keepAliveInstance, filter) {
  8040. var cache = keepAliveInstance.cache;
  8041. var keys = keepAliveInstance.keys;
  8042. var _vnode = keepAliveInstance._vnode;
  8043. for (var key in cache) {
  8044. var cachedNode = cache[key];
  8045. if (cachedNode) {
  8046. var name = getComponentName(cachedNode.componentOptions);
  8047. if (name && !filter(name)) {
  8048. pruneCacheEntry(cache, key, keys, _vnode);
  8049. }
  8050. }
  8051. }
  8052. }
  8053. function pruneCacheEntry (
  8054. cache,
  8055. key,
  8056. keys,
  8057. current
  8058. ) {
  8059. var cached$$1 = cache[key];
  8060. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8061. cached$$1.componentInstance.$destroy();
  8062. }
  8063. cache[key] = null;
  8064. remove(keys, key);
  8065. }
  8066. var patternTypes = [String, RegExp, Array];
  8067. var KeepAlive = {
  8068. name: 'keep-alive',
  8069. abstract: true,
  8070. props: {
  8071. include: patternTypes,
  8072. exclude: patternTypes,
  8073. max: [String, Number]
  8074. },
  8075. created: function created () {
  8076. this.cache = Object.create(null);
  8077. this.keys = [];
  8078. },
  8079. destroyed: function destroyed () {
  8080. for (var key in this.cache) {
  8081. pruneCacheEntry(this.cache, key, this.keys);
  8082. }
  8083. },
  8084. mounted: function mounted () {
  8085. var this$1 = this;
  8086. this.$watch('include', function (val) {
  8087. pruneCache(this$1, function (name) { return matches(val, name); });
  8088. });
  8089. this.$watch('exclude', function (val) {
  8090. pruneCache(this$1, function (name) { return !matches(val, name); });
  8091. });
  8092. },
  8093. render: function render () {
  8094. var slot = this.$slots.default;
  8095. var vnode = getFirstComponentChild(slot);
  8096. var componentOptions = vnode && vnode.componentOptions;
  8097. if (componentOptions) {
  8098. // check pattern
  8099. var name = getComponentName(componentOptions);
  8100. var ref = this;
  8101. var include = ref.include;
  8102. var exclude = ref.exclude;
  8103. if (
  8104. // not included
  8105. (include && (!name || !matches(include, name))) ||
  8106. // excluded
  8107. (exclude && name && matches(exclude, name))
  8108. ) {
  8109. return vnode
  8110. }
  8111. var ref$1 = this;
  8112. var cache = ref$1.cache;
  8113. var keys = ref$1.keys;
  8114. var key = vnode.key == null
  8115. // same constructor may get registered as different local components
  8116. // so cid alone is not enough (#3269)
  8117. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8118. : vnode.key;
  8119. if (cache[key]) {
  8120. vnode.componentInstance = cache[key].componentInstance;
  8121. // make current key freshest
  8122. remove(keys, key);
  8123. keys.push(key);
  8124. } else {
  8125. cache[key] = vnode;
  8126. keys.push(key);
  8127. // prune oldest entry
  8128. if (this.max && keys.length > parseInt(this.max)) {
  8129. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8130. }
  8131. }
  8132. vnode.data.keepAlive = true;
  8133. }
  8134. return vnode || (slot && slot[0])
  8135. }
  8136. };
  8137. var builtInComponents = {
  8138. KeepAlive: KeepAlive
  8139. };
  8140. /* */
  8141. function initGlobalAPI (Vue) {
  8142. // config
  8143. var configDef = {};
  8144. configDef.get = function () { return config; };
  8145. if (true) {
  8146. configDef.set = function () {
  8147. warn(
  8148. 'Do not replace the Vue.config object, set individual fields instead.'
  8149. );
  8150. };
  8151. }
  8152. Object.defineProperty(Vue, 'config', configDef);
  8153. // exposed util methods.
  8154. // NOTE: these are not considered part of the public API - avoid relying on
  8155. // them unless you are aware of the risk.
  8156. Vue.util = {
  8157. warn: warn,
  8158. extend: extend,
  8159. mergeOptions: mergeOptions,
  8160. defineReactive: defineReactive$$1
  8161. };
  8162. Vue.set = set;
  8163. Vue.delete = del;
  8164. Vue.nextTick = nextTick;
  8165. // 2.6 explicit observable API
  8166. Vue.observable = function (obj) {
  8167. observe(obj);
  8168. return obj
  8169. };
  8170. Vue.options = Object.create(null);
  8171. ASSET_TYPES.forEach(function (type) {
  8172. Vue.options[type + 's'] = Object.create(null);
  8173. });
  8174. // this is used to identify the "base" constructor to extend all plain-object
  8175. // components with in Weex's multi-instance scenarios.
  8176. Vue.options._base = Vue;
  8177. extend(Vue.options.components, builtInComponents);
  8178. initUse(Vue);
  8179. initMixin$1(Vue);
  8180. initExtend(Vue);
  8181. initAssetRegisters(Vue);
  8182. }
  8183. initGlobalAPI(Vue);
  8184. Object.defineProperty(Vue.prototype, '$isServer', {
  8185. get: isServerRendering
  8186. });
  8187. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8188. get: function get () {
  8189. /* istanbul ignore next */
  8190. return this.$vnode && this.$vnode.ssrContext
  8191. }
  8192. });
  8193. // expose FunctionalRenderContext for ssr runtime helper installation
  8194. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8195. value: FunctionalRenderContext
  8196. });
  8197. Vue.version = '2.6.11';
  8198. /**
  8199. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8200. */
  8201. var ARRAYTYPE = '[object Array]';
  8202. var OBJECTTYPE = '[object Object]';
  8203. var NULLTYPE = '[object Null]';
  8204. var UNDEFINEDTYPE = '[object Undefined]';
  8205. // const FUNCTIONTYPE = '[object Function]'
  8206. function diff(current, pre) {
  8207. var result = {};
  8208. syncKeys(current, pre);
  8209. _diff(current, pre, '', result);
  8210. return result
  8211. }
  8212. function syncKeys(current, pre) {
  8213. if (current === pre) { return }
  8214. var rootCurrentType = type(current);
  8215. var rootPreType = type(pre);
  8216. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8217. if(Object.keys(current).length >= Object.keys(pre).length){
  8218. for (var key in pre) {
  8219. var currentValue = current[key];
  8220. if (currentValue === undefined) {
  8221. current[key] = null;
  8222. } else {
  8223. syncKeys(currentValue, pre[key]);
  8224. }
  8225. }
  8226. }
  8227. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8228. if (current.length >= pre.length) {
  8229. pre.forEach(function (item, index) {
  8230. syncKeys(current[index], item);
  8231. });
  8232. }
  8233. }
  8234. }
  8235. function nullOrUndefined(currentType, preType) {
  8236. if(
  8237. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8238. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8239. ) {
  8240. return false
  8241. }
  8242. return true
  8243. }
  8244. function _diff(current, pre, path, result) {
  8245. if (current === pre) { return }
  8246. var rootCurrentType = type(current);
  8247. var rootPreType = type(pre);
  8248. if (rootCurrentType == OBJECTTYPE) {
  8249. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8250. setResult(result, path, current);
  8251. } else {
  8252. var loop = function ( key ) {
  8253. var currentValue = current[key];
  8254. var preValue = pre[key];
  8255. var currentType = type(currentValue);
  8256. var preType = type(preValue);
  8257. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8258. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8259. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8260. }
  8261. } else if (currentType == ARRAYTYPE) {
  8262. if (preType != ARRAYTYPE) {
  8263. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8264. } else {
  8265. if (currentValue.length < preValue.length) {
  8266. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8267. } else {
  8268. currentValue.forEach(function (item, index) {
  8269. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8270. });
  8271. }
  8272. }
  8273. } else if (currentType == OBJECTTYPE) {
  8274. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8275. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8276. } else {
  8277. for (var subKey in currentValue) {
  8278. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8279. }
  8280. }
  8281. }
  8282. };
  8283. for (var key in current) loop( key );
  8284. }
  8285. } else if (rootCurrentType == ARRAYTYPE) {
  8286. if (rootPreType != ARRAYTYPE) {
  8287. setResult(result, path, current);
  8288. } else {
  8289. if (current.length < pre.length) {
  8290. setResult(result, path, current);
  8291. } else {
  8292. current.forEach(function (item, index) {
  8293. _diff(item, pre[index], path + '[' + index + ']', result);
  8294. });
  8295. }
  8296. }
  8297. } else {
  8298. setResult(result, path, current);
  8299. }
  8300. }
  8301. function setResult(result, k, v) {
  8302. // if (type(v) != FUNCTIONTYPE) {
  8303. result[k] = v;
  8304. // }
  8305. }
  8306. function type(obj) {
  8307. return Object.prototype.toString.call(obj)
  8308. }
  8309. /* */
  8310. function flushCallbacks$1(vm) {
  8311. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8312. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8313. var mpInstance = vm.$scope;
  8314. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8315. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8316. }
  8317. var copies = vm.__next_tick_callbacks.slice(0);
  8318. vm.__next_tick_callbacks.length = 0;
  8319. for (var i = 0; i < copies.length; i++) {
  8320. copies[i]();
  8321. }
  8322. }
  8323. }
  8324. function hasRenderWatcher(vm) {
  8325. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8326. }
  8327. function nextTick$1(vm, cb) {
  8328. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8329. //2.nextTick 之前存在 render watcher
  8330. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8331. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8332. var mpInstance = vm.$scope;
  8333. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8334. ']:nextVueTick');
  8335. }
  8336. return nextTick(cb, vm)
  8337. }else{
  8338. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8339. var mpInstance$1 = vm.$scope;
  8340. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8341. ']:nextMPTick');
  8342. }
  8343. }
  8344. var _resolve;
  8345. if (!vm.__next_tick_callbacks) {
  8346. vm.__next_tick_callbacks = [];
  8347. }
  8348. vm.__next_tick_callbacks.push(function () {
  8349. if (cb) {
  8350. try {
  8351. cb.call(vm);
  8352. } catch (e) {
  8353. handleError(e, vm, 'nextTick');
  8354. }
  8355. } else if (_resolve) {
  8356. _resolve(vm);
  8357. }
  8358. });
  8359. // $flow-disable-line
  8360. if (!cb && typeof Promise !== 'undefined') {
  8361. return new Promise(function (resolve) {
  8362. _resolve = resolve;
  8363. })
  8364. }
  8365. }
  8366. /* */
  8367. function clearInstance(key, value) {
  8368. // 简易去除 Vue 和小程序组件实例
  8369. if (value) {
  8370. if (value._isVue || value.__v_isMPComponent) {
  8371. return {}
  8372. }
  8373. }
  8374. return value
  8375. }
  8376. function cloneWithData(vm) {
  8377. // 确保当前 vm 所有数据被同步
  8378. var ret = Object.create(null);
  8379. var dataKeys = [].concat(
  8380. Object.keys(vm._data || {}),
  8381. Object.keys(vm._computedWatchers || {}));
  8382. dataKeys.reduce(function(ret, key) {
  8383. ret[key] = vm[key];
  8384. return ret
  8385. }, ret);
  8386. // vue-composition-api
  8387. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8388. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8389. if (rawBindings) {
  8390. Object.keys(rawBindings).forEach(function (key) {
  8391. ret[key] = vm[key];
  8392. });
  8393. }
  8394. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8395. Object.assign(ret, vm.$mp.data || {});
  8396. if (
  8397. Array.isArray(vm.$options.behaviors) &&
  8398. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8399. ) { //form-field
  8400. ret['name'] = vm.name;
  8401. ret['value'] = vm.value;
  8402. }
  8403. return JSON.parse(JSON.stringify(ret, clearInstance))
  8404. }
  8405. var patch = function(oldVnode, vnode) {
  8406. var this$1 = this;
  8407. if (vnode === null) { //destroy
  8408. return
  8409. }
  8410. if (this.mpType === 'page' || this.mpType === 'component') {
  8411. var mpInstance = this.$scope;
  8412. var data = Object.create(null);
  8413. try {
  8414. data = cloneWithData(this);
  8415. } catch (err) {
  8416. console.error(err);
  8417. }
  8418. data.__webviewId__ = mpInstance.data.__webviewId__;
  8419. var mpData = Object.create(null);
  8420. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8421. mpData[key] = mpInstance.data[key];
  8422. });
  8423. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8424. if (Object.keys(diffData).length) {
  8425. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8426. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8427. ']差量更新',
  8428. JSON.stringify(diffData));
  8429. }
  8430. this.__next_tick_pending = true;
  8431. mpInstance.setData(diffData, function () {
  8432. this$1.__next_tick_pending = false;
  8433. flushCallbacks$1(this$1);
  8434. });
  8435. } else {
  8436. flushCallbacks$1(this);
  8437. }
  8438. }
  8439. };
  8440. /* */
  8441. function createEmptyRender() {
  8442. }
  8443. function mountComponent$1(
  8444. vm,
  8445. el,
  8446. hydrating
  8447. ) {
  8448. if (!vm.mpType) {//main.js 中的 new Vue
  8449. return vm
  8450. }
  8451. if (vm.mpType === 'app') {
  8452. vm.$options.render = createEmptyRender;
  8453. }
  8454. if (!vm.$options.render) {
  8455. vm.$options.render = createEmptyRender;
  8456. if (true) {
  8457. /* istanbul ignore if */
  8458. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8459. vm.$options.el || el) {
  8460. warn(
  8461. 'You are using the runtime-only build of Vue where the template ' +
  8462. 'compiler is not available. Either pre-compile the templates into ' +
  8463. 'render functions, or use the compiler-included build.',
  8464. vm
  8465. );
  8466. } else {
  8467. warn(
  8468. 'Failed to mount component: template or render function not defined.',
  8469. vm
  8470. );
  8471. }
  8472. }
  8473. }
  8474. !vm._$fallback && callHook(vm, 'beforeMount');
  8475. var updateComponent = function () {
  8476. vm._update(vm._render(), hydrating);
  8477. };
  8478. // we set this to vm._watcher inside the watcher's constructor
  8479. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8480. // component's mounted hook), which relies on vm._watcher being already defined
  8481. new Watcher(vm, updateComponent, noop, {
  8482. before: function before() {
  8483. if (vm._isMounted && !vm._isDestroyed) {
  8484. callHook(vm, 'beforeUpdate');
  8485. }
  8486. }
  8487. }, true /* isRenderWatcher */);
  8488. hydrating = false;
  8489. return vm
  8490. }
  8491. /* */
  8492. function renderClass (
  8493. staticClass,
  8494. dynamicClass
  8495. ) {
  8496. if (isDef(staticClass) || isDef(dynamicClass)) {
  8497. return concat(staticClass, stringifyClass(dynamicClass))
  8498. }
  8499. /* istanbul ignore next */
  8500. return ''
  8501. }
  8502. function concat (a, b) {
  8503. return a ? b ? (a + ' ' + b) : a : (b || '')
  8504. }
  8505. function stringifyClass (value) {
  8506. if (Array.isArray(value)) {
  8507. return stringifyArray(value)
  8508. }
  8509. if (isObject(value)) {
  8510. return stringifyObject(value)
  8511. }
  8512. if (typeof value === 'string') {
  8513. return value
  8514. }
  8515. /* istanbul ignore next */
  8516. return ''
  8517. }
  8518. function stringifyArray (value) {
  8519. var res = '';
  8520. var stringified;
  8521. for (var i = 0, l = value.length; i < l; i++) {
  8522. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8523. if (res) { res += ' '; }
  8524. res += stringified;
  8525. }
  8526. }
  8527. return res
  8528. }
  8529. function stringifyObject (value) {
  8530. var res = '';
  8531. for (var key in value) {
  8532. if (value[key]) {
  8533. if (res) { res += ' '; }
  8534. res += key;
  8535. }
  8536. }
  8537. return res
  8538. }
  8539. /* */
  8540. var parseStyleText = cached(function (cssText) {
  8541. var res = {};
  8542. var listDelimiter = /;(?![^(]*\))/g;
  8543. var propertyDelimiter = /:(.+)/;
  8544. cssText.split(listDelimiter).forEach(function (item) {
  8545. if (item) {
  8546. var tmp = item.split(propertyDelimiter);
  8547. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8548. }
  8549. });
  8550. return res
  8551. });
  8552. // normalize possible array / string values into Object
  8553. function normalizeStyleBinding (bindingStyle) {
  8554. if (Array.isArray(bindingStyle)) {
  8555. return toObject(bindingStyle)
  8556. }
  8557. if (typeof bindingStyle === 'string') {
  8558. return parseStyleText(bindingStyle)
  8559. }
  8560. return bindingStyle
  8561. }
  8562. /* */
  8563. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8564. function getTarget(obj, path) {
  8565. var parts = path.split('.');
  8566. var key = parts[0];
  8567. if (key.indexOf('__$n') === 0) { //number index
  8568. key = parseInt(key.replace('__$n', ''));
  8569. }
  8570. if (parts.length === 1) {
  8571. return obj[key]
  8572. }
  8573. return getTarget(obj[key], parts.slice(1).join('.'))
  8574. }
  8575. function internalMixin(Vue) {
  8576. Vue.config.errorHandler = function(err, vm, info) {
  8577. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8578. console.error(err);
  8579. /* eslint-disable no-undef */
  8580. var app = typeof getApp === 'function' && getApp();
  8581. if (app && app.onError) {
  8582. app.onError(err);
  8583. }
  8584. };
  8585. var oldEmit = Vue.prototype.$emit;
  8586. Vue.prototype.$emit = function(event) {
  8587. if (this.$scope && event) {
  8588. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8589. if (triggerEvent) {
  8590. try {
  8591. triggerEvent.call(this.$scope, event, {
  8592. __args__: toArray(arguments, 1)
  8593. });
  8594. } catch (error) {
  8595. }
  8596. }
  8597. }
  8598. return oldEmit.apply(this, arguments)
  8599. };
  8600. Vue.prototype.$nextTick = function(fn) {
  8601. return nextTick$1(this, fn)
  8602. };
  8603. MP_METHODS.forEach(function (method) {
  8604. Vue.prototype[method] = function(args) {
  8605. if (this.$scope && this.$scope[method]) {
  8606. return this.$scope[method](args)
  8607. }
  8608. // mp-alipay
  8609. if (typeof my === 'undefined') {
  8610. return
  8611. }
  8612. if (method === 'createSelectorQuery') {
  8613. /* eslint-disable no-undef */
  8614. return my.createSelectorQuery(args)
  8615. } else if (method === 'createIntersectionObserver') {
  8616. /* eslint-disable no-undef */
  8617. return my.createIntersectionObserver(args)
  8618. }
  8619. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8620. };
  8621. });
  8622. Vue.prototype.__init_provide = initProvide;
  8623. Vue.prototype.__init_injections = initInjections;
  8624. Vue.prototype.__call_hook = function(hook, args) {
  8625. var vm = this;
  8626. // #7573 disable dep collection when invoking lifecycle hooks
  8627. pushTarget();
  8628. var handlers = vm.$options[hook];
  8629. var info = hook + " hook";
  8630. var ret;
  8631. if (handlers) {
  8632. for (var i = 0, j = handlers.length; i < j; i++) {
  8633. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8634. }
  8635. }
  8636. if (vm._hasHookEvent) {
  8637. vm.$emit('hook:' + hook, args);
  8638. }
  8639. popTarget();
  8640. return ret
  8641. };
  8642. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8643. if (Array.isArray(modifiers)) {
  8644. if (modifiers.indexOf('trim') !== -1) {
  8645. value = value.trim();
  8646. }
  8647. if (modifiers.indexOf('number') !== -1) {
  8648. value = this._n(value);
  8649. }
  8650. }
  8651. if (!target) {
  8652. target = this;
  8653. }
  8654. // 解决动态属性添加
  8655. Vue.set(target, key, value);
  8656. };
  8657. Vue.prototype.__set_sync = function(target, key, value) {
  8658. if (!target) {
  8659. target = this;
  8660. }
  8661. // 解决动态属性添加
  8662. Vue.set(target, key, value);
  8663. };
  8664. Vue.prototype.__get_orig = function(item) {
  8665. if (isPlainObject(item)) {
  8666. return item['$orig'] || item
  8667. }
  8668. return item
  8669. };
  8670. Vue.prototype.__get_value = function(dataPath, target) {
  8671. return getTarget(target || this, dataPath)
  8672. };
  8673. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8674. return renderClass(staticClass, dynamicClass)
  8675. };
  8676. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8677. if (!dynamicStyle && !staticStyle) {
  8678. return ''
  8679. }
  8680. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8681. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8682. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8683. };
  8684. Vue.prototype.__map = function(val, iteratee) {
  8685. //TODO 暂不考虑 string
  8686. var ret, i, l, keys, key;
  8687. if (Array.isArray(val)) {
  8688. ret = new Array(val.length);
  8689. for (i = 0, l = val.length; i < l; i++) {
  8690. ret[i] = iteratee(val[i], i);
  8691. }
  8692. return ret
  8693. } else if (isObject(val)) {
  8694. keys = Object.keys(val);
  8695. ret = Object.create(null);
  8696. for (i = 0, l = keys.length; i < l; i++) {
  8697. key = keys[i];
  8698. ret[key] = iteratee(val[key], key, i);
  8699. }
  8700. return ret
  8701. } else if (typeof val === 'number') {
  8702. ret = new Array(val);
  8703. for (i = 0, l = val; i < l; i++) {
  8704. // 第一个参数暂时仍和小程序一致
  8705. ret[i] = iteratee(i, i);
  8706. }
  8707. return ret
  8708. }
  8709. return []
  8710. };
  8711. }
  8712. /* */
  8713. var LIFECYCLE_HOOKS$1 = [
  8714. //App
  8715. 'onLaunch',
  8716. 'onShow',
  8717. 'onHide',
  8718. 'onUniNViewMessage',
  8719. 'onPageNotFound',
  8720. 'onThemeChange',
  8721. 'onError',
  8722. 'onUnhandledRejection',
  8723. //Page
  8724. 'onInit',
  8725. 'onLoad',
  8726. // 'onShow',
  8727. 'onReady',
  8728. // 'onHide',
  8729. 'onUnload',
  8730. 'onPullDownRefresh',
  8731. 'onReachBottom',
  8732. 'onTabItemTap',
  8733. 'onAddToFavorites',
  8734. 'onShareTimeline',
  8735. 'onShareAppMessage',
  8736. 'onResize',
  8737. 'onPageScroll',
  8738. 'onNavigationBarButtonTap',
  8739. 'onBackPress',
  8740. 'onNavigationBarSearchInputChanged',
  8741. 'onNavigationBarSearchInputConfirmed',
  8742. 'onNavigationBarSearchInputClicked',
  8743. //Component
  8744. // 'onReady', // 兼容旧版本,应该移除该事件
  8745. 'onPageShow',
  8746. 'onPageHide',
  8747. 'onPageResize',
  8748. 'onUploadDouyinVideo'
  8749. ];
  8750. function lifecycleMixin$1(Vue) {
  8751. //fixed vue-class-component
  8752. var oldExtend = Vue.extend;
  8753. Vue.extend = function(extendOptions) {
  8754. extendOptions = extendOptions || {};
  8755. var methods = extendOptions.methods;
  8756. if (methods) {
  8757. Object.keys(methods).forEach(function (methodName) {
  8758. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8759. extendOptions[methodName] = methods[methodName];
  8760. delete methods[methodName];
  8761. }
  8762. });
  8763. }
  8764. return oldExtend.call(this, extendOptions)
  8765. };
  8766. var strategies = Vue.config.optionMergeStrategies;
  8767. var mergeHook = strategies.created;
  8768. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8769. strategies[hook] = mergeHook;
  8770. });
  8771. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8772. }
  8773. /* */
  8774. // install platform patch function
  8775. Vue.prototype.__patch__ = patch;
  8776. // public mount method
  8777. Vue.prototype.$mount = function(
  8778. el ,
  8779. hydrating
  8780. ) {
  8781. return mountComponent$1(this, el, hydrating)
  8782. };
  8783. lifecycleMixin$1(Vue);
  8784. internalMixin(Vue);
  8785. /* */
  8786. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8787. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8788. /***/ }),
  8789. /* 26 */
  8790. /*!*********************************************!*\
  8791. !*** D:/code/work/broke_news_wx/pages.json ***!
  8792. \*********************************************/
  8793. /*! no static exports found */
  8794. /***/ (function(module, exports) {
  8795. /***/ }),
  8796. /* 27 */,
  8797. /* 28 */,
  8798. /* 29 */,
  8799. /* 30 */,
  8800. /* 31 */,
  8801. /* 32 */
  8802. /*!**********************************************************************************************************!*\
  8803. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8804. \**********************************************************************************************************/
  8805. /*! exports provided: default */
  8806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8807. "use strict";
  8808. __webpack_require__.r(__webpack_exports__);
  8809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8810. /* globals __VUE_SSR_CONTEXT__ */
  8811. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8812. // This module is a runtime utility for cleaner component module output and will
  8813. // be included in the final webpack user bundle.
  8814. function normalizeComponent (
  8815. scriptExports,
  8816. render,
  8817. staticRenderFns,
  8818. functionalTemplate,
  8819. injectStyles,
  8820. scopeId,
  8821. moduleIdentifier, /* server only */
  8822. shadowMode, /* vue-cli only */
  8823. components, // fixed by xxxxxx auto components
  8824. renderjs // fixed by xxxxxx renderjs
  8825. ) {
  8826. // Vue.extend constructor export interop
  8827. var options = typeof scriptExports === 'function'
  8828. ? scriptExports.options
  8829. : scriptExports
  8830. // fixed by xxxxxx auto components
  8831. if (components) {
  8832. if (!options.components) {
  8833. options.components = {}
  8834. }
  8835. var hasOwn = Object.prototype.hasOwnProperty
  8836. for (var name in components) {
  8837. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8838. options.components[name] = components[name]
  8839. }
  8840. }
  8841. }
  8842. // fixed by xxxxxx renderjs
  8843. if (renderjs) {
  8844. if(typeof renderjs.beforeCreate === 'function'){
  8845. renderjs.beforeCreate = [renderjs.beforeCreate]
  8846. }
  8847. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8848. this[renderjs.__module] = this
  8849. });
  8850. (options.mixins || (options.mixins = [])).push(renderjs)
  8851. }
  8852. // render functions
  8853. if (render) {
  8854. options.render = render
  8855. options.staticRenderFns = staticRenderFns
  8856. options._compiled = true
  8857. }
  8858. // functional template
  8859. if (functionalTemplate) {
  8860. options.functional = true
  8861. }
  8862. // scopedId
  8863. if (scopeId) {
  8864. options._scopeId = 'data-v-' + scopeId
  8865. }
  8866. var hook
  8867. if (moduleIdentifier) { // server build
  8868. hook = function (context) {
  8869. // 2.3 injection
  8870. context =
  8871. context || // cached call
  8872. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8873. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8874. // 2.2 with runInNewContext: true
  8875. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8876. context = __VUE_SSR_CONTEXT__
  8877. }
  8878. // inject component styles
  8879. if (injectStyles) {
  8880. injectStyles.call(this, context)
  8881. }
  8882. // register component module identifier for async chunk inferrence
  8883. if (context && context._registeredComponents) {
  8884. context._registeredComponents.add(moduleIdentifier)
  8885. }
  8886. }
  8887. // used by ssr in case component is cached and beforeCreate
  8888. // never gets called
  8889. options._ssrRegister = hook
  8890. } else if (injectStyles) {
  8891. hook = shadowMode
  8892. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8893. : injectStyles
  8894. }
  8895. if (hook) {
  8896. if (options.functional) {
  8897. // for template-only hot-reload because in that case the render fn doesn't
  8898. // go through the normalizer
  8899. options._injectStyles = hook
  8900. // register for functioal component in vue file
  8901. var originalRender = options.render
  8902. options.render = function renderWithStyleInjection (h, context) {
  8903. hook.call(context)
  8904. return originalRender(h, context)
  8905. }
  8906. } else {
  8907. // inject component registration as beforeCreate hook
  8908. var existing = options.beforeCreate
  8909. options.beforeCreate = existing
  8910. ? [].concat(existing, hook)
  8911. : [hook]
  8912. }
  8913. }
  8914. return {
  8915. exports: scriptExports,
  8916. options: options
  8917. }
  8918. }
  8919. /***/ }),
  8920. /* 33 */
  8921. /*!*************************************************!*\
  8922. !*** D:/code/work/broke_news_wx/store/index.js ***!
  8923. \*************************************************/
  8924. /*! no static exports found */
  8925. /***/ (function(module, exports, __webpack_require__) {
  8926. "use strict";
  8927. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8928. Object.defineProperty(exports, "__esModule", {
  8929. value: true
  8930. });
  8931. exports.default = void 0;
  8932. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  8933. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 34));
  8934. _vue.default.use(_vuex.default);
  8935. var files = __webpack_require__(35);
  8936. var modules = {
  8937. state: {},
  8938. mutations: {},
  8939. actions: {}
  8940. };
  8941. files.keys().forEach(function (key) {
  8942. Object.assign(modules.state, files(key)["state"]);
  8943. Object.assign(modules.mutations, files(key)["mutations"]);
  8944. Object.assign(modules.actions, files(key)["actions"]);
  8945. });
  8946. var store = new _vuex.default.Store(modules);
  8947. var _default = store;
  8948. exports.default = _default;
  8949. /***/ }),
  8950. /* 34 */
  8951. /*!**************************************************************************************!*\
  8952. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  8953. \**************************************************************************************/
  8954. /*! no static exports found */
  8955. /***/ (function(module, exports, __webpack_require__) {
  8956. "use strict";
  8957. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8958. * vuex v3.6.2
  8959. * (c) 2021 Evan You
  8960. * @license MIT
  8961. */
  8962. function applyMixin (Vue) {
  8963. var version = Number(Vue.version.split('.')[0]);
  8964. if (version >= 2) {
  8965. Vue.mixin({ beforeCreate: vuexInit });
  8966. } else {
  8967. // override init and inject vuex init procedure
  8968. // for 1.x backwards compatibility.
  8969. var _init = Vue.prototype._init;
  8970. Vue.prototype._init = function (options) {
  8971. if ( options === void 0 ) options = {};
  8972. options.init = options.init
  8973. ? [vuexInit].concat(options.init)
  8974. : vuexInit;
  8975. _init.call(this, options);
  8976. };
  8977. }
  8978. /**
  8979. * Vuex init hook, injected into each instances init hooks list.
  8980. */
  8981. function vuexInit () {
  8982. var options = this.$options;
  8983. // store injection
  8984. if (options.store) {
  8985. this.$store = typeof options.store === 'function'
  8986. ? options.store()
  8987. : options.store;
  8988. } else if (options.parent && options.parent.$store) {
  8989. this.$store = options.parent.$store;
  8990. }
  8991. }
  8992. }
  8993. var target = typeof window !== 'undefined'
  8994. ? window
  8995. : typeof global !== 'undefined'
  8996. ? global
  8997. : {};
  8998. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8999. function devtoolPlugin (store) {
  9000. if (!devtoolHook) { return }
  9001. store._devtoolHook = devtoolHook;
  9002. devtoolHook.emit('vuex:init', store);
  9003. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  9004. store.replaceState(targetState);
  9005. });
  9006. store.subscribe(function (mutation, state) {
  9007. devtoolHook.emit('vuex:mutation', mutation, state);
  9008. }, { prepend: true });
  9009. store.subscribeAction(function (action, state) {
  9010. devtoolHook.emit('vuex:action', action, state);
  9011. }, { prepend: true });
  9012. }
  9013. /**
  9014. * Get the first item that pass the test
  9015. * by second argument function
  9016. *
  9017. * @param {Array} list
  9018. * @param {Function} f
  9019. * @return {*}
  9020. */
  9021. function find (list, f) {
  9022. return list.filter(f)[0]
  9023. }
  9024. /**
  9025. * Deep copy the given object considering circular structure.
  9026. * This function caches all nested objects and its copies.
  9027. * If it detects circular structure, use cached copy to avoid infinite loop.
  9028. *
  9029. * @param {*} obj
  9030. * @param {Array<Object>} cache
  9031. * @return {*}
  9032. */
  9033. function deepCopy (obj, cache) {
  9034. if ( cache === void 0 ) cache = [];
  9035. // just return if obj is immutable value
  9036. if (obj === null || typeof obj !== 'object') {
  9037. return obj
  9038. }
  9039. // if obj is hit, it is in circular structure
  9040. var hit = find(cache, function (c) { return c.original === obj; });
  9041. if (hit) {
  9042. return hit.copy
  9043. }
  9044. var copy = Array.isArray(obj) ? [] : {};
  9045. // put the copy into cache at first
  9046. // because we want to refer it in recursive deepCopy
  9047. cache.push({
  9048. original: obj,
  9049. copy: copy
  9050. });
  9051. Object.keys(obj).forEach(function (key) {
  9052. copy[key] = deepCopy(obj[key], cache);
  9053. });
  9054. return copy
  9055. }
  9056. /**
  9057. * forEach for object
  9058. */
  9059. function forEachValue (obj, fn) {
  9060. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  9061. }
  9062. function isObject (obj) {
  9063. return obj !== null && typeof obj === 'object'
  9064. }
  9065. function isPromise (val) {
  9066. return val && typeof val.then === 'function'
  9067. }
  9068. function assert (condition, msg) {
  9069. if (!condition) { throw new Error(("[vuex] " + msg)) }
  9070. }
  9071. function partial (fn, arg) {
  9072. return function () {
  9073. return fn(arg)
  9074. }
  9075. }
  9076. // Base data struct for store's module, package with some attribute and method
  9077. var Module = function Module (rawModule, runtime) {
  9078. this.runtime = runtime;
  9079. // Store some children item
  9080. this._children = Object.create(null);
  9081. // Store the origin module object which passed by programmer
  9082. this._rawModule = rawModule;
  9083. var rawState = rawModule.state;
  9084. // Store the origin module's state
  9085. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  9086. };
  9087. var prototypeAccessors = { namespaced: { configurable: true } };
  9088. prototypeAccessors.namespaced.get = function () {
  9089. return !!this._rawModule.namespaced
  9090. };
  9091. Module.prototype.addChild = function addChild (key, module) {
  9092. this._children[key] = module;
  9093. };
  9094. Module.prototype.removeChild = function removeChild (key) {
  9095. delete this._children[key];
  9096. };
  9097. Module.prototype.getChild = function getChild (key) {
  9098. return this._children[key]
  9099. };
  9100. Module.prototype.hasChild = function hasChild (key) {
  9101. return key in this._children
  9102. };
  9103. Module.prototype.update = function update (rawModule) {
  9104. this._rawModule.namespaced = rawModule.namespaced;
  9105. if (rawModule.actions) {
  9106. this._rawModule.actions = rawModule.actions;
  9107. }
  9108. if (rawModule.mutations) {
  9109. this._rawModule.mutations = rawModule.mutations;
  9110. }
  9111. if (rawModule.getters) {
  9112. this._rawModule.getters = rawModule.getters;
  9113. }
  9114. };
  9115. Module.prototype.forEachChild = function forEachChild (fn) {
  9116. forEachValue(this._children, fn);
  9117. };
  9118. Module.prototype.forEachGetter = function forEachGetter (fn) {
  9119. if (this._rawModule.getters) {
  9120. forEachValue(this._rawModule.getters, fn);
  9121. }
  9122. };
  9123. Module.prototype.forEachAction = function forEachAction (fn) {
  9124. if (this._rawModule.actions) {
  9125. forEachValue(this._rawModule.actions, fn);
  9126. }
  9127. };
  9128. Module.prototype.forEachMutation = function forEachMutation (fn) {
  9129. if (this._rawModule.mutations) {
  9130. forEachValue(this._rawModule.mutations, fn);
  9131. }
  9132. };
  9133. Object.defineProperties( Module.prototype, prototypeAccessors );
  9134. var ModuleCollection = function ModuleCollection (rawRootModule) {
  9135. // register root module (Vuex.Store options)
  9136. this.register([], rawRootModule, false);
  9137. };
  9138. ModuleCollection.prototype.get = function get (path) {
  9139. return path.reduce(function (module, key) {
  9140. return module.getChild(key)
  9141. }, this.root)
  9142. };
  9143. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  9144. var module = this.root;
  9145. return path.reduce(function (namespace, key) {
  9146. module = module.getChild(key);
  9147. return namespace + (module.namespaced ? key + '/' : '')
  9148. }, '')
  9149. };
  9150. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  9151. update([], this.root, rawRootModule);
  9152. };
  9153. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  9154. var this$1 = this;
  9155. if ( runtime === void 0 ) runtime = true;
  9156. if ((true)) {
  9157. assertRawModule(path, rawModule);
  9158. }
  9159. var newModule = new Module(rawModule, runtime);
  9160. if (path.length === 0) {
  9161. this.root = newModule;
  9162. } else {
  9163. var parent = this.get(path.slice(0, -1));
  9164. parent.addChild(path[path.length - 1], newModule);
  9165. }
  9166. // register nested modules
  9167. if (rawModule.modules) {
  9168. forEachValue(rawModule.modules, function (rawChildModule, key) {
  9169. this$1.register(path.concat(key), rawChildModule, runtime);
  9170. });
  9171. }
  9172. };
  9173. ModuleCollection.prototype.unregister = function unregister (path) {
  9174. var parent = this.get(path.slice(0, -1));
  9175. var key = path[path.length - 1];
  9176. var child = parent.getChild(key);
  9177. if (!child) {
  9178. if ((true)) {
  9179. console.warn(
  9180. "[vuex] trying to unregister module '" + key + "', which is " +
  9181. "not registered"
  9182. );
  9183. }
  9184. return
  9185. }
  9186. if (!child.runtime) {
  9187. return
  9188. }
  9189. parent.removeChild(key);
  9190. };
  9191. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  9192. var parent = this.get(path.slice(0, -1));
  9193. var key = path[path.length - 1];
  9194. if (parent) {
  9195. return parent.hasChild(key)
  9196. }
  9197. return false
  9198. };
  9199. function update (path, targetModule, newModule) {
  9200. if ((true)) {
  9201. assertRawModule(path, newModule);
  9202. }
  9203. // update target module
  9204. targetModule.update(newModule);
  9205. // update nested modules
  9206. if (newModule.modules) {
  9207. for (var key in newModule.modules) {
  9208. if (!targetModule.getChild(key)) {
  9209. if ((true)) {
  9210. console.warn(
  9211. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  9212. 'manual reload is needed'
  9213. );
  9214. }
  9215. return
  9216. }
  9217. update(
  9218. path.concat(key),
  9219. targetModule.getChild(key),
  9220. newModule.modules[key]
  9221. );
  9222. }
  9223. }
  9224. }
  9225. var functionAssert = {
  9226. assert: function (value) { return typeof value === 'function'; },
  9227. expected: 'function'
  9228. };
  9229. var objectAssert = {
  9230. assert: function (value) { return typeof value === 'function' ||
  9231. (typeof value === 'object' && typeof value.handler === 'function'); },
  9232. expected: 'function or object with "handler" function'
  9233. };
  9234. var assertTypes = {
  9235. getters: functionAssert,
  9236. mutations: functionAssert,
  9237. actions: objectAssert
  9238. };
  9239. function assertRawModule (path, rawModule) {
  9240. Object.keys(assertTypes).forEach(function (key) {
  9241. if (!rawModule[key]) { return }
  9242. var assertOptions = assertTypes[key];
  9243. forEachValue(rawModule[key], function (value, type) {
  9244. assert(
  9245. assertOptions.assert(value),
  9246. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  9247. );
  9248. });
  9249. });
  9250. }
  9251. function makeAssertionMessage (path, key, type, value, expected) {
  9252. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  9253. if (path.length > 0) {
  9254. buf += " in module \"" + (path.join('.')) + "\"";
  9255. }
  9256. buf += " is " + (JSON.stringify(value)) + ".";
  9257. return buf
  9258. }
  9259. var Vue; // bind on install
  9260. var Store = function Store (options) {
  9261. var this$1 = this;
  9262. if ( options === void 0 ) options = {};
  9263. // Auto install if it is not done yet and `window` has `Vue`.
  9264. // To allow users to avoid auto-installation in some cases,
  9265. // this code should be placed here. See #731
  9266. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  9267. install(window.Vue);
  9268. }
  9269. if ((true)) {
  9270. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  9271. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  9272. assert(this instanceof Store, "store must be called with the new operator.");
  9273. }
  9274. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  9275. var strict = options.strict; if ( strict === void 0 ) strict = false;
  9276. // store internal state
  9277. this._committing = false;
  9278. this._actions = Object.create(null);
  9279. this._actionSubscribers = [];
  9280. this._mutations = Object.create(null);
  9281. this._wrappedGetters = Object.create(null);
  9282. this._modules = new ModuleCollection(options);
  9283. this._modulesNamespaceMap = Object.create(null);
  9284. this._subscribers = [];
  9285. this._watcherVM = new Vue();
  9286. this._makeLocalGettersCache = Object.create(null);
  9287. // bind commit and dispatch to self
  9288. var store = this;
  9289. var ref = this;
  9290. var dispatch = ref.dispatch;
  9291. var commit = ref.commit;
  9292. this.dispatch = function boundDispatch (type, payload) {
  9293. return dispatch.call(store, type, payload)
  9294. };
  9295. this.commit = function boundCommit (type, payload, options) {
  9296. return commit.call(store, type, payload, options)
  9297. };
  9298. // strict mode
  9299. this.strict = strict;
  9300. var state = this._modules.root.state;
  9301. // init root module.
  9302. // this also recursively registers all sub-modules
  9303. // and collects all module getters inside this._wrappedGetters
  9304. installModule(this, state, [], this._modules.root);
  9305. // initialize the store vm, which is responsible for the reactivity
  9306. // (also registers _wrappedGetters as computed properties)
  9307. resetStoreVM(this, state);
  9308. // apply plugins
  9309. plugins.forEach(function (plugin) { return plugin(this$1); });
  9310. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  9311. if (useDevtools) {
  9312. devtoolPlugin(this);
  9313. }
  9314. };
  9315. var prototypeAccessors$1 = { state: { configurable: true } };
  9316. prototypeAccessors$1.state.get = function () {
  9317. return this._vm._data.$$state
  9318. };
  9319. prototypeAccessors$1.state.set = function (v) {
  9320. if ((true)) {
  9321. assert(false, "use store.replaceState() to explicit replace store state.");
  9322. }
  9323. };
  9324. Store.prototype.commit = function commit (_type, _payload, _options) {
  9325. var this$1 = this;
  9326. // check object-style commit
  9327. var ref = unifyObjectStyle(_type, _payload, _options);
  9328. var type = ref.type;
  9329. var payload = ref.payload;
  9330. var options = ref.options;
  9331. var mutation = { type: type, payload: payload };
  9332. var entry = this._mutations[type];
  9333. if (!entry) {
  9334. if ((true)) {
  9335. console.error(("[vuex] unknown mutation type: " + type));
  9336. }
  9337. return
  9338. }
  9339. this._withCommit(function () {
  9340. entry.forEach(function commitIterator (handler) {
  9341. handler(payload);
  9342. });
  9343. });
  9344. this._subscribers
  9345. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9346. .forEach(function (sub) { return sub(mutation, this$1.state); });
  9347. if (
  9348. ( true) &&
  9349. options && options.silent
  9350. ) {
  9351. console.warn(
  9352. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  9353. 'Use the filter functionality in the vue-devtools'
  9354. );
  9355. }
  9356. };
  9357. Store.prototype.dispatch = function dispatch (_type, _payload) {
  9358. var this$1 = this;
  9359. // check object-style dispatch
  9360. var ref = unifyObjectStyle(_type, _payload);
  9361. var type = ref.type;
  9362. var payload = ref.payload;
  9363. var action = { type: type, payload: payload };
  9364. var entry = this._actions[type];
  9365. if (!entry) {
  9366. if ((true)) {
  9367. console.error(("[vuex] unknown action type: " + type));
  9368. }
  9369. return
  9370. }
  9371. try {
  9372. this._actionSubscribers
  9373. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9374. .filter(function (sub) { return sub.before; })
  9375. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9376. } catch (e) {
  9377. if ((true)) {
  9378. console.warn("[vuex] error in before action subscribers: ");
  9379. console.error(e);
  9380. }
  9381. }
  9382. var result = entry.length > 1
  9383. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9384. : entry[0](payload);
  9385. return new Promise(function (resolve, reject) {
  9386. result.then(function (res) {
  9387. try {
  9388. this$1._actionSubscribers
  9389. .filter(function (sub) { return sub.after; })
  9390. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9391. } catch (e) {
  9392. if ((true)) {
  9393. console.warn("[vuex] error in after action subscribers: ");
  9394. console.error(e);
  9395. }
  9396. }
  9397. resolve(res);
  9398. }, function (error) {
  9399. try {
  9400. this$1._actionSubscribers
  9401. .filter(function (sub) { return sub.error; })
  9402. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9403. } catch (e) {
  9404. if ((true)) {
  9405. console.warn("[vuex] error in error action subscribers: ");
  9406. console.error(e);
  9407. }
  9408. }
  9409. reject(error);
  9410. });
  9411. })
  9412. };
  9413. Store.prototype.subscribe = function subscribe (fn, options) {
  9414. return genericSubscribe(fn, this._subscribers, options)
  9415. };
  9416. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9417. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9418. return genericSubscribe(subs, this._actionSubscribers, options)
  9419. };
  9420. Store.prototype.watch = function watch (getter, cb, options) {
  9421. var this$1 = this;
  9422. if ((true)) {
  9423. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9424. }
  9425. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9426. };
  9427. Store.prototype.replaceState = function replaceState (state) {
  9428. var this$1 = this;
  9429. this._withCommit(function () {
  9430. this$1._vm._data.$$state = state;
  9431. });
  9432. };
  9433. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9434. if ( options === void 0 ) options = {};
  9435. if (typeof path === 'string') { path = [path]; }
  9436. if ((true)) {
  9437. assert(Array.isArray(path), "module path must be a string or an Array.");
  9438. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9439. }
  9440. this._modules.register(path, rawModule);
  9441. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9442. // reset store to update getters...
  9443. resetStoreVM(this, this.state);
  9444. };
  9445. Store.prototype.unregisterModule = function unregisterModule (path) {
  9446. var this$1 = this;
  9447. if (typeof path === 'string') { path = [path]; }
  9448. if ((true)) {
  9449. assert(Array.isArray(path), "module path must be a string or an Array.");
  9450. }
  9451. this._modules.unregister(path);
  9452. this._withCommit(function () {
  9453. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9454. Vue.delete(parentState, path[path.length - 1]);
  9455. });
  9456. resetStore(this);
  9457. };
  9458. Store.prototype.hasModule = function hasModule (path) {
  9459. if (typeof path === 'string') { path = [path]; }
  9460. if ((true)) {
  9461. assert(Array.isArray(path), "module path must be a string or an Array.");
  9462. }
  9463. return this._modules.isRegistered(path)
  9464. };
  9465. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  9466. this._modules.update(newOptions);
  9467. resetStore(this, true);
  9468. };
  9469. Store.prototype._withCommit = function _withCommit (fn) {
  9470. var committing = this._committing;
  9471. this._committing = true;
  9472. fn();
  9473. this._committing = committing;
  9474. };
  9475. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9476. function genericSubscribe (fn, subs, options) {
  9477. if (subs.indexOf(fn) < 0) {
  9478. options && options.prepend
  9479. ? subs.unshift(fn)
  9480. : subs.push(fn);
  9481. }
  9482. return function () {
  9483. var i = subs.indexOf(fn);
  9484. if (i > -1) {
  9485. subs.splice(i, 1);
  9486. }
  9487. }
  9488. }
  9489. function resetStore (store, hot) {
  9490. store._actions = Object.create(null);
  9491. store._mutations = Object.create(null);
  9492. store._wrappedGetters = Object.create(null);
  9493. store._modulesNamespaceMap = Object.create(null);
  9494. var state = store.state;
  9495. // init all modules
  9496. installModule(store, state, [], store._modules.root, true);
  9497. // reset vm
  9498. resetStoreVM(store, state, hot);
  9499. }
  9500. function resetStoreVM (store, state, hot) {
  9501. var oldVm = store._vm;
  9502. // bind store public getters
  9503. store.getters = {};
  9504. // reset local getters cache
  9505. store._makeLocalGettersCache = Object.create(null);
  9506. var wrappedGetters = store._wrappedGetters;
  9507. var computed = {};
  9508. forEachValue(wrappedGetters, function (fn, key) {
  9509. // use computed to leverage its lazy-caching mechanism
  9510. // direct inline function use will lead to closure preserving oldVm.
  9511. // using partial to return function with only arguments preserved in closure environment.
  9512. computed[key] = partial(fn, store);
  9513. Object.defineProperty(store.getters, key, {
  9514. get: function () { return store._vm[key]; },
  9515. enumerable: true // for local getters
  9516. });
  9517. });
  9518. // use a Vue instance to store the state tree
  9519. // suppress warnings just in case the user has added
  9520. // some funky global mixins
  9521. var silent = Vue.config.silent;
  9522. Vue.config.silent = true;
  9523. store._vm = new Vue({
  9524. data: {
  9525. $$state: state
  9526. },
  9527. computed: computed
  9528. });
  9529. Vue.config.silent = silent;
  9530. // enable strict mode for new vm
  9531. if (store.strict) {
  9532. enableStrictMode(store);
  9533. }
  9534. if (oldVm) {
  9535. if (hot) {
  9536. // dispatch changes in all subscribed watchers
  9537. // to force getter re-evaluation for hot reloading.
  9538. store._withCommit(function () {
  9539. oldVm._data.$$state = null;
  9540. });
  9541. }
  9542. Vue.nextTick(function () { return oldVm.$destroy(); });
  9543. }
  9544. }
  9545. function installModule (store, rootState, path, module, hot) {
  9546. var isRoot = !path.length;
  9547. var namespace = store._modules.getNamespace(path);
  9548. // register in namespace map
  9549. if (module.namespaced) {
  9550. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9551. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9552. }
  9553. store._modulesNamespaceMap[namespace] = module;
  9554. }
  9555. // set state
  9556. if (!isRoot && !hot) {
  9557. var parentState = getNestedState(rootState, path.slice(0, -1));
  9558. var moduleName = path[path.length - 1];
  9559. store._withCommit(function () {
  9560. if ((true)) {
  9561. if (moduleName in parentState) {
  9562. console.warn(
  9563. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9564. );
  9565. }
  9566. }
  9567. Vue.set(parentState, moduleName, module.state);
  9568. });
  9569. }
  9570. var local = module.context = makeLocalContext(store, namespace, path);
  9571. module.forEachMutation(function (mutation, key) {
  9572. var namespacedType = namespace + key;
  9573. registerMutation(store, namespacedType, mutation, local);
  9574. });
  9575. module.forEachAction(function (action, key) {
  9576. var type = action.root ? key : namespace + key;
  9577. var handler = action.handler || action;
  9578. registerAction(store, type, handler, local);
  9579. });
  9580. module.forEachGetter(function (getter, key) {
  9581. var namespacedType = namespace + key;
  9582. registerGetter(store, namespacedType, getter, local);
  9583. });
  9584. module.forEachChild(function (child, key) {
  9585. installModule(store, rootState, path.concat(key), child, hot);
  9586. });
  9587. }
  9588. /**
  9589. * make localized dispatch, commit, getters and state
  9590. * if there is no namespace, just use root ones
  9591. */
  9592. function makeLocalContext (store, namespace, path) {
  9593. var noNamespace = namespace === '';
  9594. var local = {
  9595. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9596. var args = unifyObjectStyle(_type, _payload, _options);
  9597. var payload = args.payload;
  9598. var options = args.options;
  9599. var type = args.type;
  9600. if (!options || !options.root) {
  9601. type = namespace + type;
  9602. if (( true) && !store._actions[type]) {
  9603. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9604. return
  9605. }
  9606. }
  9607. return store.dispatch(type, payload)
  9608. },
  9609. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9610. var args = unifyObjectStyle(_type, _payload, _options);
  9611. var payload = args.payload;
  9612. var options = args.options;
  9613. var type = args.type;
  9614. if (!options || !options.root) {
  9615. type = namespace + type;
  9616. if (( true) && !store._mutations[type]) {
  9617. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9618. return
  9619. }
  9620. }
  9621. store.commit(type, payload, options);
  9622. }
  9623. };
  9624. // getters and state object must be gotten lazily
  9625. // because they will be changed by vm update
  9626. Object.defineProperties(local, {
  9627. getters: {
  9628. get: noNamespace
  9629. ? function () { return store.getters; }
  9630. : function () { return makeLocalGetters(store, namespace); }
  9631. },
  9632. state: {
  9633. get: function () { return getNestedState(store.state, path); }
  9634. }
  9635. });
  9636. return local
  9637. }
  9638. function makeLocalGetters (store, namespace) {
  9639. if (!store._makeLocalGettersCache[namespace]) {
  9640. var gettersProxy = {};
  9641. var splitPos = namespace.length;
  9642. Object.keys(store.getters).forEach(function (type) {
  9643. // skip if the target getter is not match this namespace
  9644. if (type.slice(0, splitPos) !== namespace) { return }
  9645. // extract local getter type
  9646. var localType = type.slice(splitPos);
  9647. // Add a port to the getters proxy.
  9648. // Define as getter property because
  9649. // we do not want to evaluate the getters in this time.
  9650. Object.defineProperty(gettersProxy, localType, {
  9651. get: function () { return store.getters[type]; },
  9652. enumerable: true
  9653. });
  9654. });
  9655. store._makeLocalGettersCache[namespace] = gettersProxy;
  9656. }
  9657. return store._makeLocalGettersCache[namespace]
  9658. }
  9659. function registerMutation (store, type, handler, local) {
  9660. var entry = store._mutations[type] || (store._mutations[type] = []);
  9661. entry.push(function wrappedMutationHandler (payload) {
  9662. handler.call(store, local.state, payload);
  9663. });
  9664. }
  9665. function registerAction (store, type, handler, local) {
  9666. var entry = store._actions[type] || (store._actions[type] = []);
  9667. entry.push(function wrappedActionHandler (payload) {
  9668. var res = handler.call(store, {
  9669. dispatch: local.dispatch,
  9670. commit: local.commit,
  9671. getters: local.getters,
  9672. state: local.state,
  9673. rootGetters: store.getters,
  9674. rootState: store.state
  9675. }, payload);
  9676. if (!isPromise(res)) {
  9677. res = Promise.resolve(res);
  9678. }
  9679. if (store._devtoolHook) {
  9680. return res.catch(function (err) {
  9681. store._devtoolHook.emit('vuex:error', err);
  9682. throw err
  9683. })
  9684. } else {
  9685. return res
  9686. }
  9687. });
  9688. }
  9689. function registerGetter (store, type, rawGetter, local) {
  9690. if (store._wrappedGetters[type]) {
  9691. if ((true)) {
  9692. console.error(("[vuex] duplicate getter key: " + type));
  9693. }
  9694. return
  9695. }
  9696. store._wrappedGetters[type] = function wrappedGetter (store) {
  9697. return rawGetter(
  9698. local.state, // local state
  9699. local.getters, // local getters
  9700. store.state, // root state
  9701. store.getters // root getters
  9702. )
  9703. };
  9704. }
  9705. function enableStrictMode (store) {
  9706. store._vm.$watch(function () { return this._data.$$state }, function () {
  9707. if ((true)) {
  9708. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  9709. }
  9710. }, { deep: true, sync: true });
  9711. }
  9712. function getNestedState (state, path) {
  9713. return path.reduce(function (state, key) { return state[key]; }, state)
  9714. }
  9715. function unifyObjectStyle (type, payload, options) {
  9716. if (isObject(type) && type.type) {
  9717. options = payload;
  9718. payload = type;
  9719. type = type.type;
  9720. }
  9721. if ((true)) {
  9722. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  9723. }
  9724. return { type: type, payload: payload, options: options }
  9725. }
  9726. function install (_Vue) {
  9727. if (Vue && _Vue === Vue) {
  9728. if ((true)) {
  9729. console.error(
  9730. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  9731. );
  9732. }
  9733. return
  9734. }
  9735. Vue = _Vue;
  9736. applyMixin(Vue);
  9737. }
  9738. /**
  9739. * Reduce the code which written in Vue.js for getting the state.
  9740. * @param {String} [namespace] - Module's namespace
  9741. * @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.
  9742. * @param {Object}
  9743. */
  9744. var mapState = normalizeNamespace(function (namespace, states) {
  9745. var res = {};
  9746. if (( true) && !isValidMap(states)) {
  9747. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  9748. }
  9749. normalizeMap(states).forEach(function (ref) {
  9750. var key = ref.key;
  9751. var val = ref.val;
  9752. res[key] = function mappedState () {
  9753. var state = this.$store.state;
  9754. var getters = this.$store.getters;
  9755. if (namespace) {
  9756. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  9757. if (!module) {
  9758. return
  9759. }
  9760. state = module.context.state;
  9761. getters = module.context.getters;
  9762. }
  9763. return typeof val === 'function'
  9764. ? val.call(this, state, getters)
  9765. : state[val]
  9766. };
  9767. // mark vuex getter for devtools
  9768. res[key].vuex = true;
  9769. });
  9770. return res
  9771. });
  9772. /**
  9773. * Reduce the code which written in Vue.js for committing the mutation
  9774. * @param {String} [namespace] - Module's namespace
  9775. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9776. * @return {Object}
  9777. */
  9778. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  9779. var res = {};
  9780. if (( true) && !isValidMap(mutations)) {
  9781. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  9782. }
  9783. normalizeMap(mutations).forEach(function (ref) {
  9784. var key = ref.key;
  9785. var val = ref.val;
  9786. res[key] = function mappedMutation () {
  9787. var args = [], len = arguments.length;
  9788. while ( len-- ) args[ len ] = arguments[ len ];
  9789. // Get the commit method from store
  9790. var commit = this.$store.commit;
  9791. if (namespace) {
  9792. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  9793. if (!module) {
  9794. return
  9795. }
  9796. commit = module.context.commit;
  9797. }
  9798. return typeof val === 'function'
  9799. ? val.apply(this, [commit].concat(args))
  9800. : commit.apply(this.$store, [val].concat(args))
  9801. };
  9802. });
  9803. return res
  9804. });
  9805. /**
  9806. * Reduce the code which written in Vue.js for getting the getters
  9807. * @param {String} [namespace] - Module's namespace
  9808. * @param {Object|Array} getters
  9809. * @return {Object}
  9810. */
  9811. var mapGetters = normalizeNamespace(function (namespace, getters) {
  9812. var res = {};
  9813. if (( true) && !isValidMap(getters)) {
  9814. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  9815. }
  9816. normalizeMap(getters).forEach(function (ref) {
  9817. var key = ref.key;
  9818. var val = ref.val;
  9819. // The namespace has been mutated by normalizeNamespace
  9820. val = namespace + val;
  9821. res[key] = function mappedGetter () {
  9822. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  9823. return
  9824. }
  9825. if (( true) && !(val in this.$store.getters)) {
  9826. console.error(("[vuex] unknown getter: " + val));
  9827. return
  9828. }
  9829. return this.$store.getters[val]
  9830. };
  9831. // mark vuex getter for devtools
  9832. res[key].vuex = true;
  9833. });
  9834. return res
  9835. });
  9836. /**
  9837. * Reduce the code which written in Vue.js for dispatch the action
  9838. * @param {String} [namespace] - Module's namespace
  9839. * @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.
  9840. * @return {Object}
  9841. */
  9842. var mapActions = normalizeNamespace(function (namespace, actions) {
  9843. var res = {};
  9844. if (( true) && !isValidMap(actions)) {
  9845. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  9846. }
  9847. normalizeMap(actions).forEach(function (ref) {
  9848. var key = ref.key;
  9849. var val = ref.val;
  9850. res[key] = function mappedAction () {
  9851. var args = [], len = arguments.length;
  9852. while ( len-- ) args[ len ] = arguments[ len ];
  9853. // get dispatch function from store
  9854. var dispatch = this.$store.dispatch;
  9855. if (namespace) {
  9856. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  9857. if (!module) {
  9858. return
  9859. }
  9860. dispatch = module.context.dispatch;
  9861. }
  9862. return typeof val === 'function'
  9863. ? val.apply(this, [dispatch].concat(args))
  9864. : dispatch.apply(this.$store, [val].concat(args))
  9865. };
  9866. });
  9867. return res
  9868. });
  9869. /**
  9870. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  9871. * @param {String} namespace
  9872. * @return {Object}
  9873. */
  9874. var createNamespacedHelpers = function (namespace) { return ({
  9875. mapState: mapState.bind(null, namespace),
  9876. mapGetters: mapGetters.bind(null, namespace),
  9877. mapMutations: mapMutations.bind(null, namespace),
  9878. mapActions: mapActions.bind(null, namespace)
  9879. }); };
  9880. /**
  9881. * Normalize the map
  9882. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  9883. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  9884. * @param {Array|Object} map
  9885. * @return {Object}
  9886. */
  9887. function normalizeMap (map) {
  9888. if (!isValidMap(map)) {
  9889. return []
  9890. }
  9891. return Array.isArray(map)
  9892. ? map.map(function (key) { return ({ key: key, val: key }); })
  9893. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  9894. }
  9895. /**
  9896. * Validate whether given map is valid or not
  9897. * @param {*} map
  9898. * @return {Boolean}
  9899. */
  9900. function isValidMap (map) {
  9901. return Array.isArray(map) || isObject(map)
  9902. }
  9903. /**
  9904. * 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.
  9905. * @param {Function} fn
  9906. * @return {Function}
  9907. */
  9908. function normalizeNamespace (fn) {
  9909. return function (namespace, map) {
  9910. if (typeof namespace !== 'string') {
  9911. map = namespace;
  9912. namespace = '';
  9913. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  9914. namespace += '/';
  9915. }
  9916. return fn(namespace, map)
  9917. }
  9918. }
  9919. /**
  9920. * Search a special module from store by namespace. if module not exist, print error message.
  9921. * @param {Object} store
  9922. * @param {String} helper
  9923. * @param {String} namespace
  9924. * @return {Object}
  9925. */
  9926. function getModuleByNamespace (store, helper, namespace) {
  9927. var module = store._modulesNamespaceMap[namespace];
  9928. if (( true) && !module) {
  9929. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  9930. }
  9931. return module
  9932. }
  9933. // Credits: borrowed code from fcomb/redux-logger
  9934. function createLogger (ref) {
  9935. if ( ref === void 0 ) ref = {};
  9936. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  9937. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  9938. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  9939. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  9940. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  9941. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  9942. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  9943. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  9944. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  9945. return function (store) {
  9946. var prevState = deepCopy(store.state);
  9947. if (typeof logger === 'undefined') {
  9948. return
  9949. }
  9950. if (logMutations) {
  9951. store.subscribe(function (mutation, state) {
  9952. var nextState = deepCopy(state);
  9953. if (filter(mutation, prevState, nextState)) {
  9954. var formattedTime = getFormattedTime();
  9955. var formattedMutation = mutationTransformer(mutation);
  9956. var message = "mutation " + (mutation.type) + formattedTime;
  9957. startMessage(logger, message, collapsed);
  9958. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  9959. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  9960. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  9961. endMessage(logger);
  9962. }
  9963. prevState = nextState;
  9964. });
  9965. }
  9966. if (logActions) {
  9967. store.subscribeAction(function (action, state) {
  9968. if (actionFilter(action, state)) {
  9969. var formattedTime = getFormattedTime();
  9970. var formattedAction = actionTransformer(action);
  9971. var message = "action " + (action.type) + formattedTime;
  9972. startMessage(logger, message, collapsed);
  9973. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  9974. endMessage(logger);
  9975. }
  9976. });
  9977. }
  9978. }
  9979. }
  9980. function startMessage (logger, message, collapsed) {
  9981. var startMessage = collapsed
  9982. ? logger.groupCollapsed
  9983. : logger.group;
  9984. // render
  9985. try {
  9986. startMessage.call(logger, message);
  9987. } catch (e) {
  9988. logger.log(message);
  9989. }
  9990. }
  9991. function endMessage (logger) {
  9992. try {
  9993. logger.groupEnd();
  9994. } catch (e) {
  9995. logger.log('—— log end ——');
  9996. }
  9997. }
  9998. function getFormattedTime () {
  9999. var time = new Date();
  10000. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  10001. }
  10002. function repeat (str, times) {
  10003. return (new Array(times + 1)).join(str)
  10004. }
  10005. function pad (num, maxLength) {
  10006. return repeat('0', maxLength - num.toString().length) + num
  10007. }
  10008. var index_cjs = {
  10009. Store: Store,
  10010. install: install,
  10011. version: '3.6.2',
  10012. mapState: mapState,
  10013. mapMutations: mapMutations,
  10014. mapGetters: mapGetters,
  10015. mapActions: mapActions,
  10016. createNamespacedHelpers: createNamespacedHelpers,
  10017. createLogger: createLogger
  10018. };
  10019. module.exports = index_cjs;
  10020. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  10021. /***/ }),
  10022. /* 35 */
  10023. /*!************************************************************************!*\
  10024. !*** D:/code/work/broke_news_wx/store/modules sync nonrecursive \.js$ ***!
  10025. \************************************************************************/
  10026. /*! no static exports found */
  10027. /***/ (function(module, exports, __webpack_require__) {
  10028. var map = {
  10029. "./user.js": 36
  10030. };
  10031. function webpackContext(req) {
  10032. var id = webpackContextResolve(req);
  10033. return __webpack_require__(id);
  10034. }
  10035. function webpackContextResolve(req) {
  10036. if(!__webpack_require__.o(map, req)) {
  10037. var e = new Error("Cannot find module '" + req + "'");
  10038. e.code = 'MODULE_NOT_FOUND';
  10039. throw e;
  10040. }
  10041. return map[req];
  10042. }
  10043. webpackContext.keys = function webpackContextKeys() {
  10044. return Object.keys(map);
  10045. };
  10046. webpackContext.resolve = webpackContextResolve;
  10047. module.exports = webpackContext;
  10048. webpackContext.id = 35;
  10049. /***/ }),
  10050. /* 36 */
  10051. /*!********************************************************!*\
  10052. !*** D:/code/work/broke_news_wx/store/modules/user.js ***!
  10053. \********************************************************/
  10054. /*! no static exports found */
  10055. /***/ (function(module, exports, __webpack_require__) {
  10056. "use strict";
  10057. Object.defineProperty(exports, "__esModule", {
  10058. value: true
  10059. });
  10060. exports.state = exports.mutations = exports.actions = void 0;
  10061. var state = {
  10062. //用户数据
  10063. userInfo: {
  10064. phone: '',
  10065. name: ''
  10066. }
  10067. };
  10068. exports.state = state;
  10069. var mutations = {
  10070. //储存用户信息
  10071. setUserInfo: function setUserInfo(state, data) {
  10072. if (data) {
  10073. state.userInfo = Object.assign({}, state.userInfo, data);
  10074. }
  10075. },
  10076. emptyUserInfo: function emptyUserInfo(state) {
  10077. state.userInfo = {};
  10078. } // 退出A
  10079. };
  10080. exports.mutations = mutations;
  10081. var actions = {};
  10082. exports.actions = actions;
  10083. /***/ }),
  10084. /* 37 */
  10085. /*!********************************************************!*\
  10086. !*** D:/code/work/broke_news_wx/js_sdk/share/index.js ***!
  10087. \********************************************************/
  10088. /*! no static exports found */
  10089. /***/ (function(module, exports, __webpack_require__) {
  10090. "use strict";
  10091. Object.defineProperty(exports, "__esModule", {
  10092. value: true
  10093. });
  10094. exports.default = void 0;
  10095. // uniapp -> 小程序分享能力
  10096. var _default = {
  10097. data: function data() {
  10098. return {
  10099. //设置默认的分享参数
  10100. share: {
  10101. share_title: '快报嗨享平台',
  10102. share_path: '/pages/index/index',
  10103. share_imageUrl: '',
  10104. share_desc: '',
  10105. share_content: ''
  10106. }
  10107. };
  10108. },
  10109. onShareAppMessage: function onShareAppMessage(res) {
  10110. return {
  10111. // title: this.share.share_title,
  10112. // path: this.share.share_path,
  10113. // imageUrl: this.share.share_imageUrl,
  10114. // desc: this.share.share_desc,
  10115. // content: this.share.share_content,
  10116. // success(res) {
  10117. // uni.showToast({
  10118. // title: '分享成功'
  10119. // })
  10120. // },
  10121. // fail(res) {
  10122. // uni.showToast({
  10123. // title: '分享失败',
  10124. // icon: 'none'
  10125. // })
  10126. // }
  10127. };
  10128. },
  10129. //分享到朋友圈
  10130. onShareTimeline: function onShareTimeline(res) {
  10131. return {
  10132. // title: this.share.share_title,
  10133. // type: 0,
  10134. // summary: "",
  10135. };
  10136. }
  10137. };
  10138. exports.default = _default;
  10139. /***/ }),
  10140. /* 38 */,
  10141. /* 39 */,
  10142. /* 40 */,
  10143. /* 41 */,
  10144. /* 42 */,
  10145. /* 43 */,
  10146. /* 44 */
  10147. /*!************************************************************************************************!*\
  10148. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  10149. \************************************************************************************************/
  10150. /*! no static exports found */
  10151. /***/ (function(module, exports, __webpack_require__) {
  10152. // TODO(Babel 8): Remove this file.
  10153. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 45)();
  10154. module.exports = runtime;
  10155. /***/ }),
  10156. /* 45 */
  10157. /*!*******************************************************************!*\
  10158. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  10159. \*******************************************************************/
  10160. /*! no static exports found */
  10161. /***/ (function(module, exports, __webpack_require__) {
  10162. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  10163. function _regeneratorRuntime() {
  10164. "use strict";
  10165. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  10166. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  10167. return exports;
  10168. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10169. var exports = {},
  10170. Op = Object.prototype,
  10171. hasOwn = Op.hasOwnProperty,
  10172. defineProperty = Object.defineProperty || function (obj, key, desc) {
  10173. obj[key] = desc.value;
  10174. },
  10175. $Symbol = "function" == typeof Symbol ? Symbol : {},
  10176. iteratorSymbol = $Symbol.iterator || "@@iterator",
  10177. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  10178. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  10179. function define(obj, key, value) {
  10180. return Object.defineProperty(obj, key, {
  10181. value: value,
  10182. enumerable: !0,
  10183. configurable: !0,
  10184. writable: !0
  10185. }), obj[key];
  10186. }
  10187. try {
  10188. define({}, "");
  10189. } catch (err) {
  10190. define = function define(obj, key, value) {
  10191. return obj[key] = value;
  10192. };
  10193. }
  10194. function wrap(innerFn, outerFn, self, tryLocsList) {
  10195. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  10196. generator = Object.create(protoGenerator.prototype),
  10197. context = new Context(tryLocsList || []);
  10198. return defineProperty(generator, "_invoke", {
  10199. value: makeInvokeMethod(innerFn, self, context)
  10200. }), generator;
  10201. }
  10202. function tryCatch(fn, obj, arg) {
  10203. try {
  10204. return {
  10205. type: "normal",
  10206. arg: fn.call(obj, arg)
  10207. };
  10208. } catch (err) {
  10209. return {
  10210. type: "throw",
  10211. arg: err
  10212. };
  10213. }
  10214. }
  10215. exports.wrap = wrap;
  10216. var ContinueSentinel = {};
  10217. function Generator() {}
  10218. function GeneratorFunction() {}
  10219. function GeneratorFunctionPrototype() {}
  10220. var IteratorPrototype = {};
  10221. define(IteratorPrototype, iteratorSymbol, function () {
  10222. return this;
  10223. });
  10224. var getProto = Object.getPrototypeOf,
  10225. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  10226. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  10227. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  10228. function defineIteratorMethods(prototype) {
  10229. ["next", "throw", "return"].forEach(function (method) {
  10230. define(prototype, method, function (arg) {
  10231. return this._invoke(method, arg);
  10232. });
  10233. });
  10234. }
  10235. function AsyncIterator(generator, PromiseImpl) {
  10236. function invoke(method, arg, resolve, reject) {
  10237. var record = tryCatch(generator[method], generator, arg);
  10238. if ("throw" !== record.type) {
  10239. var result = record.arg,
  10240. value = result.value;
  10241. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  10242. invoke("next", value, resolve, reject);
  10243. }, function (err) {
  10244. invoke("throw", err, resolve, reject);
  10245. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  10246. result.value = unwrapped, resolve(result);
  10247. }, function (error) {
  10248. return invoke("throw", error, resolve, reject);
  10249. });
  10250. }
  10251. reject(record.arg);
  10252. }
  10253. var previousPromise;
  10254. defineProperty(this, "_invoke", {
  10255. value: function value(method, arg) {
  10256. function callInvokeWithMethodAndArg() {
  10257. return new PromiseImpl(function (resolve, reject) {
  10258. invoke(method, arg, resolve, reject);
  10259. });
  10260. }
  10261. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  10262. }
  10263. });
  10264. }
  10265. function makeInvokeMethod(innerFn, self, context) {
  10266. var state = "suspendedStart";
  10267. return function (method, arg) {
  10268. if ("executing" === state) throw new Error("Generator is already running");
  10269. if ("completed" === state) {
  10270. if ("throw" === method) throw arg;
  10271. return doneResult();
  10272. }
  10273. for (context.method = method, context.arg = arg;;) {
  10274. var delegate = context.delegate;
  10275. if (delegate) {
  10276. var delegateResult = maybeInvokeDelegate(delegate, context);
  10277. if (delegateResult) {
  10278. if (delegateResult === ContinueSentinel) continue;
  10279. return delegateResult;
  10280. }
  10281. }
  10282. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  10283. if ("suspendedStart" === state) throw state = "completed", context.arg;
  10284. context.dispatchException(context.arg);
  10285. } else "return" === context.method && context.abrupt("return", context.arg);
  10286. state = "executing";
  10287. var record = tryCatch(innerFn, self, context);
  10288. if ("normal" === record.type) {
  10289. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  10290. return {
  10291. value: record.arg,
  10292. done: context.done
  10293. };
  10294. }
  10295. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  10296. }
  10297. };
  10298. }
  10299. function maybeInvokeDelegate(delegate, context) {
  10300. var methodName = context.method,
  10301. method = delegate.iterator[methodName];
  10302. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  10303. var record = tryCatch(method, delegate.iterator, context.arg);
  10304. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  10305. var info = record.arg;
  10306. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  10307. }
  10308. function pushTryEntry(locs) {
  10309. var entry = {
  10310. tryLoc: locs[0]
  10311. };
  10312. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  10313. }
  10314. function resetTryEntry(entry) {
  10315. var record = entry.completion || {};
  10316. record.type = "normal", delete record.arg, entry.completion = record;
  10317. }
  10318. function Context(tryLocsList) {
  10319. this.tryEntries = [{
  10320. tryLoc: "root"
  10321. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  10322. }
  10323. function values(iterable) {
  10324. if (iterable) {
  10325. var iteratorMethod = iterable[iteratorSymbol];
  10326. if (iteratorMethod) return iteratorMethod.call(iterable);
  10327. if ("function" == typeof iterable.next) return iterable;
  10328. if (!isNaN(iterable.length)) {
  10329. var i = -1,
  10330. next = function next() {
  10331. for (; ++i < iterable.length;) {
  10332. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  10333. }
  10334. return next.value = undefined, next.done = !0, next;
  10335. };
  10336. return next.next = next;
  10337. }
  10338. }
  10339. return {
  10340. next: doneResult
  10341. };
  10342. }
  10343. function doneResult() {
  10344. return {
  10345. value: undefined,
  10346. done: !0
  10347. };
  10348. }
  10349. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  10350. value: GeneratorFunctionPrototype,
  10351. configurable: !0
  10352. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  10353. value: GeneratorFunction,
  10354. configurable: !0
  10355. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  10356. var ctor = "function" == typeof genFun && genFun.constructor;
  10357. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  10358. }, exports.mark = function (genFun) {
  10359. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  10360. }, exports.awrap = function (arg) {
  10361. return {
  10362. __await: arg
  10363. };
  10364. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  10365. return this;
  10366. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  10367. void 0 === PromiseImpl && (PromiseImpl = Promise);
  10368. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  10369. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  10370. return result.done ? result.value : iter.next();
  10371. });
  10372. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  10373. return this;
  10374. }), define(Gp, "toString", function () {
  10375. return "[object Generator]";
  10376. }), exports.keys = function (val) {
  10377. var object = Object(val),
  10378. keys = [];
  10379. for (var key in object) {
  10380. keys.push(key);
  10381. }
  10382. return keys.reverse(), function next() {
  10383. for (; keys.length;) {
  10384. var key = keys.pop();
  10385. if (key in object) return next.value = key, next.done = !1, next;
  10386. }
  10387. return next.done = !0, next;
  10388. };
  10389. }, exports.values = values, Context.prototype = {
  10390. constructor: Context,
  10391. reset: function reset(skipTempReset) {
  10392. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  10393. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  10394. }
  10395. },
  10396. stop: function stop() {
  10397. this.done = !0;
  10398. var rootRecord = this.tryEntries[0].completion;
  10399. if ("throw" === rootRecord.type) throw rootRecord.arg;
  10400. return this.rval;
  10401. },
  10402. dispatchException: function dispatchException(exception) {
  10403. if (this.done) throw exception;
  10404. var context = this;
  10405. function handle(loc, caught) {
  10406. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  10407. }
  10408. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10409. var entry = this.tryEntries[i],
  10410. record = entry.completion;
  10411. if ("root" === entry.tryLoc) return handle("end");
  10412. if (entry.tryLoc <= this.prev) {
  10413. var hasCatch = hasOwn.call(entry, "catchLoc"),
  10414. hasFinally = hasOwn.call(entry, "finallyLoc");
  10415. if (hasCatch && hasFinally) {
  10416. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  10417. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  10418. } else if (hasCatch) {
  10419. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  10420. } else {
  10421. if (!hasFinally) throw new Error("try statement without catch or finally");
  10422. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  10423. }
  10424. }
  10425. }
  10426. },
  10427. abrupt: function abrupt(type, arg) {
  10428. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10429. var entry = this.tryEntries[i];
  10430. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  10431. var finallyEntry = entry;
  10432. break;
  10433. }
  10434. }
  10435. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  10436. var record = finallyEntry ? finallyEntry.completion : {};
  10437. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  10438. },
  10439. complete: function complete(record, afterLoc) {
  10440. if ("throw" === record.type) throw record.arg;
  10441. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  10442. },
  10443. finish: function finish(finallyLoc) {
  10444. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10445. var entry = this.tryEntries[i];
  10446. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  10447. }
  10448. },
  10449. "catch": function _catch(tryLoc) {
  10450. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10451. var entry = this.tryEntries[i];
  10452. if (entry.tryLoc === tryLoc) {
  10453. var record = entry.completion;
  10454. if ("throw" === record.type) {
  10455. var thrown = record.arg;
  10456. resetTryEntry(entry);
  10457. }
  10458. return thrown;
  10459. }
  10460. }
  10461. throw new Error("illegal catch attempt");
  10462. },
  10463. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  10464. return this.delegate = {
  10465. iterator: values(iterable),
  10466. resultName: resultName,
  10467. nextLoc: nextLoc
  10468. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  10469. }
  10470. }, exports;
  10471. }
  10472. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10473. /***/ }),
  10474. /* 46 */
  10475. /*!*****************************************************************!*\
  10476. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  10477. \*****************************************************************/
  10478. /*! no static exports found */
  10479. /***/ (function(module, exports) {
  10480. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  10481. try {
  10482. var info = gen[key](arg);
  10483. var value = info.value;
  10484. } catch (error) {
  10485. reject(error);
  10486. return;
  10487. }
  10488. if (info.done) {
  10489. resolve(value);
  10490. } else {
  10491. Promise.resolve(value).then(_next, _throw);
  10492. }
  10493. }
  10494. function _asyncToGenerator(fn) {
  10495. return function () {
  10496. var self = this,
  10497. args = arguments;
  10498. return new Promise(function (resolve, reject) {
  10499. var gen = fn.apply(self, args);
  10500. function _next(value) {
  10501. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  10502. }
  10503. function _throw(err) {
  10504. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  10505. }
  10506. _next(undefined);
  10507. });
  10508. };
  10509. }
  10510. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10511. /***/ }),
  10512. /* 47 */
  10513. /*!*************************************************!*\
  10514. !*** D:/code/work/broke_news_wx/network/api.js ***!
  10515. \*************************************************/
  10516. /*! no static exports found */
  10517. /***/ (function(module, exports, __webpack_require__) {
  10518. "use strict";
  10519. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10520. Object.defineProperty(exports, "__esModule", {
  10521. value: true
  10522. });
  10523. exports.uploadMediaFile = exports.saveClue = exports.getMobile = exports.getClueById = exports.findUserAuth = exports.findPage = void 0;
  10524. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  10525. var _http = __webpack_require__(/*! ./http.js */ 48);
  10526. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  10527. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  10528. //上传素材
  10529. var uploadMediaFile = function uploadMediaFile(data) {
  10530. return (0, _http.uploadFile)(_objectSpread({
  10531. url: '/cmsback/api/clue/uploadMediaFile'
  10532. }, data));
  10533. };
  10534. //发布报料
  10535. exports.uploadMediaFile = uploadMediaFile;
  10536. var saveClue = function saveClue(data) {
  10537. return (0, _http.myRequest)({
  10538. url: '/cmsback/api/clue/save',
  10539. method: 'POST',
  10540. data: data
  10541. });
  10542. };
  10543. //报料广场
  10544. exports.saveClue = saveClue;
  10545. var findPage = function findPage(data) {
  10546. return (0, _http.myRequest)({
  10547. url: '/cmsback/api/clue/findPage',
  10548. method: 'POST',
  10549. data: data
  10550. });
  10551. };
  10552. //查看线索详情
  10553. exports.findPage = findPage;
  10554. var getClueById = function getClueById(id) {
  10555. return (0, _http.myRequest)({
  10556. url: "/cmsback/api/clue/getClueById/".concat(id),
  10557. method: 'GET'
  10558. });
  10559. };
  10560. //获取手机号码
  10561. exports.getClueById = getClueById;
  10562. var getMobile = function getMobile(data) {
  10563. return (0, _http.myRequest)({
  10564. url: '/cmsback/api/clue/findMobile',
  10565. method: "POST",
  10566. data: data
  10567. });
  10568. };
  10569. //获取用户权限
  10570. exports.getMobile = getMobile;
  10571. var findUserAuth = function findUserAuth(data) {
  10572. return (0, _http.myRequest)({
  10573. url: '/cmsback/api/clue/checkAuth',
  10574. method: 'GET',
  10575. data: data
  10576. });
  10577. };
  10578. exports.findUserAuth = findUserAuth;
  10579. /***/ }),
  10580. /* 48 */
  10581. /*!**************************************************!*\
  10582. !*** D:/code/work/broke_news_wx/network/http.js ***!
  10583. \**************************************************/
  10584. /*! no static exports found */
  10585. /***/ (function(module, exports, __webpack_require__) {
  10586. "use strict";
  10587. /* WEBPACK VAR INJECTION */(function(uni) {
  10588. Object.defineProperty(exports, "__esModule", {
  10589. value: true
  10590. });
  10591. exports.uploadFile = exports.myRequest = void 0;
  10592. var _config = __webpack_require__(/*! ../utils/config.js */ 49);
  10593. // const baseURL = 'https://console.sxtvs.com.cn'
  10594. var baseURL = 'https://baoliao.sxtvs.net';
  10595. var myRequest = function myRequest(options) {
  10596. uni.showLoading({
  10597. title: '加载中...'
  10598. });
  10599. return new Promise(function (resolve, reject) {
  10600. uni.request({
  10601. url: "".concat(baseURL).concat(options.url),
  10602. //接口地址:前缀+方法中传入的地址
  10603. method: options.method || 'GET',
  10604. //请求方法:传入的方法或者默认是“GET”
  10605. data: options.data || {},
  10606. //传递参数:传入的参数或者默认传递空集合
  10607. header: {
  10608. 'tenantId': _config.config.tenantId
  10609. },
  10610. success: function success(res) {
  10611. //返回的数据(不固定,看后端接口,这里是做了一个判断,如果不为true,用uni.showToast方法提示获取数据失败)
  10612. // if (res.data.success != true) {
  10613. // return uni.showToast({
  10614. // title: '获取数据失败',
  10615. // icon: 'none'
  10616. // })
  10617. // }
  10618. // 如果不满足上述判断就输出数据
  10619. uni.hideLoading();
  10620. resolve(res);
  10621. },
  10622. // 这里的接口请求,如果出现问题就输出接口请求失败
  10623. fail: function fail(err) {
  10624. uni.hideLoading();
  10625. console.log(err);
  10626. reject(err);
  10627. }
  10628. });
  10629. });
  10630. };
  10631. //上传文件
  10632. exports.myRequest = myRequest;
  10633. var uploadFile = function uploadFile(options) {
  10634. uni.showLoading({
  10635. title: '加载中...'
  10636. });
  10637. return new Promise(function (resolve, reject) {
  10638. console.log(options);
  10639. uni.uploadFile({
  10640. url: "".concat(baseURL).concat(options.url),
  10641. name: 'file',
  10642. fileType: options.fileType,
  10643. filePath: options.filePath,
  10644. // 文件
  10645. formData: options.formData,
  10646. // 除文件外其他所有数据,传对象,会默认转换为 FormData
  10647. header: {
  10648. 'tenantId': _config.config.tenantId
  10649. },
  10650. success: function success(res) {
  10651. uni.hideLoading();
  10652. resolve(JSON.parse(res.data));
  10653. },
  10654. // 这里的接口请求,如果出现问题就输出接口请求失败
  10655. fail: function fail(err) {
  10656. uni.hideLoading();
  10657. console.log(err);
  10658. reject(err);
  10659. }
  10660. });
  10661. });
  10662. };
  10663. exports.uploadFile = uploadFile;
  10664. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10665. /***/ }),
  10666. /* 49 */
  10667. /*!**************************************************!*\
  10668. !*** D:/code/work/broke_news_wx/utils/config.js ***!
  10669. \**************************************************/
  10670. /*! no static exports found */
  10671. /***/ (function(module, exports, __webpack_require__) {
  10672. "use strict";
  10673. Object.defineProperty(exports, "__esModule", {
  10674. value: true
  10675. });
  10676. exports.config = void 0;
  10677. var config = {
  10678. cmc_group_url: "",
  10679. public_key: "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+1/AVZ8ngWzh+lF6O2niL594SI0G0ac++a7ZfaUl6Qn4CiaY5Wk4T2ljqt4zaBVecWEP/HD1gaIzh/Swjc6SmbxGddElTtrmU5UwXYwlys+oU5husvzA+Um6vFWU5umE1tvnt2S4CBijBrY+iM0/67oZNDnR/1CKMRpZwtDNR5QIDAQAB-----END PUBLIC KEY-----",
  10680. geetest_js_url: "/gt.js",
  10681. vaptcha_js_url: "/v3.js",
  10682. oauth_login_url: "/lr/login/oauth-login",
  10683. local_login_url: "/lr/login/local-login",
  10684. local_logout_url: "/lr/login/login-out",
  10685. local_reg_url: "/lr/reg/local-reguser",
  10686. reset_user_pwd_url: "/gu/user/reset-user-pwd",
  10687. send_mobile_code_message_url: "/vcode-server/send-mobile-vcode",
  10688. first_login_url: '/lr/login/first-login',
  10689. login_duration: 3 * 24 * 60 * 60,
  10690. session_storage_key: "cmc_login_session_storage",
  10691. agreement_url: "/agreement.html",
  10692. ip_location_url: "/ip/api/index?ip=&type=0",
  10693. multiTenantLogin: true,
  10694. multi_tenant_login_url: "/lr/login/multi-tenant-login",
  10695. broke_enws_baoliao_righi: {
  10696. All_List: "33628ed877bf589f50806fd7f8235d08",
  10697. AuditedList: "088fdda97c1779587e135978c012611f",
  10698. Reply: "db9c6764be89713ee823d51ff741e391",
  10699. Audit: "ca00f0116a153e249861505386170e6f"
  10700. },
  10701. tenantId: 'dcfc7ff84dd717c9713049d205f113be',
  10702. BMapKey: 'tIRoQn8nup0e5zCKgcy4MGditGy9xu3K'
  10703. };
  10704. // window.configs = config
  10705. exports.config = config;
  10706. /***/ }),
  10707. /* 50 */,
  10708. /* 51 */,
  10709. /* 52 */,
  10710. /* 53 */,
  10711. /* 54 */,
  10712. /* 55 */,
  10713. /* 56 */,
  10714. /* 57 */,
  10715. /* 58 */,
  10716. /* 59 */,
  10717. /* 60 */,
  10718. /* 61 */,
  10719. /* 62 */,
  10720. /* 63 */,
  10721. /* 64 */,
  10722. /* 65 */,
  10723. /* 66 */,
  10724. /* 67 */,
  10725. /* 68 */,
  10726. /* 69 */,
  10727. /* 70 */,
  10728. /* 71 */,
  10729. /* 72 */,
  10730. /* 73 */,
  10731. /* 74 */,
  10732. /* 75 */,
  10733. /* 76 */,
  10734. /* 77 */,
  10735. /* 78 */,
  10736. /* 79 */,
  10737. /* 80 */,
  10738. /* 81 */,
  10739. /* 82 */,
  10740. /* 83 */,
  10741. /* 84 */,
  10742. /* 85 */,
  10743. /* 86 */,
  10744. /* 87 */,
  10745. /* 88 */,
  10746. /* 89 */,
  10747. /* 90 */,
  10748. /* 91 */,
  10749. /* 92 */
  10750. /*!***********************************************!*\
  10751. !*** D:/code/work/broke_news_wx/utils/rsa.js ***!
  10752. \***********************************************/
  10753. /*! no static exports found */
  10754. /***/ (function(module, exports, __webpack_require__) {
  10755. "use strict";
  10756. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10757. Object.defineProperty(exports, "__esModule", {
  10758. value: true
  10759. });
  10760. exports.rsaEncrypt = rsaEncrypt;
  10761. var _jsencrypt = _interopRequireDefault(__webpack_require__(/*! @/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.vue */ 93));
  10762. // import JSEncrypt from './jsencrypt.js';
  10763. // 加密公钥
  10764. var key = "\n\t-----BEGIN PUBLIC KEY-----\n\tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDvUWs2UiUj8quRyePoTXZLlK+Q\n\tvWnyPLgsvYdZedfwQIK4DYdkYwqMHvuPAc1xYjtMqegGpF8cmMpnz3w32zB1ESWx\n\tPXWYZETytDmRp4BUyA4usmVLA0Z9SwDEURDyjrJSdBuKqeid3fMk6C+3YmI/kxvP\n\t/rj9Oj+LX9YaMUKgqwIDAQAB\n\t-----END PUBLIC KEY-----\n";
  10765. // 加密
  10766. // 此加密公钥不能含有 '_' '-'字符串 参考:https://www.codenong.com/jsc71374f48fb3/
  10767. function rsaEncrypt(msg) {
  10768. var encryptMsg = _jsencrypt.default.setEncrypt(key, msg);
  10769. return encryptMsg;
  10770. }
  10771. //超长字符加密 支持汉字加密
  10772. // var ArrayData=jsencrypt.setLongEncrypt(key,"超长字符加密支持汉字加密");
  10773. /***/ }),
  10774. /* 93 */,
  10775. /* 94 */,
  10776. /* 95 */,
  10777. /* 96 */,
  10778. /* 97 */,
  10779. /* 98 */
  10780. /*!**********************************************************************************!*\
  10781. !*** D:/code/work/broke_news_wx/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js ***!
  10782. \**********************************************************************************/
  10783. /*! no static exports found */
  10784. /***/ (function(module, exports, __webpack_require__) {
  10785. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  10786. var CryptoJS = CryptoJS || function (a, b) {
  10787. var c, e, f, g, h, i, j, k, l, m, n, o, q;
  10788. if (!c && "undefined" != typeof global && global.crypto && (c = global.crypto), !c && "function" == "function") try {
  10789. c = __webpack_require__(/*! crypto */ 99);
  10790. } catch (d) {}
  10791. return e = function e() {
  10792. if (c) {
  10793. if ("function" == typeof c.getRandomValues) try {
  10794. return c.getRandomValues(new Uint32Array(1))[0];
  10795. } catch (a) {}
  10796. if ("function" == typeof c.randomBytes) try {
  10797. return c.randomBytes(4).readInt32LE();
  10798. } catch (a) {}
  10799. }
  10800. throw new Error("Native crypto module could not be used to get secure random number.");
  10801. }, f = Object.create || function () {
  10802. function a() {}
  10803. return function (b) {
  10804. var c;
  10805. return a.prototype = b, c = new a(), a.prototype = null, c;
  10806. };
  10807. }(), g = {}, h = g.lib = {}, i = h.Base = function () {
  10808. return {
  10809. extend: function extend(a) {
  10810. var b = f(this);
  10811. return a && b.mixIn(a), b.hasOwnProperty("init") && this.init !== b.init || (b.init = function () {
  10812. b.$super.init.apply(this, arguments);
  10813. }), b.init.prototype = b, b.$super = this, b;
  10814. },
  10815. create: function create() {
  10816. var a = this.extend();
  10817. return a.init.apply(a, arguments), a;
  10818. },
  10819. init: function init() {},
  10820. mixIn: function mixIn(a) {
  10821. for (var b in a) {
  10822. a.hasOwnProperty(b) && (this[b] = a[b]);
  10823. }
  10824. a.hasOwnProperty("toString") && (this.toString = a.toString);
  10825. },
  10826. clone: function clone() {
  10827. return this.init.prototype.extend(this);
  10828. }
  10829. };
  10830. }(), j = h.WordArray = i.extend({
  10831. init: function init(a, c) {
  10832. a = this.words = a || [], this.sigBytes = c != b ? c : 4 * a.length;
  10833. },
  10834. toString: function toString(a) {
  10835. return (a || l).stringify(this);
  10836. },
  10837. concat: function concat(a) {
  10838. var f,
  10839. g,
  10840. b = this.words,
  10841. c = a.words,
  10842. d = this.sigBytes,
  10843. e = a.sigBytes;
  10844. if (this.clamp(), d % 4) for (f = 0; e > f; f++) {
  10845. g = 255 & c[f >>> 2] >>> 24 - 8 * (f % 4), b[d + f >>> 2] |= g << 24 - 8 * ((d + f) % 4);
  10846. } else for (f = 0; e > f; f += 4) {
  10847. b[d + f >>> 2] = c[f >>> 2];
  10848. }
  10849. return this.sigBytes += e, this;
  10850. },
  10851. clamp: function clamp() {
  10852. var b = this.words,
  10853. c = this.sigBytes;
  10854. b[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4), b.length = a.ceil(c / 4);
  10855. },
  10856. clone: function clone() {
  10857. var a = i.clone.call(this);
  10858. return a.words = this.words.slice(0), a;
  10859. },
  10860. random: function random(a) {
  10861. var c,
  10862. b = [];
  10863. for (c = 0; a > c; c += 4) {
  10864. b.push(e());
  10865. }
  10866. return new j.init(b, a);
  10867. }
  10868. }), k = g.enc = {}, l = k.Hex = {
  10869. stringify: function stringify(a) {
  10870. var e,
  10871. f,
  10872. b = a.words,
  10873. c = a.sigBytes,
  10874. d = [];
  10875. for (e = 0; c > e; e++) {
  10876. f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push((f >>> 4).toString(16)), d.push((15 & f).toString(16));
  10877. }
  10878. return d.join("");
  10879. },
  10880. parse: function parse(a) {
  10881. var d,
  10882. b = a.length,
  10883. c = [];
  10884. for (d = 0; b > d; d += 2) {
  10885. c[d >>> 3] |= parseInt(a.substr(d, 2), 16) << 24 - 4 * (d % 8);
  10886. }
  10887. return new j.init(c, b / 2);
  10888. }
  10889. }, m = k.Latin1 = {
  10890. stringify: function stringify(a) {
  10891. var e,
  10892. f,
  10893. b = a.words,
  10894. c = a.sigBytes,
  10895. d = [];
  10896. for (e = 0; c > e; e++) {
  10897. f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push(String.fromCharCode(f));
  10898. }
  10899. return d.join("");
  10900. },
  10901. parse: function parse(a) {
  10902. var d,
  10903. b = a.length,
  10904. c = [];
  10905. for (d = 0; b > d; d++) {
  10906. c[d >>> 2] |= (255 & a.charCodeAt(d)) << 24 - 8 * (d % 4);
  10907. }
  10908. return new j.init(c, b);
  10909. }
  10910. }, n = k.Utf8 = {
  10911. stringify: function stringify(a) {
  10912. try {
  10913. return decodeURIComponent(escape(m.stringify(a)));
  10914. } catch (b) {
  10915. throw new Error("Malformed UTF-8 data");
  10916. }
  10917. },
  10918. parse: function parse(a) {
  10919. return m.parse(unescape(encodeURIComponent(a)));
  10920. }
  10921. }, o = h.BufferedBlockAlgorithm = i.extend({
  10922. reset: function reset() {
  10923. this._data = new j.init(), this._nDataBytes = 0;
  10924. },
  10925. _append: function _append(a) {
  10926. "string" == typeof a && (a = n.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
  10927. },
  10928. _process: function _process(b) {
  10929. var c,
  10930. k,
  10931. l,
  10932. m,
  10933. d = this._data,
  10934. e = d.words,
  10935. f = d.sigBytes,
  10936. g = this.blockSize,
  10937. h = 4 * g,
  10938. i = f / h;
  10939. if (i = b ? a.ceil(i) : a.max((0 | i) - this._minBufferSize, 0), k = i * g, l = a.min(4 * k, f), k) {
  10940. for (m = 0; k > m; m += g) {
  10941. this._doProcessBlock(e, m);
  10942. }
  10943. c = e.splice(0, k), d.sigBytes -= l;
  10944. }
  10945. return new j.init(c, l);
  10946. },
  10947. clone: function clone() {
  10948. var a = i.clone.call(this);
  10949. return a._data = this._data.clone(), a;
  10950. },
  10951. _minBufferSize: 0
  10952. }), h.Hasher = o.extend({
  10953. cfg: i.extend(),
  10954. init: function init(a) {
  10955. this.cfg = this.cfg.extend(a), this.reset();
  10956. },
  10957. reset: function reset() {
  10958. o.reset.call(this), this._doReset();
  10959. },
  10960. update: function update(a) {
  10961. return this._append(a), this._process(), this;
  10962. },
  10963. finalize: function finalize(a) {
  10964. a && this._append(a);
  10965. var b = this._doFinalize();
  10966. return b;
  10967. },
  10968. blockSize: 16,
  10969. _createHelper: function _createHelper(a) {
  10970. return function (b, c) {
  10971. return new a.init(c).finalize(b);
  10972. };
  10973. },
  10974. _createHmacHelper: function _createHmacHelper(a) {
  10975. return function (b, c) {
  10976. return new q.HMAC.init(a, c).finalize(b);
  10977. };
  10978. }
  10979. }), q = g.algo = {}, g;
  10980. }(Math);
  10981. !function () {
  10982. function f(a, b, d) {
  10983. var g,
  10984. h,
  10985. i,
  10986. j,
  10987. e = [],
  10988. f = 0;
  10989. for (g = 0; b > g; g++) {
  10990. g % 4 && (h = d[a.charCodeAt(g - 1)] << 2 * (g % 4), i = d[a.charCodeAt(g)] >>> 6 - 2 * (g % 4), j = h | i, e[f >>> 2] |= j << 24 - 8 * (f % 4), f++);
  10991. }
  10992. return c.create(e, f);
  10993. }
  10994. var a = CryptoJS,
  10995. b = a.lib,
  10996. c = b.WordArray,
  10997. d = a.enc;
  10998. d.Base64 = {
  10999. stringify: function stringify(a) {
  11000. var e,
  11001. f,
  11002. g,
  11003. h,
  11004. i,
  11005. j,
  11006. k,
  11007. l,
  11008. b = a.words,
  11009. c = a.sigBytes,
  11010. d = this._map;
  11011. for (a.clamp(), e = [], f = 0; c > f; f += 3) {
  11012. for (g = 255 & b[f >>> 2] >>> 24 - 8 * (f % 4), h = 255 & b[f + 1 >>> 2] >>> 24 - 8 * ((f + 1) % 4), i = 255 & b[f + 2 >>> 2] >>> 24 - 8 * ((f + 2) % 4), j = g << 16 | h << 8 | i, k = 0; 4 > k && c > f + .75 * k; k++) {
  11013. e.push(d.charAt(63 & j >>> 6 * (3 - k)));
  11014. }
  11015. }
  11016. if (l = d.charAt(64)) for (; e.length % 4;) {
  11017. e.push(l);
  11018. }
  11019. return e.join("");
  11020. },
  11021. parse: function parse(a) {
  11022. var e,
  11023. g,
  11024. h,
  11025. b = a.length,
  11026. c = this._map,
  11027. d = this._reverseMap;
  11028. if (!d) for (d = this._reverseMap = [], e = 0; e < c.length; e++) {
  11029. d[c.charCodeAt(e)] = e;
  11030. }
  11031. return g = c.charAt(64), g && (h = a.indexOf(g), -1 !== h && (b = h)), f(a, b, d);
  11032. },
  11033. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  11034. };
  11035. }(), function (a) {
  11036. function i(a, b, c, d, e, f, g) {
  11037. var h = a + (b & c | ~b & d) + e + g;
  11038. return (h << f | h >>> 32 - f) + b;
  11039. }
  11040. function j(a, b, c, d, e, f, g) {
  11041. var h = a + (b & d | c & ~d) + e + g;
  11042. return (h << f | h >>> 32 - f) + b;
  11043. }
  11044. function k(a, b, c, d, e, f, g) {
  11045. var h = a + (b ^ c ^ d) + e + g;
  11046. return (h << f | h >>> 32 - f) + b;
  11047. }
  11048. function l(a, b, c, d, e, f, g) {
  11049. var h = a + (c ^ (b | ~d)) + e + g;
  11050. return (h << f | h >>> 32 - f) + b;
  11051. }
  11052. var h,
  11053. b = CryptoJS,
  11054. c = b.lib,
  11055. d = c.WordArray,
  11056. e = c.Hasher,
  11057. f = b.algo,
  11058. g = [];
  11059. !function () {
  11060. for (var b = 0; 64 > b; b++) {
  11061. g[b] = 0 | 4294967296 * a.abs(a.sin(b + 1));
  11062. }
  11063. }(), h = f.MD5 = e.extend({
  11064. _doReset: function _doReset() {
  11065. this._hash = new d.init([1732584193, 4023233417, 2562383102, 271733878]);
  11066. },
  11067. _doProcessBlock: function _doProcessBlock(a, b) {
  11068. var c, d, e, f, h, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E;
  11069. for (c = 0; 16 > c; c++) {
  11070. d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);
  11071. }
  11072. f = this._hash.words, h = a[b + 0], m = a[b + 1], n = a[b + 2], o = a[b + 3], p = a[b + 4], q = a[b + 5], r = a[b + 6], s = a[b + 7], t = a[b + 8], u = a[b + 9], v = a[b + 10], w = a[b + 11], x = a[b + 12], y = a[b + 13], z = a[b + 14], A = a[b + 15], B = f[0], C = f[1], D = f[2], E = f[3], B = i(B, C, D, E, h, 7, g[0]), E = i(E, B, C, D, m, 12, g[1]), D = i(D, E, B, C, n, 17, g[2]), C = i(C, D, E, B, o, 22, g[3]), B = i(B, C, D, E, p, 7, g[4]), E = i(E, B, C, D, q, 12, g[5]), D = i(D, E, B, C, r, 17, g[6]), C = i(C, D, E, B, s, 22, g[7]), B = i(B, C, D, E, t, 7, g[8]), E = i(E, B, C, D, u, 12, g[9]), D = i(D, E, B, C, v, 17, g[10]), C = i(C, D, E, B, w, 22, g[11]), B = i(B, C, D, E, x, 7, g[12]), E = i(E, B, C, D, y, 12, g[13]), D = i(D, E, B, C, z, 17, g[14]), C = i(C, D, E, B, A, 22, g[15]), B = j(B, C, D, E, m, 5, g[16]), E = j(E, B, C, D, r, 9, g[17]), D = j(D, E, B, C, w, 14, g[18]), C = j(C, D, E, B, h, 20, g[19]), B = j(B, C, D, E, q, 5, g[20]), E = j(E, B, C, D, v, 9, g[21]), D = j(D, E, B, C, A, 14, g[22]), C = j(C, D, E, B, p, 20, g[23]), B = j(B, C, D, E, u, 5, g[24]), E = j(E, B, C, D, z, 9, g[25]), D = j(D, E, B, C, o, 14, g[26]), C = j(C, D, E, B, t, 20, g[27]), B = j(B, C, D, E, y, 5, g[28]), E = j(E, B, C, D, n, 9, g[29]), D = j(D, E, B, C, s, 14, g[30]), C = j(C, D, E, B, x, 20, g[31]), B = k(B, C, D, E, q, 4, g[32]), E = k(E, B, C, D, t, 11, g[33]), D = k(D, E, B, C, w, 16, g[34]), C = k(C, D, E, B, z, 23, g[35]), B = k(B, C, D, E, m, 4, g[36]), E = k(E, B, C, D, p, 11, g[37]), D = k(D, E, B, C, s, 16, g[38]), C = k(C, D, E, B, v, 23, g[39]), B = k(B, C, D, E, y, 4, g[40]), E = k(E, B, C, D, h, 11, g[41]), D = k(D, E, B, C, o, 16, g[42]), C = k(C, D, E, B, r, 23, g[43]), B = k(B, C, D, E, u, 4, g[44]), E = k(E, B, C, D, x, 11, g[45]), D = k(D, E, B, C, A, 16, g[46]), C = k(C, D, E, B, n, 23, g[47]), B = l(B, C, D, E, h, 6, g[48]), E = l(E, B, C, D, s, 10, g[49]), D = l(D, E, B, C, z, 15, g[50]), C = l(C, D, E, B, q, 21, g[51]), B = l(B, C, D, E, x, 6, g[52]), E = l(E, B, C, D, o, 10, g[53]), D = l(D, E, B, C, v, 15, g[54]), C = l(C, D, E, B, m, 21, g[55]), B = l(B, C, D, E, t, 6, g[56]), E = l(E, B, C, D, A, 10, g[57]), D = l(D, E, B, C, r, 15, g[58]), C = l(C, D, E, B, y, 21, g[59]), B = l(B, C, D, E, p, 6, g[60]), E = l(E, B, C, D, w, 10, g[61]), D = l(D, E, B, C, n, 15, g[62]), C = l(C, D, E, B, u, 21, g[63]), f[0] = 0 | f[0] + B, f[1] = 0 | f[1] + C, f[2] = 0 | f[2] + D, f[3] = 0 | f[3] + E;
  11073. },
  11074. _doFinalize: function _doFinalize() {
  11075. var f,
  11076. g,
  11077. h,
  11078. i,
  11079. j,
  11080. k,
  11081. b = this._data,
  11082. c = b.words,
  11083. d = 8 * this._nDataBytes,
  11084. e = 8 * b.sigBytes;
  11085. for (c[e >>> 5] |= 128 << 24 - e % 32, f = a.floor(d / 4294967296), g = d, c[(e + 64 >>> 9 << 4) + 15] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), c[(e + 64 >>> 9 << 4) + 14] = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), b.sigBytes = 4 * (c.length + 1), this._process(), h = this._hash, i = h.words, j = 0; 4 > j; j++) {
  11086. k = i[j], i[j] = 16711935 & (k << 8 | k >>> 24) | 4278255360 & (k << 24 | k >>> 8);
  11087. }
  11088. return h;
  11089. },
  11090. clone: function clone() {
  11091. var a = e.clone.call(this);
  11092. return a._hash = this._hash.clone(), a;
  11093. }
  11094. }), b.MD5 = e._createHelper(h), b.HmacMD5 = e._createHmacHelper(h);
  11095. }(Math), function () {
  11096. var a = CryptoJS,
  11097. b = a.lib,
  11098. c = b.WordArray,
  11099. d = b.Hasher,
  11100. e = a.algo,
  11101. f = [],
  11102. g = e.SHA1 = d.extend({
  11103. _doReset: function _doReset() {
  11104. this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
  11105. },
  11106. _doProcessBlock: function _doProcessBlock(a, b) {
  11107. var j,
  11108. k,
  11109. l,
  11110. c = this._hash.words,
  11111. d = c[0],
  11112. e = c[1],
  11113. g = c[2],
  11114. h = c[3],
  11115. i = c[4];
  11116. for (j = 0; 80 > j; j++) {
  11117. 16 > j ? f[j] = 0 | a[b + j] : (k = f[j - 3] ^ f[j - 8] ^ f[j - 14] ^ f[j - 16], f[j] = k << 1 | k >>> 31), l = (d << 5 | d >>> 27) + i + f[j], l += 20 > j ? (e & g | ~e & h) + 1518500249 : 40 > j ? (e ^ g ^ h) + 1859775393 : 60 > j ? (e & g | e & h | g & h) - 1894007588 : (e ^ g ^ h) - 899497514, i = h, h = g, g = e << 30 | e >>> 2, e = d, d = l;
  11118. }
  11119. c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + g, c[3] = 0 | c[3] + h, c[4] = 0 | c[4] + i;
  11120. },
  11121. _doFinalize: function _doFinalize() {
  11122. var a = this._data,
  11123. b = a.words,
  11124. c = 8 * this._nDataBytes,
  11125. d = 8 * a.sigBytes;
  11126. return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = Math.floor(c / 4294967296), b[(d + 64 >>> 9 << 4) + 15] = c, a.sigBytes = 4 * b.length, this._process(), this._hash;
  11127. },
  11128. clone: function clone() {
  11129. var a = d.clone.call(this);
  11130. return a._hash = this._hash.clone(), a;
  11131. }
  11132. });
  11133. a.SHA1 = d._createHelper(g), a.HmacSHA1 = d._createHmacHelper(g);
  11134. }(), function (a) {
  11135. var i,
  11136. j,
  11137. b = CryptoJS,
  11138. c = b.lib,
  11139. d = c.WordArray,
  11140. e = c.Hasher,
  11141. f = b.algo,
  11142. g = [],
  11143. h = [];
  11144. !function () {
  11145. function b(b) {
  11146. var d,
  11147. c = a.sqrt(b);
  11148. for (d = 2; c >= d; d++) {
  11149. if (!(b % d)) return !1;
  11150. }
  11151. return !0;
  11152. }
  11153. function c(a) {
  11154. return 0 | 4294967296 * (a - (0 | a));
  11155. }
  11156. for (var d = 2, e = 0; 64 > e;) {
  11157. b(d) && (8 > e && (g[e] = c(a.pow(d, .5))), h[e] = c(a.pow(d, 1 / 3)), e++), d++;
  11158. }
  11159. }(), i = [], j = f.SHA256 = e.extend({
  11160. _doReset: function _doReset() {
  11161. this._hash = new d.init(g.slice(0));
  11162. },
  11163. _doProcessBlock: function _doProcessBlock(a, b) {
  11164. var n,
  11165. o,
  11166. p,
  11167. q,
  11168. r,
  11169. s,
  11170. t,
  11171. u,
  11172. v,
  11173. w,
  11174. x,
  11175. c = this._hash.words,
  11176. d = c[0],
  11177. e = c[1],
  11178. f = c[2],
  11179. g = c[3],
  11180. j = c[4],
  11181. k = c[5],
  11182. l = c[6],
  11183. m = c[7];
  11184. for (n = 0; 64 > n; n++) {
  11185. 16 > n ? i[n] = 0 | a[b + n] : (o = i[n - 15], p = (o << 25 | o >>> 7) ^ (o << 14 | o >>> 18) ^ o >>> 3, q = i[n - 2], r = (q << 15 | q >>> 17) ^ (q << 13 | q >>> 19) ^ q >>> 10, i[n] = p + i[n - 7] + r + i[n - 16]), s = j & k ^ ~j & l, t = d & e ^ d & f ^ e & f, u = (d << 30 | d >>> 2) ^ (d << 19 | d >>> 13) ^ (d << 10 | d >>> 22), v = (j << 26 | j >>> 6) ^ (j << 21 | j >>> 11) ^ (j << 7 | j >>> 25), w = m + v + s + h[n] + i[n], x = u + t, m = l, l = k, k = j, j = 0 | g + w, g = f, f = e, e = d, d = 0 | w + x;
  11186. }
  11187. c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + f, c[3] = 0 | c[3] + g, c[4] = 0 | c[4] + j, c[5] = 0 | c[5] + k, c[6] = 0 | c[6] + l, c[7] = 0 | c[7] + m;
  11188. },
  11189. _doFinalize: function _doFinalize() {
  11190. var b = this._data,
  11191. c = b.words,
  11192. d = 8 * this._nDataBytes,
  11193. e = 8 * b.sigBytes;
  11194. return c[e >>> 5] |= 128 << 24 - e % 32, c[(e + 64 >>> 9 << 4) + 14] = a.floor(d / 4294967296), c[(e + 64 >>> 9 << 4) + 15] = d, b.sigBytes = 4 * c.length, this._process(), this._hash;
  11195. },
  11196. clone: function clone() {
  11197. var a = e.clone.call(this);
  11198. return a._hash = this._hash.clone(), a;
  11199. }
  11200. }), b.SHA256 = e._createHelper(j), b.HmacSHA256 = e._createHmacHelper(j);
  11201. }(Math), function () {
  11202. function f(a) {
  11203. return 4278255360 & a << 8 | 16711935 & a >>> 8;
  11204. }
  11205. var a = CryptoJS,
  11206. b = a.lib,
  11207. c = b.WordArray,
  11208. d = a.enc;
  11209. d.Utf16 = d.Utf16BE = {
  11210. stringify: function stringify(a) {
  11211. var e,
  11212. f,
  11213. b = a.words,
  11214. c = a.sigBytes,
  11215. d = [];
  11216. for (e = 0; c > e; e += 2) {
  11217. f = 65535 & b[e >>> 2] >>> 16 - 8 * (e % 4), d.push(String.fromCharCode(f));
  11218. }
  11219. return d.join("");
  11220. },
  11221. parse: function parse(a) {
  11222. var e,
  11223. b = a.length,
  11224. d = [];
  11225. for (e = 0; b > e; e++) {
  11226. d[e >>> 1] |= a.charCodeAt(e) << 16 - 16 * (e % 2);
  11227. }
  11228. return c.create(d, 2 * b);
  11229. }
  11230. }, d.Utf16LE = {
  11231. stringify: function stringify(a) {
  11232. var e,
  11233. g,
  11234. b = a.words,
  11235. c = a.sigBytes,
  11236. d = [];
  11237. for (e = 0; c > e; e += 2) {
  11238. g = f(65535 & b[e >>> 2] >>> 16 - 8 * (e % 4)), d.push(String.fromCharCode(g));
  11239. }
  11240. return d.join("");
  11241. },
  11242. parse: function parse(a) {
  11243. var e,
  11244. b = a.length,
  11245. d = [];
  11246. for (e = 0; b > e; e++) {
  11247. d[e >>> 1] |= f(a.charCodeAt(e) << 16 - 16 * (e % 2));
  11248. }
  11249. return c.create(d, 2 * b);
  11250. }
  11251. };
  11252. }(), function () {
  11253. var a, b, c, d, e;
  11254. "function" == typeof ArrayBuffer && (a = CryptoJS, b = a.lib, c = b.WordArray, d = c.init, e = c.init = function (a) {
  11255. var b, c, e;
  11256. if (a instanceof ArrayBuffer && (a = new Uint8Array(a)), (a instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && a instanceof Uint8ClampedArray || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array) && (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)), a instanceof Uint8Array) {
  11257. for (b = a.byteLength, c = [], e = 0; b > e; e++) {
  11258. c[e >>> 2] |= a[e] << 24 - 8 * (e % 4);
  11259. }
  11260. d.call(this, c, b);
  11261. } else d.apply(this, arguments);
  11262. }, e.prototype = c);
  11263. }(), function () {
  11264. function n(a, b, c) {
  11265. return a ^ b ^ c;
  11266. }
  11267. function o(a, b, c) {
  11268. return a & b | ~a & c;
  11269. }
  11270. function p(a, b, c) {
  11271. return (a | ~b) ^ c;
  11272. }
  11273. function q(a, b, c) {
  11274. return a & c | b & ~c;
  11275. }
  11276. function r(a, b, c) {
  11277. return a ^ (b | ~c);
  11278. }
  11279. function s(a, b) {
  11280. return a << b | a >>> 32 - b;
  11281. }
  11282. var b = CryptoJS,
  11283. c = b.lib,
  11284. d = c.WordArray,
  11285. e = c.Hasher,
  11286. f = b.algo,
  11287. g = d.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),
  11288. h = d.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),
  11289. i = d.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),
  11290. j = d.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),
  11291. k = d.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),
  11292. l = d.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),
  11293. m = f.RIPEMD160 = e.extend({
  11294. _doReset: function _doReset() {
  11295. this._hash = d.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
  11296. },
  11297. _doProcessBlock: function _doProcessBlock(a, b) {
  11298. var c, d, e, f, m, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I;
  11299. for (c = 0; 16 > c; c++) {
  11300. d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);
  11301. }
  11302. for (f = this._hash.words, m = k.words, t = l.words, u = g.words, v = h.words, w = i.words, x = j.words, D = y = f[0], E = z = f[1], F = A = f[2], G = B = f[3], H = C = f[4], c = 0; 80 > c; c += 1) {
  11303. I = 0 | y + a[b + u[c]], I += 16 > c ? n(z, A, B) + m[0] : 32 > c ? o(z, A, B) + m[1] : 48 > c ? p(z, A, B) + m[2] : 64 > c ? q(z, A, B) + m[3] : r(z, A, B) + m[4], I = 0 | I, I = s(I, w[c]), I = 0 | I + C, y = C, C = B, B = s(A, 10), A = z, z = I, I = 0 | D + a[b + v[c]], I += 16 > c ? r(E, F, G) + t[0] : 32 > c ? q(E, F, G) + t[1] : 48 > c ? p(E, F, G) + t[2] : 64 > c ? o(E, F, G) + t[3] : n(E, F, G) + t[4], I = 0 | I, I = s(I, x[c]), I = 0 | I + H, D = H, H = G, G = s(F, 10), F = E, E = I;
  11304. }
  11305. I = 0 | f[1] + A + G, f[1] = 0 | f[2] + B + H, f[2] = 0 | f[3] + C + D, f[3] = 0 | f[4] + y + E, f[4] = 0 | f[0] + z + F, f[0] = I;
  11306. },
  11307. _doFinalize: function _doFinalize() {
  11308. var e,
  11309. f,
  11310. g,
  11311. h,
  11312. a = this._data,
  11313. b = a.words,
  11314. c = 8 * this._nDataBytes,
  11315. d = 8 * a.sigBytes;
  11316. for (b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), a.sigBytes = 4 * (b.length + 1), this._process(), e = this._hash, f = e.words, g = 0; 5 > g; g++) {
  11317. h = f[g], f[g] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  11318. }
  11319. return e;
  11320. },
  11321. clone: function clone() {
  11322. var a = e.clone.call(this);
  11323. return a._hash = this._hash.clone(), a;
  11324. }
  11325. });
  11326. b.RIPEMD160 = e._createHelper(m), b.HmacRIPEMD160 = e._createHmacHelper(m);
  11327. }(Math), function () {
  11328. var a = CryptoJS,
  11329. b = a.lib,
  11330. c = b.Base,
  11331. d = a.enc,
  11332. e = d.Utf8,
  11333. f = a.algo;
  11334. f.HMAC = c.extend({
  11335. init: function init(a, b) {
  11336. var c, d, f, g, h, i, j;
  11337. for (a = this._hasher = new a.init(), "string" == typeof b && (b = e.parse(b)), c = a.blockSize, d = 4 * c, b.sigBytes > d && (b = a.finalize(b)), b.clamp(), f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, i = g.words, j = 0; c > j; j++) {
  11338. h[j] ^= 1549556828, i[j] ^= 909522486;
  11339. }
  11340. f.sigBytes = g.sigBytes = d, this.reset();
  11341. },
  11342. reset: function reset() {
  11343. var a = this._hasher;
  11344. a.reset(), a.update(this._iKey);
  11345. },
  11346. update: function update(a) {
  11347. return this._hasher.update(a), this;
  11348. },
  11349. finalize: function finalize(a) {
  11350. var d,
  11351. b = this._hasher,
  11352. c = b.finalize(a);
  11353. return b.reset(), d = b.finalize(this._oKey.clone().concat(c));
  11354. }
  11355. });
  11356. }(), function () {
  11357. var a = CryptoJS,
  11358. b = a.lib,
  11359. c = b.Base,
  11360. d = b.WordArray,
  11361. e = a.algo,
  11362. f = e.SHA1,
  11363. g = e.HMAC,
  11364. h = e.PBKDF2 = c.extend({
  11365. cfg: c.extend({
  11366. keySize: 4,
  11367. hasher: f,
  11368. iterations: 1
  11369. }),
  11370. init: function init(a) {
  11371. this.cfg = this.cfg.extend(a);
  11372. },
  11373. compute: function compute(a, b) {
  11374. for (var m, n, o, p, q, r, s, c = this.cfg, e = g.create(c.hasher, a), f = d.create(), h = d.create([1]), i = f.words, j = h.words, k = c.keySize, l = c.iterations; i.length < k;) {
  11375. for (m = e.update(b).finalize(h), e.reset(), n = m.words, o = n.length, p = m, q = 1; l > q; q++) {
  11376. for (p = e.finalize(p), e.reset(), r = p.words, s = 0; o > s; s++) {
  11377. n[s] ^= r[s];
  11378. }
  11379. }
  11380. f.concat(m), j[0]++;
  11381. }
  11382. return f.sigBytes = 4 * k, f;
  11383. }
  11384. });
  11385. a.PBKDF2 = function (a, b, c) {
  11386. return h.create(c).compute(a, b);
  11387. };
  11388. }(), function () {
  11389. var a = CryptoJS,
  11390. b = a.lib,
  11391. c = b.Base,
  11392. d = b.WordArray,
  11393. e = a.algo,
  11394. f = e.MD5,
  11395. g = e.EvpKDF = c.extend({
  11396. cfg: c.extend({
  11397. keySize: 4,
  11398. hasher: f,
  11399. iterations: 1
  11400. }),
  11401. init: function init(a) {
  11402. this.cfg = this.cfg.extend(a);
  11403. },
  11404. compute: function compute(a, b) {
  11405. for (var c, k, e = this.cfg, f = e.hasher.create(), g = d.create(), h = g.words, i = e.keySize, j = e.iterations; h.length < i;) {
  11406. for (c && f.update(c), c = f.update(a).finalize(b), f.reset(), k = 1; j > k; k++) {
  11407. c = f.finalize(c), f.reset();
  11408. }
  11409. g.concat(c);
  11410. }
  11411. return g.sigBytes = 4 * i, g;
  11412. }
  11413. });
  11414. a.EvpKDF = function (a, b, c) {
  11415. return g.create(c).compute(a, b);
  11416. };
  11417. }(), function () {
  11418. var a = CryptoJS,
  11419. b = a.lib,
  11420. c = b.WordArray,
  11421. d = a.algo,
  11422. e = d.SHA256,
  11423. f = d.SHA224 = e.extend({
  11424. _doReset: function _doReset() {
  11425. this._hash = new c.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
  11426. },
  11427. _doFinalize: function _doFinalize() {
  11428. var a = e._doFinalize.call(this);
  11429. return a.sigBytes -= 4, a;
  11430. }
  11431. });
  11432. a.SHA224 = e._createHelper(f), a.HmacSHA224 = e._createHmacHelper(f);
  11433. }(), function (a) {
  11434. var b = CryptoJS,
  11435. c = b.lib,
  11436. d = c.Base,
  11437. e = c.WordArray,
  11438. f = b.x64 = {};
  11439. f.Word = d.extend({
  11440. init: function init(a, b) {
  11441. this.high = a, this.low = b;
  11442. }
  11443. }), f.WordArray = d.extend({
  11444. init: function init(b, c) {
  11445. b = this.words = b || [], this.sigBytes = c != a ? c : 8 * b.length;
  11446. },
  11447. toX32: function toX32() {
  11448. var d,
  11449. f,
  11450. a = this.words,
  11451. b = a.length,
  11452. c = [];
  11453. for (d = 0; b > d; d++) {
  11454. f = a[d], c.push(f.high), c.push(f.low);
  11455. }
  11456. return e.create(c, this.sigBytes);
  11457. },
  11458. clone: function clone() {
  11459. var e,
  11460. a = d.clone.call(this),
  11461. b = a.words = this.words.slice(0),
  11462. c = b.length;
  11463. for (e = 0; c > e; e++) {
  11464. b[e] = b[e].clone();
  11465. }
  11466. return a;
  11467. }
  11468. });
  11469. }(), function (a) {
  11470. var l,
  11471. m,
  11472. b = CryptoJS,
  11473. c = b.lib,
  11474. d = c.WordArray,
  11475. e = c.Hasher,
  11476. f = b.x64,
  11477. g = f.Word,
  11478. h = b.algo,
  11479. i = [],
  11480. j = [],
  11481. k = [];
  11482. !function () {
  11483. var c,
  11484. d,
  11485. e,
  11486. f,
  11487. h,
  11488. l,
  11489. m,
  11490. n,
  11491. o,
  11492. a = 1,
  11493. b = 0;
  11494. for (c = 0; 24 > c; c++) {
  11495. i[a + 5 * b] = (c + 1) * (c + 2) / 2 % 64, d = b % 5, e = (2 * a + 3 * b) % 5, a = d, b = e;
  11496. }
  11497. for (a = 0; 5 > a; a++) {
  11498. for (b = 0; 5 > b; b++) {
  11499. j[a + 5 * b] = b + 5 * ((2 * a + 3 * b) % 5);
  11500. }
  11501. }
  11502. for (f = 1, h = 0; 24 > h; h++) {
  11503. for (l = 0, m = 0, n = 0; 7 > n; n++) {
  11504. 1 & f && (o = (1 << n) - 1, 32 > o ? m ^= 1 << o : l ^= 1 << o - 32), 128 & f ? f = 113 ^ f << 1 : f <<= 1;
  11505. }
  11506. k[h] = g.create(l, m);
  11507. }
  11508. }(), l = [], function () {
  11509. for (var a = 0; 25 > a; a++) {
  11510. l[a] = g.create();
  11511. }
  11512. }(), m = h.SHA3 = e.extend({
  11513. cfg: e.cfg.extend({
  11514. outputLength: 512
  11515. }),
  11516. _doReset: function _doReset() {
  11517. var b,
  11518. a = this._state = [];
  11519. for (b = 0; 25 > b; b++) {
  11520. a[b] = new g.init();
  11521. }
  11522. this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
  11523. },
  11524. _doProcessBlock: function _doProcessBlock(a, b) {
  11525. var e,
  11526. f,
  11527. g,
  11528. h,
  11529. m,
  11530. n,
  11531. o,
  11532. p,
  11533. q,
  11534. r,
  11535. s,
  11536. t,
  11537. u,
  11538. v,
  11539. w,
  11540. x,
  11541. y,
  11542. z,
  11543. A,
  11544. B,
  11545. C,
  11546. D,
  11547. E,
  11548. F,
  11549. G,
  11550. c = this._state,
  11551. d = this.blockSize / 2;
  11552. for (e = 0; d > e; e++) {
  11553. f = a[b + 2 * e], g = a[b + 2 * e + 1], f = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), g = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), h = c[e], h.high ^= g, h.low ^= f;
  11554. }
  11555. for (m = 0; 24 > m; m++) {
  11556. for (n = 0; 5 > n; n++) {
  11557. for (o = 0, p = 0, q = 0; 5 > q; q++) {
  11558. h = c[n + 5 * q], o ^= h.high, p ^= h.low;
  11559. }
  11560. r = l[n], r.high = o, r.low = p;
  11561. }
  11562. for (n = 0; 5 > n; n++) {
  11563. for (s = l[(n + 4) % 5], t = l[(n + 1) % 5], u = t.high, v = t.low, o = s.high ^ (u << 1 | v >>> 31), p = s.low ^ (v << 1 | u >>> 31), q = 0; 5 > q; q++) {
  11564. h = c[n + 5 * q], h.high ^= o, h.low ^= p;
  11565. }
  11566. }
  11567. for (w = 1; 25 > w; w++) {
  11568. h = c[w], x = h.high, y = h.low, z = i[w], 32 > z ? (o = x << z | y >>> 32 - z, p = y << z | x >>> 32 - z) : (o = y << z - 32 | x >>> 64 - z, p = x << z - 32 | y >>> 64 - z), A = l[j[w]], A.high = o, A.low = p;
  11569. }
  11570. for (B = l[0], C = c[0], B.high = C.high, B.low = C.low, n = 0; 5 > n; n++) {
  11571. for (q = 0; 5 > q; q++) {
  11572. w = n + 5 * q, h = c[w], D = l[w], E = l[(n + 1) % 5 + 5 * q], F = l[(n + 2) % 5 + 5 * q], h.high = D.high ^ ~E.high & F.high, h.low = D.low ^ ~E.low & F.low;
  11573. }
  11574. }
  11575. h = c[0], G = k[m], h.high ^= G.high, h.low ^= G.low;
  11576. }
  11577. },
  11578. _doFinalize: function _doFinalize() {
  11579. var f,
  11580. g,
  11581. h,
  11582. i,
  11583. j,
  11584. k,
  11585. l,
  11586. m,
  11587. n,
  11588. o,
  11589. b = this._data,
  11590. c = b.words;
  11591. for (8 * this._nDataBytes, f = 8 * b.sigBytes, g = 32 * this.blockSize, c[f >>> 5] |= 1 << 24 - f % 32, c[(a.ceil((f + 1) / g) * g >>> 5) - 1] |= 128, b.sigBytes = 4 * c.length, this._process(), h = this._state, i = this.cfg.outputLength / 8, j = i / 8, k = [], l = 0; j > l; l++) {
  11592. m = h[l], n = m.high, o = m.low, n = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), k.push(o), k.push(n);
  11593. }
  11594. return new d.init(k, i);
  11595. },
  11596. clone: function clone() {
  11597. var c,
  11598. a = e.clone.call(this),
  11599. b = a._state = this._state.slice(0);
  11600. for (c = 0; 25 > c; c++) {
  11601. b[c] = b[c].clone();
  11602. }
  11603. return a;
  11604. }
  11605. }), b.SHA3 = e._createHelper(m), b.HmacSHA3 = e._createHmacHelper(m);
  11606. }(Math), function () {
  11607. function h() {
  11608. return e.create.apply(e, arguments);
  11609. }
  11610. var k,
  11611. a = CryptoJS,
  11612. b = a.lib,
  11613. c = b.Hasher,
  11614. d = a.x64,
  11615. e = d.Word,
  11616. f = d.WordArray,
  11617. g = a.algo,
  11618. i = [h(1116352408, 3609767458), h(1899447441, 602891725), h(3049323471, 3964484399), h(3921009573, 2173295548), h(961987163, 4081628472), h(1508970993, 3053834265), h(2453635748, 2937671579), h(2870763221, 3664609560), h(3624381080, 2734883394), h(310598401, 1164996542), h(607225278, 1323610764), h(1426881987, 3590304994), h(1925078388, 4068182383), h(2162078206, 991336113), h(2614888103, 633803317), h(3248222580, 3479774868), h(3835390401, 2666613458), h(4022224774, 944711139), h(264347078, 2341262773), h(604807628, 2007800933), h(770255983, 1495990901), h(1249150122, 1856431235), h(1555081692, 3175218132), h(1996064986, 2198950837), h(2554220882, 3999719339), h(2821834349, 766784016), h(2952996808, 2566594879), h(3210313671, 3203337956), h(3336571891, 1034457026), h(3584528711, 2466948901), h(113926993, 3758326383), h(338241895, 168717936), h(666307205, 1188179964), h(773529912, 1546045734), h(1294757372, 1522805485), h(1396182291, 2643833823), h(1695183700, 2343527390), h(1986661051, 1014477480), h(2177026350, 1206759142), h(2456956037, 344077627), h(2730485921, 1290863460), h(2820302411, 3158454273), h(3259730800, 3505952657), h(3345764771, 106217008), h(3516065817, 3606008344), h(3600352804, 1432725776), h(4094571909, 1467031594), h(275423344, 851169720), h(430227734, 3100823752), h(506948616, 1363258195), h(659060556, 3750685593), h(883997877, 3785050280), h(958139571, 3318307427), h(1322822218, 3812723403), h(1537002063, 2003034995), h(1747873779, 3602036899), h(1955562222, 1575990012), h(2024104815, 1125592928), h(2227730452, 2716904306), h(2361852424, 442776044), h(2428436474, 593698344), h(2756734187, 3733110249), h(3204031479, 2999351573), h(3329325298, 3815920427), h(3391569614, 3928383900), h(3515267271, 566280711), h(3940187606, 3454069534), h(4118630271, 4000239992), h(116418474, 1914138554), h(174292421, 2731055270), h(289380356, 3203993006), h(460393269, 320620315), h(685471733, 587496836), h(852142971, 1086792851), h(1017036298, 365543100), h(1126000580, 2618297676), h(1288033470, 3409855158), h(1501505948, 4234509866), h(1607167915, 987167468), h(1816402316, 1246189591)],
  11619. j = [];
  11620. !function () {
  11621. for (var a = 0; 80 > a; a++) {
  11622. j[a] = h();
  11623. }
  11624. }(), k = g.SHA512 = c.extend({
  11625. _doReset: function _doReset() {
  11626. this._hash = new f.init([new e.init(1779033703, 4089235720), new e.init(3144134277, 2227873595), new e.init(1013904242, 4271175723), new e.init(2773480762, 1595750129), new e.init(1359893119, 2917565137), new e.init(2600822924, 725511199), new e.init(528734635, 4215389547), new e.init(1541459225, 327033209)]);
  11627. },
  11628. _doProcessBlock: function _doProcessBlock(a, b) {
  11629. var T,
  11630. U,
  11631. V,
  11632. W,
  11633. X,
  11634. Y,
  11635. Z,
  11636. $,
  11637. _,
  11638. ab,
  11639. bb,
  11640. cb,
  11641. db,
  11642. eb,
  11643. fb,
  11644. gb,
  11645. hb,
  11646. ib,
  11647. jb,
  11648. kb,
  11649. lb,
  11650. mb,
  11651. nb,
  11652. ob,
  11653. pb,
  11654. qb,
  11655. rb,
  11656. sb,
  11657. tb,
  11658. ub,
  11659. vb,
  11660. wb,
  11661. xb,
  11662. yb,
  11663. zb,
  11664. c = this._hash.words,
  11665. d = c[0],
  11666. e = c[1],
  11667. f = c[2],
  11668. g = c[3],
  11669. h = c[4],
  11670. k = c[5],
  11671. l = c[6],
  11672. m = c[7],
  11673. n = d.high,
  11674. o = d.low,
  11675. p = e.high,
  11676. q = e.low,
  11677. r = f.high,
  11678. s = f.low,
  11679. t = g.high,
  11680. u = g.low,
  11681. v = h.high,
  11682. w = h.low,
  11683. x = k.high,
  11684. y = k.low,
  11685. z = l.high,
  11686. A = l.low,
  11687. B = m.high,
  11688. C = m.low,
  11689. D = n,
  11690. E = o,
  11691. F = p,
  11692. G = q,
  11693. H = r,
  11694. I = s,
  11695. J = t,
  11696. K = u,
  11697. L = v,
  11698. M = w,
  11699. N = x,
  11700. O = y,
  11701. P = z,
  11702. Q = A,
  11703. R = B,
  11704. S = C;
  11705. for (T = 0; 80 > T; T++) {
  11706. W = j[T], 16 > T ? (V = W.high = 0 | a[b + 2 * T], U = W.low = 0 | a[b + 2 * T + 1]) : (X = j[T - 15], Y = X.high, Z = X.low, $ = (Y >>> 1 | Z << 31) ^ (Y >>> 8 | Z << 24) ^ Y >>> 7, _ = (Z >>> 1 | Y << 31) ^ (Z >>> 8 | Y << 24) ^ (Z >>> 7 | Y << 25), ab = j[T - 2], bb = ab.high, cb = ab.low, db = (bb >>> 19 | cb << 13) ^ (bb << 3 | cb >>> 29) ^ bb >>> 6, eb = (cb >>> 19 | bb << 13) ^ (cb << 3 | bb >>> 29) ^ (cb >>> 6 | bb << 26), fb = j[T - 7], gb = fb.high, hb = fb.low, ib = j[T - 16], jb = ib.high, kb = ib.low, U = _ + hb, V = $ + gb + (_ >>> 0 > U >>> 0 ? 1 : 0), U += eb, V = V + db + (eb >>> 0 > U >>> 0 ? 1 : 0), U += kb, V = V + jb + (kb >>> 0 > U >>> 0 ? 1 : 0), W.high = V, W.low = U), lb = L & N ^ ~L & P, mb = M & O ^ ~M & Q, nb = D & F ^ D & H ^ F & H, ob = E & G ^ E & I ^ G & I, pb = (D >>> 28 | E << 4) ^ (D << 30 | E >>> 2) ^ (D << 25 | E >>> 7), qb = (E >>> 28 | D << 4) ^ (E << 30 | D >>> 2) ^ (E << 25 | D >>> 7), rb = (L >>> 14 | M << 18) ^ (L >>> 18 | M << 14) ^ (L << 23 | M >>> 9), sb = (M >>> 14 | L << 18) ^ (M >>> 18 | L << 14) ^ (M << 23 | L >>> 9), tb = i[T], ub = tb.high, vb = tb.low, wb = S + sb, xb = R + rb + (S >>> 0 > wb >>> 0 ? 1 : 0), wb += mb, xb = xb + lb + (mb >>> 0 > wb >>> 0 ? 1 : 0), wb += vb, xb = xb + ub + (vb >>> 0 > wb >>> 0 ? 1 : 0), wb += U, xb = xb + V + (U >>> 0 > wb >>> 0 ? 1 : 0), yb = qb + ob, zb = pb + nb + (qb >>> 0 > yb >>> 0 ? 1 : 0), R = P, S = Q, P = N, Q = O, N = L, O = M, M = 0 | K + wb, L = 0 | J + xb + (K >>> 0 > M >>> 0 ? 1 : 0), J = H, K = I, H = F, I = G, F = D, G = E, E = 0 | wb + yb, D = 0 | xb + zb + (wb >>> 0 > E >>> 0 ? 1 : 0);
  11707. }
  11708. o = d.low = o + E, d.high = n + D + (E >>> 0 > o >>> 0 ? 1 : 0), q = e.low = q + G, e.high = p + F + (G >>> 0 > q >>> 0 ? 1 : 0), s = f.low = s + I, f.high = r + H + (I >>> 0 > s >>> 0 ? 1 : 0), u = g.low = u + K, g.high = t + J + (K >>> 0 > u >>> 0 ? 1 : 0), w = h.low = w + M, h.high = v + L + (M >>> 0 > w >>> 0 ? 1 : 0), y = k.low = y + O, k.high = x + N + (O >>> 0 > y >>> 0 ? 1 : 0), A = l.low = A + Q, l.high = z + P + (Q >>> 0 > A >>> 0 ? 1 : 0), C = m.low = C + S, m.high = B + R + (S >>> 0 > C >>> 0 ? 1 : 0);
  11709. },
  11710. _doFinalize: function _doFinalize() {
  11711. var e,
  11712. a = this._data,
  11713. b = a.words,
  11714. c = 8 * this._nDataBytes,
  11715. d = 8 * a.sigBytes;
  11716. return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296), b[(d + 128 >>> 10 << 5) + 31] = c, a.sigBytes = 4 * b.length, this._process(), e = this._hash.toX32();
  11717. },
  11718. clone: function clone() {
  11719. var a = c.clone.call(this);
  11720. return a._hash = this._hash.clone(), a;
  11721. },
  11722. blockSize: 32
  11723. }), a.SHA512 = c._createHelper(k), a.HmacSHA512 = c._createHmacHelper(k);
  11724. }(), function () {
  11725. var a = CryptoJS,
  11726. b = a.x64,
  11727. c = b.Word,
  11728. d = b.WordArray,
  11729. e = a.algo,
  11730. f = e.SHA512,
  11731. g = e.SHA384 = f.extend({
  11732. _doReset: function _doReset() {
  11733. this._hash = new d.init([new c.init(3418070365, 3238371032), new c.init(1654270250, 914150663), new c.init(2438529370, 812702999), new c.init(355462360, 4144912697), new c.init(1731405415, 4290775857), new c.init(2394180231, 1750603025), new c.init(3675008525, 1694076839), new c.init(1203062813, 3204075428)]);
  11734. },
  11735. _doFinalize: function _doFinalize() {
  11736. var a = f._doFinalize.call(this);
  11737. return a.sigBytes -= 16, a;
  11738. }
  11739. });
  11740. a.SHA384 = f._createHelper(g), a.HmacSHA384 = f._createHmacHelper(g);
  11741. }(), CryptoJS.lib.Cipher || function (a) {
  11742. var i,
  11743. j,
  11744. k,
  11745. l,
  11746. n,
  11747. o,
  11748. p,
  11749. q,
  11750. r,
  11751. t,
  11752. u,
  11753. v,
  11754. w,
  11755. x,
  11756. y,
  11757. z,
  11758. b = CryptoJS,
  11759. c = b.lib,
  11760. d = c.Base,
  11761. e = c.WordArray,
  11762. f = c.BufferedBlockAlgorithm,
  11763. g = b.enc;
  11764. g.Utf8, i = g.Base64, j = b.algo, k = j.EvpKDF, l = c.Cipher = f.extend({
  11765. cfg: d.extend(),
  11766. createEncryptor: function createEncryptor(a, b) {
  11767. return this.create(this._ENC_XFORM_MODE, a, b);
  11768. },
  11769. createDecryptor: function createDecryptor(a, b) {
  11770. return this.create(this._DEC_XFORM_MODE, a, b);
  11771. },
  11772. init: function init(a, b, c) {
  11773. this.cfg = this.cfg.extend(c), this._xformMode = a, this._key = b, this.reset();
  11774. },
  11775. reset: function reset() {
  11776. f.reset.call(this), this._doReset();
  11777. },
  11778. process: function process(a) {
  11779. return this._append(a), this._process();
  11780. },
  11781. finalize: function finalize(a) {
  11782. a && this._append(a);
  11783. var b = this._doFinalize();
  11784. return b;
  11785. },
  11786. keySize: 4,
  11787. ivSize: 4,
  11788. _ENC_XFORM_MODE: 1,
  11789. _DEC_XFORM_MODE: 2,
  11790. _createHelper: function () {
  11791. function a(a) {
  11792. return "string" == typeof a ? z : w;
  11793. }
  11794. return function (b) {
  11795. return {
  11796. encrypt: function encrypt(c, d, e) {
  11797. return a(d).encrypt(b, c, d, e);
  11798. },
  11799. decrypt: function decrypt(c, d, e) {
  11800. return a(d).decrypt(b, c, d, e);
  11801. }
  11802. };
  11803. };
  11804. }()
  11805. }), c.StreamCipher = l.extend({
  11806. _doFinalize: function _doFinalize() {
  11807. var a = this._process(!0);
  11808. return a;
  11809. },
  11810. blockSize: 1
  11811. }), n = b.mode = {}, o = c.BlockCipherMode = d.extend({
  11812. createEncryptor: function createEncryptor(a, b) {
  11813. return this.Encryptor.create(a, b);
  11814. },
  11815. createDecryptor: function createDecryptor(a, b) {
  11816. return this.Decryptor.create(a, b);
  11817. },
  11818. init: function init(a, b) {
  11819. this._cipher = a, this._iv = b;
  11820. }
  11821. }), p = n.CBC = function () {
  11822. function c(b, c, d) {
  11823. var e,
  11824. g,
  11825. f = this._iv;
  11826. for (f ? (e = f, this._iv = a) : e = this._prevBlock, g = 0; d > g; g++) {
  11827. b[c + g] ^= e[g];
  11828. }
  11829. }
  11830. var b = o.extend();
  11831. return b.Encryptor = b.extend({
  11832. processBlock: function processBlock(a, b) {
  11833. var d = this._cipher,
  11834. e = d.blockSize;
  11835. c.call(this, a, b, e), d.encryptBlock(a, b), this._prevBlock = a.slice(b, b + e);
  11836. }
  11837. }), b.Decryptor = b.extend({
  11838. processBlock: function processBlock(a, b) {
  11839. var d = this._cipher,
  11840. e = d.blockSize,
  11841. f = a.slice(b, b + e);
  11842. d.decryptBlock(a, b), c.call(this, a, b, e), this._prevBlock = f;
  11843. }
  11844. }), b;
  11845. }(), q = b.pad = {}, r = q.Pkcs7 = {
  11846. pad: function pad(a, b) {
  11847. var h,
  11848. i,
  11849. c = 4 * b,
  11850. d = c - a.sigBytes % c,
  11851. f = d << 24 | d << 16 | d << 8 | d,
  11852. g = [];
  11853. for (h = 0; d > h; h += 4) {
  11854. g.push(f);
  11855. }
  11856. i = e.create(g, d), a.concat(i);
  11857. },
  11858. unpad: function unpad(a) {
  11859. var b = 255 & a.words[a.sigBytes - 1 >>> 2];
  11860. a.sigBytes -= b;
  11861. }
  11862. }, c.BlockCipher = l.extend({
  11863. cfg: l.cfg.extend({
  11864. mode: p,
  11865. padding: r
  11866. }),
  11867. reset: function reset() {
  11868. var a, b, c, d;
  11869. l.reset.call(this), b = this.cfg, c = b.iv, d = b.mode, this._xformMode == this._ENC_XFORM_MODE ? a = d.createEncryptor : (a = d.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, c && c.words) : (this._mode = a.call(d, this, c && c.words), this._mode.__creator = a);
  11870. },
  11871. _doProcessBlock: function _doProcessBlock(a, b) {
  11872. this._mode.processBlock(a, b);
  11873. },
  11874. _doFinalize: function _doFinalize() {
  11875. var a,
  11876. b = this.cfg.padding;
  11877. return this._xformMode == this._ENC_XFORM_MODE ? (b.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), b.unpad(a)), a;
  11878. },
  11879. blockSize: 4
  11880. }), t = c.CipherParams = d.extend({
  11881. init: function init(a) {
  11882. this.mixIn(a);
  11883. },
  11884. toString: function toString(a) {
  11885. return (a || this.formatter).stringify(this);
  11886. }
  11887. }), u = b.format = {}, v = u.OpenSSL = {
  11888. stringify: function stringify(a) {
  11889. var b,
  11890. c = a.ciphertext,
  11891. d = a.salt;
  11892. return b = d ? e.create([1398893684, 1701076831]).concat(d).concat(c) : c, b.toString(i);
  11893. },
  11894. parse: function parse(a) {
  11895. var b,
  11896. c = i.parse(a),
  11897. d = c.words;
  11898. return 1398893684 == d[0] && 1701076831 == d[1] && (b = e.create(d.slice(2, 4)), d.splice(0, 4), c.sigBytes -= 16), t.create({
  11899. ciphertext: c,
  11900. salt: b
  11901. });
  11902. }
  11903. }, w = c.SerializableCipher = d.extend({
  11904. cfg: d.extend({
  11905. format: v
  11906. }),
  11907. encrypt: function encrypt(a, b, c, d) {
  11908. var e, f, g;
  11909. return d = this.cfg.extend(d), e = a.createEncryptor(c, d), f = e.finalize(b), g = e.cfg, t.create({
  11910. ciphertext: f,
  11911. key: c,
  11912. iv: g.iv,
  11913. algorithm: a,
  11914. mode: g.mode,
  11915. padding: g.padding,
  11916. blockSize: a.blockSize,
  11917. formatter: d.format
  11918. });
  11919. },
  11920. decrypt: function decrypt(a, b, c, d) {
  11921. d = this.cfg.extend(d), b = this._parse(b, d.format);
  11922. var e = a.createDecryptor(c, d).finalize(b.ciphertext);
  11923. return e;
  11924. },
  11925. _parse: function _parse(a, b) {
  11926. return "string" == typeof a ? b.parse(a, this) : a;
  11927. }
  11928. }), x = b.kdf = {}, y = x.OpenSSL = {
  11929. execute: function execute(a, b, c, d) {
  11930. var f, g;
  11931. return d || (d = e.random(8)), f = k.create({
  11932. keySize: b + c
  11933. }).compute(a, d), g = e.create(f.words.slice(b), 4 * c), f.sigBytes = 4 * b, t.create({
  11934. key: f,
  11935. iv: g,
  11936. salt: d
  11937. });
  11938. }
  11939. }, z = c.PasswordBasedCipher = w.extend({
  11940. cfg: w.cfg.extend({
  11941. kdf: y
  11942. }),
  11943. encrypt: function encrypt(a, b, c, d) {
  11944. var e, f;
  11945. return d = this.cfg.extend(d), e = d.kdf.execute(c, a.keySize, a.ivSize), d.iv = e.iv, f = w.encrypt.call(this, a, b, e.key, d), f.mixIn(e), f;
  11946. },
  11947. decrypt: function decrypt(a, b, c, d) {
  11948. var e, f;
  11949. return d = this.cfg.extend(d), b = this._parse(b, d.format), e = d.kdf.execute(c, a.keySize, a.ivSize, b.salt), d.iv = e.iv, f = w.decrypt.call(this, a, b, e.key, d);
  11950. }
  11951. });
  11952. }(), CryptoJS.mode.CFB = function () {
  11953. function b(a, b, c, d) {
  11954. var e,
  11955. g,
  11956. f = this._iv;
  11957. for (f ? (e = f.slice(0), this._iv = void 0) : e = this._prevBlock, d.encryptBlock(e, 0), g = 0; c > g; g++) {
  11958. a[b + g] ^= e[g];
  11959. }
  11960. }
  11961. var a = CryptoJS.lib.BlockCipherMode.extend();
  11962. return a.Encryptor = a.extend({
  11963. processBlock: function processBlock(a, c) {
  11964. var d = this._cipher,
  11965. e = d.blockSize;
  11966. b.call(this, a, c, e, d), this._prevBlock = a.slice(c, c + e);
  11967. }
  11968. }), a.Decryptor = a.extend({
  11969. processBlock: function processBlock(a, c) {
  11970. var d = this._cipher,
  11971. e = d.blockSize,
  11972. f = a.slice(c, c + e);
  11973. b.call(this, a, c, e, d), this._prevBlock = f;
  11974. }
  11975. }), a;
  11976. }(), CryptoJS.mode.ECB = function () {
  11977. var a = CryptoJS.lib.BlockCipherMode.extend();
  11978. return a.Encryptor = a.extend({
  11979. processBlock: function processBlock(a, b) {
  11980. this._cipher.encryptBlock(a, b);
  11981. }
  11982. }), a.Decryptor = a.extend({
  11983. processBlock: function processBlock(a, b) {
  11984. this._cipher.decryptBlock(a, b);
  11985. }
  11986. }), a;
  11987. }(), CryptoJS.pad.AnsiX923 = {
  11988. pad: function pad(a, b) {
  11989. var c = a.sigBytes,
  11990. d = 4 * b,
  11991. e = d - c % d,
  11992. f = c + e - 1;
  11993. a.clamp(), a.words[f >>> 2] |= e << 24 - 8 * (f % 4), a.sigBytes += e;
  11994. },
  11995. unpad: function unpad(a) {
  11996. var b = 255 & a.words[a.sigBytes - 1 >>> 2];
  11997. a.sigBytes -= b;
  11998. }
  11999. }, CryptoJS.pad.Iso10126 = {
  12000. pad: function pad(a, b) {
  12001. var c = 4 * b,
  12002. d = c - a.sigBytes % c;
  12003. a.concat(CryptoJS.lib.WordArray.random(d - 1)).concat(CryptoJS.lib.WordArray.create([d << 24], 1));
  12004. },
  12005. unpad: function unpad(a) {
  12006. var b = 255 & a.words[a.sigBytes - 1 >>> 2];
  12007. a.sigBytes -= b;
  12008. }
  12009. }, CryptoJS.pad.Iso97971 = {
  12010. pad: function pad(a, b) {
  12011. a.concat(CryptoJS.lib.WordArray.create([2147483648], 1)), CryptoJS.pad.ZeroPadding.pad(a, b);
  12012. },
  12013. unpad: function unpad(a) {
  12014. CryptoJS.pad.ZeroPadding.unpad(a), a.sigBytes--;
  12015. }
  12016. }, CryptoJS.mode.OFB = function () {
  12017. var a = CryptoJS.lib.BlockCipherMode.extend(),
  12018. b = a.Encryptor = a.extend({
  12019. processBlock: function processBlock(a, b) {
  12020. var g,
  12021. c = this._cipher,
  12022. d = c.blockSize,
  12023. e = this._iv,
  12024. f = this._keystream;
  12025. for (e && (f = this._keystream = e.slice(0), this._iv = void 0), c.encryptBlock(f, 0), g = 0; d > g; g++) {
  12026. a[b + g] ^= f[g];
  12027. }
  12028. }
  12029. });
  12030. return a.Decryptor = b, a;
  12031. }(), CryptoJS.pad.NoPadding = {
  12032. pad: function pad() {},
  12033. unpad: function unpad() {}
  12034. }, function () {
  12035. var b = CryptoJS,
  12036. c = b.lib,
  12037. d = c.CipherParams,
  12038. e = b.enc,
  12039. f = e.Hex,
  12040. g = b.format;
  12041. g.Hex = {
  12042. stringify: function stringify(a) {
  12043. return a.ciphertext.toString(f);
  12044. },
  12045. parse: function parse(a) {
  12046. var b = f.parse(a);
  12047. return d.create({
  12048. ciphertext: b
  12049. });
  12050. }
  12051. };
  12052. }(), function () {
  12053. var o,
  12054. p,
  12055. a = CryptoJS,
  12056. b = a.lib,
  12057. c = b.BlockCipher,
  12058. d = a.algo,
  12059. e = [],
  12060. f = [],
  12061. g = [],
  12062. h = [],
  12063. i = [],
  12064. j = [],
  12065. k = [],
  12066. l = [],
  12067. m = [],
  12068. n = [];
  12069. !function () {
  12070. var b,
  12071. c,
  12072. d,
  12073. o,
  12074. p,
  12075. q,
  12076. r,
  12077. s,
  12078. a = [];
  12079. for (b = 0; 256 > b; b++) {
  12080. a[b] = 128 > b ? b << 1 : 283 ^ b << 1;
  12081. }
  12082. for (c = 0, d = 0, b = 0; 256 > b; b++) {
  12083. o = d ^ d << 1 ^ d << 2 ^ d << 3 ^ d << 4, o = 99 ^ (o >>> 8 ^ 255 & o), e[c] = o, f[o] = c, p = a[c], q = a[p], r = a[q], s = 257 * a[o] ^ 16843008 * o, g[c] = s << 24 | s >>> 8, h[c] = s << 16 | s >>> 16, i[c] = s << 8 | s >>> 24, j[c] = s, s = 16843009 * r ^ 65537 * q ^ 257 * p ^ 16843008 * c, k[o] = s << 24 | s >>> 8, l[o] = s << 16 | s >>> 16, m[o] = s << 8 | s >>> 24, n[o] = s, c ? (c = p ^ a[a[a[r ^ p]]], d ^= a[a[d]]) : c = d = 1;
  12084. }
  12085. }(), o = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], p = d.AES = c.extend({
  12086. _doReset: function _doReset() {
  12087. var a, b, c, d, f, g, h, i, j, p;
  12088. if (!this._nRounds || this._keyPriorReset !== this._key) {
  12089. for (b = this._keyPriorReset = this._key, c = b.words, d = b.sigBytes / 4, f = this._nRounds = d + 6, g = 4 * (f + 1), h = this._keySchedule = [], i = 0; g > i; i++) {
  12090. d > i ? h[i] = c[i] : (a = h[i - 1], i % d ? d > 6 && 4 == i % d && (a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a]) : (a = a << 8 | a >>> 24, a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a], a ^= o[0 | i / d] << 24), h[i] = h[i - d] ^ a);
  12091. }
  12092. for (j = this._invKeySchedule = [], p = 0; g > p; p++) {
  12093. i = g - p, a = p % 4 ? h[i] : h[i - 4], j[p] = 4 > p || 4 >= i ? a : k[e[a >>> 24]] ^ l[e[255 & a >>> 16]] ^ m[e[255 & a >>> 8]] ^ n[e[255 & a]];
  12094. }
  12095. }
  12096. },
  12097. encryptBlock: function encryptBlock(a, b) {
  12098. this._doCryptBlock(a, b, this._keySchedule, g, h, i, j, e);
  12099. },
  12100. decryptBlock: function decryptBlock(a, b) {
  12101. var c = a[b + 1];
  12102. a[b + 1] = a[b + 3], a[b + 3] = c, this._doCryptBlock(a, b, this._invKeySchedule, k, l, m, n, f), c = a[b + 1], a[b + 1] = a[b + 3], a[b + 3] = c;
  12103. },
  12104. _doCryptBlock: function _doCryptBlock(a, b, c, d, e, f, g, h) {
  12105. var o,
  12106. p,
  12107. q,
  12108. r,
  12109. s,
  12110. i = this._nRounds,
  12111. j = a[b] ^ c[0],
  12112. k = a[b + 1] ^ c[1],
  12113. l = a[b + 2] ^ c[2],
  12114. m = a[b + 3] ^ c[3],
  12115. n = 4;
  12116. for (o = 1; i > o; o++) {
  12117. p = d[j >>> 24] ^ e[255 & k >>> 16] ^ f[255 & l >>> 8] ^ g[255 & m] ^ c[n++], q = d[k >>> 24] ^ e[255 & l >>> 16] ^ f[255 & m >>> 8] ^ g[255 & j] ^ c[n++], r = d[l >>> 24] ^ e[255 & m >>> 16] ^ f[255 & j >>> 8] ^ g[255 & k] ^ c[n++], s = d[m >>> 24] ^ e[255 & j >>> 16] ^ f[255 & k >>> 8] ^ g[255 & l] ^ c[n++], j = p, k = q, l = r, m = s;
  12118. }
  12119. p = (h[j >>> 24] << 24 | h[255 & k >>> 16] << 16 | h[255 & l >>> 8] << 8 | h[255 & m]) ^ c[n++], q = (h[k >>> 24] << 24 | h[255 & l >>> 16] << 16 | h[255 & m >>> 8] << 8 | h[255 & j]) ^ c[n++], r = (h[l >>> 24] << 24 | h[255 & m >>> 16] << 16 | h[255 & j >>> 8] << 8 | h[255 & k]) ^ c[n++], s = (h[m >>> 24] << 24 | h[255 & j >>> 16] << 16 | h[255 & k >>> 8] << 8 | h[255 & l]) ^ c[n++], a[b] = p, a[b + 1] = q, a[b + 2] = r, a[b + 3] = s;
  12120. },
  12121. keySize: 8
  12122. }), a.AES = c._createHelper(p);
  12123. }(), function () {
  12124. function l(a, b) {
  12125. var c = (this._lBlock >>> a ^ this._rBlock) & b;
  12126. this._rBlock ^= c, this._lBlock ^= c << a;
  12127. }
  12128. function m(a, b) {
  12129. var c = (this._rBlock >>> a ^ this._lBlock) & b;
  12130. this._lBlock ^= c, this._rBlock ^= c << a;
  12131. }
  12132. var n,
  12133. a = CryptoJS,
  12134. b = a.lib,
  12135. c = b.WordArray,
  12136. d = b.BlockCipher,
  12137. e = a.algo,
  12138. f = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
  12139. g = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
  12140. h = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
  12141. i = [{
  12142. 0: 8421888,
  12143. 268435456: 32768,
  12144. 536870912: 8421378,
  12145. 805306368: 2,
  12146. 1073741824: 512,
  12147. 1342177280: 8421890,
  12148. 1610612736: 8389122,
  12149. 1879048192: 8388608,
  12150. 2147483648: 514,
  12151. 2415919104: 8389120,
  12152. 2684354560: 33280,
  12153. 2952790016: 8421376,
  12154. 3221225472: 32770,
  12155. 3489660928: 8388610,
  12156. 3758096384: 0,
  12157. 4026531840: 33282,
  12158. 134217728: 0,
  12159. 402653184: 8421890,
  12160. 671088640: 33282,
  12161. 939524096: 32768,
  12162. 1207959552: 8421888,
  12163. 1476395008: 512,
  12164. 1744830464: 8421378,
  12165. 2013265920: 2,
  12166. 2281701376: 8389120,
  12167. 2550136832: 33280,
  12168. 2818572288: 8421376,
  12169. 3087007744: 8389122,
  12170. 3355443200: 8388610,
  12171. 3623878656: 32770,
  12172. 3892314112: 514,
  12173. 4160749568: 8388608,
  12174. 1: 32768,
  12175. 268435457: 2,
  12176. 536870913: 8421888,
  12177. 805306369: 8388608,
  12178. 1073741825: 8421378,
  12179. 1342177281: 33280,
  12180. 1610612737: 512,
  12181. 1879048193: 8389122,
  12182. 2147483649: 8421890,
  12183. 2415919105: 8421376,
  12184. 2684354561: 8388610,
  12185. 2952790017: 33282,
  12186. 3221225473: 514,
  12187. 3489660929: 8389120,
  12188. 3758096385: 32770,
  12189. 4026531841: 0,
  12190. 134217729: 8421890,
  12191. 402653185: 8421376,
  12192. 671088641: 8388608,
  12193. 939524097: 512,
  12194. 1207959553: 32768,
  12195. 1476395009: 8388610,
  12196. 1744830465: 2,
  12197. 2013265921: 33282,
  12198. 2281701377: 32770,
  12199. 2550136833: 8389122,
  12200. 2818572289: 514,
  12201. 3087007745: 8421888,
  12202. 3355443201: 8389120,
  12203. 3623878657: 0,
  12204. 3892314113: 33280,
  12205. 4160749569: 8421378
  12206. }, {
  12207. 0: 1074282512,
  12208. 16777216: 16384,
  12209. 33554432: 524288,
  12210. 50331648: 1074266128,
  12211. 67108864: 1073741840,
  12212. 83886080: 1074282496,
  12213. 100663296: 1073758208,
  12214. 117440512: 16,
  12215. 134217728: 540672,
  12216. 150994944: 1073758224,
  12217. 167772160: 1073741824,
  12218. 184549376: 540688,
  12219. 201326592: 524304,
  12220. 218103808: 0,
  12221. 234881024: 16400,
  12222. 251658240: 1074266112,
  12223. 8388608: 1073758208,
  12224. 25165824: 540688,
  12225. 41943040: 16,
  12226. 58720256: 1073758224,
  12227. 75497472: 1074282512,
  12228. 92274688: 1073741824,
  12229. 109051904: 524288,
  12230. 125829120: 1074266128,
  12231. 142606336: 524304,
  12232. 159383552: 0,
  12233. 176160768: 16384,
  12234. 192937984: 1074266112,
  12235. 209715200: 1073741840,
  12236. 226492416: 540672,
  12237. 243269632: 1074282496,
  12238. 260046848: 16400,
  12239. 268435456: 0,
  12240. 285212672: 1074266128,
  12241. 301989888: 1073758224,
  12242. 318767104: 1074282496,
  12243. 335544320: 1074266112,
  12244. 352321536: 16,
  12245. 369098752: 540688,
  12246. 385875968: 16384,
  12247. 402653184: 16400,
  12248. 419430400: 524288,
  12249. 436207616: 524304,
  12250. 452984832: 1073741840,
  12251. 469762048: 540672,
  12252. 486539264: 1073758208,
  12253. 503316480: 1073741824,
  12254. 520093696: 1074282512,
  12255. 276824064: 540688,
  12256. 293601280: 524288,
  12257. 310378496: 1074266112,
  12258. 327155712: 16384,
  12259. 343932928: 1073758208,
  12260. 360710144: 1074282512,
  12261. 377487360: 16,
  12262. 394264576: 1073741824,
  12263. 411041792: 1074282496,
  12264. 427819008: 1073741840,
  12265. 444596224: 1073758224,
  12266. 461373440: 524304,
  12267. 478150656: 0,
  12268. 494927872: 16400,
  12269. 511705088: 1074266128,
  12270. 528482304: 540672
  12271. }, {
  12272. 0: 260,
  12273. 1048576: 0,
  12274. 2097152: 67109120,
  12275. 3145728: 65796,
  12276. 4194304: 65540,
  12277. 5242880: 67108868,
  12278. 6291456: 67174660,
  12279. 7340032: 67174400,
  12280. 8388608: 67108864,
  12281. 9437184: 67174656,
  12282. 10485760: 65792,
  12283. 11534336: 67174404,
  12284. 12582912: 67109124,
  12285. 13631488: 65536,
  12286. 14680064: 4,
  12287. 15728640: 256,
  12288. 524288: 67174656,
  12289. 1572864: 67174404,
  12290. 2621440: 0,
  12291. 3670016: 67109120,
  12292. 4718592: 67108868,
  12293. 5767168: 65536,
  12294. 6815744: 65540,
  12295. 7864320: 260,
  12296. 8912896: 4,
  12297. 9961472: 256,
  12298. 11010048: 67174400,
  12299. 12058624: 65796,
  12300. 13107200: 65792,
  12301. 14155776: 67109124,
  12302. 15204352: 67174660,
  12303. 16252928: 67108864,
  12304. 16777216: 67174656,
  12305. 17825792: 65540,
  12306. 18874368: 65536,
  12307. 19922944: 67109120,
  12308. 20971520: 256,
  12309. 22020096: 67174660,
  12310. 23068672: 67108868,
  12311. 24117248: 0,
  12312. 25165824: 67109124,
  12313. 26214400: 67108864,
  12314. 27262976: 4,
  12315. 28311552: 65792,
  12316. 29360128: 67174400,
  12317. 30408704: 260,
  12318. 31457280: 65796,
  12319. 32505856: 67174404,
  12320. 17301504: 67108864,
  12321. 18350080: 260,
  12322. 19398656: 67174656,
  12323. 20447232: 0,
  12324. 21495808: 65540,
  12325. 22544384: 67109120,
  12326. 23592960: 256,
  12327. 24641536: 67174404,
  12328. 25690112: 65536,
  12329. 26738688: 67174660,
  12330. 27787264: 65796,
  12331. 28835840: 67108868,
  12332. 29884416: 67109124,
  12333. 30932992: 67174400,
  12334. 31981568: 4,
  12335. 33030144: 65792
  12336. }, {
  12337. 0: 2151682048,
  12338. 65536: 2147487808,
  12339. 131072: 4198464,
  12340. 196608: 2151677952,
  12341. 262144: 0,
  12342. 327680: 4198400,
  12343. 393216: 2147483712,
  12344. 458752: 4194368,
  12345. 524288: 2147483648,
  12346. 589824: 4194304,
  12347. 655360: 64,
  12348. 720896: 2147487744,
  12349. 786432: 2151678016,
  12350. 851968: 4160,
  12351. 917504: 4096,
  12352. 983040: 2151682112,
  12353. 32768: 2147487808,
  12354. 98304: 64,
  12355. 163840: 2151678016,
  12356. 229376: 2147487744,
  12357. 294912: 4198400,
  12358. 360448: 2151682112,
  12359. 425984: 0,
  12360. 491520: 2151677952,
  12361. 557056: 4096,
  12362. 622592: 2151682048,
  12363. 688128: 4194304,
  12364. 753664: 4160,
  12365. 819200: 2147483648,
  12366. 884736: 4194368,
  12367. 950272: 4198464,
  12368. 1015808: 2147483712,
  12369. 1048576: 4194368,
  12370. 1114112: 4198400,
  12371. 1179648: 2147483712,
  12372. 1245184: 0,
  12373. 1310720: 4160,
  12374. 1376256: 2151678016,
  12375. 1441792: 2151682048,
  12376. 1507328: 2147487808,
  12377. 1572864: 2151682112,
  12378. 1638400: 2147483648,
  12379. 1703936: 2151677952,
  12380. 1769472: 4198464,
  12381. 1835008: 2147487744,
  12382. 1900544: 4194304,
  12383. 1966080: 64,
  12384. 2031616: 4096,
  12385. 1081344: 2151677952,
  12386. 1146880: 2151682112,
  12387. 1212416: 0,
  12388. 1277952: 4198400,
  12389. 1343488: 4194368,
  12390. 1409024: 2147483648,
  12391. 1474560: 2147487808,
  12392. 1540096: 64,
  12393. 1605632: 2147483712,
  12394. 1671168: 4096,
  12395. 1736704: 2147487744,
  12396. 1802240: 2151678016,
  12397. 1867776: 4160,
  12398. 1933312: 2151682048,
  12399. 1998848: 4194304,
  12400. 2064384: 4198464
  12401. }, {
  12402. 0: 128,
  12403. 4096: 17039360,
  12404. 8192: 262144,
  12405. 12288: 536870912,
  12406. 16384: 537133184,
  12407. 20480: 16777344,
  12408. 24576: 553648256,
  12409. 28672: 262272,
  12410. 32768: 16777216,
  12411. 36864: 537133056,
  12412. 40960: 536871040,
  12413. 45056: 553910400,
  12414. 49152: 553910272,
  12415. 53248: 0,
  12416. 57344: 17039488,
  12417. 61440: 553648128,
  12418. 2048: 17039488,
  12419. 6144: 553648256,
  12420. 10240: 128,
  12421. 14336: 17039360,
  12422. 18432: 262144,
  12423. 22528: 537133184,
  12424. 26624: 553910272,
  12425. 30720: 536870912,
  12426. 34816: 537133056,
  12427. 38912: 0,
  12428. 43008: 553910400,
  12429. 47104: 16777344,
  12430. 51200: 536871040,
  12431. 55296: 553648128,
  12432. 59392: 16777216,
  12433. 63488: 262272,
  12434. 65536: 262144,
  12435. 69632: 128,
  12436. 73728: 536870912,
  12437. 77824: 553648256,
  12438. 81920: 16777344,
  12439. 86016: 553910272,
  12440. 90112: 537133184,
  12441. 94208: 16777216,
  12442. 98304: 553910400,
  12443. 102400: 553648128,
  12444. 106496: 17039360,
  12445. 110592: 537133056,
  12446. 114688: 262272,
  12447. 118784: 536871040,
  12448. 122880: 0,
  12449. 126976: 17039488,
  12450. 67584: 553648256,
  12451. 71680: 16777216,
  12452. 75776: 17039360,
  12453. 79872: 537133184,
  12454. 83968: 536870912,
  12455. 88064: 17039488,
  12456. 92160: 128,
  12457. 96256: 553910272,
  12458. 100352: 262272,
  12459. 104448: 553910400,
  12460. 108544: 0,
  12461. 112640: 553648128,
  12462. 116736: 16777344,
  12463. 120832: 262144,
  12464. 124928: 537133056,
  12465. 129024: 536871040
  12466. }, {
  12467. 0: 268435464,
  12468. 256: 8192,
  12469. 512: 270532608,
  12470. 768: 270540808,
  12471. 1024: 268443648,
  12472. 1280: 2097152,
  12473. 1536: 2097160,
  12474. 1792: 268435456,
  12475. 2048: 0,
  12476. 2304: 268443656,
  12477. 2560: 2105344,
  12478. 2816: 8,
  12479. 3072: 270532616,
  12480. 3328: 2105352,
  12481. 3584: 8200,
  12482. 3840: 270540800,
  12483. 128: 270532608,
  12484. 384: 270540808,
  12485. 640: 8,
  12486. 896: 2097152,
  12487. 1152: 2105352,
  12488. 1408: 268435464,
  12489. 1664: 268443648,
  12490. 1920: 8200,
  12491. 2176: 2097160,
  12492. 2432: 8192,
  12493. 2688: 268443656,
  12494. 2944: 270532616,
  12495. 3200: 0,
  12496. 3456: 270540800,
  12497. 3712: 2105344,
  12498. 3968: 268435456,
  12499. 4096: 268443648,
  12500. 4352: 270532616,
  12501. 4608: 270540808,
  12502. 4864: 8200,
  12503. 5120: 2097152,
  12504. 5376: 268435456,
  12505. 5632: 268435464,
  12506. 5888: 2105344,
  12507. 6144: 2105352,
  12508. 6400: 0,
  12509. 6656: 8,
  12510. 6912: 270532608,
  12511. 7168: 8192,
  12512. 7424: 268443656,
  12513. 7680: 270540800,
  12514. 7936: 2097160,
  12515. 4224: 8,
  12516. 4480: 2105344,
  12517. 4736: 2097152,
  12518. 4992: 268435464,
  12519. 5248: 268443648,
  12520. 5504: 8200,
  12521. 5760: 270540808,
  12522. 6016: 270532608,
  12523. 6272: 270540800,
  12524. 6528: 270532616,
  12525. 6784: 8192,
  12526. 7040: 2105352,
  12527. 7296: 2097160,
  12528. 7552: 0,
  12529. 7808: 268435456,
  12530. 8064: 268443656
  12531. }, {
  12532. 0: 1048576,
  12533. 16: 33555457,
  12534. 32: 1024,
  12535. 48: 1049601,
  12536. 64: 34604033,
  12537. 80: 0,
  12538. 96: 1,
  12539. 112: 34603009,
  12540. 128: 33555456,
  12541. 144: 1048577,
  12542. 160: 33554433,
  12543. 176: 34604032,
  12544. 192: 34603008,
  12545. 208: 1025,
  12546. 224: 1049600,
  12547. 240: 33554432,
  12548. 8: 34603009,
  12549. 24: 0,
  12550. 40: 33555457,
  12551. 56: 34604032,
  12552. 72: 1048576,
  12553. 88: 33554433,
  12554. 104: 33554432,
  12555. 120: 1025,
  12556. 136: 1049601,
  12557. 152: 33555456,
  12558. 168: 34603008,
  12559. 184: 1048577,
  12560. 200: 1024,
  12561. 216: 34604033,
  12562. 232: 1,
  12563. 248: 1049600,
  12564. 256: 33554432,
  12565. 272: 1048576,
  12566. 288: 33555457,
  12567. 304: 34603009,
  12568. 320: 1048577,
  12569. 336: 33555456,
  12570. 352: 34604032,
  12571. 368: 1049601,
  12572. 384: 1025,
  12573. 400: 34604033,
  12574. 416: 1049600,
  12575. 432: 1,
  12576. 448: 0,
  12577. 464: 34603008,
  12578. 480: 33554433,
  12579. 496: 1024,
  12580. 264: 1049600,
  12581. 280: 33555457,
  12582. 296: 34603009,
  12583. 312: 1,
  12584. 328: 33554432,
  12585. 344: 1048576,
  12586. 360: 1025,
  12587. 376: 34604032,
  12588. 392: 33554433,
  12589. 408: 34603008,
  12590. 424: 0,
  12591. 440: 34604033,
  12592. 456: 1049601,
  12593. 472: 1024,
  12594. 488: 33555456,
  12595. 504: 1048577
  12596. }, {
  12597. 0: 134219808,
  12598. 1: 131072,
  12599. 2: 134217728,
  12600. 3: 32,
  12601. 4: 131104,
  12602. 5: 134350880,
  12603. 6: 134350848,
  12604. 7: 2048,
  12605. 8: 134348800,
  12606. 9: 134219776,
  12607. 10: 133120,
  12608. 11: 134348832,
  12609. 12: 2080,
  12610. 13: 0,
  12611. 14: 134217760,
  12612. 15: 133152,
  12613. 2147483648: 2048,
  12614. 2147483649: 134350880,
  12615. 2147483650: 134219808,
  12616. 2147483651: 134217728,
  12617. 2147483652: 134348800,
  12618. 2147483653: 133120,
  12619. 2147483654: 133152,
  12620. 2147483655: 32,
  12621. 2147483656: 134217760,
  12622. 2147483657: 2080,
  12623. 2147483658: 131104,
  12624. 2147483659: 134350848,
  12625. 2147483660: 0,
  12626. 2147483661: 134348832,
  12627. 2147483662: 134219776,
  12628. 2147483663: 131072,
  12629. 16: 133152,
  12630. 17: 134350848,
  12631. 18: 32,
  12632. 19: 2048,
  12633. 20: 134219776,
  12634. 21: 134217760,
  12635. 22: 134348832,
  12636. 23: 131072,
  12637. 24: 0,
  12638. 25: 131104,
  12639. 26: 134348800,
  12640. 27: 134219808,
  12641. 28: 134350880,
  12642. 29: 133120,
  12643. 30: 2080,
  12644. 31: 134217728,
  12645. 2147483664: 131072,
  12646. 2147483665: 2048,
  12647. 2147483666: 134348832,
  12648. 2147483667: 133152,
  12649. 2147483668: 32,
  12650. 2147483669: 134348800,
  12651. 2147483670: 134217728,
  12652. 2147483671: 134219808,
  12653. 2147483672: 134350880,
  12654. 2147483673: 134217760,
  12655. 2147483674: 134219776,
  12656. 2147483675: 0,
  12657. 2147483676: 133120,
  12658. 2147483677: 2080,
  12659. 2147483678: 131104,
  12660. 2147483679: 134350848
  12661. }],
  12662. j = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],
  12663. k = e.DES = d.extend({
  12664. _doReset: function _doReset() {
  12665. var d,
  12666. e,
  12667. i,
  12668. j,
  12669. k,
  12670. l,
  12671. m,
  12672. a = this._key,
  12673. b = a.words,
  12674. c = [];
  12675. for (d = 0; 56 > d; d++) {
  12676. e = f[d] - 1, c[d] = 1 & b[e >>> 5] >>> 31 - e % 32;
  12677. }
  12678. for (i = this._subKeys = [], j = 0; 16 > j; j++) {
  12679. for (k = i[j] = [], l = h[j], d = 0; 24 > d; d++) {
  12680. k[0 | d / 6] |= c[(g[d] - 1 + l) % 28] << 31 - d % 6, k[4 + (0 | d / 6)] |= c[28 + (g[d + 24] - 1 + l) % 28] << 31 - d % 6;
  12681. }
  12682. for (k[0] = k[0] << 1 | k[0] >>> 31, d = 1; 7 > d; d++) {
  12683. k[d] = k[d] >>> 4 * (d - 1) + 3;
  12684. }
  12685. k[7] = k[7] << 5 | k[7] >>> 27;
  12686. }
  12687. for (m = this._invSubKeys = [], d = 0; 16 > d; d++) {
  12688. m[d] = i[15 - d];
  12689. }
  12690. },
  12691. encryptBlock: function encryptBlock(a, b) {
  12692. this._doCryptBlock(a, b, this._subKeys);
  12693. },
  12694. decryptBlock: function decryptBlock(a, b) {
  12695. this._doCryptBlock(a, b, this._invSubKeys);
  12696. },
  12697. _doCryptBlock: function _doCryptBlock(a, b, c) {
  12698. var d, e, f, g, h, k, n;
  12699. for (this._lBlock = a[b], this._rBlock = a[b + 1], l.call(this, 4, 252645135), l.call(this, 16, 65535), m.call(this, 2, 858993459), m.call(this, 8, 16711935), l.call(this, 1, 1431655765), d = 0; 16 > d; d++) {
  12700. for (e = c[d], f = this._lBlock, g = this._rBlock, h = 0, k = 0; 8 > k; k++) {
  12701. h |= i[k][((g ^ e[k]) & j[k]) >>> 0];
  12702. }
  12703. this._lBlock = g, this._rBlock = f ^ h;
  12704. }
  12705. n = this._lBlock, this._lBlock = this._rBlock, this._rBlock = n, l.call(this, 1, 1431655765), m.call(this, 8, 16711935), m.call(this, 2, 858993459), l.call(this, 16, 65535), l.call(this, 4, 252645135), a[b] = this._lBlock, a[b + 1] = this._rBlock;
  12706. },
  12707. keySize: 2,
  12708. ivSize: 2,
  12709. blockSize: 2
  12710. });
  12711. a.DES = d._createHelper(k), n = e.TripleDES = d.extend({
  12712. _doReset: function _doReset() {
  12713. var d,
  12714. e,
  12715. f,
  12716. a = this._key,
  12717. b = a.words;
  12718. if (2 !== b.length && 4 !== b.length && b.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
  12719. d = b.slice(0, 2), e = b.length < 4 ? b.slice(0, 2) : b.slice(2, 4), f = b.length < 6 ? b.slice(0, 2) : b.slice(4, 6), this._des1 = k.createEncryptor(c.create(d)), this._des2 = k.createEncryptor(c.create(e)), this._des3 = k.createEncryptor(c.create(f));
  12720. },
  12721. encryptBlock: function encryptBlock(a, b) {
  12722. this._des1.encryptBlock(a, b), this._des2.decryptBlock(a, b), this._des3.encryptBlock(a, b);
  12723. },
  12724. decryptBlock: function decryptBlock(a, b) {
  12725. this._des3.decryptBlock(a, b), this._des2.encryptBlock(a, b), this._des1.decryptBlock(a, b);
  12726. },
  12727. keySize: 6,
  12728. ivSize: 2,
  12729. blockSize: 2
  12730. }), a.TripleDES = d._createHelper(n);
  12731. }(), function () {
  12732. function f() {
  12733. var e,
  12734. f,
  12735. a = this._S,
  12736. b = this._i,
  12737. c = this._j,
  12738. d = 0;
  12739. for (e = 0; 4 > e; e++) {
  12740. b = (b + 1) % 256, c = (c + a[b]) % 256, f = a[b], a[b] = a[c], a[c] = f, d |= a[(a[b] + a[c]) % 256] << 24 - 8 * e;
  12741. }
  12742. return this._i = b, this._j = c, d;
  12743. }
  12744. var g,
  12745. a = CryptoJS,
  12746. b = a.lib,
  12747. c = b.StreamCipher,
  12748. d = a.algo,
  12749. e = d.RC4 = c.extend({
  12750. _doReset: function _doReset() {
  12751. var e,
  12752. f,
  12753. g,
  12754. h,
  12755. i,
  12756. a = this._key,
  12757. b = a.words,
  12758. c = a.sigBytes,
  12759. d = this._S = [];
  12760. for (e = 0; 256 > e; e++) {
  12761. d[e] = e;
  12762. }
  12763. for (e = 0, f = 0; 256 > e; e++) {
  12764. g = e % c, h = 255 & b[g >>> 2] >>> 24 - 8 * (g % 4), f = (f + d[e] + h) % 256, i = d[e], d[e] = d[f], d[f] = i;
  12765. }
  12766. this._i = this._j = 0;
  12767. },
  12768. _doProcessBlock: function _doProcessBlock(a, b) {
  12769. a[b] ^= f.call(this);
  12770. },
  12771. keySize: 8,
  12772. ivSize: 0
  12773. });
  12774. a.RC4 = c._createHelper(e), g = d.RC4Drop = e.extend({
  12775. cfg: e.cfg.extend({
  12776. drop: 192
  12777. }),
  12778. _doReset: function _doReset() {
  12779. e._doReset.call(this);
  12780. for (var a = this.cfg.drop; a > 0; a--) {
  12781. f.call(this);
  12782. }
  12783. }
  12784. }), a.RC4Drop = c._createHelper(g);
  12785. }(), CryptoJS.mode.CTRGladman = function () {
  12786. function b(a) {
  12787. var b, c, d;
  12788. return 255 === (255 & a >> 24) ? (b = 255 & a >> 16, c = 255 & a >> 8, d = 255 & a, 255 === b ? (b = 0, 255 === c ? (c = 0, 255 === d ? d = 0 : ++d) : ++c) : ++b, a = 0, a += b << 16, a += c << 8, a += d) : a += 1 << 24, a;
  12789. }
  12790. function c(a) {
  12791. return 0 === (a[0] = b(a[0])) && (a[1] = b(a[1])), a;
  12792. }
  12793. var a = CryptoJS.lib.BlockCipherMode.extend(),
  12794. d = a.Encryptor = a.extend({
  12795. processBlock: function processBlock(a, b) {
  12796. var h,
  12797. i,
  12798. d = this._cipher,
  12799. e = d.blockSize,
  12800. f = this._iv,
  12801. g = this._counter;
  12802. for (f && (g = this._counter = f.slice(0), this._iv = void 0), c(g), h = g.slice(0), d.encryptBlock(h, 0), i = 0; e > i; i++) {
  12803. a[b + i] ^= h[i];
  12804. }
  12805. }
  12806. });
  12807. return a.Decryptor = d, a;
  12808. }(), function () {
  12809. function i() {
  12810. var c,
  12811. d,
  12812. e,
  12813. h,
  12814. i,
  12815. j,
  12816. a = this._X,
  12817. b = this._C;
  12818. for (c = 0; 8 > c; c++) {
  12819. f[c] = b[c];
  12820. }
  12821. for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {
  12822. d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;
  12823. }
  12824. a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];
  12825. }
  12826. var a = CryptoJS,
  12827. b = a.lib,
  12828. c = b.StreamCipher,
  12829. d = a.algo,
  12830. e = [],
  12831. f = [],
  12832. g = [],
  12833. h = d.Rabbit = c.extend({
  12834. _doReset: function _doReset() {
  12835. var c,
  12836. d,
  12837. e,
  12838. f,
  12839. g,
  12840. h,
  12841. j,
  12842. k,
  12843. l,
  12844. m,
  12845. a = this._key.words,
  12846. b = this.cfg.iv;
  12847. for (c = 0; 4 > c; c++) {
  12848. a[c] = 16711935 & (a[c] << 8 | a[c] >>> 24) | 4278255360 & (a[c] << 24 | a[c] >>> 8);
  12849. }
  12850. for (d = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16], e = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]], this._b = 0, c = 0; 4 > c; c++) {
  12851. i.call(this);
  12852. }
  12853. for (c = 0; 8 > c; c++) {
  12854. e[c] ^= d[7 & c + 4];
  12855. }
  12856. if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, e[0] ^= j, e[1] ^= l, e[2] ^= k, e[3] ^= m, e[4] ^= j, e[5] ^= l, e[6] ^= k, e[7] ^= m, c = 0; 4 > c; c++) {
  12857. i.call(this);
  12858. }
  12859. },
  12860. _doProcessBlock: function _doProcessBlock(a, b) {
  12861. var d,
  12862. c = this._X;
  12863. for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {
  12864. e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];
  12865. }
  12866. },
  12867. blockSize: 4,
  12868. ivSize: 2
  12869. });
  12870. a.Rabbit = c._createHelper(h);
  12871. }(), CryptoJS.mode.CTR = function () {
  12872. var a = CryptoJS.lib.BlockCipherMode.extend(),
  12873. b = a.Encryptor = a.extend({
  12874. processBlock: function processBlock(a, b) {
  12875. var g,
  12876. h,
  12877. c = this._cipher,
  12878. d = c.blockSize,
  12879. e = this._iv,
  12880. f = this._counter;
  12881. for (e && (f = this._counter = e.slice(0), this._iv = void 0), g = f.slice(0), c.encryptBlock(g, 0), f[d - 1] = 0 | f[d - 1] + 1, h = 0; d > h; h++) {
  12882. a[b + h] ^= g[h];
  12883. }
  12884. }
  12885. });
  12886. return a.Decryptor = b, a;
  12887. }(), function () {
  12888. function i() {
  12889. var c,
  12890. d,
  12891. e,
  12892. h,
  12893. i,
  12894. j,
  12895. a = this._X,
  12896. b = this._C;
  12897. for (c = 0; 8 > c; c++) {
  12898. f[c] = b[c];
  12899. }
  12900. for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {
  12901. d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;
  12902. }
  12903. a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];
  12904. }
  12905. var a = CryptoJS,
  12906. b = a.lib,
  12907. c = b.StreamCipher,
  12908. d = a.algo,
  12909. e = [],
  12910. f = [],
  12911. g = [],
  12912. h = d.RabbitLegacy = c.extend({
  12913. _doReset: function _doReset() {
  12914. var e,
  12915. f,
  12916. g,
  12917. h,
  12918. j,
  12919. k,
  12920. l,
  12921. m,
  12922. a = this._key.words,
  12923. b = this.cfg.iv,
  12924. c = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16],
  12925. d = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]];
  12926. for (this._b = 0, e = 0; 4 > e; e++) {
  12927. i.call(this);
  12928. }
  12929. for (e = 0; 8 > e; e++) {
  12930. d[e] ^= c[7 & e + 4];
  12931. }
  12932. if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, d[0] ^= j, d[1] ^= l, d[2] ^= k, d[3] ^= m, d[4] ^= j, d[5] ^= l, d[6] ^= k, d[7] ^= m, e = 0; 4 > e; e++) {
  12933. i.call(this);
  12934. }
  12935. },
  12936. _doProcessBlock: function _doProcessBlock(a, b) {
  12937. var d,
  12938. c = this._X;
  12939. for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {
  12940. e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];
  12941. }
  12942. },
  12943. blockSize: 4,
  12944. ivSize: 2
  12945. });
  12946. a.RabbitLegacy = c._createHelper(h);
  12947. }(), CryptoJS.pad.ZeroPadding = {
  12948. pad: function pad(a, b) {
  12949. var c = 4 * b;
  12950. a.clamp(), a.sigBytes += c - (a.sigBytes % c || c);
  12951. },
  12952. unpad: function unpad(a) {
  12953. var b = a.words,
  12954. c = a.sigBytes - 1;
  12955. for (c = a.sigBytes - 1; c >= 0; c--) {
  12956. if (255 & b[c >>> 2] >>> 24 - 8 * (c % 4)) {
  12957. a.sigBytes = c + 1;
  12958. break;
  12959. }
  12960. }
  12961. }
  12962. };
  12963. try {} catch (e) {}
  12964. !function (a, b) {
  12965. "object" == ( false ? undefined : _typeof(exports)) && "undefined" != typeof module ? b(exports) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
  12966. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  12967. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  12968. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
  12969. }(this, function (a) {
  12970. "use strict";
  12971. function c(a) {
  12972. return b.charAt(a);
  12973. }
  12974. function d(a, b) {
  12975. return a & b;
  12976. }
  12977. function e(a, b) {
  12978. return a | b;
  12979. }
  12980. function f(a, b) {
  12981. return a ^ b;
  12982. }
  12983. function g(a, b) {
  12984. return a & ~b;
  12985. }
  12986. function h(a) {
  12987. if (0 == a) return -1;
  12988. var b = 0;
  12989. return 0 == (65535 & a) && (a >>= 16, b += 16), 0 == (255 & a) && (a >>= 8, b += 8), 0 == (15 & a) && (a >>= 4, b += 4), 0 == (3 & a) && (a >>= 2, b += 2), 0 == (1 & a) && ++b, b;
  12990. }
  12991. function i(a) {
  12992. for (var b = 0; 0 != a;) {
  12993. a &= a - 1, ++b;
  12994. }
  12995. return b;
  12996. }
  12997. function l(a) {
  12998. var b,
  12999. c,
  13000. d = "";
  13001. for (b = 0; b + 3 <= a.length; b += 3) {
  13002. c = parseInt(a.substring(b, b + 3), 16), d += j.charAt(c >> 6) + j.charAt(63 & c);
  13003. }
  13004. for (b + 1 == a.length ? (c = parseInt(a.substring(b, b + 1), 16), d += j.charAt(c << 2)) : b + 2 == a.length && (c = parseInt(a.substring(b, b + 2), 16), d += j.charAt(c >> 2) + j.charAt((3 & c) << 4)); (3 & d.length) > 0;) {
  13005. d += k;
  13006. }
  13007. return d;
  13008. }
  13009. function m(a) {
  13010. var d,
  13011. g,
  13012. b = "",
  13013. e = 0,
  13014. f = 0;
  13015. for (d = 0; d < a.length && a.charAt(d) != k; ++d) {
  13016. g = j.indexOf(a.charAt(d)), 0 > g || (0 == e ? (b += c(g >> 2), f = 3 & g, e = 1) : 1 == e ? (b += c(f << 2 | g >> 4), f = 15 & g, e = 2) : 2 == e ? (b += c(f), b += c(g >> 2), f = 3 & g, e = 3) : (b += c(f << 2 | g >> 4), b += c(15 & g), e = 0));
  13017. }
  13018. return 1 == e && (b += c(f << 2)), b;
  13019. }
  13020. function o(a, b) {
  13021. function c() {
  13022. this.constructor = a;
  13023. }
  13024. _n(a, b), a.prototype = null === b ? Object.create(b) : (c.prototype = b.prototype, new c());
  13025. }
  13026. function y(a, b) {
  13027. return a.length > b && (a = a.substring(0, b) + v), a;
  13028. }
  13029. function M() {
  13030. return new H(null);
  13031. }
  13032. function N(a, b) {
  13033. return new H(a, b);
  13034. }
  13035. function Q(a, b, c, d, e, f) {
  13036. for (var i, j, k, g = 16383 & b, h = b >> 14; --f >= 0;) {
  13037. i = 16383 & this[a], j = this[a++] >> 14, k = h * i + j * g, i = g * i + ((16383 & k) << 14) + c[d] + e, e = (i >> 28) + (k >> 14) + h * j, c[d++] = 268435455 & i;
  13038. }
  13039. return e;
  13040. }
  13041. function V(a, b) {
  13042. var c = S[a.charCodeAt(b)];
  13043. return null == c ? -1 : c;
  13044. }
  13045. function W(a) {
  13046. var b = M();
  13047. return b.fromInt(a), b;
  13048. }
  13049. function X(a) {
  13050. var c,
  13051. b = 1;
  13052. return 0 != (c = a >>> 16) && (a = c, b += 16), 0 != (c = a >> 8) && (a = c, b += 8), 0 != (c = a >> 4) && (a = c, b += 4), 0 != (c = a >> 2) && (a = c, b += 2), 0 != (c = a >> 1) && (a = c, b += 1), b;
  13053. }
  13054. function Z() {
  13055. return new Y();
  13056. }
  13057. function fb() {
  13058. if (null == _) {
  13059. for (_ = Z(); $ > bb;) {
  13060. var a = Math.floor(65536 * Math.random());
  13061. ab[bb++] = 255 & a;
  13062. }
  13063. for (_.init(ab), bb = 0; bb < ab.length; ++bb) {
  13064. ab[bb] = 0;
  13065. }
  13066. bb = 0;
  13067. }
  13068. return _.next();
  13069. }
  13070. function hb(a, b) {
  13071. var c, d, e, f;
  13072. if (b < a.length + 22) return console.error("Message too long for RSA"), null;
  13073. for (c = b - a.length - 6, d = "", e = 0; c > e; e += 2) {
  13074. d += "ff";
  13075. }
  13076. return f = "0001" + d + "00" + a, N(f, 16);
  13077. }
  13078. function ib(a, b) {
  13079. var c, d, e, f, g;
  13080. if (b < a.length + 11) return console.error("Message too long for RSA"), null;
  13081. for (c = [], d = a.length - 1; d >= 0 && b > 0;) {
  13082. e = a.charCodeAt(d--), 128 > e ? c[--b] = e : e > 127 && 2048 > e ? (c[--b] = 128 | 63 & e, c[--b] = 192 | e >> 6) : (c[--b] = 128 | 63 & e, c[--b] = 128 | 63 & e >> 6, c[--b] = 224 | e >> 12);
  13083. }
  13084. for (c[--b] = 0, f = new gb(), g = []; b > 2;) {
  13085. for (g[0] = 0; 0 == g[0];) {
  13086. f.nextBytes(g);
  13087. }
  13088. c[--b] = g[0];
  13089. }
  13090. return c[--b] = 2, c[--b] = 0, new H(c);
  13091. }
  13092. function kb(a, b) {
  13093. for (var e, f, c = a.toByteArray(), d = 0; d < c.length && 0 == c[d];) {
  13094. ++d;
  13095. }
  13096. if (c.length - d != b - 1 || 2 != c[d]) return null;
  13097. for (++d; 0 != c[d];) {
  13098. if (++d >= c.length) return null;
  13099. }
  13100. for (e = ""; ++d < c.length;) {
  13101. f = 255 & c[d], 128 > f ? e += String.fromCharCode(f) : f > 191 && 224 > f ? (e += String.fromCharCode((31 & f) << 6 | 63 & c[d + 1]), ++d) : (e += String.fromCharCode((15 & f) << 12 | (63 & c[d + 1]) << 6 | 63 & c[d + 2]), d += 2);
  13102. }
  13103. return e;
  13104. }
  13105. function mb(a) {
  13106. return lb[a] || "";
  13107. }
  13108. function nb(a) {
  13109. var b, c, d;
  13110. for (b in lb) {
  13111. if (lb.hasOwnProperty(b) && (c = lb[b], d = c.length, a.substr(0, d) == c)) return a.substr(d);
  13112. }
  13113. return a;
  13114. }
  13115. var p,
  13116. r,
  13117. C,
  13118. R,
  13119. S,
  13120. T,
  13121. U,
  13122. Y,
  13123. $,
  13124. _,
  13125. ab,
  13126. bb,
  13127. cb,
  13128. db,
  13129. gb,
  13130. jb,
  13131. lb,
  13132. ob,
  13133. pb,
  13134. qb,
  13135. rb,
  13136. b = "0123456789abcdefghijklmnopqrstuvwxyz",
  13137. j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  13138. k = "=",
  13139. _n = function n(a, b) {
  13140. return _n = Object.setPrototypeOf || {
  13141. __proto__: []
  13142. } instanceof Array && function (a, b) {
  13143. a.__proto__ = b;
  13144. } || function (a, b) {
  13145. for (var c in b) {
  13146. b.hasOwnProperty(c) && (a[c] = b[c]);
  13147. }
  13148. }, _n(a, b);
  13149. },
  13150. q = {
  13151. decode: function decode(a) {
  13152. var b, c, d, e, f, g, h;
  13153. if (void 0 === p) {
  13154. for (c = "0123456789ABCDEF", d = " \f\n\r\t\xA0\u2028\u2029", p = {}, b = 0; 16 > b; ++b) {
  13155. p[c.charAt(b)] = b;
  13156. }
  13157. for (c = c.toLowerCase(), b = 10; 16 > b; ++b) {
  13158. p[c.charAt(b)] = b;
  13159. }
  13160. for (b = 0; b < d.length; ++b) {
  13161. p[d.charAt(b)] = -1;
  13162. }
  13163. }
  13164. for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {
  13165. if (h = p[h], -1 != h) {
  13166. if (void 0 === h) throw new Error("Illegal character at offset " + b);
  13167. f |= h, ++g >= 2 ? (e[e.length] = f, f = 0, g = 0) : f <<= 4;
  13168. }
  13169. }
  13170. if (g) throw new Error("Hex encoding incomplete: 4 bits missing");
  13171. return e;
  13172. }
  13173. },
  13174. s = {
  13175. decode: function decode(a) {
  13176. var b, c, d, e, f, g, h;
  13177. if (void 0 === r) {
  13178. for (c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = "= \f\n\r\t\xA0\u2028\u2029", r = Object.create(null), b = 0; 64 > b; ++b) {
  13179. r[c.charAt(b)] = b;
  13180. }
  13181. for (b = 0; b < d.length; ++b) {
  13182. r[d.charAt(b)] = -1;
  13183. }
  13184. }
  13185. for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {
  13186. if (h = r[h], -1 != h) {
  13187. if (void 0 === h) throw new Error("Illegal character at offset " + b);
  13188. f |= h, ++g >= 4 ? (e[e.length] = f >> 16, e[e.length] = 255 & f >> 8, e[e.length] = 255 & f, f = 0, g = 0) : f <<= 6;
  13189. }
  13190. }
  13191. switch (g) {
  13192. case 1:
  13193. throw new Error("Base64 encoding incomplete: at least 2 bits missing");
  13194. case 2:
  13195. e[e.length] = f >> 10;
  13196. break;
  13197. case 3:
  13198. e[e.length] = f >> 16, e[e.length] = 255 & f >> 8;
  13199. }
  13200. return e;
  13201. },
  13202. re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
  13203. unarmor: function unarmor(a) {
  13204. var b = s.re.exec(a);
  13205. if (b) if (b[1]) a = b[1];else {
  13206. if (!b[2]) throw new Error("RegExp out of sync");
  13207. a = b[2];
  13208. }
  13209. return s.decode(a);
  13210. }
  13211. },
  13212. t = 1e13,
  13213. u = function () {
  13214. function a(a) {
  13215. this.buf = [+a || 0];
  13216. }
  13217. return a.prototype.mulAdd = function (a, b) {
  13218. var e,
  13219. f,
  13220. c = this.buf,
  13221. d = c.length;
  13222. for (e = 0; d > e; ++e) {
  13223. f = c[e] * a + b, t > f ? b = 0 : (b = 0 | f / t, f -= b * t), c[e] = f;
  13224. }
  13225. b > 0 && (c[e] = b);
  13226. }, a.prototype.sub = function (a) {
  13227. var d,
  13228. e,
  13229. b = this.buf,
  13230. c = b.length;
  13231. for (d = 0; c > d; ++d) {
  13232. e = b[d] - a, 0 > e ? (e += t, a = 1) : a = 0, b[d] = e;
  13233. }
  13234. for (; 0 === b[b.length - 1];) {
  13235. b.pop();
  13236. }
  13237. }, a.prototype.toString = function (a) {
  13238. var b, c, d;
  13239. if (10 != (a || 10)) throw new Error("only base 10 is supported");
  13240. for (b = this.buf, c = b[b.length - 1].toString(), d = b.length - 2; d >= 0; --d) {
  13241. c += (t + b[d]).toString().substring(1);
  13242. }
  13243. return c;
  13244. }, a.prototype.valueOf = function () {
  13245. var c,
  13246. a = this.buf,
  13247. b = 0;
  13248. for (c = a.length - 1; c >= 0; --c) {
  13249. b = b * t + a[c];
  13250. }
  13251. return b;
  13252. }, a.prototype.simplify = function () {
  13253. var a = this.buf;
  13254. return 1 == a.length ? a[0] : this;
  13255. }, a;
  13256. }(),
  13257. v = "…",
  13258. w = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
  13259. x = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
  13260. z = function () {
  13261. function a(b, c) {
  13262. this.hexDigits = "0123456789ABCDEF", b instanceof a ? (this.enc = b.enc, this.pos = b.pos) : (this.enc = b, this.pos = c);
  13263. }
  13264. return a.prototype.get = function (a) {
  13265. if (void 0 === a && (a = this.pos++), a >= this.enc.length) throw new Error("Requesting byte offset " + a + " on a stream of length " + this.enc.length);
  13266. return "string" == typeof this.enc ? this.enc.charCodeAt(a) : this.enc[a];
  13267. }, a.prototype.hexByte = function (a) {
  13268. return this.hexDigits.charAt(15 & a >> 4) + this.hexDigits.charAt(15 & a);
  13269. }, a.prototype.hexDump = function (a, b, c) {
  13270. var e,
  13271. d = "";
  13272. for (e = a; b > e; ++e) {
  13273. if (d += this.hexByte(this.get(e)), c !== !0) switch (15 & e) {
  13274. case 7:
  13275. d += " ";
  13276. break;
  13277. case 15:
  13278. d += "\n";
  13279. break;
  13280. default:
  13281. d += " ";
  13282. }
  13283. }
  13284. return d;
  13285. }, a.prototype.isASCII = function (a, b) {
  13286. var c, d;
  13287. for (c = a; b > c; ++c) {
  13288. if (d = this.get(c), 32 > d || d > 176) return !1;
  13289. }
  13290. return !0;
  13291. }, a.prototype.parseStringISO = function (a, b) {
  13292. var d,
  13293. c = "";
  13294. for (d = a; b > d; ++d) {
  13295. c += String.fromCharCode(this.get(d));
  13296. }
  13297. return c;
  13298. }, a.prototype.parseStringUTF = function (a, b) {
  13299. var d,
  13300. e,
  13301. c = "";
  13302. for (d = a; b > d;) {
  13303. e = this.get(d++), c += 128 > e ? String.fromCharCode(e) : e > 191 && 224 > e ? String.fromCharCode((31 & e) << 6 | 63 & this.get(d++)) : String.fromCharCode((15 & e) << 12 | (63 & this.get(d++)) << 6 | 63 & this.get(d++));
  13304. }
  13305. return c;
  13306. }, a.prototype.parseStringBMP = function (a, b) {
  13307. var d,
  13308. e,
  13309. f,
  13310. c = "";
  13311. for (f = a; b > f;) {
  13312. d = this.get(f++), e = this.get(f++), c += String.fromCharCode(d << 8 | e);
  13313. }
  13314. return c;
  13315. }, a.prototype.parseTime = function (a, b, c) {
  13316. var d = this.parseStringISO(a, b),
  13317. e = (c ? w : x).exec(d);
  13318. return e ? (c && (e[1] = +e[1], e[1] += +e[1] < 70 ? 2e3 : 1900), d = e[1] + "-" + e[2] + "-" + e[3] + " " + e[4], e[5] && (d += ":" + e[5], e[6] && (d += ":" + e[6], e[7] && (d += "." + e[7]))), e[8] && (d += " UTC", "Z" != e[8] && (d += e[8], e[9] && (d += ":" + e[9]))), d) : "Unrecognized time: " + d;
  13319. }, a.prototype.parseInteger = function (a, b) {
  13320. for (var f, h, i, c = this.get(a), d = c > 127, e = d ? 255 : 0, g = ""; c == e && ++a < b;) {
  13321. c = this.get(a);
  13322. }
  13323. if (f = b - a, 0 === f) return d ? -1 : 0;
  13324. if (f > 4) {
  13325. for (g = c, f <<= 3; 0 == (128 & (+g ^ e));) {
  13326. g = +g << 1, --f;
  13327. }
  13328. g = "(" + f + " bit)\n";
  13329. }
  13330. for (d && (c -= 256), h = new u(c), i = a + 1; b > i; ++i) {
  13331. h.mulAdd(256, this.get(i));
  13332. }
  13333. return g + h.toString();
  13334. }, a.prototype.parseBitString = function (a, b, c) {
  13335. var h,
  13336. i,
  13337. j,
  13338. k,
  13339. d = this.get(a),
  13340. e = (b - a - 1 << 3) - d,
  13341. f = "(" + e + " bit)\n",
  13342. g = "";
  13343. for (h = a + 1; b > h; ++h) {
  13344. for (i = this.get(h), j = h == b - 1 ? d : 0, k = 7; k >= j; --k) {
  13345. g += 1 & i >> k ? "1" : "0";
  13346. }
  13347. if (g.length > c) return f + y(g, c);
  13348. }
  13349. return f + g;
  13350. }, a.prototype.parseOctetString = function (a, b, c) {
  13351. var d, e, f;
  13352. if (this.isASCII(a, b)) return y(this.parseStringISO(a, b), c);
  13353. for (d = b - a, e = "(" + d + " byte)\n", c /= 2, d > c && (b = a + c), f = a; b > f; ++f) {
  13354. e += this.hexByte(this.get(f));
  13355. }
  13356. return d > c && (e += v), e;
  13357. }, a.prototype.parseOID = function (a, b, c) {
  13358. var g,
  13359. h,
  13360. i,
  13361. d = "",
  13362. e = new u(),
  13363. f = 0;
  13364. for (g = a; b > g; ++g) {
  13365. if (h = this.get(g), e.mulAdd(128, 127 & h), f += 7, !(128 & h)) {
  13366. if ("" === d ? (e = e.simplify(), e instanceof u ? (e.sub(80), d = "2." + e.toString()) : (i = 80 > e ? 40 > e ? 0 : 1 : 2, d = i + "." + (e - 40 * i))) : d += "." + e.toString(), d.length > c) return y(d, c);
  13367. e = new u(), f = 0;
  13368. }
  13369. }
  13370. return f > 0 && (d += ".incomplete"), d;
  13371. }, a;
  13372. }(),
  13373. A = function () {
  13374. function a(a, b, c, d, e) {
  13375. if (!(d instanceof B)) throw new Error("Invalid tag value.");
  13376. this.stream = a, this.header = b, this.length = c, this.tag = d, this.sub = e;
  13377. }
  13378. return a.prototype.typeName = function () {
  13379. switch (this.tag.tagClass) {
  13380. case 0:
  13381. switch (this.tag.tagNumber) {
  13382. case 0:
  13383. return "EOC";
  13384. case 1:
  13385. return "BOOLEAN";
  13386. case 2:
  13387. return "INTEGER";
  13388. case 3:
  13389. return "BIT_STRING";
  13390. case 4:
  13391. return "OCTET_STRING";
  13392. case 5:
  13393. return "NULL";
  13394. case 6:
  13395. return "OBJECT_IDENTIFIER";
  13396. case 7:
  13397. return "ObjectDescriptor";
  13398. case 8:
  13399. return "EXTERNAL";
  13400. case 9:
  13401. return "REAL";
  13402. case 10:
  13403. return "ENUMERATED";
  13404. case 11:
  13405. return "EMBEDDED_PDV";
  13406. case 12:
  13407. return "UTF8String";
  13408. case 16:
  13409. return "SEQUENCE";
  13410. case 17:
  13411. return "SET";
  13412. case 18:
  13413. return "NumericString";
  13414. case 19:
  13415. return "PrintableString";
  13416. case 20:
  13417. return "TeletexString";
  13418. case 21:
  13419. return "VideotexString";
  13420. case 22:
  13421. return "IA5String";
  13422. case 23:
  13423. return "UTCTime";
  13424. case 24:
  13425. return "GeneralizedTime";
  13426. case 25:
  13427. return "GraphicString";
  13428. case 26:
  13429. return "VisibleString";
  13430. case 27:
  13431. return "GeneralString";
  13432. case 28:
  13433. return "UniversalString";
  13434. case 30:
  13435. return "BMPString";
  13436. }
  13437. return "Universal_" + this.tag.tagNumber.toString();
  13438. case 1:
  13439. return "Application_" + this.tag.tagNumber.toString();
  13440. case 2:
  13441. return "[" + this.tag.tagNumber.toString() + "]";
  13442. case 3:
  13443. return "Private_" + this.tag.tagNumber.toString();
  13444. }
  13445. }, a.prototype.content = function (a) {
  13446. var b, c;
  13447. if (void 0 === this.tag) return null;
  13448. if (void 0 === a && (a = 1 / 0), b = this.posContent(), c = Math.abs(this.length), !this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);
  13449. switch (this.tag.tagNumber) {
  13450. case 1:
  13451. return 0 === this.stream.get(b) ? "false" : "true";
  13452. case 2:
  13453. return this.stream.parseInteger(b, b + c);
  13454. case 3:
  13455. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(b, b + c, a);
  13456. case 4:
  13457. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);
  13458. case 6:
  13459. return this.stream.parseOID(b, b + c, a);
  13460. case 16:
  13461. case 17:
  13462. return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
  13463. case 12:
  13464. return y(this.stream.parseStringUTF(b, b + c), a);
  13465. case 18:
  13466. case 19:
  13467. case 20:
  13468. case 21:
  13469. case 22:
  13470. case 26:
  13471. return y(this.stream.parseStringISO(b, b + c), a);
  13472. case 30:
  13473. return y(this.stream.parseStringBMP(b, b + c), a);
  13474. case 23:
  13475. case 24:
  13476. return this.stream.parseTime(b, b + c, 23 == this.tag.tagNumber);
  13477. }
  13478. return null;
  13479. }, a.prototype.toString = function () {
  13480. return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]";
  13481. }, a.prototype.toPrettyString = function (a) {
  13482. var b, c, d;
  13483. if (void 0 === a && (a = ""), b = a + this.typeName() + " @" + this.stream.pos, this.length >= 0 && (b += "+"), b += this.length, this.tag.tagConstructed ? b += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (b += " (encapsulates)"), b += "\n", null !== this.sub) for (a += " ", c = 0, d = this.sub.length; d > c; ++c) {
  13484. b += this.sub[c].toPrettyString(a);
  13485. }
  13486. return b;
  13487. }, a.prototype.posStart = function () {
  13488. return this.stream.pos;
  13489. }, a.prototype.posContent = function () {
  13490. return this.stream.pos + this.header;
  13491. }, a.prototype.posEnd = function () {
  13492. return this.stream.pos + this.header + Math.abs(this.length);
  13493. }, a.prototype.toHexString = function () {
  13494. return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
  13495. }, a.decodeLength = function (a) {
  13496. var d,
  13497. b = a.get(),
  13498. c = 127 & b;
  13499. if (c == b) return c;
  13500. if (c > 6) throw new Error("Length over 48 bits not supported at position " + (a.pos - 1));
  13501. if (0 === c) return null;
  13502. for (b = 0, d = 0; c > d; ++d) {
  13503. b = 256 * b + a.get();
  13504. }
  13505. return b;
  13506. }, a.prototype.getHexStringValue = function () {
  13507. var a = this.toHexString(),
  13508. b = 2 * this.header,
  13509. c = 2 * this.length;
  13510. return a.substr(b, c);
  13511. }, a.decode = function (b) {
  13512. var c, d, e, f, g, h, i, j, k;
  13513. if (c = b instanceof z ? b : new z(b, 0), d = new z(c), e = new B(c), f = a.decodeLength(c), g = c.pos, h = g - d.pos, i = null, j = function j() {
  13514. var d,
  13515. e,
  13516. b = [];
  13517. if (null !== f) {
  13518. for (d = g + f; c.pos < d;) {
  13519. b[b.length] = a.decode(c);
  13520. }
  13521. if (c.pos != d) throw new Error("Content size is not correct for container starting at offset " + g);
  13522. } else try {
  13523. for (; e = a.decode(c), !e.tag.isEOC();) {
  13524. b[b.length] = e;
  13525. }
  13526. f = g - c.pos;
  13527. } catch (h) {
  13528. throw new Error("Exception while decoding undefined length content: " + h);
  13529. }
  13530. return b;
  13531. }, e.tagConstructed) i = j();else if (e.isUniversal() && (3 == e.tagNumber || 4 == e.tagNumber)) try {
  13532. if (3 == e.tagNumber && 0 != c.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
  13533. for (i = j(), k = 0; k < i.length; ++k) {
  13534. if (i[k].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.");
  13535. }
  13536. } catch (l) {
  13537. i = null;
  13538. }
  13539. if (null === i) {
  13540. if (null === f) throw new Error("We can't skip over an invalid tag with undefined length at offset " + g);
  13541. c.pos = g + Math.abs(f);
  13542. }
  13543. return new a(d, h, f, e, i);
  13544. }, a;
  13545. }(),
  13546. B = function () {
  13547. function a(a) {
  13548. var c,
  13549. b = a.get();
  13550. if (this.tagClass = b >> 6, this.tagConstructed = 0 !== (32 & b), this.tagNumber = 31 & b, 31 == this.tagNumber) {
  13551. c = new u();
  13552. do {
  13553. b = a.get(), c.mulAdd(128, 127 & b);
  13554. } while (128 & b);
  13555. this.tagNumber = c.simplify();
  13556. }
  13557. }
  13558. return a.prototype.isUniversal = function () {
  13559. return 0 === this.tagClass;
  13560. }, a.prototype.isEOC = function () {
  13561. return 0 === this.tagClass && 0 === this.tagNumber;
  13562. }, a;
  13563. }(),
  13564. F = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
  13565. G = (1 << 26) / F[F.length - 1],
  13566. H = function () {
  13567. function a(a, b, c) {
  13568. null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b));
  13569. }
  13570. return a.prototype.toString = function (a) {
  13571. var b, d, e, f, g, h, i;
  13572. if (this.s < 0) return "-" + this.negate().toString(a);
  13573. if (16 == a) b = 4;else if (8 == a) b = 3;else if (2 == a) b = 1;else if (32 == a) b = 5;else {
  13574. if (4 != a) return this.toRadix(a);
  13575. b = 2;
  13576. }
  13577. if (d = (1 << b) - 1, f = !1, g = "", h = this.t, i = this.DB - h * this.DB % b, h-- > 0) for (i < this.DB && (e = this[h] >> i) > 0 && (f = !0, g = c(e)); h >= 0;) {
  13578. b > i ? (e = (this[h] & (1 << i) - 1) << b - i, e |= this[--h] >> (i += this.DB - b)) : (e = this[h] >> (i -= b) & d, 0 >= i && (i += this.DB, --h)), e > 0 && (f = !0), f && (g += c(e));
  13579. }
  13580. return f ? g : "0";
  13581. }, a.prototype.negate = function () {
  13582. var b = M();
  13583. return a.ZERO.subTo(this, b), b;
  13584. }, a.prototype.abs = function () {
  13585. return this.s < 0 ? this.negate() : this;
  13586. }, a.prototype.compareTo = function (a) {
  13587. var c,
  13588. b = this.s - a.s;
  13589. if (0 != b) return b;
  13590. if (c = this.t, b = c - a.t, 0 != b) return this.s < 0 ? -b : b;
  13591. for (; --c >= 0;) {
  13592. if (0 != (b = this[c] - a[c])) return b;
  13593. }
  13594. return 0;
  13595. }, a.prototype.bitLength = function () {
  13596. return this.t <= 0 ? 0 : this.DB * (this.t - 1) + X(this[this.t - 1] ^ this.s & this.DM);
  13597. }, a.prototype.mod = function (b) {
  13598. var c = M();
  13599. return this.abs().divRemTo(b, null, c), this.s < 0 && c.compareTo(a.ZERO) > 0 && b.subTo(c, c), c;
  13600. }, a.prototype.modPowInt = function (a, b) {
  13601. var c;
  13602. return c = 256 > a || b.isEven() ? new J(b) : new K(b), this.exp(a, c);
  13603. }, a.prototype.clone = function () {
  13604. var a = M();
  13605. return this.copyTo(a), a;
  13606. }, a.prototype.intValue = function () {
  13607. if (this.s < 0) {
  13608. if (1 == this.t) return this[0] - this.DV;
  13609. if (0 == this.t) return -1;
  13610. } else {
  13611. if (1 == this.t) return this[0];
  13612. if (0 == this.t) return 0;
  13613. }
  13614. return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
  13615. }, a.prototype.byteValue = function () {
  13616. return 0 == this.t ? this.s : this[0] << 24 >> 24;
  13617. }, a.prototype.shortValue = function () {
  13618. return 0 == this.t ? this.s : this[0] << 16 >> 16;
  13619. }, a.prototype.signum = function () {
  13620. return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1;
  13621. }, a.prototype.toByteArray = function () {
  13622. var c,
  13623. d,
  13624. e,
  13625. a = this.t,
  13626. b = [];
  13627. if (b[0] = this.s, c = this.DB - a * this.DB % 8, e = 0, a-- > 0) for (c < this.DB && (d = this[a] >> c) != (this.s & this.DM) >> c && (b[e++] = d | this.s << this.DB - c); a >= 0;) {
  13628. 8 > c ? (d = (this[a] & (1 << c) - 1) << 8 - c, d |= this[--a] >> (c += this.DB - 8)) : (d = 255 & this[a] >> (c -= 8), 0 >= c && (c += this.DB, --a)), 0 != (128 & d) && (d |= -256), 0 == e && (128 & this.s) != (128 & d) && ++e, (e > 0 || d != this.s) && (b[e++] = d);
  13629. }
  13630. return b;
  13631. }, a.prototype.equals = function (a) {
  13632. return 0 == this.compareTo(a);
  13633. }, a.prototype.min = function (a) {
  13634. return this.compareTo(a) < 0 ? this : a;
  13635. }, a.prototype.max = function (a) {
  13636. return this.compareTo(a) > 0 ? this : a;
  13637. }, a.prototype.and = function (a) {
  13638. var b = M();
  13639. return this.bitwiseTo(a, d, b), b;
  13640. }, a.prototype.or = function (a) {
  13641. var b = M();
  13642. return this.bitwiseTo(a, e, b), b;
  13643. }, a.prototype.xor = function (a) {
  13644. var b = M();
  13645. return this.bitwiseTo(a, f, b), b;
  13646. }, a.prototype.andNot = function (a) {
  13647. var b = M();
  13648. return this.bitwiseTo(a, g, b), b;
  13649. }, a.prototype.not = function () {
  13650. var b,
  13651. a = M();
  13652. for (b = 0; b < this.t; ++b) {
  13653. a[b] = this.DM & ~this[b];
  13654. }
  13655. return a.t = this.t, a.s = ~this.s, a;
  13656. }, a.prototype.shiftLeft = function (a) {
  13657. var b = M();
  13658. return 0 > a ? this.rShiftTo(-a, b) : this.lShiftTo(a, b), b;
  13659. }, a.prototype.shiftRight = function (a) {
  13660. var b = M();
  13661. return 0 > a ? this.lShiftTo(-a, b) : this.rShiftTo(a, b), b;
  13662. }, a.prototype.getLowestSetBit = function () {
  13663. for (var a = 0; a < this.t; ++a) {
  13664. if (0 != this[a]) return a * this.DB + h(this[a]);
  13665. }
  13666. return this.s < 0 ? this.t * this.DB : -1;
  13667. }, a.prototype.bitCount = function () {
  13668. var c,
  13669. a = 0,
  13670. b = this.s & this.DM;
  13671. for (c = 0; c < this.t; ++c) {
  13672. a += i(this[c] ^ b);
  13673. }
  13674. return a;
  13675. }, a.prototype.testBit = function (a) {
  13676. var b = Math.floor(a / this.DB);
  13677. return b >= this.t ? 0 != this.s : 0 != (this[b] & 1 << a % this.DB);
  13678. }, a.prototype.setBit = function (a) {
  13679. return this.changeBit(a, e);
  13680. }, a.prototype.clearBit = function (a) {
  13681. return this.changeBit(a, g);
  13682. }, a.prototype.flipBit = function (a) {
  13683. return this.changeBit(a, f);
  13684. }, a.prototype.add = function (a) {
  13685. var b = M();
  13686. return this.addTo(a, b), b;
  13687. }, a.prototype.subtract = function (a) {
  13688. var b = M();
  13689. return this.subTo(a, b), b;
  13690. }, a.prototype.multiply = function (a) {
  13691. var b = M();
  13692. return this.multiplyTo(a, b), b;
  13693. }, a.prototype.divide = function (a) {
  13694. var b = M();
  13695. return this.divRemTo(a, b, null), b;
  13696. }, a.prototype.remainder = function (a) {
  13697. var b = M();
  13698. return this.divRemTo(a, null, b), b;
  13699. }, a.prototype.divideAndRemainder = function (a) {
  13700. var b = M(),
  13701. c = M();
  13702. return this.divRemTo(a, b, c), [b, c];
  13703. }, a.prototype.modPow = function (a, b) {
  13704. var d,
  13705. f,
  13706. g,
  13707. h,
  13708. i,
  13709. j,
  13710. k,
  13711. l,
  13712. m,
  13713. n,
  13714. o,
  13715. p,
  13716. c = a.bitLength(),
  13717. e = W(1);
  13718. if (0 >= c) return e;
  13719. if (d = 18 > c ? 1 : 48 > c ? 3 : 144 > c ? 4 : 768 > c ? 5 : 6, f = 8 > c ? new J(b) : b.isEven() ? new L(b) : new K(b), g = [], h = 3, i = d - 1, j = (1 << d) - 1, g[1] = f.convert(this), d > 1) for (k = M(), f.sqrTo(g[1], k); j >= h;) {
  13720. g[h] = M(), f.mulTo(k, g[h - 2], g[h]), h += 2;
  13721. }
  13722. for (l = a.t - 1, n = !0, o = M(), c = X(a[l]) - 1; l >= 0;) {
  13723. for (c >= i ? m = a[l] >> c - i & j : (m = (a[l] & (1 << c + 1) - 1) << i - c, l > 0 && (m |= a[l - 1] >> this.DB + c - i)), h = d; 0 == (1 & m);) {
  13724. m >>= 1, --h;
  13725. }
  13726. if ((c -= h) < 0 && (c += this.DB, --l), n) g[m].copyTo(e), n = !1;else {
  13727. for (; h > 1;) {
  13728. f.sqrTo(e, o), f.sqrTo(o, e), h -= 2;
  13729. }
  13730. h > 0 ? f.sqrTo(e, o) : (p = e, e = o, o = p), f.mulTo(o, g[m], e);
  13731. }
  13732. for (; l >= 0 && 0 == (a[l] & 1 << c);) {
  13733. f.sqrTo(e, o), p = e, e = o, o = p, --c < 0 && (c = this.DB - 1, --l);
  13734. }
  13735. }
  13736. return f.revert(e);
  13737. }, a.prototype.modInverse = function (b) {
  13738. var d,
  13739. e,
  13740. f,
  13741. g,
  13742. h,
  13743. i,
  13744. c = b.isEven();
  13745. if (this.isEven() && c || 0 == b.signum()) return a.ZERO;
  13746. for (d = b.clone(), e = this.clone(), f = W(1), g = W(0), h = W(0), i = W(1); 0 != d.signum();) {
  13747. for (; d.isEven();) {
  13748. d.rShiftTo(1, d), c ? (f.isEven() && g.isEven() || (f.addTo(this, f), g.subTo(b, g)), f.rShiftTo(1, f)) : g.isEven() || g.subTo(b, g), g.rShiftTo(1, g);
  13749. }
  13750. for (; e.isEven();) {
  13751. e.rShiftTo(1, e), c ? (h.isEven() && i.isEven() || (h.addTo(this, h), i.subTo(b, i)), h.rShiftTo(1, h)) : i.isEven() || i.subTo(b, i), i.rShiftTo(1, i);
  13752. }
  13753. d.compareTo(e) >= 0 ? (d.subTo(e, d), c && f.subTo(h, f), g.subTo(i, g)) : (e.subTo(d, e), c && h.subTo(f, h), i.subTo(g, i));
  13754. }
  13755. return 0 != e.compareTo(a.ONE) ? a.ZERO : i.compareTo(b) >= 0 ? i.subtract(b) : i.signum() < 0 ? (i.addTo(b, i), i.signum() < 0 ? i.add(b) : i) : i;
  13756. }, a.prototype.pow = function (a) {
  13757. return this.exp(a, new I());
  13758. }, a.prototype.gcd = function (a) {
  13759. var d,
  13760. e,
  13761. f,
  13762. b = this.s < 0 ? this.negate() : this.clone(),
  13763. c = a.s < 0 ? a.negate() : a.clone();
  13764. if (b.compareTo(c) < 0 && (d = b, b = c, c = d), e = b.getLowestSetBit(), f = c.getLowestSetBit(), 0 > f) return b;
  13765. for (f > e && (f = e), f > 0 && (b.rShiftTo(f, b), c.rShiftTo(f, c)); b.signum() > 0;) {
  13766. (e = b.getLowestSetBit()) > 0 && b.rShiftTo(e, b), (e = c.getLowestSetBit()) > 0 && c.rShiftTo(e, c), b.compareTo(c) >= 0 ? (b.subTo(c, b), b.rShiftTo(1, b)) : (c.subTo(b, c), c.rShiftTo(1, c));
  13767. }
  13768. return f > 0 && c.lShiftTo(f, c), c;
  13769. }, a.prototype.isProbablePrime = function (a) {
  13770. var b,
  13771. d,
  13772. e,
  13773. c = this.abs();
  13774. if (1 == c.t && c[0] <= F[F.length - 1]) {
  13775. for (b = 0; b < F.length; ++b) {
  13776. if (c[0] == F[b]) return !0;
  13777. }
  13778. return !1;
  13779. }
  13780. if (c.isEven()) return !1;
  13781. for (b = 1; b < F.length;) {
  13782. for (d = F[b], e = b + 1; e < F.length && G > d;) {
  13783. d *= F[e++];
  13784. }
  13785. for (d = c.modInt(d); e > b;) {
  13786. if (0 == d % F[b++]) return !1;
  13787. }
  13788. }
  13789. return c.millerRabin(a);
  13790. }, a.prototype.copyTo = function (a) {
  13791. for (var b = this.t - 1; b >= 0; --b) {
  13792. a[b] = this[b];
  13793. }
  13794. a.t = this.t, a.s = this.s;
  13795. }, a.prototype.fromInt = function (a) {
  13796. this.t = 1, this.s = 0 > a ? -1 : 0, a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0;
  13797. }, a.prototype.fromString = function (b, c) {
  13798. var d, e, f, g, h;
  13799. if (16 == c) d = 4;else if (8 == c) d = 3;else if (256 == c) d = 8;else if (2 == c) d = 1;else if (32 == c) d = 5;else {
  13800. if (4 != c) return this.fromRadix(b, c), void 0;
  13801. d = 2;
  13802. }
  13803. for (this.t = 0, this.s = 0, e = b.length, f = !1, g = 0; --e >= 0;) {
  13804. h = 8 == d ? 255 & +b[e] : V(b, e), 0 > h ? "-" == b.charAt(e) && (f = !0) : (f = !1, 0 == g ? this[this.t++] = h : g + d > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - g) - 1) << g, this[this.t++] = h >> this.DB - g) : this[this.t - 1] |= h << g, g += d, g >= this.DB && (g -= this.DB));
  13805. }
  13806. 8 == d && 0 != (128 & +b[0]) && (this.s = -1, g > 0 && (this[this.t - 1] |= (1 << this.DB - g) - 1 << g)), this.clamp(), f && a.ZERO.subTo(this, this);
  13807. }, a.prototype.clamp = function () {
  13808. for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;) {
  13809. --this.t;
  13810. }
  13811. }, a.prototype.dlShiftTo = function (a, b) {
  13812. var c;
  13813. for (c = this.t - 1; c >= 0; --c) {
  13814. b[c + a] = this[c];
  13815. }
  13816. for (c = a - 1; c >= 0; --c) {
  13817. b[c] = 0;
  13818. }
  13819. b.t = this.t + a, b.s = this.s;
  13820. }, a.prototype.drShiftTo = function (a, b) {
  13821. for (var c = a; c < this.t; ++c) {
  13822. b[c - a] = this[c];
  13823. }
  13824. b.t = Math.max(this.t - a, 0), b.s = this.s;
  13825. }, a.prototype.lShiftTo = function (a, b) {
  13826. var h,
  13827. c = a % this.DB,
  13828. d = this.DB - c,
  13829. e = (1 << d) - 1,
  13830. f = Math.floor(a / this.DB),
  13831. g = this.s << c & this.DM;
  13832. for (h = this.t - 1; h >= 0; --h) {
  13833. b[h + f + 1] = this[h] >> d | g, g = (this[h] & e) << c;
  13834. }
  13835. for (h = f - 1; h >= 0; --h) {
  13836. b[h] = 0;
  13837. }
  13838. b[f] = g, b.t = this.t + f + 1, b.s = this.s, b.clamp();
  13839. }, a.prototype.rShiftTo = function (a, b) {
  13840. var c, d, e, f, g;
  13841. if (b.s = this.s, c = Math.floor(a / this.DB), c >= this.t) return b.t = 0, void 0;
  13842. for (d = a % this.DB, e = this.DB - d, f = (1 << d) - 1, b[0] = this[c] >> d, g = c + 1; g < this.t; ++g) {
  13843. b[g - c - 1] |= (this[g] & f) << e, b[g - c] = this[g] >> d;
  13844. }
  13845. d > 0 && (b[this.t - c - 1] |= (this.s & f) << e), b.t = this.t - c, b.clamp();
  13846. }, a.prototype.subTo = function (a, b) {
  13847. for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {
  13848. d += this[c] - a[c], b[c++] = d & this.DM, d >>= this.DB;
  13849. }
  13850. if (a.t < this.t) {
  13851. for (d -= a.s; c < this.t;) {
  13852. d += this[c], b[c++] = d & this.DM, d >>= this.DB;
  13853. }
  13854. d += this.s;
  13855. } else {
  13856. for (d += this.s; c < a.t;) {
  13857. d -= a[c], b[c++] = d & this.DM, d >>= this.DB;
  13858. }
  13859. d -= a.s;
  13860. }
  13861. b.s = 0 > d ? -1 : 0, -1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d), b.t = c, b.clamp();
  13862. }, a.prototype.multiplyTo = function (b, c) {
  13863. var d = this.abs(),
  13864. e = b.abs(),
  13865. f = d.t;
  13866. for (c.t = f + e.t; --f >= 0;) {
  13867. c[f] = 0;
  13868. }
  13869. for (f = 0; f < e.t; ++f) {
  13870. c[f + d.t] = d.am(0, e[f], c, f, 0, d.t);
  13871. }
  13872. c.s = 0, c.clamp(), this.s != b.s && a.ZERO.subTo(c, c);
  13873. }, a.prototype.squareTo = function (a) {
  13874. for (var d, b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) {
  13875. a[c] = 0;
  13876. }
  13877. for (c = 0; c < b.t - 1; ++c) {
  13878. d = b.am(c, b[c], a, 2 * c, 0, 1), (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1);
  13879. }
  13880. a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)), a.s = 0, a.clamp();
  13881. }, a.prototype.divRemTo = function (b, c, d) {
  13882. var f,
  13883. g,
  13884. h,
  13885. i,
  13886. j,
  13887. k,
  13888. l,
  13889. m,
  13890. n,
  13891. o,
  13892. p,
  13893. q,
  13894. r,
  13895. s,
  13896. t,
  13897. e = b.abs();
  13898. if (!(e.t <= 0)) {
  13899. if (f = this.abs(), f.t < e.t) return null != c && c.fromInt(0), null != d && this.copyTo(d), void 0;
  13900. if (null == d && (d = M()), g = M(), h = this.s, i = b.s, j = this.DB - X(e[e.t - 1]), j > 0 ? (e.lShiftTo(j, g), f.lShiftTo(j, d)) : (e.copyTo(g), f.copyTo(d)), k = g.t, l = g[k - 1], 0 != l) {
  13901. for (m = l * (1 << this.F1) + (k > 1 ? g[k - 2] >> this.F2 : 0), n = this.FV / m, o = (1 << this.F1) / m, p = 1 << this.F2, q = d.t, r = q - k, s = null == c ? M() : c, g.dlShiftTo(r, s), d.compareTo(s) >= 0 && (d[d.t++] = 1, d.subTo(s, d)), a.ONE.dlShiftTo(k, s), s.subTo(g, g); g.t < k;) {
  13902. g[g.t++] = 0;
  13903. }
  13904. for (; --r >= 0;) {
  13905. if (t = d[--q] == l ? this.DM : Math.floor(d[q] * n + (d[q - 1] + p) * o), (d[q] += g.am(0, t, d, r, 0, k)) < t) for (g.dlShiftTo(r, s), d.subTo(s, d); d[q] < --t;) {
  13906. d.subTo(s, d);
  13907. }
  13908. }
  13909. null != c && (d.drShiftTo(k, c), h != i && a.ZERO.subTo(c, c)), d.t = k, d.clamp(), j > 0 && d.rShiftTo(j, d), 0 > h && a.ZERO.subTo(d, d);
  13910. }
  13911. }
  13912. }, a.prototype.invDigit = function () {
  13913. var a, b;
  13914. return this.t < 1 ? 0 : (a = this[0], 0 == (1 & a) ? 0 : (b = 3 & a, b = 15 & b * (2 - (15 & a) * b), b = 255 & b * (2 - (255 & a) * b), b = 65535 & b * (2 - (65535 & (65535 & a) * b)), b = b * (2 - a * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b));
  13915. }, a.prototype.isEven = function () {
  13916. return 0 == (this.t > 0 ? 1 & this[0] : this.s);
  13917. }, a.prototype.exp = function (b, c) {
  13918. var d, e, f, g, h;
  13919. if (b > 4294967295 || 1 > b) return a.ONE;
  13920. for (d = M(), e = M(), f = c.convert(this), g = X(b) - 1, f.copyTo(d); --g >= 0;) {
  13921. c.sqrTo(d, e), (b & 1 << g) > 0 ? c.mulTo(e, f, d) : (h = d, d = e, e = h);
  13922. }
  13923. return c.revert(d);
  13924. }, a.prototype.chunkSize = function (a) {
  13925. return Math.floor(Math.LN2 * this.DB / Math.log(a));
  13926. }, a.prototype.toRadix = function (a) {
  13927. var b, c, d, e, f, g;
  13928. if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0";
  13929. for (b = this.chunkSize(a), c = Math.pow(a, b), d = W(c), e = M(), f = M(), g = "", this.divRemTo(d, e, f); e.signum() > 0;) {
  13930. g = (c + f.intValue()).toString(a).substr(1) + g, e.divRemTo(d, e, f);
  13931. }
  13932. return f.intValue().toString(a) + g;
  13933. }, a.prototype.fromRadix = function (b, c) {
  13934. var d, e, f, g, h, i, j;
  13935. for (this.fromInt(0), null == c && (c = 10), d = this.chunkSize(c), e = Math.pow(c, d), f = !1, g = 0, h = 0, i = 0; i < b.length; ++i) {
  13936. j = V(b, i), 0 > j ? "-" == b.charAt(i) && 0 == this.signum() && (f = !0) : (h = c * h + j, ++g >= d && (this.dMultiply(e), this.dAddOffset(h, 0), g = 0, h = 0));
  13937. }
  13938. g > 0 && (this.dMultiply(Math.pow(c, g)), this.dAddOffset(h, 0)), f && a.ZERO.subTo(this, this);
  13939. }, a.prototype.fromNumber = function (b, c, d) {
  13940. var f, g;
  13941. if ("number" == typeof c) {
  13942. if (2 > b) this.fromInt(1);else for (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(c);) {
  13943. this.dAddOffset(2, 0), this.bitLength() > b && this.subTo(a.ONE.shiftLeft(b - 1), this);
  13944. }
  13945. } else f = [], g = 7 & b, f.length = (b >> 3) + 1, c.nextBytes(f), g > 0 ? f[0] &= (1 << g) - 1 : f[0] = 0, this.fromString(f, 256);
  13946. }, a.prototype.bitwiseTo = function (a, b, c) {
  13947. var d,
  13948. e,
  13949. f = Math.min(a.t, this.t);
  13950. for (d = 0; f > d; ++d) {
  13951. c[d] = b(this[d], a[d]);
  13952. }
  13953. if (a.t < this.t) {
  13954. for (e = a.s & this.DM, d = f; d < this.t; ++d) {
  13955. c[d] = b(this[d], e);
  13956. }
  13957. c.t = this.t;
  13958. } else {
  13959. for (e = this.s & this.DM, d = f; d < a.t; ++d) {
  13960. c[d] = b(e, a[d]);
  13961. }
  13962. c.t = a.t;
  13963. }
  13964. c.s = b(this.s, a.s), c.clamp();
  13965. }, a.prototype.changeBit = function (b, c) {
  13966. var d = a.ONE.shiftLeft(b);
  13967. return this.bitwiseTo(d, c, d), d;
  13968. }, a.prototype.addTo = function (a, b) {
  13969. for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {
  13970. d += this[c] + a[c], b[c++] = d & this.DM, d >>= this.DB;
  13971. }
  13972. if (a.t < this.t) {
  13973. for (d += a.s; c < this.t;) {
  13974. d += this[c], b[c++] = d & this.DM, d >>= this.DB;
  13975. }
  13976. d += this.s;
  13977. } else {
  13978. for (d += this.s; c < a.t;) {
  13979. d += a[c], b[c++] = d & this.DM, d >>= this.DB;
  13980. }
  13981. d += a.s;
  13982. }
  13983. b.s = 0 > d ? -1 : 0, d > 0 ? b[c++] = d : -1 > d && (b[c++] = this.DV + d), b.t = c, b.clamp();
  13984. }, a.prototype.dMultiply = function (a) {
  13985. this[this.t] = this.am(0, a - 1, this, 0, 0, this.t), ++this.t, this.clamp();
  13986. }, a.prototype.dAddOffset = function (a, b) {
  13987. if (0 != a) {
  13988. for (; this.t <= b;) {
  13989. this[this.t++] = 0;
  13990. }
  13991. for (this[b] += a; this[b] >= this.DV;) {
  13992. this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b];
  13993. }
  13994. }
  13995. }, a.prototype.multiplyLowerTo = function (a, b, c) {
  13996. var e,
  13997. d = Math.min(this.t + a.t, b);
  13998. for (c.s = 0, c.t = d; d > 0;) {
  13999. c[--d] = 0;
  14000. }
  14001. for (e = c.t - this.t; e > d; ++d) {
  14002. c[d + this.t] = this.am(0, a[d], c, d, 0, this.t);
  14003. }
  14004. for (e = Math.min(a.t, b); e > d; ++d) {
  14005. this.am(0, a[d], c, d, 0, b - d);
  14006. }
  14007. c.clamp();
  14008. }, a.prototype.multiplyUpperTo = function (a, b, c) {
  14009. --b;
  14010. var d = c.t = this.t + a.t - b;
  14011. for (c.s = 0; --d >= 0;) {
  14012. c[d] = 0;
  14013. }
  14014. for (d = Math.max(b - this.t, 0); d < a.t; ++d) {
  14015. c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b);
  14016. }
  14017. c.clamp(), c.drShiftTo(1, c);
  14018. }, a.prototype.modInt = function (a) {
  14019. var b, c, d;
  14020. if (0 >= a) return 0;
  14021. if (b = this.DV % a, c = this.s < 0 ? a - 1 : 0, this.t > 0) if (0 == b) c = this[0] % a;else for (d = this.t - 1; d >= 0; --d) {
  14022. c = (b * c + this[d]) % a;
  14023. }
  14024. return c;
  14025. }, a.prototype.millerRabin = function (b) {
  14026. var e,
  14027. f,
  14028. g,
  14029. h,
  14030. i,
  14031. c = this.subtract(a.ONE),
  14032. d = c.getLowestSetBit();
  14033. if (0 >= d) return !1;
  14034. for (e = c.shiftRight(d), b = b + 1 >> 1, b > F.length && (b = F.length), f = M(), g = 0; b > g; ++g) {
  14035. if (f.fromInt(F[Math.floor(Math.random() * F.length)]), h = f.modPow(e, this), 0 != h.compareTo(a.ONE) && 0 != h.compareTo(c)) {
  14036. for (i = 1; i++ < d && 0 != h.compareTo(c);) {
  14037. if (h = h.modPowInt(2, this), 0 == h.compareTo(a.ONE)) return !1;
  14038. }
  14039. if (0 != h.compareTo(c)) return !1;
  14040. }
  14041. }
  14042. return !0;
  14043. }, a.prototype.square = function () {
  14044. var a = M();
  14045. return this.squareTo(a), a;
  14046. }, a.prototype.gcda = function (a, b) {
  14047. var e,
  14048. f,
  14049. g,
  14050. _h,
  14051. c = this.s < 0 ? this.negate() : this.clone(),
  14052. d = a.s < 0 ? a.negate() : a.clone();
  14053. return c.compareTo(d) < 0 && (e = c, c = d, d = e), f = c.getLowestSetBit(), g = d.getLowestSetBit(), 0 > g ? (b(c), void 0) : (g > f && (g = f), g > 0 && (c.rShiftTo(g, c), d.rShiftTo(g, d)), _h = function h() {
  14054. (f = c.getLowestSetBit()) > 0 && c.rShiftTo(f, c), (f = d.getLowestSetBit()) > 0 && d.rShiftTo(f, d), c.compareTo(d) >= 0 ? (c.subTo(d, c), c.rShiftTo(1, c)) : (d.subTo(c, d), d.rShiftTo(1, d)), c.signum() > 0 ? setTimeout(_h, 0) : (g > 0 && d.lShiftTo(g, d), setTimeout(function () {
  14055. b(d);
  14056. }, 0));
  14057. }, setTimeout(_h, 10), void 0);
  14058. }, a.prototype.fromNumberAsync = function (b, c, d, f) {
  14059. var g, _h2, i, j;
  14060. "number" == typeof c ? 2 > b ? this.fromInt(1) : (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0), g = this, _h2 = function h() {
  14061. g.dAddOffset(2, 0), g.bitLength() > b && g.subTo(a.ONE.shiftLeft(b - 1), g), g.isProbablePrime(c) ? setTimeout(function () {
  14062. f();
  14063. }, 0) : setTimeout(_h2, 0);
  14064. }, setTimeout(_h2, 0)) : (i = [], j = 7 & b, i.length = (b >> 3) + 1, c.nextBytes(i), j > 0 ? i[0] &= (1 << j) - 1 : i[0] = 0, this.fromString(i, 256));
  14065. }, a;
  14066. }(),
  14067. I = function () {
  14068. function a() {}
  14069. return a.prototype.convert = function (a) {
  14070. return a;
  14071. }, a.prototype.revert = function (a) {
  14072. return a;
  14073. }, a.prototype.mulTo = function (a, b, c) {
  14074. a.multiplyTo(b, c);
  14075. }, a.prototype.sqrTo = function (a, b) {
  14076. a.squareTo(b);
  14077. }, a;
  14078. }(),
  14079. J = function () {
  14080. function a(a) {
  14081. this.m = a;
  14082. }
  14083. return a.prototype.convert = function (a) {
  14084. return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a;
  14085. }, a.prototype.revert = function (a) {
  14086. return a;
  14087. }, a.prototype.reduce = function (a) {
  14088. a.divRemTo(this.m, null, a);
  14089. }, a.prototype.mulTo = function (a, b, c) {
  14090. a.multiplyTo(b, c), this.reduce(c);
  14091. }, a.prototype.sqrTo = function (a, b) {
  14092. a.squareTo(b), this.reduce(b);
  14093. }, a;
  14094. }(),
  14095. K = function () {
  14096. function a(a) {
  14097. this.m = a, this.mp = a.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a.DB - 15) - 1, this.mt2 = 2 * a.t;
  14098. }
  14099. return a.prototype.convert = function (a) {
  14100. var b = M();
  14101. return a.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), a.s < 0 && b.compareTo(H.ZERO) > 0 && this.m.subTo(b, b), b;
  14102. }, a.prototype.revert = function (a) {
  14103. var b = M();
  14104. return a.copyTo(b), this.reduce(b), b;
  14105. }, a.prototype.reduce = function (a) {
  14106. for (var b, c, d; a.t <= this.mt2;) {
  14107. a[a.t++] = 0;
  14108. }
  14109. for (b = 0; b < this.m.t; ++b) {
  14110. for (c = 32767 & a[b], d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM, c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) {
  14111. a[c] -= a.DV, a[++c]++;
  14112. }
  14113. }
  14114. a.clamp(), a.drShiftTo(this.m.t, a), a.compareTo(this.m) >= 0 && a.subTo(this.m, a);
  14115. }, a.prototype.mulTo = function (a, b, c) {
  14116. a.multiplyTo(b, c), this.reduce(c);
  14117. }, a.prototype.sqrTo = function (a, b) {
  14118. a.squareTo(b), this.reduce(b);
  14119. }, a;
  14120. }(),
  14121. L = function () {
  14122. function a(a) {
  14123. this.m = a, this.r2 = M(), this.q3 = M(), H.ONE.dlShiftTo(2 * a.t, this.r2), this.mu = this.r2.divide(a);
  14124. }
  14125. return a.prototype.convert = function (a) {
  14126. if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m);
  14127. if (a.compareTo(this.m) < 0) return a;
  14128. var b = M();
  14129. return a.copyTo(b), this.reduce(b), b;
  14130. }, a.prototype.revert = function (a) {
  14131. return a;
  14132. }, a.prototype.reduce = function (a) {
  14133. for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) {
  14134. a.dAddOffset(1, this.m.t + 1);
  14135. }
  14136. for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) {
  14137. a.subTo(this.m, a);
  14138. }
  14139. }, a.prototype.mulTo = function (a, b, c) {
  14140. a.multiplyTo(b, c), this.reduce(c);
  14141. }, a.prototype.sqrTo = function (a, b) {
  14142. a.squareTo(b), this.reduce(b);
  14143. }, a;
  14144. }();
  14145. for (H.prototype.am = Q, C = 28, H.prototype.DB = C, H.prototype.DM = (1 << C) - 1, H.prototype.DV = 1 << C, R = 52, H.prototype.FV = Math.pow(2, R), H.prototype.F1 = R - C, H.prototype.F2 = 2 * C - R, S = [], T = "0".charCodeAt(0), U = 0; 9 >= U; ++U) {
  14146. S[T++] = U;
  14147. }
  14148. for (T = "a".charCodeAt(0), U = 10; 36 > U; ++U) {
  14149. S[T++] = U;
  14150. }
  14151. for (T = "A".charCodeAt(0), U = 10; 36 > U; ++U) {
  14152. S[T++] = U;
  14153. }
  14154. if (H.ZERO = W(0), H.ONE = W(1), Y = function () {
  14155. function a() {
  14156. this.i = 0, this.j = 0, this.S = [];
  14157. }
  14158. return a.prototype.init = function (a) {
  14159. var b, c, d;
  14160. for (b = 0; 256 > b; ++b) {
  14161. this.S[b] = b;
  14162. }
  14163. for (c = 0, b = 0; 256 > b; ++b) {
  14164. c = 255 & c + this.S[b] + a[b % a.length], d = this.S[b], this.S[b] = this.S[c], this.S[c] = d;
  14165. }
  14166. this.i = 0, this.j = 0;
  14167. }, a.prototype.next = function () {
  14168. var a;
  14169. return this.i = 255 & this.i + 1, this.j = 255 & this.j + this.S[this.i], a = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a, this.S[255 & a + this.S[this.i]];
  14170. }, a;
  14171. }(), $ = 256, ab = null, null == ab && (ab = [], bb = 0, cb = void 0, CryptoJS && CryptoJS.getRandomValues)) for (db = new Uint32Array(256), CryptoJS.getRandomValues(db), cb = 0; cb < db.length; ++cb) {
  14172. ab[bb++] = 255 & db[cb];
  14173. }
  14174. gb = function () {
  14175. function a() {}
  14176. return a.prototype.nextBytes = function (a) {
  14177. for (var b = 0; b < a.length; ++b) {
  14178. a[b] = fb();
  14179. }
  14180. }, a;
  14181. }(), jb = function () {
  14182. function a() {
  14183. this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
  14184. }
  14185. return a.prototype.doPublic = function (a) {
  14186. return a.modPowInt(this.e, this.n);
  14187. }, a.prototype.doPrivate = function (a) {
  14188. var b, c;
  14189. if (null == this.p || null == this.q) return a.modPow(this.d, this.n);
  14190. for (b = a.mod(this.p).modPow(this.dmp1, this.p), c = a.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(c) < 0;) {
  14191. b = b.add(this.p);
  14192. }
  14193. return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c);
  14194. }, a.prototype.setPublic = function (a, b) {
  14195. null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key");
  14196. }, a.prototype.encrypt = function (a) {
  14197. var c,
  14198. d,
  14199. b = ib(a, this.n.bitLength() + 7 >> 3);
  14200. return null == b ? null : (c = this.doPublic(b), null == c ? null : (d = c.toString(16), 0 == (1 & d.length) ? d : "0" + d));
  14201. }, a.prototype.setPrivate = function (a, b, c) {
  14202. null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16)) : console.error("Invalid RSA private key");
  14203. }, a.prototype.setPrivateEx = function (a, b, c, d, e, f, g, h) {
  14204. null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16), this.p = N(d, 16), this.q = N(e, 16), this.dmp1 = N(f, 16), this.dmq1 = N(g, 16), this.coeff = N(h, 16)) : console.error("Invalid RSA private key");
  14205. }, a.prototype.generate = function (a, b) {
  14206. var e,
  14207. f,
  14208. g,
  14209. h,
  14210. i,
  14211. c = new gb(),
  14212. d = a >> 1;
  14213. for (this.e = parseInt(b, 16), e = new H(b, 16);;) {
  14214. for (; this.p = new H(a - d, 1, c), 0 != this.p.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.p.isProbablePrime(10);) {
  14215. ;
  14216. }
  14217. for (; this.q = new H(d, 1, c), 0 != this.q.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.q.isProbablePrime(10);) {
  14218. ;
  14219. }
  14220. if (this.p.compareTo(this.q) <= 0 && (f = this.p, this.p = this.q, this.q = f), g = this.p.subtract(H.ONE), h = this.q.subtract(H.ONE), i = g.multiply(h), 0 == i.gcd(e).compareTo(H.ONE)) {
  14221. this.n = this.p.multiply(this.q), this.d = e.modInverse(i), this.dmp1 = this.d.mod(g), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p);
  14222. break;
  14223. }
  14224. }
  14225. }, a.prototype.decrypt = function (a) {
  14226. var b = N(a, 16),
  14227. c = this.doPrivate(b);
  14228. return null == c ? null : kb(c, this.n.bitLength() + 7 >> 3);
  14229. }, a.prototype.generateAsync = function (a, b, c) {
  14230. var f,
  14231. g,
  14232. _h3,
  14233. d = new gb(),
  14234. e = a >> 1;
  14235. this.e = parseInt(b, 16), f = new H(b, 16), g = this, _h3 = function h() {
  14236. var b = function b() {
  14237. var a, b, d, e;
  14238. g.p.compareTo(g.q) <= 0 && (a = g.p, g.p = g.q, g.q = a), b = g.p.subtract(H.ONE), d = g.q.subtract(H.ONE), e = b.multiply(d), 0 == e.gcd(f).compareTo(H.ONE) ? (g.n = g.p.multiply(g.q), g.d = f.modInverse(e), g.dmp1 = g.d.mod(b), g.dmq1 = g.d.mod(d), g.coeff = g.q.modInverse(g.p), setTimeout(function () {
  14239. c();
  14240. }, 0)) : setTimeout(_h3, 0);
  14241. },
  14242. i = function i() {
  14243. g.q = M(), g.q.fromNumberAsync(e, 1, d, function () {
  14244. g.q.subtract(H.ONE).gcda(f, function (a) {
  14245. 0 == a.compareTo(H.ONE) && g.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(i, 0);
  14246. });
  14247. });
  14248. },
  14249. j = function j() {
  14250. g.p = M(), g.p.fromNumberAsync(a - e, 1, d, function () {
  14251. g.p.subtract(H.ONE).gcda(f, function (a) {
  14252. 0 == a.compareTo(H.ONE) && g.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(j, 0);
  14253. });
  14254. });
  14255. };
  14256. setTimeout(j, 0);
  14257. }, setTimeout(_h3, 0);
  14258. }, a.prototype.sign = function (a, b, c) {
  14259. var g,
  14260. h,
  14261. d = mb(c),
  14262. e = d + b(a).toString(),
  14263. f = hb(e, this.n.bitLength() / 4);
  14264. return null == f ? null : (g = this.doPrivate(f), null == g ? null : (h = g.toString(16), 0 == (1 & h.length) ? h : "0" + h));
  14265. }, a.prototype.verify = function (a, b, c) {
  14266. var f,
  14267. g,
  14268. d = N(b, 16),
  14269. e = this.doPublic(d);
  14270. return null == e ? null : (f = e.toString(16).replace(/^1f+00/, ""), g = nb(f), g == c(a).toString());
  14271. }, a;
  14272. }(), lb = {
  14273. md2: "3020300c06082a864886f70d020205000410",
  14274. md5: "3020300c06082a864886f70d020505000410",
  14275. sha1: "3021300906052b0e03021a05000414",
  14276. sha224: "302d300d06096086480165030402040500041c",
  14277. sha256: "3031300d060960864801650304020105000420",
  14278. sha384: "3041300d060960864801650304020205000430",
  14279. sha512: "3051300d060960864801650304020305000440",
  14280. ripemd160: "3021300906052b2403020105000414"
  14281. }, ob = {}, ob.lang = {
  14282. extend: function extend(a, b, c) {
  14283. var d, e, f, g;
  14284. if (!b || !a) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
  14285. if (d = function d() {}, d.prototype = b.prototype, a.prototype = new d(), a.prototype.constructor = a, a.superclass = b.prototype, b.prototype.constructor == Object.prototype.constructor && (b.prototype.constructor = b), c) {
  14286. for (e in c) {
  14287. a.prototype[e] = c[e];
  14288. }
  14289. f = function f() {}, g = ["toString", "valueOf"];
  14290. try {
  14291. /MSIE/.test(navigator.userAgent) && (f = function f(a, b) {
  14292. for (e = 0; e < g.length; e += 1) {
  14293. var c = g[e],
  14294. d = b[c];
  14295. "function" == typeof d && d != Object.prototype[c] && (a[c] = d);
  14296. }
  14297. });
  14298. } catch (h) {}
  14299. f(a.prototype, c);
  14300. }
  14301. }
  14302. }, pb = {}, "undefined" != typeof pb.asn1 && pb.asn1 || (pb.asn1 = {}), pb.asn1.ASN1Util = new function () {
  14303. this.integerToByteHex = function (a) {
  14304. var b = a.toString(16);
  14305. return 1 == b.length % 2 && (b = "0" + b), b;
  14306. }, this.bigIntToMinTwosComplementsHex = function (a) {
  14307. var c,
  14308. d,
  14309. e,
  14310. f,
  14311. g,
  14312. h,
  14313. b = a.toString(16);
  14314. if ("-" != b.substr(0, 1)) 1 == b.length % 2 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b);else {
  14315. for (c = b.substr(1), d = c.length, 1 == d % 2 ? d += 1 : b.match(/^[0-7]/) || (d += 2), e = "", f = 0; d > f; f++) {
  14316. e += "f";
  14317. }
  14318. g = new H(e, 16), h = g.xor(a).add(H.ONE), b = h.toString(16).replace(/^-/, "");
  14319. }
  14320. return b;
  14321. }, this.getPEMStringFromHex = function (a, b) {
  14322. return hextopem(a, b);
  14323. }, this.newObject = function (a) {
  14324. var w,
  14325. x,
  14326. y,
  14327. z,
  14328. A,
  14329. B,
  14330. C,
  14331. D,
  14332. b = pb,
  14333. c = b.asn1,
  14334. d = c.DERBoolean,
  14335. e = c.DERInteger,
  14336. f = c.DERBitString,
  14337. g = c.DEROctetString,
  14338. h = c.DERNull,
  14339. i = c.DERObjectIdentifier,
  14340. j = c.DEREnumerated,
  14341. k = c.DERUTF8String,
  14342. l = c.DERNumericString,
  14343. m = c.DERPrintableString,
  14344. n = c.DERTeletexString,
  14345. o = c.DERIA5String,
  14346. p = c.DERUTCTime,
  14347. q = c.DERGeneralizedTime,
  14348. r = c.DERSequence,
  14349. s = c.DERSet,
  14350. t = c.DERTaggedObject,
  14351. u = c.ASN1Util.newObject,
  14352. v = Object.keys(a);
  14353. if (1 != v.length) throw "key of param shall be only one.";
  14354. if (w = v[0], -1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + w + ":")) throw "undefined key: " + w;
  14355. if ("bool" == w) return new d(a[w]);
  14356. if ("int" == w) return new e(a[w]);
  14357. if ("bitstr" == w) return new f(a[w]);
  14358. if ("octstr" == w) return new g(a[w]);
  14359. if ("null" == w) return new h(a[w]);
  14360. if ("oid" == w) return new i(a[w]);
  14361. if ("enum" == w) return new j(a[w]);
  14362. if ("utf8str" == w) return new k(a[w]);
  14363. if ("numstr" == w) return new l(a[w]);
  14364. if ("prnstr" == w) return new m(a[w]);
  14365. if ("telstr" == w) return new n(a[w]);
  14366. if ("ia5str" == w) return new o(a[w]);
  14367. if ("utctime" == w) return new p(a[w]);
  14368. if ("gentime" == w) return new q(a[w]);
  14369. if ("seq" == w) {
  14370. for (x = a[w], y = [], z = 0; z < x.length; z++) {
  14371. A = u(x[z]), y.push(A);
  14372. }
  14373. return new r({
  14374. array: y
  14375. });
  14376. }
  14377. if ("set" == w) {
  14378. for (x = a[w], y = [], z = 0; z < x.length; z++) {
  14379. A = u(x[z]), y.push(A);
  14380. }
  14381. return new s({
  14382. array: y
  14383. });
  14384. }
  14385. if ("tag" == w) {
  14386. if (B = a[w], "[object Array]" === Object.prototype.toString.call(B) && 3 == B.length) return C = u(B[2]), new t({
  14387. tag: B[0],
  14388. explicit: B[1],
  14389. obj: C
  14390. });
  14391. if (D = {}, void 0 !== B.explicit && (D.explicit = B.explicit), void 0 !== B.tag && (D.tag = B.tag), void 0 === B.obj) throw "obj shall be specified for 'tag'.";
  14392. return D.obj = u(B.obj), new t(D);
  14393. }
  14394. }, this.jsonToASN1HEX = function (a) {
  14395. var b = this.newObject(a);
  14396. return b.getEncodedHex();
  14397. };
  14398. }(), pb.asn1.ASN1Util.oidHexToInt = function (a) {
  14399. var f,
  14400. g,
  14401. h,
  14402. i,
  14403. j,
  14404. b = "",
  14405. c = parseInt(a.substr(0, 2), 16),
  14406. d = Math.floor(c / 40),
  14407. e = c % 40;
  14408. for (b = d + "." + e, f = "", g = 2; g < a.length; g += 2) {
  14409. h = parseInt(a.substr(g, 2), 16), i = ("00000000" + h.toString(2)).slice(-8), f += i.substr(1, 7), "0" == i.substr(0, 1) && (j = new H(f, 2), b = b + "." + j.toString(10), f = "");
  14410. }
  14411. return b;
  14412. }, pb.asn1.ASN1Util.oidIntToHex = function (a) {
  14413. var d,
  14414. e,
  14415. f,
  14416. g,
  14417. b = function b(a) {
  14418. var b = a.toString(16);
  14419. return 1 == b.length && (b = "0" + b), b;
  14420. },
  14421. c = function c(a) {
  14422. var g,
  14423. h,
  14424. i,
  14425. c = "",
  14426. d = new H(a, 10),
  14427. e = d.toString(2),
  14428. f = 7 - e.length % 7;
  14429. for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {
  14430. g += "0";
  14431. }
  14432. for (e = g + e, h = 0; h < e.length - 1; h += 7) {
  14433. i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));
  14434. }
  14435. return c;
  14436. };
  14437. if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;
  14438. for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {
  14439. d += c(e[g]);
  14440. }
  14441. return d;
  14442. }, pb.asn1.ASN1Object = function () {
  14443. var a = "";
  14444. this.getLengthHexFromValue = function () {
  14445. var b, c, d, e;
  14446. if ("undefined" == typeof this.hV || null == this.hV) throw "this.hV is null or undefined.";
  14447. if (1 == this.hV.length % 2) throw "value hex must be even length: n=" + a.length + ",v=" + this.hV;
  14448. if (b = this.hV.length / 2, c = b.toString(16), 1 == c.length % 2 && (c = "0" + c), 128 > b) return c;
  14449. if (d = c.length / 2, d > 15) throw "ASN.1 length too long to represent by 8x: n = " + b.toString(16);
  14450. return e = 128 + d, e.toString(16) + c;
  14451. }, this.getEncodedHex = function () {
  14452. return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;
  14453. }, this.getValueHex = function () {
  14454. return this.getEncodedHex(), this.hV;
  14455. }, this.getFreshValueHex = function () {
  14456. return "";
  14457. };
  14458. }, pb.asn1.DERAbstractString = function (a) {
  14459. pb.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function () {
  14460. return this.s;
  14461. }, this.setString = function (a) {
  14462. this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s);
  14463. }, this.setStringHex = function (a) {
  14464. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;
  14465. }, this.getFreshValueHex = function () {
  14466. return this.hV;
  14467. }, "undefined" != typeof a && ("string" == typeof a ? this.setString(a) : "undefined" != typeof a["str"] ? this.setString(a["str"]) : "undefined" != typeof a["hex"] && this.setStringHex(a["hex"]));
  14468. }, ob.lang.extend(pb.asn1.DERAbstractString, pb.asn1.ASN1Object), pb.asn1.DERAbstractTime = function () {
  14469. pb.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function (a) {
  14470. utc = a.getTime() + 6e4 * a.getTimezoneOffset();
  14471. var b = new Date(utc);
  14472. return b;
  14473. }, this.formatDate = function (a, b, c) {
  14474. var g,
  14475. h,
  14476. i,
  14477. j,
  14478. k,
  14479. l,
  14480. m,
  14481. n,
  14482. d = this.zeroPadding,
  14483. e = this.localDateToUTC(a),
  14484. f = String(e.getFullYear());
  14485. return "utc" == b && (f = f.substr(2, 2)), g = d(String(e.getMonth() + 1), 2), h = d(String(e.getDate()), 2), i = d(String(e.getHours()), 2), j = d(String(e.getMinutes()), 2), k = d(String(e.getSeconds()), 2), l = f + g + h + i + j + k, c === !0 && (m = e.getMilliseconds(), 0 != m && (n = d(String(m), 3), n = n.replace(/[0]+$/, ""), l = l + "." + n)), l + "Z";
  14486. }, this.zeroPadding = function (a, b) {
  14487. return a.length >= b ? a : new Array(b - a.length + 1).join("0") + a;
  14488. }, this.getString = function () {
  14489. return this.s;
  14490. }, this.setString = function (a) {
  14491. this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(a);
  14492. }, this.setByDateValue = function (a, b, c, d, e, f) {
  14493. var g = new Date(Date.UTC(a, b - 1, c, d, e, f, 0));
  14494. this.setByDate(g);
  14495. }, this.getFreshValueHex = function () {
  14496. return this.hV;
  14497. };
  14498. }, ob.lang.extend(pb.asn1.DERAbstractTime, pb.asn1.ASN1Object), pb.asn1.DERAbstractStructured = function (a) {
  14499. pb.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function (a) {
  14500. this.hTLV = null, this.isModified = !0, this.asn1Array = a;
  14501. }, this.appendASN1Object = function (a) {
  14502. this.hTLV = null, this.isModified = !0, this.asn1Array.push(a);
  14503. }, this.asn1Array = new Array(), "undefined" != typeof a && "undefined" != typeof a["array"] && (this.asn1Array = a["array"]);
  14504. }, ob.lang.extend(pb.asn1.DERAbstractStructured, pb.asn1.ASN1Object), pb.asn1.DERBoolean = function () {
  14505. pb.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
  14506. }, ob.lang.extend(pb.asn1.DERBoolean, pb.asn1.ASN1Object), pb.asn1.DERInteger = function (a) {
  14507. pb.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function (a) {
  14508. this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);
  14509. }, this.setByInteger = function (a) {
  14510. var b = new H(String(a), 10);
  14511. this.setByBigInteger(b);
  14512. }, this.setValueHex = function (a) {
  14513. this.hV = a;
  14514. }, this.getFreshValueHex = function () {
  14515. return this.hV;
  14516. }, "undefined" != typeof a && ("undefined" != typeof a["bigint"] ? this.setByBigInteger(a["bigint"]) : "undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));
  14517. }, ob.lang.extend(pb.asn1.DERInteger, pb.asn1.ASN1Object), pb.asn1.DERBitString = function (a) {
  14518. if (void 0 !== a && "undefined" != typeof a.obj) {
  14519. var b = pb.asn1.ASN1Util.newObject(a.obj);
  14520. a.hex = "00" + b.getEncodedHex();
  14521. }
  14522. pb.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function (a) {
  14523. this.hTLV = null, this.isModified = !0, this.hV = a;
  14524. }, this.setUnusedBitsAndHexValue = function (a, b) {
  14525. if (0 > a || a > 7) throw "unused bits shall be from 0 to 7: u = " + a;
  14526. var c = "0" + a;
  14527. this.hTLV = null, this.isModified = !0, this.hV = c + b;
  14528. }, this.setByBinaryString = function (a) {
  14529. var b, c, d, e, f;
  14530. for (a = a.replace(/0+$/, ""), b = 8 - a.length % 8, 8 == b && (b = 0), c = 0; b >= c; c++) {
  14531. a += "0";
  14532. }
  14533. for (d = "", c = 0; c < a.length - 1; c += 8) {
  14534. e = a.substr(c, 8), f = parseInt(e, 2).toString(16), 1 == f.length && (f = "0" + f), d += f;
  14535. }
  14536. this.hTLV = null, this.isModified = !0, this.hV = "0" + b + d;
  14537. }, this.setByBooleanArray = function (a) {
  14538. var c,
  14539. b = "";
  14540. for (c = 0; c < a.length; c++) {
  14541. b += 1 == a[c] ? "1" : "0";
  14542. }
  14543. this.setByBinaryString(b);
  14544. }, this.newFalseArray = function (a) {
  14545. var c,
  14546. b = new Array(a);
  14547. for (c = 0; a > c; c++) {
  14548. b[c] = !1;
  14549. }
  14550. return b;
  14551. }, this.getFreshValueHex = function () {
  14552. return this.hV;
  14553. }, "undefined" != typeof a && ("string" == typeof a && a.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(a) : "undefined" != typeof a["hex"] ? this.setHexValueIncludingUnusedBits(a["hex"]) : "undefined" != typeof a["bin"] ? this.setByBinaryString(a["bin"]) : "undefined" != typeof a["array"] && this.setByBooleanArray(a["array"]));
  14554. }, ob.lang.extend(pb.asn1.DERBitString, pb.asn1.ASN1Object), pb.asn1.DEROctetString = function (a) {
  14555. if (void 0 !== a && "undefined" != typeof a.obj) {
  14556. var b = pb.asn1.ASN1Util.newObject(a.obj);
  14557. a.hex = b.getEncodedHex();
  14558. }
  14559. pb.asn1.DEROctetString.superclass.constructor.call(this, a), this.hT = "04";
  14560. }, ob.lang.extend(pb.asn1.DEROctetString, pb.asn1.DERAbstractString), pb.asn1.DERNull = function () {
  14561. pb.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
  14562. }, ob.lang.extend(pb.asn1.DERNull, pb.asn1.ASN1Object), pb.asn1.DERObjectIdentifier = function (a) {
  14563. var b = function b(a) {
  14564. var b = a.toString(16);
  14565. return 1 == b.length && (b = "0" + b), b;
  14566. },
  14567. c = function c(a) {
  14568. var g,
  14569. h,
  14570. i,
  14571. c = "",
  14572. d = new H(a, 10),
  14573. e = d.toString(2),
  14574. f = 7 - e.length % 7;
  14575. for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {
  14576. g += "0";
  14577. }
  14578. for (e = g + e, h = 0; h < e.length - 1; h += 7) {
  14579. i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));
  14580. }
  14581. return c;
  14582. };
  14583. pb.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function (a) {
  14584. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;
  14585. }, this.setValueOidString = function (a) {
  14586. var d, e, f, g;
  14587. if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;
  14588. for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {
  14589. d += c(e[g]);
  14590. }
  14591. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = d;
  14592. }, this.setValueName = function (a) {
  14593. var b = pb.asn1.x509.OID.name2oid(a);
  14594. if ("" === b) throw "DERObjectIdentifier oidName undefined: " + a;
  14595. this.setValueOidString(b);
  14596. }, this.getFreshValueHex = function () {
  14597. return this.hV;
  14598. }, void 0 !== a && ("string" == typeof a ? a.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(a) : this.setValueName(a) : void 0 !== a.oid ? this.setValueOidString(a.oid) : void 0 !== a.hex ? this.setValueHex(a.hex) : void 0 !== a.name && this.setValueName(a.name));
  14599. }, ob.lang.extend(pb.asn1.DERObjectIdentifier, pb.asn1.ASN1Object), pb.asn1.DEREnumerated = function (a) {
  14600. pb.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function (a) {
  14601. this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);
  14602. }, this.setByInteger = function (a) {
  14603. var b = new H(String(a), 10);
  14604. this.setByBigInteger(b);
  14605. }, this.setValueHex = function (a) {
  14606. this.hV = a;
  14607. }, this.getFreshValueHex = function () {
  14608. return this.hV;
  14609. }, "undefined" != typeof a && ("undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));
  14610. }, ob.lang.extend(pb.asn1.DEREnumerated, pb.asn1.ASN1Object), pb.asn1.DERUTF8String = function (a) {
  14611. pb.asn1.DERUTF8String.superclass.constructor.call(this, a), this.hT = "0c";
  14612. }, ob.lang.extend(pb.asn1.DERUTF8String, pb.asn1.DERAbstractString), pb.asn1.DERNumericString = function (a) {
  14613. pb.asn1.DERNumericString.superclass.constructor.call(this, a), this.hT = "12";
  14614. }, ob.lang.extend(pb.asn1.DERNumericString, pb.asn1.DERAbstractString), pb.asn1.DERPrintableString = function (a) {
  14615. pb.asn1.DERPrintableString.superclass.constructor.call(this, a), this.hT = "13";
  14616. }, ob.lang.extend(pb.asn1.DERPrintableString, pb.asn1.DERAbstractString), pb.asn1.DERTeletexString = function (a) {
  14617. pb.asn1.DERTeletexString.superclass.constructor.call(this, a), this.hT = "14";
  14618. }, ob.lang.extend(pb.asn1.DERTeletexString, pb.asn1.DERAbstractString), pb.asn1.DERIA5String = function (a) {
  14619. pb.asn1.DERIA5String.superclass.constructor.call(this, a), this.hT = "16";
  14620. }, ob.lang.extend(pb.asn1.DERIA5String, pb.asn1.DERAbstractString), pb.asn1.DERUTCTime = function (a) {
  14621. pb.asn1.DERUTCTime.superclass.constructor.call(this, a), this.hT = "17", this.setByDate = function (a) {
  14622. this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
  14623. }, this.getFreshValueHex = function () {
  14624. return "undefined" == typeof this.date && "undefined" == typeof this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
  14625. }, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{12}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date));
  14626. }, ob.lang.extend(pb.asn1.DERUTCTime, pb.asn1.DERAbstractTime), pb.asn1.DERGeneralizedTime = function (a) {
  14627. pb.asn1.DERGeneralizedTime.superclass.constructor.call(this, a), this.hT = "18", this.withMillis = !1, this.setByDate = function (a) {
  14628. this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
  14629. }, this.getFreshValueHex = function () {
  14630. return void 0 === this.date && void 0 === this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
  14631. }, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{14}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date), a.millis === !0 && (this.withMillis = !0));
  14632. }, ob.lang.extend(pb.asn1.DERGeneralizedTime, pb.asn1.DERAbstractTime), pb.asn1.DERSequence = function (a) {
  14633. pb.asn1.DERSequence.superclass.constructor.call(this, a), this.hT = "30", this.getFreshValueHex = function () {
  14634. var b,
  14635. c,
  14636. a = "";
  14637. for (b = 0; b < this.asn1Array.length; b++) {
  14638. c = this.asn1Array[b], a += c.getEncodedHex();
  14639. }
  14640. return this.hV = a, this.hV;
  14641. };
  14642. }, ob.lang.extend(pb.asn1.DERSequence, pb.asn1.DERAbstractStructured), pb.asn1.DERSet = function (a) {
  14643. pb.asn1.DERSet.superclass.constructor.call(this, a), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function () {
  14644. var b,
  14645. c,
  14646. a = new Array();
  14647. for (b = 0; b < this.asn1Array.length; b++) {
  14648. c = this.asn1Array[b], a.push(c.getEncodedHex());
  14649. }
  14650. return 1 == this.sortFlag && a.sort(), this.hV = a.join(""), this.hV;
  14651. }, "undefined" != typeof a && "undefined" != typeof a.sortflag && 0 == a.sortflag && (this.sortFlag = !1);
  14652. }, ob.lang.extend(pb.asn1.DERSet, pb.asn1.DERAbstractStructured), pb.asn1.DERTaggedObject = function (a) {
  14653. pb.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function (a, b, c) {
  14654. this.hT = b, this.isExplicit = a, this.asn1Object = c, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = c.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1);
  14655. }, this.getFreshValueHex = function () {
  14656. return this.hV;
  14657. }, "undefined" != typeof a && ("undefined" != typeof a["tag"] && (this.hT = a["tag"]), "undefined" != typeof a["explicit"] && (this.isExplicit = a["explicit"]), "undefined" != typeof a["obj"] && (this.asn1Object = a["obj"], this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
  14658. }, ob.lang.extend(pb.asn1.DERTaggedObject, pb.asn1.ASN1Object), qb = function (a) {
  14659. function b(c) {
  14660. var d = a.call(this) || this;
  14661. return c && ("string" == typeof c ? d.parseKey(c) : (b.hasPrivateKeyProperty(c) || b.hasPublicKeyProperty(c)) && d.parsePropertiesFrom(c)), d;
  14662. }
  14663. return o(b, a), b.prototype.parseKey = function (a) {
  14664. var b, c, d, e, f, g, h, i, j, k, l, m, n;
  14665. try {
  14666. if (b = 0, c = 0, d = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, e = d.test(a) ? q.decode(a) : s.unarmor(a), f = A.decode(e), 3 === f.sub.length && (f = f.sub[2].sub[0]), 9 === f.sub.length) b = f.sub[1].getHexStringValue(), this.n = N(b, 16), c = f.sub[2].getHexStringValue(), this.e = parseInt(c, 16), g = f.sub[3].getHexStringValue(), this.d = N(g, 16), h = f.sub[4].getHexStringValue(), this.p = N(h, 16), i = f.sub[5].getHexStringValue(), this.q = N(i, 16), j = f.sub[6].getHexStringValue(), this.dmp1 = N(j, 16), k = f.sub[7].getHexStringValue(), this.dmq1 = N(k, 16), l = f.sub[8].getHexStringValue(), this.coeff = N(l, 16);else {
  14667. if (2 !== f.sub.length) return !1;
  14668. m = f.sub[1], n = m.sub[0], b = n.sub[0].getHexStringValue(), this.n = N(b, 16), c = n.sub[1].getHexStringValue(), this.e = parseInt(c, 16);
  14669. }
  14670. return !0;
  14671. } catch (o) {
  14672. return !1;
  14673. }
  14674. }, b.prototype.getPrivateBaseKey = function () {
  14675. var a = {
  14676. array: [new pb.asn1.DERInteger({
  14677. "int": 0
  14678. }), new pb.asn1.DERInteger({
  14679. bigint: this.n
  14680. }), new pb.asn1.DERInteger({
  14681. "int": this.e
  14682. }), new pb.asn1.DERInteger({
  14683. bigint: this.d
  14684. }), new pb.asn1.DERInteger({
  14685. bigint: this.p
  14686. }), new pb.asn1.DERInteger({
  14687. bigint: this.q
  14688. }), new pb.asn1.DERInteger({
  14689. bigint: this.dmp1
  14690. }), new pb.asn1.DERInteger({
  14691. bigint: this.dmq1
  14692. }), new pb.asn1.DERInteger({
  14693. bigint: this.coeff
  14694. })]
  14695. },
  14696. b = new pb.asn1.DERSequence(a);
  14697. return b.getEncodedHex();
  14698. }, b.prototype.getPrivateBaseKeyB64 = function () {
  14699. return l(this.getPrivateBaseKey());
  14700. }, b.prototype.getPublicBaseKey = function () {
  14701. var a = new pb.asn1.DERSequence({
  14702. array: [new pb.asn1.DERObjectIdentifier({
  14703. oid: "1.2.840.113549.1.1.1"
  14704. }), new pb.asn1.DERNull()]
  14705. }),
  14706. b = new pb.asn1.DERSequence({
  14707. array: [new pb.asn1.DERInteger({
  14708. bigint: this.n
  14709. }), new pb.asn1.DERInteger({
  14710. "int": this.e
  14711. })]
  14712. }),
  14713. c = new pb.asn1.DERBitString({
  14714. hex: "00" + b.getEncodedHex()
  14715. }),
  14716. d = new pb.asn1.DERSequence({
  14717. array: [a, c]
  14718. });
  14719. return d.getEncodedHex();
  14720. }, b.prototype.getPublicBaseKeyB64 = function () {
  14721. return l(this.getPublicBaseKey());
  14722. }, b.wordwrap = function (a, b) {
  14723. if (b = b || 64, !a) return a;
  14724. var c = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})";
  14725. return a.match(RegExp(c, "g")).join("\n");
  14726. }, b.prototype.getPrivateKey = function () {
  14727. var a = "-----BEGIN RSA PRIVATE KEY-----\n";
  14728. return a += b.wordwrap(this.getPrivateBaseKeyB64()) + "\n", a += "-----END RSA PRIVATE KEY-----";
  14729. }, b.prototype.getPublicKey = function () {
  14730. var a = "-----BEGIN PUBLIC KEY-----\n";
  14731. return a += b.wordwrap(this.getPublicBaseKeyB64()) + "\n", a += "-----END PUBLIC KEY-----";
  14732. }, b.hasPublicKeyProperty = function (a) {
  14733. return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e");
  14734. }, b.hasPrivateKeyProperty = function (a) {
  14735. return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") && a.hasOwnProperty("d") && a.hasOwnProperty("p") && a.hasOwnProperty("q") && a.hasOwnProperty("dmp1") && a.hasOwnProperty("dmq1") && a.hasOwnProperty("coeff");
  14736. }, b.prototype.parsePropertiesFrom = function (a) {
  14737. this.n = a.n, this.e = a.e, a.hasOwnProperty("d") && (this.d = a.d, this.p = a.p, this.q = a.q, this.dmp1 = a.dmp1, this.dmq1 = a.dmq1, this.coeff = a.coeff);
  14738. }, b;
  14739. }(jb), rb = function () {
  14740. function a(a) {
  14741. a = a || {}, this.default_key_size = parseInt(a.default_key_size, 10) || 1024, this.default_public_exponent = a.default_public_exponent || "010001", this.log = a.log || !1, this.key = null;
  14742. }
  14743. return a.prototype.setKey = function (a) {
  14744. this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new qb(a);
  14745. }, a.prototype.setPrivateKey = function (a) {
  14746. this.setKey(a);
  14747. }, a.prototype.setPublicKey = function (a) {
  14748. this.setKey(a);
  14749. }, a.prototype.decrypt = function (a) {
  14750. try {
  14751. return this.getKey().decrypt(m(a));
  14752. } catch (b) {
  14753. return !1;
  14754. }
  14755. }, a.prototype.encrypt = function (a) {
  14756. try {
  14757. return l(this.getKey().encrypt(a));
  14758. } catch (b) {
  14759. return !1;
  14760. }
  14761. }, a.prototype.sign = function (a, b, c) {
  14762. try {
  14763. return l(this.getKey().sign(a, b, c));
  14764. } catch (d) {
  14765. return !1;
  14766. }
  14767. }, a.prototype.verify = function (a, b, c) {
  14768. try {
  14769. return this.getKey().verify(a, m(b), c);
  14770. } catch (d) {
  14771. return !1;
  14772. }
  14773. }, a.prototype.getKey = function (a) {
  14774. if (!this.key) {
  14775. if (this.key = new qb(), a && "[object Function]" === {}.toString.call(a)) return this.key.generateAsync(this.default_key_size, this.default_public_exponent, a), void 0;
  14776. this.key.generate(this.default_key_size, this.default_public_exponent);
  14777. }
  14778. return this.key;
  14779. }, a.prototype.getPrivateKey = function () {
  14780. return this.getKey().getPrivateKey();
  14781. }, a.prototype.getPrivateKeyB64 = function () {
  14782. return this.getKey().getPrivateBaseKeyB64();
  14783. }, a.prototype.getPublicKey = function () {
  14784. return this.getKey().getPublicKey();
  14785. }, a.prototype.getPublicKeyB64 = function () {
  14786. return this.getKey().getPublicBaseKeyB64();
  14787. }, a.version = "3.0.0-rc.1", a;
  14788. }(), a.JSEncrypt = rb, a.default = rb, Object.defineProperty(a, "__esModule", {
  14789. value: !0
  14790. });
  14791. });
  14792. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 3)))
  14793. /***/ }),
  14794. /* 99 */
  14795. /*!*************************************************!*\
  14796. !*** ./node_modules/crypto-browserify/index.js ***!
  14797. \*************************************************/
  14798. /*! no static exports found */
  14799. /***/ (function(module, exports, __webpack_require__) {
  14800. "use strict";
  14801. exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 100)
  14802. exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 108)
  14803. exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 143)
  14804. var algos = __webpack_require__(/*! browserify-sign/algos */ 146)
  14805. var algoKeys = Object.keys(algos)
  14806. var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
  14807. exports.getHashes = function () {
  14808. return hashes
  14809. }
  14810. var p = __webpack_require__(/*! pbkdf2 */ 148)
  14811. exports.pbkdf2 = p.pbkdf2
  14812. exports.pbkdf2Sync = p.pbkdf2Sync
  14813. var aes = __webpack_require__(/*! browserify-cipher */ 154)
  14814. exports.Cipher = aes.Cipher
  14815. exports.createCipher = aes.createCipher
  14816. exports.Cipheriv = aes.Cipheriv
  14817. exports.createCipheriv = aes.createCipheriv
  14818. exports.Decipher = aes.Decipher
  14819. exports.createDecipher = aes.createDecipher
  14820. exports.Decipheriv = aes.Decipheriv
  14821. exports.createDecipheriv = aes.createDecipheriv
  14822. exports.getCiphers = aes.getCiphers
  14823. exports.listCiphers = aes.listCiphers
  14824. var dh = __webpack_require__(/*! diffie-hellman */ 183)
  14825. exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
  14826. exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
  14827. exports.getDiffieHellman = dh.getDiffieHellman
  14828. exports.createDiffieHellman = dh.createDiffieHellman
  14829. exports.DiffieHellman = dh.DiffieHellman
  14830. var sign = __webpack_require__(/*! browserify-sign */ 193)
  14831. exports.createSign = sign.createSign
  14832. exports.Sign = sign.Sign
  14833. exports.createVerify = sign.createVerify
  14834. exports.Verify = sign.Verify
  14835. exports.createECDH = __webpack_require__(/*! create-ecdh */ 248)
  14836. var publicEncrypt = __webpack_require__(/*! public-encrypt */ 249)
  14837. exports.publicEncrypt = publicEncrypt.publicEncrypt
  14838. exports.privateEncrypt = publicEncrypt.privateEncrypt
  14839. exports.publicDecrypt = publicEncrypt.publicDecrypt
  14840. exports.privateDecrypt = publicEncrypt.privateDecrypt
  14841. // the least I can do is make error messages for the rest of the node.js/crypto api.
  14842. // ;[
  14843. // 'createCredentials'
  14844. // ].forEach(function (name) {
  14845. // exports[name] = function () {
  14846. // throw new Error([
  14847. // 'sorry, ' + name + ' is not implemented yet',
  14848. // 'we accept pull requests',
  14849. // 'https://github.com/crypto-browserify/crypto-browserify'
  14850. // ].join('\n'))
  14851. // }
  14852. // })
  14853. var rf = __webpack_require__(/*! randomfill */ 255)
  14854. exports.randomFill = rf.randomFill
  14855. exports.randomFillSync = rf.randomFillSync
  14856. exports.createCredentials = function () {
  14857. throw new Error([
  14858. 'sorry, createCredentials is not implemented yet',
  14859. 'we accept pull requests',
  14860. 'https://github.com/crypto-browserify/crypto-browserify'
  14861. ].join('\n'))
  14862. }
  14863. exports.constants = {
  14864. 'DH_CHECK_P_NOT_SAFE_PRIME': 2,
  14865. 'DH_CHECK_P_NOT_PRIME': 1,
  14866. 'DH_UNABLE_TO_CHECK_GENERATOR': 4,
  14867. 'DH_NOT_SUITABLE_GENERATOR': 8,
  14868. 'NPN_ENABLED': 1,
  14869. 'ALPN_ENABLED': 1,
  14870. 'RSA_PKCS1_PADDING': 1,
  14871. 'RSA_SSLV23_PADDING': 2,
  14872. 'RSA_NO_PADDING': 3,
  14873. 'RSA_PKCS1_OAEP_PADDING': 4,
  14874. 'RSA_X931_PADDING': 5,
  14875. 'RSA_PKCS1_PSS_PADDING': 6,
  14876. 'POINT_CONVERSION_COMPRESSED': 2,
  14877. 'POINT_CONVERSION_UNCOMPRESSED': 4,
  14878. 'POINT_CONVERSION_HYBRID': 6
  14879. }
  14880. /***/ }),
  14881. /* 100 */
  14882. /*!*********************************************!*\
  14883. !*** ./node_modules/randombytes/browser.js ***!
  14884. \*********************************************/
  14885. /*! no static exports found */
  14886. /***/ (function(module, exports, __webpack_require__) {
  14887. "use strict";
  14888. /* WEBPACK VAR INJECTION */(function(global, process) {
  14889. // limit of Crypto.getRandomValues()
  14890. // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
  14891. var MAX_BYTES = 65536
  14892. // Node supports requesting up to this number of bytes
  14893. // https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
  14894. var MAX_UINT32 = 4294967295
  14895. function oldBrowser () {
  14896. throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
  14897. }
  14898. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  14899. var crypto = global.crypto || global.msCrypto
  14900. if (crypto && crypto.getRandomValues) {
  14901. module.exports = randomBytes
  14902. } else {
  14903. module.exports = oldBrowser
  14904. }
  14905. function randomBytes (size, cb) {
  14906. // phantomjs needs to throw
  14907. if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
  14908. var bytes = Buffer.allocUnsafe(size)
  14909. if (size > 0) { // getRandomValues fails on IE if size == 0
  14910. if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
  14911. // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
  14912. for (var generated = 0; generated < size; generated += MAX_BYTES) {
  14913. // buffer.slice automatically checks if the end is past the end of
  14914. // the buffer so we don't have to here
  14915. crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
  14916. }
  14917. } else {
  14918. crypto.getRandomValues(bytes)
  14919. }
  14920. }
  14921. if (typeof cb === 'function') {
  14922. return process.nextTick(function () {
  14923. cb(null, bytes)
  14924. })
  14925. }
  14926. return bytes
  14927. }
  14928. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 101)))
  14929. /***/ }),
  14930. /* 101 */
  14931. /*!********************************************************!*\
  14932. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  14933. \********************************************************/
  14934. /*! no static exports found */
  14935. /***/ (function(module, exports, __webpack_require__) {
  14936. exports.nextTick = function nextTick(fn) {
  14937. var args = Array.prototype.slice.call(arguments);
  14938. args.shift();
  14939. setTimeout(function () {
  14940. fn.apply(null, args);
  14941. }, 0);
  14942. };
  14943. exports.platform = exports.arch =
  14944. exports.execPath = exports.title = 'browser';
  14945. exports.pid = 1;
  14946. exports.browser = true;
  14947. exports.env = {};
  14948. exports.argv = [];
  14949. exports.binding = function (name) {
  14950. throw new Error('No such module. (Possibly not yet loaded)')
  14951. };
  14952. (function () {
  14953. var cwd = '/';
  14954. var path;
  14955. exports.cwd = function () { return cwd };
  14956. exports.chdir = function (dir) {
  14957. if (!path) path = __webpack_require__(/*! path */ 102);
  14958. cwd = path.resolve(dir, cwd);
  14959. };
  14960. })();
  14961. exports.exit = exports.kill =
  14962. exports.umask = exports.dlopen =
  14963. exports.uptime = exports.memoryUsage =
  14964. exports.uvCounters = function() {};
  14965. exports.features = {};
  14966. /***/ }),
  14967. /* 102 */
  14968. /*!***********************************************!*\
  14969. !*** ./node_modules/path-browserify/index.js ***!
  14970. \***********************************************/
  14971. /*! no static exports found */
  14972. /***/ (function(module, exports, __webpack_require__) {
  14973. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  14974. // backported and transplited with Babel, with backwards-compat fixes
  14975. // Copyright Joyent, Inc. and other Node contributors.
  14976. //
  14977. // Permission is hereby granted, free of charge, to any person obtaining a
  14978. // copy of this software and associated documentation files (the
  14979. // "Software"), to deal in the Software without restriction, including
  14980. // without limitation the rights to use, copy, modify, merge, publish,
  14981. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14982. // persons to whom the Software is furnished to do so, subject to the
  14983. // following conditions:
  14984. //
  14985. // The above copyright notice and this permission notice shall be included
  14986. // in all copies or substantial portions of the Software.
  14987. //
  14988. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14989. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14990. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14991. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14992. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14993. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14994. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14995. // resolves . and .. elements in a path array with directory names there
  14996. // must be no slashes, empty elements, or device names (c:\) in the array
  14997. // (so also no leading and trailing slashes - it does not distinguish
  14998. // relative and absolute paths)
  14999. function normalizeArray(parts, allowAboveRoot) {
  15000. // if the path tries to go above the root, `up` ends up > 0
  15001. var up = 0;
  15002. for (var i = parts.length - 1; i >= 0; i--) {
  15003. var last = parts[i];
  15004. if (last === '.') {
  15005. parts.splice(i, 1);
  15006. } else if (last === '..') {
  15007. parts.splice(i, 1);
  15008. up++;
  15009. } else if (up) {
  15010. parts.splice(i, 1);
  15011. up--;
  15012. }
  15013. }
  15014. // if the path is allowed to go above the root, restore leading ..s
  15015. if (allowAboveRoot) {
  15016. for (; up--; up) {
  15017. parts.unshift('..');
  15018. }
  15019. }
  15020. return parts;
  15021. }
  15022. // path.resolve([from ...], to)
  15023. // posix version
  15024. exports.resolve = function() {
  15025. var resolvedPath = '',
  15026. resolvedAbsolute = false;
  15027. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  15028. var path = (i >= 0) ? arguments[i] : process.cwd();
  15029. // Skip empty and invalid entries
  15030. if (typeof path !== 'string') {
  15031. throw new TypeError('Arguments to path.resolve must be strings');
  15032. } else if (!path) {
  15033. continue;
  15034. }
  15035. resolvedPath = path + '/' + resolvedPath;
  15036. resolvedAbsolute = path.charAt(0) === '/';
  15037. }
  15038. // At this point the path should be resolved to a full absolute path, but
  15039. // handle relative paths to be safe (might happen when process.cwd() fails)
  15040. // Normalize the path
  15041. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  15042. return !!p;
  15043. }), !resolvedAbsolute).join('/');
  15044. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  15045. };
  15046. // path.normalize(path)
  15047. // posix version
  15048. exports.normalize = function(path) {
  15049. var isAbsolute = exports.isAbsolute(path),
  15050. trailingSlash = substr(path, -1) === '/';
  15051. // Normalize the path
  15052. path = normalizeArray(filter(path.split('/'), function(p) {
  15053. return !!p;
  15054. }), !isAbsolute).join('/');
  15055. if (!path && !isAbsolute) {
  15056. path = '.';
  15057. }
  15058. if (path && trailingSlash) {
  15059. path += '/';
  15060. }
  15061. return (isAbsolute ? '/' : '') + path;
  15062. };
  15063. // posix version
  15064. exports.isAbsolute = function(path) {
  15065. return path.charAt(0) === '/';
  15066. };
  15067. // posix version
  15068. exports.join = function() {
  15069. var paths = Array.prototype.slice.call(arguments, 0);
  15070. return exports.normalize(filter(paths, function(p, index) {
  15071. if (typeof p !== 'string') {
  15072. throw new TypeError('Arguments to path.join must be strings');
  15073. }
  15074. return p;
  15075. }).join('/'));
  15076. };
  15077. // path.relative(from, to)
  15078. // posix version
  15079. exports.relative = function(from, to) {
  15080. from = exports.resolve(from).substr(1);
  15081. to = exports.resolve(to).substr(1);
  15082. function trim(arr) {
  15083. var start = 0;
  15084. for (; start < arr.length; start++) {
  15085. if (arr[start] !== '') break;
  15086. }
  15087. var end = arr.length - 1;
  15088. for (; end >= 0; end--) {
  15089. if (arr[end] !== '') break;
  15090. }
  15091. if (start > end) return [];
  15092. return arr.slice(start, end - start + 1);
  15093. }
  15094. var fromParts = trim(from.split('/'));
  15095. var toParts = trim(to.split('/'));
  15096. var length = Math.min(fromParts.length, toParts.length);
  15097. var samePartsLength = length;
  15098. for (var i = 0; i < length; i++) {
  15099. if (fromParts[i] !== toParts[i]) {
  15100. samePartsLength = i;
  15101. break;
  15102. }
  15103. }
  15104. var outputParts = [];
  15105. for (var i = samePartsLength; i < fromParts.length; i++) {
  15106. outputParts.push('..');
  15107. }
  15108. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  15109. return outputParts.join('/');
  15110. };
  15111. exports.sep = '/';
  15112. exports.delimiter = ':';
  15113. exports.dirname = function (path) {
  15114. if (typeof path !== 'string') path = path + '';
  15115. if (path.length === 0) return '.';
  15116. var code = path.charCodeAt(0);
  15117. var hasRoot = code === 47 /*/*/;
  15118. var end = -1;
  15119. var matchedSlash = true;
  15120. for (var i = path.length - 1; i >= 1; --i) {
  15121. code = path.charCodeAt(i);
  15122. if (code === 47 /*/*/) {
  15123. if (!matchedSlash) {
  15124. end = i;
  15125. break;
  15126. }
  15127. } else {
  15128. // We saw the first non-path separator
  15129. matchedSlash = false;
  15130. }
  15131. }
  15132. if (end === -1) return hasRoot ? '/' : '.';
  15133. if (hasRoot && end === 1) {
  15134. // return '//';
  15135. // Backwards-compat fix:
  15136. return '/';
  15137. }
  15138. return path.slice(0, end);
  15139. };
  15140. function basename(path) {
  15141. if (typeof path !== 'string') path = path + '';
  15142. var start = 0;
  15143. var end = -1;
  15144. var matchedSlash = true;
  15145. var i;
  15146. for (i = path.length - 1; i >= 0; --i) {
  15147. if (path.charCodeAt(i) === 47 /*/*/) {
  15148. // If we reached a path separator that was not part of a set of path
  15149. // separators at the end of the string, stop now
  15150. if (!matchedSlash) {
  15151. start = i + 1;
  15152. break;
  15153. }
  15154. } else if (end === -1) {
  15155. // We saw the first non-path separator, mark this as the end of our
  15156. // path component
  15157. matchedSlash = false;
  15158. end = i + 1;
  15159. }
  15160. }
  15161. if (end === -1) return '';
  15162. return path.slice(start, end);
  15163. }
  15164. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  15165. // in new Node.js versions, so only basename() above is backported here
  15166. exports.basename = function (path, ext) {
  15167. var f = basename(path);
  15168. if (ext && f.substr(-1 * ext.length) === ext) {
  15169. f = f.substr(0, f.length - ext.length);
  15170. }
  15171. return f;
  15172. };
  15173. exports.extname = function (path) {
  15174. if (typeof path !== 'string') path = path + '';
  15175. var startDot = -1;
  15176. var startPart = 0;
  15177. var end = -1;
  15178. var matchedSlash = true;
  15179. // Track the state of characters (if any) we see before our first dot and
  15180. // after any path separator we find
  15181. var preDotState = 0;
  15182. for (var i = path.length - 1; i >= 0; --i) {
  15183. var code = path.charCodeAt(i);
  15184. if (code === 47 /*/*/) {
  15185. // If we reached a path separator that was not part of a set of path
  15186. // separators at the end of the string, stop now
  15187. if (!matchedSlash) {
  15188. startPart = i + 1;
  15189. break;
  15190. }
  15191. continue;
  15192. }
  15193. if (end === -1) {
  15194. // We saw the first non-path separator, mark this as the end of our
  15195. // extension
  15196. matchedSlash = false;
  15197. end = i + 1;
  15198. }
  15199. if (code === 46 /*.*/) {
  15200. // If this is our first dot, mark it as the start of our extension
  15201. if (startDot === -1)
  15202. startDot = i;
  15203. else if (preDotState !== 1)
  15204. preDotState = 1;
  15205. } else if (startDot !== -1) {
  15206. // We saw a non-dot and non-path separator before our dot, so we should
  15207. // have a good chance at having a non-empty extension
  15208. preDotState = -1;
  15209. }
  15210. }
  15211. if (startDot === -1 || end === -1 ||
  15212. // We saw a non-dot character immediately before the dot
  15213. preDotState === 0 ||
  15214. // The (right-most) trimmed path component is exactly '..'
  15215. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  15216. return '';
  15217. }
  15218. return path.slice(startDot, end);
  15219. };
  15220. function filter (xs, f) {
  15221. if (xs.filter) return xs.filter(f);
  15222. var res = [];
  15223. for (var i = 0; i < xs.length; i++) {
  15224. if (f(xs[i], i, xs)) res.push(xs[i]);
  15225. }
  15226. return res;
  15227. }
  15228. // String.prototype.substr - negative index don't work in IE8
  15229. var substr = 'ab'.substr(-1) === 'b'
  15230. ? function (str, start, len) { return str.substr(start, len) }
  15231. : function (str, start, len) {
  15232. if (start < 0) start = str.length + start;
  15233. return str.substr(start, len);
  15234. }
  15235. ;
  15236. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 101)))
  15237. /***/ }),
  15238. /* 103 */
  15239. /*!*******************************************!*\
  15240. !*** ./node_modules/safe-buffer/index.js ***!
  15241. \*******************************************/
  15242. /*! no static exports found */
  15243. /***/ (function(module, exports, __webpack_require__) {
  15244. /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  15245. /* eslint-disable node/no-deprecated-api */
  15246. var buffer = __webpack_require__(/*! buffer */ 104)
  15247. var Buffer = buffer.Buffer
  15248. // alternative to using Object.keys for old browsers
  15249. function copyProps (src, dst) {
  15250. for (var key in src) {
  15251. dst[key] = src[key]
  15252. }
  15253. }
  15254. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  15255. module.exports = buffer
  15256. } else {
  15257. // Copy properties from require('buffer')
  15258. copyProps(buffer, exports)
  15259. exports.Buffer = SafeBuffer
  15260. }
  15261. function SafeBuffer (arg, encodingOrOffset, length) {
  15262. return Buffer(arg, encodingOrOffset, length)
  15263. }
  15264. SafeBuffer.prototype = Object.create(Buffer.prototype)
  15265. // Copy static methods from Buffer
  15266. copyProps(Buffer, SafeBuffer)
  15267. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  15268. if (typeof arg === 'number') {
  15269. throw new TypeError('Argument must not be a number')
  15270. }
  15271. return Buffer(arg, encodingOrOffset, length)
  15272. }
  15273. SafeBuffer.alloc = function (size, fill, encoding) {
  15274. if (typeof size !== 'number') {
  15275. throw new TypeError('Argument must be a number')
  15276. }
  15277. var buf = Buffer(size)
  15278. if (fill !== undefined) {
  15279. if (typeof encoding === 'string') {
  15280. buf.fill(fill, encoding)
  15281. } else {
  15282. buf.fill(fill)
  15283. }
  15284. } else {
  15285. buf.fill(0)
  15286. }
  15287. return buf
  15288. }
  15289. SafeBuffer.allocUnsafe = function (size) {
  15290. if (typeof size !== 'number') {
  15291. throw new TypeError('Argument must be a number')
  15292. }
  15293. return Buffer(size)
  15294. }
  15295. SafeBuffer.allocUnsafeSlow = function (size) {
  15296. if (typeof size !== 'number') {
  15297. throw new TypeError('Argument must be a number')
  15298. }
  15299. return buffer.SlowBuffer(size)
  15300. }
  15301. /***/ }),
  15302. /* 104 */
  15303. /*!**************************************!*\
  15304. !*** ./node_modules/buffer/index.js ***!
  15305. \**************************************/
  15306. /*! no static exports found */
  15307. /***/ (function(module, exports, __webpack_require__) {
  15308. "use strict";
  15309. /* WEBPACK VAR INJECTION */(function(global) {/*!
  15310. * The buffer module from node.js, for the browser.
  15311. *
  15312. * @author Feross Aboukhadijeh <http://feross.org>
  15313. * @license MIT
  15314. */
  15315. /* eslint-disable no-proto */
  15316. var base64 = __webpack_require__(/*! base64-js */ 105)
  15317. var ieee754 = __webpack_require__(/*! ieee754 */ 106)
  15318. var isArray = __webpack_require__(/*! isarray */ 107)
  15319. exports.Buffer = Buffer
  15320. exports.SlowBuffer = SlowBuffer
  15321. exports.INSPECT_MAX_BYTES = 50
  15322. /**
  15323. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  15324. * === true Use Uint8Array implementation (fastest)
  15325. * === false Use Object implementation (most compatible, even IE6)
  15326. *
  15327. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  15328. * Opera 11.6+, iOS 4.2+.
  15329. *
  15330. * Due to various browser bugs, sometimes the Object implementation will be used even
  15331. * when the browser supports typed arrays.
  15332. *
  15333. * Note:
  15334. *
  15335. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  15336. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  15337. *
  15338. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  15339. *
  15340. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  15341. * incorrect length in some situations.
  15342. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  15343. * get the Object implementation, which is slower but behaves correctly.
  15344. */
  15345. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  15346. ? global.TYPED_ARRAY_SUPPORT
  15347. : typedArraySupport()
  15348. /*
  15349. * Export kMaxLength after typed array support is determined.
  15350. */
  15351. exports.kMaxLength = kMaxLength()
  15352. function typedArraySupport () {
  15353. try {
  15354. var arr = new Uint8Array(1)
  15355. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  15356. return arr.foo() === 42 && // typed array instances can be augmented
  15357. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  15358. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  15359. } catch (e) {
  15360. return false
  15361. }
  15362. }
  15363. function kMaxLength () {
  15364. return Buffer.TYPED_ARRAY_SUPPORT
  15365. ? 0x7fffffff
  15366. : 0x3fffffff
  15367. }
  15368. function createBuffer (that, length) {
  15369. if (kMaxLength() < length) {
  15370. throw new RangeError('Invalid typed array length')
  15371. }
  15372. if (Buffer.TYPED_ARRAY_SUPPORT) {
  15373. // Return an augmented `Uint8Array` instance, for best performance
  15374. that = new Uint8Array(length)
  15375. that.__proto__ = Buffer.prototype
  15376. } else {
  15377. // Fallback: Return an object instance of the Buffer class
  15378. if (that === null) {
  15379. that = new Buffer(length)
  15380. }
  15381. that.length = length
  15382. }
  15383. return that
  15384. }
  15385. /**
  15386. * The Buffer constructor returns instances of `Uint8Array` that have their
  15387. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  15388. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  15389. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  15390. * returns a single octet.
  15391. *
  15392. * The `Uint8Array` prototype remains unmodified.
  15393. */
  15394. function Buffer (arg, encodingOrOffset, length) {
  15395. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  15396. return new Buffer(arg, encodingOrOffset, length)
  15397. }
  15398. // Common case.
  15399. if (typeof arg === 'number') {
  15400. if (typeof encodingOrOffset === 'string') {
  15401. throw new Error(
  15402. 'If encoding is specified then the first argument must be a string'
  15403. )
  15404. }
  15405. return allocUnsafe(this, arg)
  15406. }
  15407. return from(this, arg, encodingOrOffset, length)
  15408. }
  15409. Buffer.poolSize = 8192 // not used by this implementation
  15410. // TODO: Legacy, not needed anymore. Remove in next major version.
  15411. Buffer._augment = function (arr) {
  15412. arr.__proto__ = Buffer.prototype
  15413. return arr
  15414. }
  15415. function from (that, value, encodingOrOffset, length) {
  15416. if (typeof value === 'number') {
  15417. throw new TypeError('"value" argument must not be a number')
  15418. }
  15419. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  15420. return fromArrayBuffer(that, value, encodingOrOffset, length)
  15421. }
  15422. if (typeof value === 'string') {
  15423. return fromString(that, value, encodingOrOffset)
  15424. }
  15425. return fromObject(that, value)
  15426. }
  15427. /**
  15428. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  15429. * if value is a number.
  15430. * Buffer.from(str[, encoding])
  15431. * Buffer.from(array)
  15432. * Buffer.from(buffer)
  15433. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  15434. **/
  15435. Buffer.from = function (value, encodingOrOffset, length) {
  15436. return from(null, value, encodingOrOffset, length)
  15437. }
  15438. if (Buffer.TYPED_ARRAY_SUPPORT) {
  15439. Buffer.prototype.__proto__ = Uint8Array.prototype
  15440. Buffer.__proto__ = Uint8Array
  15441. if (typeof Symbol !== 'undefined' && Symbol.species &&
  15442. Buffer[Symbol.species] === Buffer) {
  15443. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  15444. Object.defineProperty(Buffer, Symbol.species, {
  15445. value: null,
  15446. configurable: true
  15447. })
  15448. }
  15449. }
  15450. function assertSize (size) {
  15451. if (typeof size !== 'number') {
  15452. throw new TypeError('"size" argument must be a number')
  15453. } else if (size < 0) {
  15454. throw new RangeError('"size" argument must not be negative')
  15455. }
  15456. }
  15457. function alloc (that, size, fill, encoding) {
  15458. assertSize(size)
  15459. if (size <= 0) {
  15460. return createBuffer(that, size)
  15461. }
  15462. if (fill !== undefined) {
  15463. // Only pay attention to encoding if it's a string. This
  15464. // prevents accidentally sending in a number that would
  15465. // be interpretted as a start offset.
  15466. return typeof encoding === 'string'
  15467. ? createBuffer(that, size).fill(fill, encoding)
  15468. : createBuffer(that, size).fill(fill)
  15469. }
  15470. return createBuffer(that, size)
  15471. }
  15472. /**
  15473. * Creates a new filled Buffer instance.
  15474. * alloc(size[, fill[, encoding]])
  15475. **/
  15476. Buffer.alloc = function (size, fill, encoding) {
  15477. return alloc(null, size, fill, encoding)
  15478. }
  15479. function allocUnsafe (that, size) {
  15480. assertSize(size)
  15481. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  15482. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  15483. for (var i = 0; i < size; ++i) {
  15484. that[i] = 0
  15485. }
  15486. }
  15487. return that
  15488. }
  15489. /**
  15490. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  15491. * */
  15492. Buffer.allocUnsafe = function (size) {
  15493. return allocUnsafe(null, size)
  15494. }
  15495. /**
  15496. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  15497. */
  15498. Buffer.allocUnsafeSlow = function (size) {
  15499. return allocUnsafe(null, size)
  15500. }
  15501. function fromString (that, string, encoding) {
  15502. if (typeof encoding !== 'string' || encoding === '') {
  15503. encoding = 'utf8'
  15504. }
  15505. if (!Buffer.isEncoding(encoding)) {
  15506. throw new TypeError('"encoding" must be a valid string encoding')
  15507. }
  15508. var length = byteLength(string, encoding) | 0
  15509. that = createBuffer(that, length)
  15510. var actual = that.write(string, encoding)
  15511. if (actual !== length) {
  15512. // Writing a hex string, for example, that contains invalid characters will
  15513. // cause everything after the first invalid character to be ignored. (e.g.
  15514. // 'abxxcd' will be treated as 'ab')
  15515. that = that.slice(0, actual)
  15516. }
  15517. return that
  15518. }
  15519. function fromArrayLike (that, array) {
  15520. var length = array.length < 0 ? 0 : checked(array.length) | 0
  15521. that = createBuffer(that, length)
  15522. for (var i = 0; i < length; i += 1) {
  15523. that[i] = array[i] & 255
  15524. }
  15525. return that
  15526. }
  15527. function fromArrayBuffer (that, array, byteOffset, length) {
  15528. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  15529. if (byteOffset < 0 || array.byteLength < byteOffset) {
  15530. throw new RangeError('\'offset\' is out of bounds')
  15531. }
  15532. if (array.byteLength < byteOffset + (length || 0)) {
  15533. throw new RangeError('\'length\' is out of bounds')
  15534. }
  15535. if (byteOffset === undefined && length === undefined) {
  15536. array = new Uint8Array(array)
  15537. } else if (length === undefined) {
  15538. array = new Uint8Array(array, byteOffset)
  15539. } else {
  15540. array = new Uint8Array(array, byteOffset, length)
  15541. }
  15542. if (Buffer.TYPED_ARRAY_SUPPORT) {
  15543. // Return an augmented `Uint8Array` instance, for best performance
  15544. that = array
  15545. that.__proto__ = Buffer.prototype
  15546. } else {
  15547. // Fallback: Return an object instance of the Buffer class
  15548. that = fromArrayLike(that, array)
  15549. }
  15550. return that
  15551. }
  15552. function fromObject (that, obj) {
  15553. if (Buffer.isBuffer(obj)) {
  15554. var len = checked(obj.length) | 0
  15555. that = createBuffer(that, len)
  15556. if (that.length === 0) {
  15557. return that
  15558. }
  15559. obj.copy(that, 0, 0, len)
  15560. return that
  15561. }
  15562. if (obj) {
  15563. if ((typeof ArrayBuffer !== 'undefined' &&
  15564. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  15565. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  15566. return createBuffer(that, 0)
  15567. }
  15568. return fromArrayLike(that, obj)
  15569. }
  15570. if (obj.type === 'Buffer' && isArray(obj.data)) {
  15571. return fromArrayLike(that, obj.data)
  15572. }
  15573. }
  15574. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  15575. }
  15576. function checked (length) {
  15577. // Note: cannot use `length < kMaxLength()` here because that fails when
  15578. // length is NaN (which is otherwise coerced to zero.)
  15579. if (length >= kMaxLength()) {
  15580. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  15581. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  15582. }
  15583. return length | 0
  15584. }
  15585. function SlowBuffer (length) {
  15586. if (+length != length) { // eslint-disable-line eqeqeq
  15587. length = 0
  15588. }
  15589. return Buffer.alloc(+length)
  15590. }
  15591. Buffer.isBuffer = function isBuffer (b) {
  15592. return !!(b != null && b._isBuffer)
  15593. }
  15594. Buffer.compare = function compare (a, b) {
  15595. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  15596. throw new TypeError('Arguments must be Buffers')
  15597. }
  15598. if (a === b) return 0
  15599. var x = a.length
  15600. var y = b.length
  15601. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  15602. if (a[i] !== b[i]) {
  15603. x = a[i]
  15604. y = b[i]
  15605. break
  15606. }
  15607. }
  15608. if (x < y) return -1
  15609. if (y < x) return 1
  15610. return 0
  15611. }
  15612. Buffer.isEncoding = function isEncoding (encoding) {
  15613. switch (String(encoding).toLowerCase()) {
  15614. case 'hex':
  15615. case 'utf8':
  15616. case 'utf-8':
  15617. case 'ascii':
  15618. case 'latin1':
  15619. case 'binary':
  15620. case 'base64':
  15621. case 'ucs2':
  15622. case 'ucs-2':
  15623. case 'utf16le':
  15624. case 'utf-16le':
  15625. return true
  15626. default:
  15627. return false
  15628. }
  15629. }
  15630. Buffer.concat = function concat (list, length) {
  15631. if (!isArray(list)) {
  15632. throw new TypeError('"list" argument must be an Array of Buffers')
  15633. }
  15634. if (list.length === 0) {
  15635. return Buffer.alloc(0)
  15636. }
  15637. var i
  15638. if (length === undefined) {
  15639. length = 0
  15640. for (i = 0; i < list.length; ++i) {
  15641. length += list[i].length
  15642. }
  15643. }
  15644. var buffer = Buffer.allocUnsafe(length)
  15645. var pos = 0
  15646. for (i = 0; i < list.length; ++i) {
  15647. var buf = list[i]
  15648. if (!Buffer.isBuffer(buf)) {
  15649. throw new TypeError('"list" argument must be an Array of Buffers')
  15650. }
  15651. buf.copy(buffer, pos)
  15652. pos += buf.length
  15653. }
  15654. return buffer
  15655. }
  15656. function byteLength (string, encoding) {
  15657. if (Buffer.isBuffer(string)) {
  15658. return string.length
  15659. }
  15660. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  15661. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  15662. return string.byteLength
  15663. }
  15664. if (typeof string !== 'string') {
  15665. string = '' + string
  15666. }
  15667. var len = string.length
  15668. if (len === 0) return 0
  15669. // Use a for loop to avoid recursion
  15670. var loweredCase = false
  15671. for (;;) {
  15672. switch (encoding) {
  15673. case 'ascii':
  15674. case 'latin1':
  15675. case 'binary':
  15676. return len
  15677. case 'utf8':
  15678. case 'utf-8':
  15679. case undefined:
  15680. return utf8ToBytes(string).length
  15681. case 'ucs2':
  15682. case 'ucs-2':
  15683. case 'utf16le':
  15684. case 'utf-16le':
  15685. return len * 2
  15686. case 'hex':
  15687. return len >>> 1
  15688. case 'base64':
  15689. return base64ToBytes(string).length
  15690. default:
  15691. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  15692. encoding = ('' + encoding).toLowerCase()
  15693. loweredCase = true
  15694. }
  15695. }
  15696. }
  15697. Buffer.byteLength = byteLength
  15698. function slowToString (encoding, start, end) {
  15699. var loweredCase = false
  15700. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  15701. // property of a typed array.
  15702. // This behaves neither like String nor Uint8Array in that we set start/end
  15703. // to their upper/lower bounds if the value passed is out of range.
  15704. // undefined is handled specially as per ECMA-262 6th Edition,
  15705. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  15706. if (start === undefined || start < 0) {
  15707. start = 0
  15708. }
  15709. // Return early if start > this.length. Done here to prevent potential uint32
  15710. // coercion fail below.
  15711. if (start > this.length) {
  15712. return ''
  15713. }
  15714. if (end === undefined || end > this.length) {
  15715. end = this.length
  15716. }
  15717. if (end <= 0) {
  15718. return ''
  15719. }
  15720. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  15721. end >>>= 0
  15722. start >>>= 0
  15723. if (end <= start) {
  15724. return ''
  15725. }
  15726. if (!encoding) encoding = 'utf8'
  15727. while (true) {
  15728. switch (encoding) {
  15729. case 'hex':
  15730. return hexSlice(this, start, end)
  15731. case 'utf8':
  15732. case 'utf-8':
  15733. return utf8Slice(this, start, end)
  15734. case 'ascii':
  15735. return asciiSlice(this, start, end)
  15736. case 'latin1':
  15737. case 'binary':
  15738. return latin1Slice(this, start, end)
  15739. case 'base64':
  15740. return base64Slice(this, start, end)
  15741. case 'ucs2':
  15742. case 'ucs-2':
  15743. case 'utf16le':
  15744. case 'utf-16le':
  15745. return utf16leSlice(this, start, end)
  15746. default:
  15747. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  15748. encoding = (encoding + '').toLowerCase()
  15749. loweredCase = true
  15750. }
  15751. }
  15752. }
  15753. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  15754. // Buffer instances.
  15755. Buffer.prototype._isBuffer = true
  15756. function swap (b, n, m) {
  15757. var i = b[n]
  15758. b[n] = b[m]
  15759. b[m] = i
  15760. }
  15761. Buffer.prototype.swap16 = function swap16 () {
  15762. var len = this.length
  15763. if (len % 2 !== 0) {
  15764. throw new RangeError('Buffer size must be a multiple of 16-bits')
  15765. }
  15766. for (var i = 0; i < len; i += 2) {
  15767. swap(this, i, i + 1)
  15768. }
  15769. return this
  15770. }
  15771. Buffer.prototype.swap32 = function swap32 () {
  15772. var len = this.length
  15773. if (len % 4 !== 0) {
  15774. throw new RangeError('Buffer size must be a multiple of 32-bits')
  15775. }
  15776. for (var i = 0; i < len; i += 4) {
  15777. swap(this, i, i + 3)
  15778. swap(this, i + 1, i + 2)
  15779. }
  15780. return this
  15781. }
  15782. Buffer.prototype.swap64 = function swap64 () {
  15783. var len = this.length
  15784. if (len % 8 !== 0) {
  15785. throw new RangeError('Buffer size must be a multiple of 64-bits')
  15786. }
  15787. for (var i = 0; i < len; i += 8) {
  15788. swap(this, i, i + 7)
  15789. swap(this, i + 1, i + 6)
  15790. swap(this, i + 2, i + 5)
  15791. swap(this, i + 3, i + 4)
  15792. }
  15793. return this
  15794. }
  15795. Buffer.prototype.toString = function toString () {
  15796. var length = this.length | 0
  15797. if (length === 0) return ''
  15798. if (arguments.length === 0) return utf8Slice(this, 0, length)
  15799. return slowToString.apply(this, arguments)
  15800. }
  15801. Buffer.prototype.equals = function equals (b) {
  15802. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  15803. if (this === b) return true
  15804. return Buffer.compare(this, b) === 0
  15805. }
  15806. Buffer.prototype.inspect = function inspect () {
  15807. var str = ''
  15808. var max = exports.INSPECT_MAX_BYTES
  15809. if (this.length > 0) {
  15810. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  15811. if (this.length > max) str += ' ... '
  15812. }
  15813. return '<Buffer ' + str + '>'
  15814. }
  15815. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  15816. if (!Buffer.isBuffer(target)) {
  15817. throw new TypeError('Argument must be a Buffer')
  15818. }
  15819. if (start === undefined) {
  15820. start = 0
  15821. }
  15822. if (end === undefined) {
  15823. end = target ? target.length : 0
  15824. }
  15825. if (thisStart === undefined) {
  15826. thisStart = 0
  15827. }
  15828. if (thisEnd === undefined) {
  15829. thisEnd = this.length
  15830. }
  15831. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  15832. throw new RangeError('out of range index')
  15833. }
  15834. if (thisStart >= thisEnd && start >= end) {
  15835. return 0
  15836. }
  15837. if (thisStart >= thisEnd) {
  15838. return -1
  15839. }
  15840. if (start >= end) {
  15841. return 1
  15842. }
  15843. start >>>= 0
  15844. end >>>= 0
  15845. thisStart >>>= 0
  15846. thisEnd >>>= 0
  15847. if (this === target) return 0
  15848. var x = thisEnd - thisStart
  15849. var y = end - start
  15850. var len = Math.min(x, y)
  15851. var thisCopy = this.slice(thisStart, thisEnd)
  15852. var targetCopy = target.slice(start, end)
  15853. for (var i = 0; i < len; ++i) {
  15854. if (thisCopy[i] !== targetCopy[i]) {
  15855. x = thisCopy[i]
  15856. y = targetCopy[i]
  15857. break
  15858. }
  15859. }
  15860. if (x < y) return -1
  15861. if (y < x) return 1
  15862. return 0
  15863. }
  15864. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  15865. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  15866. //
  15867. // Arguments:
  15868. // - buffer - a Buffer to search
  15869. // - val - a string, Buffer, or number
  15870. // - byteOffset - an index into `buffer`; will be clamped to an int32
  15871. // - encoding - an optional encoding, relevant is val is a string
  15872. // - dir - true for indexOf, false for lastIndexOf
  15873. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  15874. // Empty buffer means no match
  15875. if (buffer.length === 0) return -1
  15876. // Normalize byteOffset
  15877. if (typeof byteOffset === 'string') {
  15878. encoding = byteOffset
  15879. byteOffset = 0
  15880. } else if (byteOffset > 0x7fffffff) {
  15881. byteOffset = 0x7fffffff
  15882. } else if (byteOffset < -0x80000000) {
  15883. byteOffset = -0x80000000
  15884. }
  15885. byteOffset = +byteOffset // Coerce to Number.
  15886. if (isNaN(byteOffset)) {
  15887. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  15888. byteOffset = dir ? 0 : (buffer.length - 1)
  15889. }
  15890. // Normalize byteOffset: negative offsets start from the end of the buffer
  15891. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  15892. if (byteOffset >= buffer.length) {
  15893. if (dir) return -1
  15894. else byteOffset = buffer.length - 1
  15895. } else if (byteOffset < 0) {
  15896. if (dir) byteOffset = 0
  15897. else return -1
  15898. }
  15899. // Normalize val
  15900. if (typeof val === 'string') {
  15901. val = Buffer.from(val, encoding)
  15902. }
  15903. // Finally, search either indexOf (if dir is true) or lastIndexOf
  15904. if (Buffer.isBuffer(val)) {
  15905. // Special case: looking for empty string/buffer always fails
  15906. if (val.length === 0) {
  15907. return -1
  15908. }
  15909. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  15910. } else if (typeof val === 'number') {
  15911. val = val & 0xFF // Search for a byte value [0-255]
  15912. if (Buffer.TYPED_ARRAY_SUPPORT &&
  15913. typeof Uint8Array.prototype.indexOf === 'function') {
  15914. if (dir) {
  15915. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  15916. } else {
  15917. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  15918. }
  15919. }
  15920. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  15921. }
  15922. throw new TypeError('val must be string, number or Buffer')
  15923. }
  15924. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  15925. var indexSize = 1
  15926. var arrLength = arr.length
  15927. var valLength = val.length
  15928. if (encoding !== undefined) {
  15929. encoding = String(encoding).toLowerCase()
  15930. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  15931. encoding === 'utf16le' || encoding === 'utf-16le') {
  15932. if (arr.length < 2 || val.length < 2) {
  15933. return -1
  15934. }
  15935. indexSize = 2
  15936. arrLength /= 2
  15937. valLength /= 2
  15938. byteOffset /= 2
  15939. }
  15940. }
  15941. function read (buf, i) {
  15942. if (indexSize === 1) {
  15943. return buf[i]
  15944. } else {
  15945. return buf.readUInt16BE(i * indexSize)
  15946. }
  15947. }
  15948. var i
  15949. if (dir) {
  15950. var foundIndex = -1
  15951. for (i = byteOffset; i < arrLength; i++) {
  15952. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  15953. if (foundIndex === -1) foundIndex = i
  15954. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  15955. } else {
  15956. if (foundIndex !== -1) i -= i - foundIndex
  15957. foundIndex = -1
  15958. }
  15959. }
  15960. } else {
  15961. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  15962. for (i = byteOffset; i >= 0; i--) {
  15963. var found = true
  15964. for (var j = 0; j < valLength; j++) {
  15965. if (read(arr, i + j) !== read(val, j)) {
  15966. found = false
  15967. break
  15968. }
  15969. }
  15970. if (found) return i
  15971. }
  15972. }
  15973. return -1
  15974. }
  15975. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  15976. return this.indexOf(val, byteOffset, encoding) !== -1
  15977. }
  15978. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  15979. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  15980. }
  15981. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  15982. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  15983. }
  15984. function hexWrite (buf, string, offset, length) {
  15985. offset = Number(offset) || 0
  15986. var remaining = buf.length - offset
  15987. if (!length) {
  15988. length = remaining
  15989. } else {
  15990. length = Number(length)
  15991. if (length > remaining) {
  15992. length = remaining
  15993. }
  15994. }
  15995. // must be an even number of digits
  15996. var strLen = string.length
  15997. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  15998. if (length > strLen / 2) {
  15999. length = strLen / 2
  16000. }
  16001. for (var i = 0; i < length; ++i) {
  16002. var parsed = parseInt(string.substr(i * 2, 2), 16)
  16003. if (isNaN(parsed)) return i
  16004. buf[offset + i] = parsed
  16005. }
  16006. return i
  16007. }
  16008. function utf8Write (buf, string, offset, length) {
  16009. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  16010. }
  16011. function asciiWrite (buf, string, offset, length) {
  16012. return blitBuffer(asciiToBytes(string), buf, offset, length)
  16013. }
  16014. function latin1Write (buf, string, offset, length) {
  16015. return asciiWrite(buf, string, offset, length)
  16016. }
  16017. function base64Write (buf, string, offset, length) {
  16018. return blitBuffer(base64ToBytes(string), buf, offset, length)
  16019. }
  16020. function ucs2Write (buf, string, offset, length) {
  16021. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  16022. }
  16023. Buffer.prototype.write = function write (string, offset, length, encoding) {
  16024. // Buffer#write(string)
  16025. if (offset === undefined) {
  16026. encoding = 'utf8'
  16027. length = this.length
  16028. offset = 0
  16029. // Buffer#write(string, encoding)
  16030. } else if (length === undefined && typeof offset === 'string') {
  16031. encoding = offset
  16032. length = this.length
  16033. offset = 0
  16034. // Buffer#write(string, offset[, length][, encoding])
  16035. } else if (isFinite(offset)) {
  16036. offset = offset | 0
  16037. if (isFinite(length)) {
  16038. length = length | 0
  16039. if (encoding === undefined) encoding = 'utf8'
  16040. } else {
  16041. encoding = length
  16042. length = undefined
  16043. }
  16044. // legacy write(string, encoding, offset, length) - remove in v0.13
  16045. } else {
  16046. throw new Error(
  16047. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  16048. )
  16049. }
  16050. var remaining = this.length - offset
  16051. if (length === undefined || length > remaining) length = remaining
  16052. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  16053. throw new RangeError('Attempt to write outside buffer bounds')
  16054. }
  16055. if (!encoding) encoding = 'utf8'
  16056. var loweredCase = false
  16057. for (;;) {
  16058. switch (encoding) {
  16059. case 'hex':
  16060. return hexWrite(this, string, offset, length)
  16061. case 'utf8':
  16062. case 'utf-8':
  16063. return utf8Write(this, string, offset, length)
  16064. case 'ascii':
  16065. return asciiWrite(this, string, offset, length)
  16066. case 'latin1':
  16067. case 'binary':
  16068. return latin1Write(this, string, offset, length)
  16069. case 'base64':
  16070. // Warning: maxLength not taken into account in base64Write
  16071. return base64Write(this, string, offset, length)
  16072. case 'ucs2':
  16073. case 'ucs-2':
  16074. case 'utf16le':
  16075. case 'utf-16le':
  16076. return ucs2Write(this, string, offset, length)
  16077. default:
  16078. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  16079. encoding = ('' + encoding).toLowerCase()
  16080. loweredCase = true
  16081. }
  16082. }
  16083. }
  16084. Buffer.prototype.toJSON = function toJSON () {
  16085. return {
  16086. type: 'Buffer',
  16087. data: Array.prototype.slice.call(this._arr || this, 0)
  16088. }
  16089. }
  16090. function base64Slice (buf, start, end) {
  16091. if (start === 0 && end === buf.length) {
  16092. return base64.fromByteArray(buf)
  16093. } else {
  16094. return base64.fromByteArray(buf.slice(start, end))
  16095. }
  16096. }
  16097. function utf8Slice (buf, start, end) {
  16098. end = Math.min(buf.length, end)
  16099. var res = []
  16100. var i = start
  16101. while (i < end) {
  16102. var firstByte = buf[i]
  16103. var codePoint = null
  16104. var bytesPerSequence = (firstByte > 0xEF) ? 4
  16105. : (firstByte > 0xDF) ? 3
  16106. : (firstByte > 0xBF) ? 2
  16107. : 1
  16108. if (i + bytesPerSequence <= end) {
  16109. var secondByte, thirdByte, fourthByte, tempCodePoint
  16110. switch (bytesPerSequence) {
  16111. case 1:
  16112. if (firstByte < 0x80) {
  16113. codePoint = firstByte
  16114. }
  16115. break
  16116. case 2:
  16117. secondByte = buf[i + 1]
  16118. if ((secondByte & 0xC0) === 0x80) {
  16119. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  16120. if (tempCodePoint > 0x7F) {
  16121. codePoint = tempCodePoint
  16122. }
  16123. }
  16124. break
  16125. case 3:
  16126. secondByte = buf[i + 1]
  16127. thirdByte = buf[i + 2]
  16128. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  16129. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  16130. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  16131. codePoint = tempCodePoint
  16132. }
  16133. }
  16134. break
  16135. case 4:
  16136. secondByte = buf[i + 1]
  16137. thirdByte = buf[i + 2]
  16138. fourthByte = buf[i + 3]
  16139. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  16140. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  16141. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  16142. codePoint = tempCodePoint
  16143. }
  16144. }
  16145. }
  16146. }
  16147. if (codePoint === null) {
  16148. // we did not generate a valid codePoint so insert a
  16149. // replacement char (U+FFFD) and advance only 1 byte
  16150. codePoint = 0xFFFD
  16151. bytesPerSequence = 1
  16152. } else if (codePoint > 0xFFFF) {
  16153. // encode to utf16 (surrogate pair dance)
  16154. codePoint -= 0x10000
  16155. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  16156. codePoint = 0xDC00 | codePoint & 0x3FF
  16157. }
  16158. res.push(codePoint)
  16159. i += bytesPerSequence
  16160. }
  16161. return decodeCodePointsArray(res)
  16162. }
  16163. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  16164. // the lowest limit is Chrome, with 0x10000 args.
  16165. // We go 1 magnitude less, for safety
  16166. var MAX_ARGUMENTS_LENGTH = 0x1000
  16167. function decodeCodePointsArray (codePoints) {
  16168. var len = codePoints.length
  16169. if (len <= MAX_ARGUMENTS_LENGTH) {
  16170. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  16171. }
  16172. // Decode in chunks to avoid "call stack size exceeded".
  16173. var res = ''
  16174. var i = 0
  16175. while (i < len) {
  16176. res += String.fromCharCode.apply(
  16177. String,
  16178. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  16179. )
  16180. }
  16181. return res
  16182. }
  16183. function asciiSlice (buf, start, end) {
  16184. var ret = ''
  16185. end = Math.min(buf.length, end)
  16186. for (var i = start; i < end; ++i) {
  16187. ret += String.fromCharCode(buf[i] & 0x7F)
  16188. }
  16189. return ret
  16190. }
  16191. function latin1Slice (buf, start, end) {
  16192. var ret = ''
  16193. end = Math.min(buf.length, end)
  16194. for (var i = start; i < end; ++i) {
  16195. ret += String.fromCharCode(buf[i])
  16196. }
  16197. return ret
  16198. }
  16199. function hexSlice (buf, start, end) {
  16200. var len = buf.length
  16201. if (!start || start < 0) start = 0
  16202. if (!end || end < 0 || end > len) end = len
  16203. var out = ''
  16204. for (var i = start; i < end; ++i) {
  16205. out += toHex(buf[i])
  16206. }
  16207. return out
  16208. }
  16209. function utf16leSlice (buf, start, end) {
  16210. var bytes = buf.slice(start, end)
  16211. var res = ''
  16212. for (var i = 0; i < bytes.length; i += 2) {
  16213. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  16214. }
  16215. return res
  16216. }
  16217. Buffer.prototype.slice = function slice (start, end) {
  16218. var len = this.length
  16219. start = ~~start
  16220. end = end === undefined ? len : ~~end
  16221. if (start < 0) {
  16222. start += len
  16223. if (start < 0) start = 0
  16224. } else if (start > len) {
  16225. start = len
  16226. }
  16227. if (end < 0) {
  16228. end += len
  16229. if (end < 0) end = 0
  16230. } else if (end > len) {
  16231. end = len
  16232. }
  16233. if (end < start) end = start
  16234. var newBuf
  16235. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16236. newBuf = this.subarray(start, end)
  16237. newBuf.__proto__ = Buffer.prototype
  16238. } else {
  16239. var sliceLen = end - start
  16240. newBuf = new Buffer(sliceLen, undefined)
  16241. for (var i = 0; i < sliceLen; ++i) {
  16242. newBuf[i] = this[i + start]
  16243. }
  16244. }
  16245. return newBuf
  16246. }
  16247. /*
  16248. * Need to make sure that buffer isn't trying to write out of bounds.
  16249. */
  16250. function checkOffset (offset, ext, length) {
  16251. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  16252. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  16253. }
  16254. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  16255. offset = offset | 0
  16256. byteLength = byteLength | 0
  16257. if (!noAssert) checkOffset(offset, byteLength, this.length)
  16258. var val = this[offset]
  16259. var mul = 1
  16260. var i = 0
  16261. while (++i < byteLength && (mul *= 0x100)) {
  16262. val += this[offset + i] * mul
  16263. }
  16264. return val
  16265. }
  16266. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  16267. offset = offset | 0
  16268. byteLength = byteLength | 0
  16269. if (!noAssert) {
  16270. checkOffset(offset, byteLength, this.length)
  16271. }
  16272. var val = this[offset + --byteLength]
  16273. var mul = 1
  16274. while (byteLength > 0 && (mul *= 0x100)) {
  16275. val += this[offset + --byteLength] * mul
  16276. }
  16277. return val
  16278. }
  16279. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  16280. if (!noAssert) checkOffset(offset, 1, this.length)
  16281. return this[offset]
  16282. }
  16283. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  16284. if (!noAssert) checkOffset(offset, 2, this.length)
  16285. return this[offset] | (this[offset + 1] << 8)
  16286. }
  16287. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  16288. if (!noAssert) checkOffset(offset, 2, this.length)
  16289. return (this[offset] << 8) | this[offset + 1]
  16290. }
  16291. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  16292. if (!noAssert) checkOffset(offset, 4, this.length)
  16293. return ((this[offset]) |
  16294. (this[offset + 1] << 8) |
  16295. (this[offset + 2] << 16)) +
  16296. (this[offset + 3] * 0x1000000)
  16297. }
  16298. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  16299. if (!noAssert) checkOffset(offset, 4, this.length)
  16300. return (this[offset] * 0x1000000) +
  16301. ((this[offset + 1] << 16) |
  16302. (this[offset + 2] << 8) |
  16303. this[offset + 3])
  16304. }
  16305. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  16306. offset = offset | 0
  16307. byteLength = byteLength | 0
  16308. if (!noAssert) checkOffset(offset, byteLength, this.length)
  16309. var val = this[offset]
  16310. var mul = 1
  16311. var i = 0
  16312. while (++i < byteLength && (mul *= 0x100)) {
  16313. val += this[offset + i] * mul
  16314. }
  16315. mul *= 0x80
  16316. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  16317. return val
  16318. }
  16319. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  16320. offset = offset | 0
  16321. byteLength = byteLength | 0
  16322. if (!noAssert) checkOffset(offset, byteLength, this.length)
  16323. var i = byteLength
  16324. var mul = 1
  16325. var val = this[offset + --i]
  16326. while (i > 0 && (mul *= 0x100)) {
  16327. val += this[offset + --i] * mul
  16328. }
  16329. mul *= 0x80
  16330. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  16331. return val
  16332. }
  16333. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  16334. if (!noAssert) checkOffset(offset, 1, this.length)
  16335. if (!(this[offset] & 0x80)) return (this[offset])
  16336. return ((0xff - this[offset] + 1) * -1)
  16337. }
  16338. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  16339. if (!noAssert) checkOffset(offset, 2, this.length)
  16340. var val = this[offset] | (this[offset + 1] << 8)
  16341. return (val & 0x8000) ? val | 0xFFFF0000 : val
  16342. }
  16343. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  16344. if (!noAssert) checkOffset(offset, 2, this.length)
  16345. var val = this[offset + 1] | (this[offset] << 8)
  16346. return (val & 0x8000) ? val | 0xFFFF0000 : val
  16347. }
  16348. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  16349. if (!noAssert) checkOffset(offset, 4, this.length)
  16350. return (this[offset]) |
  16351. (this[offset + 1] << 8) |
  16352. (this[offset + 2] << 16) |
  16353. (this[offset + 3] << 24)
  16354. }
  16355. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  16356. if (!noAssert) checkOffset(offset, 4, this.length)
  16357. return (this[offset] << 24) |
  16358. (this[offset + 1] << 16) |
  16359. (this[offset + 2] << 8) |
  16360. (this[offset + 3])
  16361. }
  16362. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  16363. if (!noAssert) checkOffset(offset, 4, this.length)
  16364. return ieee754.read(this, offset, true, 23, 4)
  16365. }
  16366. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  16367. if (!noAssert) checkOffset(offset, 4, this.length)
  16368. return ieee754.read(this, offset, false, 23, 4)
  16369. }
  16370. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  16371. if (!noAssert) checkOffset(offset, 8, this.length)
  16372. return ieee754.read(this, offset, true, 52, 8)
  16373. }
  16374. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  16375. if (!noAssert) checkOffset(offset, 8, this.length)
  16376. return ieee754.read(this, offset, false, 52, 8)
  16377. }
  16378. function checkInt (buf, value, offset, ext, max, min) {
  16379. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  16380. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  16381. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  16382. }
  16383. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  16384. value = +value
  16385. offset = offset | 0
  16386. byteLength = byteLength | 0
  16387. if (!noAssert) {
  16388. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  16389. checkInt(this, value, offset, byteLength, maxBytes, 0)
  16390. }
  16391. var mul = 1
  16392. var i = 0
  16393. this[offset] = value & 0xFF
  16394. while (++i < byteLength && (mul *= 0x100)) {
  16395. this[offset + i] = (value / mul) & 0xFF
  16396. }
  16397. return offset + byteLength
  16398. }
  16399. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  16400. value = +value
  16401. offset = offset | 0
  16402. byteLength = byteLength | 0
  16403. if (!noAssert) {
  16404. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  16405. checkInt(this, value, offset, byteLength, maxBytes, 0)
  16406. }
  16407. var i = byteLength - 1
  16408. var mul = 1
  16409. this[offset + i] = value & 0xFF
  16410. while (--i >= 0 && (mul *= 0x100)) {
  16411. this[offset + i] = (value / mul) & 0xFF
  16412. }
  16413. return offset + byteLength
  16414. }
  16415. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  16416. value = +value
  16417. offset = offset | 0
  16418. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  16419. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  16420. this[offset] = (value & 0xff)
  16421. return offset + 1
  16422. }
  16423. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  16424. if (value < 0) value = 0xffff + value + 1
  16425. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  16426. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  16427. (littleEndian ? i : 1 - i) * 8
  16428. }
  16429. }
  16430. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  16431. value = +value
  16432. offset = offset | 0
  16433. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  16434. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16435. this[offset] = (value & 0xff)
  16436. this[offset + 1] = (value >>> 8)
  16437. } else {
  16438. objectWriteUInt16(this, value, offset, true)
  16439. }
  16440. return offset + 2
  16441. }
  16442. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  16443. value = +value
  16444. offset = offset | 0
  16445. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  16446. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16447. this[offset] = (value >>> 8)
  16448. this[offset + 1] = (value & 0xff)
  16449. } else {
  16450. objectWriteUInt16(this, value, offset, false)
  16451. }
  16452. return offset + 2
  16453. }
  16454. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  16455. if (value < 0) value = 0xffffffff + value + 1
  16456. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  16457. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  16458. }
  16459. }
  16460. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  16461. value = +value
  16462. offset = offset | 0
  16463. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  16464. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16465. this[offset + 3] = (value >>> 24)
  16466. this[offset + 2] = (value >>> 16)
  16467. this[offset + 1] = (value >>> 8)
  16468. this[offset] = (value & 0xff)
  16469. } else {
  16470. objectWriteUInt32(this, value, offset, true)
  16471. }
  16472. return offset + 4
  16473. }
  16474. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  16475. value = +value
  16476. offset = offset | 0
  16477. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  16478. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16479. this[offset] = (value >>> 24)
  16480. this[offset + 1] = (value >>> 16)
  16481. this[offset + 2] = (value >>> 8)
  16482. this[offset + 3] = (value & 0xff)
  16483. } else {
  16484. objectWriteUInt32(this, value, offset, false)
  16485. }
  16486. return offset + 4
  16487. }
  16488. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  16489. value = +value
  16490. offset = offset | 0
  16491. if (!noAssert) {
  16492. var limit = Math.pow(2, 8 * byteLength - 1)
  16493. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  16494. }
  16495. var i = 0
  16496. var mul = 1
  16497. var sub = 0
  16498. this[offset] = value & 0xFF
  16499. while (++i < byteLength && (mul *= 0x100)) {
  16500. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  16501. sub = 1
  16502. }
  16503. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  16504. }
  16505. return offset + byteLength
  16506. }
  16507. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  16508. value = +value
  16509. offset = offset | 0
  16510. if (!noAssert) {
  16511. var limit = Math.pow(2, 8 * byteLength - 1)
  16512. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  16513. }
  16514. var i = byteLength - 1
  16515. var mul = 1
  16516. var sub = 0
  16517. this[offset + i] = value & 0xFF
  16518. while (--i >= 0 && (mul *= 0x100)) {
  16519. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  16520. sub = 1
  16521. }
  16522. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  16523. }
  16524. return offset + byteLength
  16525. }
  16526. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  16527. value = +value
  16528. offset = offset | 0
  16529. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  16530. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  16531. if (value < 0) value = 0xff + value + 1
  16532. this[offset] = (value & 0xff)
  16533. return offset + 1
  16534. }
  16535. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  16536. value = +value
  16537. offset = offset | 0
  16538. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  16539. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16540. this[offset] = (value & 0xff)
  16541. this[offset + 1] = (value >>> 8)
  16542. } else {
  16543. objectWriteUInt16(this, value, offset, true)
  16544. }
  16545. return offset + 2
  16546. }
  16547. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  16548. value = +value
  16549. offset = offset | 0
  16550. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  16551. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16552. this[offset] = (value >>> 8)
  16553. this[offset + 1] = (value & 0xff)
  16554. } else {
  16555. objectWriteUInt16(this, value, offset, false)
  16556. }
  16557. return offset + 2
  16558. }
  16559. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  16560. value = +value
  16561. offset = offset | 0
  16562. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  16563. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16564. this[offset] = (value & 0xff)
  16565. this[offset + 1] = (value >>> 8)
  16566. this[offset + 2] = (value >>> 16)
  16567. this[offset + 3] = (value >>> 24)
  16568. } else {
  16569. objectWriteUInt32(this, value, offset, true)
  16570. }
  16571. return offset + 4
  16572. }
  16573. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  16574. value = +value
  16575. offset = offset | 0
  16576. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  16577. if (value < 0) value = 0xffffffff + value + 1
  16578. if (Buffer.TYPED_ARRAY_SUPPORT) {
  16579. this[offset] = (value >>> 24)
  16580. this[offset + 1] = (value >>> 16)
  16581. this[offset + 2] = (value >>> 8)
  16582. this[offset + 3] = (value & 0xff)
  16583. } else {
  16584. objectWriteUInt32(this, value, offset, false)
  16585. }
  16586. return offset + 4
  16587. }
  16588. function checkIEEE754 (buf, value, offset, ext, max, min) {
  16589. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  16590. if (offset < 0) throw new RangeError('Index out of range')
  16591. }
  16592. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  16593. if (!noAssert) {
  16594. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  16595. }
  16596. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  16597. return offset + 4
  16598. }
  16599. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  16600. return writeFloat(this, value, offset, true, noAssert)
  16601. }
  16602. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  16603. return writeFloat(this, value, offset, false, noAssert)
  16604. }
  16605. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  16606. if (!noAssert) {
  16607. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  16608. }
  16609. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  16610. return offset + 8
  16611. }
  16612. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  16613. return writeDouble(this, value, offset, true, noAssert)
  16614. }
  16615. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  16616. return writeDouble(this, value, offset, false, noAssert)
  16617. }
  16618. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  16619. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  16620. if (!start) start = 0
  16621. if (!end && end !== 0) end = this.length
  16622. if (targetStart >= target.length) targetStart = target.length
  16623. if (!targetStart) targetStart = 0
  16624. if (end > 0 && end < start) end = start
  16625. // Copy 0 bytes; we're done
  16626. if (end === start) return 0
  16627. if (target.length === 0 || this.length === 0) return 0
  16628. // Fatal error conditions
  16629. if (targetStart < 0) {
  16630. throw new RangeError('targetStart out of bounds')
  16631. }
  16632. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  16633. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  16634. // Are we oob?
  16635. if (end > this.length) end = this.length
  16636. if (target.length - targetStart < end - start) {
  16637. end = target.length - targetStart + start
  16638. }
  16639. var len = end - start
  16640. var i
  16641. if (this === target && start < targetStart && targetStart < end) {
  16642. // descending copy from end
  16643. for (i = len - 1; i >= 0; --i) {
  16644. target[i + targetStart] = this[i + start]
  16645. }
  16646. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  16647. // ascending copy from start
  16648. for (i = 0; i < len; ++i) {
  16649. target[i + targetStart] = this[i + start]
  16650. }
  16651. } else {
  16652. Uint8Array.prototype.set.call(
  16653. target,
  16654. this.subarray(start, start + len),
  16655. targetStart
  16656. )
  16657. }
  16658. return len
  16659. }
  16660. // Usage:
  16661. // buffer.fill(number[, offset[, end]])
  16662. // buffer.fill(buffer[, offset[, end]])
  16663. // buffer.fill(string[, offset[, end]][, encoding])
  16664. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  16665. // Handle string cases:
  16666. if (typeof val === 'string') {
  16667. if (typeof start === 'string') {
  16668. encoding = start
  16669. start = 0
  16670. end = this.length
  16671. } else if (typeof end === 'string') {
  16672. encoding = end
  16673. end = this.length
  16674. }
  16675. if (val.length === 1) {
  16676. var code = val.charCodeAt(0)
  16677. if (code < 256) {
  16678. val = code
  16679. }
  16680. }
  16681. if (encoding !== undefined && typeof encoding !== 'string') {
  16682. throw new TypeError('encoding must be a string')
  16683. }
  16684. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  16685. throw new TypeError('Unknown encoding: ' + encoding)
  16686. }
  16687. } else if (typeof val === 'number') {
  16688. val = val & 255
  16689. }
  16690. // Invalid ranges are not set to a default, so can range check early.
  16691. if (start < 0 || this.length < start || this.length < end) {
  16692. throw new RangeError('Out of range index')
  16693. }
  16694. if (end <= start) {
  16695. return this
  16696. }
  16697. start = start >>> 0
  16698. end = end === undefined ? this.length : end >>> 0
  16699. if (!val) val = 0
  16700. var i
  16701. if (typeof val === 'number') {
  16702. for (i = start; i < end; ++i) {
  16703. this[i] = val
  16704. }
  16705. } else {
  16706. var bytes = Buffer.isBuffer(val)
  16707. ? val
  16708. : utf8ToBytes(new Buffer(val, encoding).toString())
  16709. var len = bytes.length
  16710. for (i = 0; i < end - start; ++i) {
  16711. this[i + start] = bytes[i % len]
  16712. }
  16713. }
  16714. return this
  16715. }
  16716. // HELPER FUNCTIONS
  16717. // ================
  16718. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  16719. function base64clean (str) {
  16720. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  16721. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  16722. // Node converts strings with length < 2 to ''
  16723. if (str.length < 2) return ''
  16724. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  16725. while (str.length % 4 !== 0) {
  16726. str = str + '='
  16727. }
  16728. return str
  16729. }
  16730. function stringtrim (str) {
  16731. if (str.trim) return str.trim()
  16732. return str.replace(/^\s+|\s+$/g, '')
  16733. }
  16734. function toHex (n) {
  16735. if (n < 16) return '0' + n.toString(16)
  16736. return n.toString(16)
  16737. }
  16738. function utf8ToBytes (string, units) {
  16739. units = units || Infinity
  16740. var codePoint
  16741. var length = string.length
  16742. var leadSurrogate = null
  16743. var bytes = []
  16744. for (var i = 0; i < length; ++i) {
  16745. codePoint = string.charCodeAt(i)
  16746. // is surrogate component
  16747. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  16748. // last char was a lead
  16749. if (!leadSurrogate) {
  16750. // no lead yet
  16751. if (codePoint > 0xDBFF) {
  16752. // unexpected trail
  16753. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  16754. continue
  16755. } else if (i + 1 === length) {
  16756. // unpaired lead
  16757. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  16758. continue
  16759. }
  16760. // valid lead
  16761. leadSurrogate = codePoint
  16762. continue
  16763. }
  16764. // 2 leads in a row
  16765. if (codePoint < 0xDC00) {
  16766. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  16767. leadSurrogate = codePoint
  16768. continue
  16769. }
  16770. // valid surrogate pair
  16771. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  16772. } else if (leadSurrogate) {
  16773. // valid bmp char, but last char was a lead
  16774. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  16775. }
  16776. leadSurrogate = null
  16777. // encode utf8
  16778. if (codePoint < 0x80) {
  16779. if ((units -= 1) < 0) break
  16780. bytes.push(codePoint)
  16781. } else if (codePoint < 0x800) {
  16782. if ((units -= 2) < 0) break
  16783. bytes.push(
  16784. codePoint >> 0x6 | 0xC0,
  16785. codePoint & 0x3F | 0x80
  16786. )
  16787. } else if (codePoint < 0x10000) {
  16788. if ((units -= 3) < 0) break
  16789. bytes.push(
  16790. codePoint >> 0xC | 0xE0,
  16791. codePoint >> 0x6 & 0x3F | 0x80,
  16792. codePoint & 0x3F | 0x80
  16793. )
  16794. } else if (codePoint < 0x110000) {
  16795. if ((units -= 4) < 0) break
  16796. bytes.push(
  16797. codePoint >> 0x12 | 0xF0,
  16798. codePoint >> 0xC & 0x3F | 0x80,
  16799. codePoint >> 0x6 & 0x3F | 0x80,
  16800. codePoint & 0x3F | 0x80
  16801. )
  16802. } else {
  16803. throw new Error('Invalid code point')
  16804. }
  16805. }
  16806. return bytes
  16807. }
  16808. function asciiToBytes (str) {
  16809. var byteArray = []
  16810. for (var i = 0; i < str.length; ++i) {
  16811. // Node's code seems to be doing this and not & 0x7F..
  16812. byteArray.push(str.charCodeAt(i) & 0xFF)
  16813. }
  16814. return byteArray
  16815. }
  16816. function utf16leToBytes (str, units) {
  16817. var c, hi, lo
  16818. var byteArray = []
  16819. for (var i = 0; i < str.length; ++i) {
  16820. if ((units -= 2) < 0) break
  16821. c = str.charCodeAt(i)
  16822. hi = c >> 8
  16823. lo = c % 256
  16824. byteArray.push(lo)
  16825. byteArray.push(hi)
  16826. }
  16827. return byteArray
  16828. }
  16829. function base64ToBytes (str) {
  16830. return base64.toByteArray(base64clean(str))
  16831. }
  16832. function blitBuffer (src, dst, offset, length) {
  16833. for (var i = 0; i < length; ++i) {
  16834. if ((i + offset >= dst.length) || (i >= src.length)) break
  16835. dst[i + offset] = src[i]
  16836. }
  16837. return i
  16838. }
  16839. function isnan (val) {
  16840. return val !== val // eslint-disable-line no-self-compare
  16841. }
  16842. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
  16843. /***/ }),
  16844. /* 105 */
  16845. /*!*****************************************!*\
  16846. !*** ./node_modules/base64-js/index.js ***!
  16847. \*****************************************/
  16848. /*! no static exports found */
  16849. /***/ (function(module, exports, __webpack_require__) {
  16850. "use strict";
  16851. exports.byteLength = byteLength
  16852. exports.toByteArray = toByteArray
  16853. exports.fromByteArray = fromByteArray
  16854. var lookup = []
  16855. var revLookup = []
  16856. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  16857. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  16858. for (var i = 0, len = code.length; i < len; ++i) {
  16859. lookup[i] = code[i]
  16860. revLookup[code.charCodeAt(i)] = i
  16861. }
  16862. // Support decoding URL-safe base64 strings, as Node.js does.
  16863. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  16864. revLookup['-'.charCodeAt(0)] = 62
  16865. revLookup['_'.charCodeAt(0)] = 63
  16866. function getLens (b64) {
  16867. var len = b64.length
  16868. if (len % 4 > 0) {
  16869. throw new Error('Invalid string. Length must be a multiple of 4')
  16870. }
  16871. // Trim off extra bytes after placeholder bytes are found
  16872. // See: https://github.com/beatgammit/base64-js/issues/42
  16873. var validLen = b64.indexOf('=')
  16874. if (validLen === -1) validLen = len
  16875. var placeHoldersLen = validLen === len
  16876. ? 0
  16877. : 4 - (validLen % 4)
  16878. return [validLen, placeHoldersLen]
  16879. }
  16880. // base64 is 4/3 + up to two characters of the original data
  16881. function byteLength (b64) {
  16882. var lens = getLens(b64)
  16883. var validLen = lens[0]
  16884. var placeHoldersLen = lens[1]
  16885. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  16886. }
  16887. function _byteLength (b64, validLen, placeHoldersLen) {
  16888. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  16889. }
  16890. function toByteArray (b64) {
  16891. var tmp
  16892. var lens = getLens(b64)
  16893. var validLen = lens[0]
  16894. var placeHoldersLen = lens[1]
  16895. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  16896. var curByte = 0
  16897. // if there are placeholders, only get up to the last complete 4 chars
  16898. var len = placeHoldersLen > 0
  16899. ? validLen - 4
  16900. : validLen
  16901. var i
  16902. for (i = 0; i < len; i += 4) {
  16903. tmp =
  16904. (revLookup[b64.charCodeAt(i)] << 18) |
  16905. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  16906. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  16907. revLookup[b64.charCodeAt(i + 3)]
  16908. arr[curByte++] = (tmp >> 16) & 0xFF
  16909. arr[curByte++] = (tmp >> 8) & 0xFF
  16910. arr[curByte++] = tmp & 0xFF
  16911. }
  16912. if (placeHoldersLen === 2) {
  16913. tmp =
  16914. (revLookup[b64.charCodeAt(i)] << 2) |
  16915. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  16916. arr[curByte++] = tmp & 0xFF
  16917. }
  16918. if (placeHoldersLen === 1) {
  16919. tmp =
  16920. (revLookup[b64.charCodeAt(i)] << 10) |
  16921. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  16922. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  16923. arr[curByte++] = (tmp >> 8) & 0xFF
  16924. arr[curByte++] = tmp & 0xFF
  16925. }
  16926. return arr
  16927. }
  16928. function tripletToBase64 (num) {
  16929. return lookup[num >> 18 & 0x3F] +
  16930. lookup[num >> 12 & 0x3F] +
  16931. lookup[num >> 6 & 0x3F] +
  16932. lookup[num & 0x3F]
  16933. }
  16934. function encodeChunk (uint8, start, end) {
  16935. var tmp
  16936. var output = []
  16937. for (var i = start; i < end; i += 3) {
  16938. tmp =
  16939. ((uint8[i] << 16) & 0xFF0000) +
  16940. ((uint8[i + 1] << 8) & 0xFF00) +
  16941. (uint8[i + 2] & 0xFF)
  16942. output.push(tripletToBase64(tmp))
  16943. }
  16944. return output.join('')
  16945. }
  16946. function fromByteArray (uint8) {
  16947. var tmp
  16948. var len = uint8.length
  16949. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  16950. var parts = []
  16951. var maxChunkLength = 16383 // must be multiple of 3
  16952. // go through the array every three bytes, we'll deal with trailing stuff later
  16953. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  16954. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  16955. }
  16956. // pad the end with zeros, but make sure to not forget the extra bytes
  16957. if (extraBytes === 1) {
  16958. tmp = uint8[len - 1]
  16959. parts.push(
  16960. lookup[tmp >> 2] +
  16961. lookup[(tmp << 4) & 0x3F] +
  16962. '=='
  16963. )
  16964. } else if (extraBytes === 2) {
  16965. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  16966. parts.push(
  16967. lookup[tmp >> 10] +
  16968. lookup[(tmp >> 4) & 0x3F] +
  16969. lookup[(tmp << 2) & 0x3F] +
  16970. '='
  16971. )
  16972. }
  16973. return parts.join('')
  16974. }
  16975. /***/ }),
  16976. /* 106 */
  16977. /*!***************************************!*\
  16978. !*** ./node_modules/ieee754/index.js ***!
  16979. \***************************************/
  16980. /*! no static exports found */
  16981. /***/ (function(module, exports) {
  16982. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  16983. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  16984. var e, m
  16985. var eLen = (nBytes * 8) - mLen - 1
  16986. var eMax = (1 << eLen) - 1
  16987. var eBias = eMax >> 1
  16988. var nBits = -7
  16989. var i = isLE ? (nBytes - 1) : 0
  16990. var d = isLE ? -1 : 1
  16991. var s = buffer[offset + i]
  16992. i += d
  16993. e = s & ((1 << (-nBits)) - 1)
  16994. s >>= (-nBits)
  16995. nBits += eLen
  16996. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  16997. m = e & ((1 << (-nBits)) - 1)
  16998. e >>= (-nBits)
  16999. nBits += mLen
  17000. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  17001. if (e === 0) {
  17002. e = 1 - eBias
  17003. } else if (e === eMax) {
  17004. return m ? NaN : ((s ? -1 : 1) * Infinity)
  17005. } else {
  17006. m = m + Math.pow(2, mLen)
  17007. e = e - eBias
  17008. }
  17009. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  17010. }
  17011. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  17012. var e, m, c
  17013. var eLen = (nBytes * 8) - mLen - 1
  17014. var eMax = (1 << eLen) - 1
  17015. var eBias = eMax >> 1
  17016. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  17017. var i = isLE ? 0 : (nBytes - 1)
  17018. var d = isLE ? 1 : -1
  17019. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  17020. value = Math.abs(value)
  17021. if (isNaN(value) || value === Infinity) {
  17022. m = isNaN(value) ? 1 : 0
  17023. e = eMax
  17024. } else {
  17025. e = Math.floor(Math.log(value) / Math.LN2)
  17026. if (value * (c = Math.pow(2, -e)) < 1) {
  17027. e--
  17028. c *= 2
  17029. }
  17030. if (e + eBias >= 1) {
  17031. value += rt / c
  17032. } else {
  17033. value += rt * Math.pow(2, 1 - eBias)
  17034. }
  17035. if (value * c >= 2) {
  17036. e++
  17037. c /= 2
  17038. }
  17039. if (e + eBias >= eMax) {
  17040. m = 0
  17041. e = eMax
  17042. } else if (e + eBias >= 1) {
  17043. m = ((value * c) - 1) * Math.pow(2, mLen)
  17044. e = e + eBias
  17045. } else {
  17046. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  17047. e = 0
  17048. }
  17049. }
  17050. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  17051. e = (e << mLen) | m
  17052. eLen += mLen
  17053. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  17054. buffer[offset + i - d] |= s * 128
  17055. }
  17056. /***/ }),
  17057. /* 107 */
  17058. /*!***************************************!*\
  17059. !*** ./node_modules/isarray/index.js ***!
  17060. \***************************************/
  17061. /*! no static exports found */
  17062. /***/ (function(module, exports) {
  17063. var toString = {}.toString;
  17064. module.exports = Array.isArray || function (arr) {
  17065. return toString.call(arr) == '[object Array]';
  17066. };
  17067. /***/ }),
  17068. /* 108 */
  17069. /*!*********************************************!*\
  17070. !*** ./node_modules/create-hash/browser.js ***!
  17071. \*********************************************/
  17072. /*! no static exports found */
  17073. /***/ (function(module, exports, __webpack_require__) {
  17074. "use strict";
  17075. var inherits = __webpack_require__(/*! inherits */ 109)
  17076. var MD5 = __webpack_require__(/*! md5.js */ 110)
  17077. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 128)
  17078. var sha = __webpack_require__(/*! sha.js */ 129)
  17079. var Base = __webpack_require__(/*! cipher-base */ 137)
  17080. function Hash (hash) {
  17081. Base.call(this, 'digest')
  17082. this._hash = hash
  17083. }
  17084. inherits(Hash, Base)
  17085. Hash.prototype._update = function (data) {
  17086. this._hash.update(data)
  17087. }
  17088. Hash.prototype._final = function () {
  17089. return this._hash.digest()
  17090. }
  17091. module.exports = function createHash (alg) {
  17092. alg = alg.toLowerCase()
  17093. if (alg === 'md5') return new MD5()
  17094. if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
  17095. return new Hash(sha(alg))
  17096. }
  17097. /***/ }),
  17098. /* 109 */
  17099. /*!***************************************************!*\
  17100. !*** ./node_modules/inherits/inherits_browser.js ***!
  17101. \***************************************************/
  17102. /*! no static exports found */
  17103. /***/ (function(module, exports) {
  17104. if (typeof Object.create === 'function') {
  17105. // implementation from standard node.js 'util' module
  17106. module.exports = function inherits(ctor, superCtor) {
  17107. if (superCtor) {
  17108. ctor.super_ = superCtor
  17109. ctor.prototype = Object.create(superCtor.prototype, {
  17110. constructor: {
  17111. value: ctor,
  17112. enumerable: false,
  17113. writable: true,
  17114. configurable: true
  17115. }
  17116. })
  17117. }
  17118. };
  17119. } else {
  17120. // old school shim for old browsers
  17121. module.exports = function inherits(ctor, superCtor) {
  17122. if (superCtor) {
  17123. ctor.super_ = superCtor
  17124. var TempCtor = function () {}
  17125. TempCtor.prototype = superCtor.prototype
  17126. ctor.prototype = new TempCtor()
  17127. ctor.prototype.constructor = ctor
  17128. }
  17129. }
  17130. }
  17131. /***/ }),
  17132. /* 110 */
  17133. /*!**************************************!*\
  17134. !*** ./node_modules/md5.js/index.js ***!
  17135. \**************************************/
  17136. /*! no static exports found */
  17137. /***/ (function(module, exports, __webpack_require__) {
  17138. "use strict";
  17139. var inherits = __webpack_require__(/*! inherits */ 109)
  17140. var HashBase = __webpack_require__(/*! hash-base */ 111)
  17141. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  17142. var ARRAY16 = new Array(16)
  17143. function MD5 () {
  17144. HashBase.call(this, 64)
  17145. // state
  17146. this._a = 0x67452301
  17147. this._b = 0xefcdab89
  17148. this._c = 0x98badcfe
  17149. this._d = 0x10325476
  17150. }
  17151. inherits(MD5, HashBase)
  17152. MD5.prototype._update = function () {
  17153. var M = ARRAY16
  17154. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  17155. var a = this._a
  17156. var b = this._b
  17157. var c = this._c
  17158. var d = this._d
  17159. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  17160. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  17161. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  17162. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  17163. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  17164. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  17165. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  17166. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  17167. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  17168. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  17169. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  17170. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  17171. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  17172. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  17173. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  17174. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  17175. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  17176. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  17177. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  17178. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  17179. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  17180. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  17181. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  17182. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  17183. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  17184. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  17185. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  17186. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  17187. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  17188. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  17189. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  17190. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  17191. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  17192. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  17193. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  17194. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  17195. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  17196. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  17197. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  17198. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  17199. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  17200. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  17201. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  17202. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  17203. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  17204. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  17205. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  17206. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  17207. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  17208. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  17209. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  17210. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  17211. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  17212. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  17213. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  17214. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  17215. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  17216. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  17217. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  17218. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  17219. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  17220. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  17221. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  17222. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  17223. this._a = (this._a + a) | 0
  17224. this._b = (this._b + b) | 0
  17225. this._c = (this._c + c) | 0
  17226. this._d = (this._d + d) | 0
  17227. }
  17228. MD5.prototype._digest = function () {
  17229. // create padding and handle blocks
  17230. this._block[this._blockOffset++] = 0x80
  17231. if (this._blockOffset > 56) {
  17232. this._block.fill(0, this._blockOffset, 64)
  17233. this._update()
  17234. this._blockOffset = 0
  17235. }
  17236. this._block.fill(0, this._blockOffset, 56)
  17237. this._block.writeUInt32LE(this._length[0], 56)
  17238. this._block.writeUInt32LE(this._length[1], 60)
  17239. this._update()
  17240. // produce result
  17241. var buffer = Buffer.allocUnsafe(16)
  17242. buffer.writeInt32LE(this._a, 0)
  17243. buffer.writeInt32LE(this._b, 4)
  17244. buffer.writeInt32LE(this._c, 8)
  17245. buffer.writeInt32LE(this._d, 12)
  17246. return buffer
  17247. }
  17248. function rotl (x, n) {
  17249. return (x << n) | (x >>> (32 - n))
  17250. }
  17251. function fnF (a, b, c, d, m, k, s) {
  17252. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  17253. }
  17254. function fnG (a, b, c, d, m, k, s) {
  17255. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  17256. }
  17257. function fnH (a, b, c, d, m, k, s) {
  17258. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  17259. }
  17260. function fnI (a, b, c, d, m, k, s) {
  17261. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  17262. }
  17263. module.exports = MD5
  17264. /***/ }),
  17265. /* 111 */
  17266. /*!*****************************************!*\
  17267. !*** ./node_modules/hash-base/index.js ***!
  17268. \*****************************************/
  17269. /*! no static exports found */
  17270. /***/ (function(module, exports, __webpack_require__) {
  17271. "use strict";
  17272. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  17273. var Transform = __webpack_require__(/*! readable-stream */ 112).Transform
  17274. var inherits = __webpack_require__(/*! inherits */ 109)
  17275. function throwIfNotStringOrBuffer (val, prefix) {
  17276. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  17277. throw new TypeError(prefix + ' must be a string or a buffer')
  17278. }
  17279. }
  17280. function HashBase (blockSize) {
  17281. Transform.call(this)
  17282. this._block = Buffer.allocUnsafe(blockSize)
  17283. this._blockSize = blockSize
  17284. this._blockOffset = 0
  17285. this._length = [0, 0, 0, 0]
  17286. this._finalized = false
  17287. }
  17288. inherits(HashBase, Transform)
  17289. HashBase.prototype._transform = function (chunk, encoding, callback) {
  17290. var error = null
  17291. try {
  17292. this.update(chunk, encoding)
  17293. } catch (err) {
  17294. error = err
  17295. }
  17296. callback(error)
  17297. }
  17298. HashBase.prototype._flush = function (callback) {
  17299. var error = null
  17300. try {
  17301. this.push(this.digest())
  17302. } catch (err) {
  17303. error = err
  17304. }
  17305. callback(error)
  17306. }
  17307. HashBase.prototype.update = function (data, encoding) {
  17308. throwIfNotStringOrBuffer(data, 'Data')
  17309. if (this._finalized) throw new Error('Digest already called')
  17310. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  17311. // consume data
  17312. var block = this._block
  17313. var offset = 0
  17314. while (this._blockOffset + data.length - offset >= this._blockSize) {
  17315. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  17316. this._update()
  17317. this._blockOffset = 0
  17318. }
  17319. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  17320. // update length
  17321. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  17322. this._length[j] += carry
  17323. carry = (this._length[j] / 0x0100000000) | 0
  17324. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  17325. }
  17326. return this
  17327. }
  17328. HashBase.prototype._update = function () {
  17329. throw new Error('_update is not implemented')
  17330. }
  17331. HashBase.prototype.digest = function (encoding) {
  17332. if (this._finalized) throw new Error('Digest already called')
  17333. this._finalized = true
  17334. var digest = this._digest()
  17335. if (encoding !== undefined) digest = digest.toString(encoding)
  17336. // reset state
  17337. this._block.fill(0)
  17338. this._blockOffset = 0
  17339. for (var i = 0; i < 4; ++i) this._length[i] = 0
  17340. return digest
  17341. }
  17342. HashBase.prototype._digest = function () {
  17343. throw new Error('_digest is not implemented')
  17344. }
  17345. module.exports = HashBase
  17346. /***/ }),
  17347. /* 112 */
  17348. /*!**********************************************************!*\
  17349. !*** ./node_modules/readable-stream/readable-browser.js ***!
  17350. \**********************************************************/
  17351. /*! no static exports found */
  17352. /***/ (function(module, exports, __webpack_require__) {
  17353. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 113);
  17354. exports.Stream = exports;
  17355. exports.Readable = exports;
  17356. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 123);
  17357. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 122);
  17358. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 126);
  17359. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 127);
  17360. /***/ }),
  17361. /* 113 */
  17362. /*!**************************************************************!*\
  17363. !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
  17364. \**************************************************************/
  17365. /*! no static exports found */
  17366. /***/ (function(module, exports, __webpack_require__) {
  17367. "use strict";
  17368. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  17369. //
  17370. // Permission is hereby granted, free of charge, to any person obtaining a
  17371. // copy of this software and associated documentation files (the
  17372. // "Software"), to deal in the Software without restriction, including
  17373. // without limitation the rights to use, copy, modify, merge, publish,
  17374. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17375. // persons to whom the Software is furnished to do so, subject to the
  17376. // following conditions:
  17377. //
  17378. // The above copyright notice and this permission notice shall be included
  17379. // in all copies or substantial portions of the Software.
  17380. //
  17381. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17382. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17383. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17384. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17385. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17386. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17387. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17388. /*<replacement>*/
  17389. var pna = __webpack_require__(/*! process-nextick-args */ 114);
  17390. /*</replacement>*/
  17391. module.exports = Readable;
  17392. /*<replacement>*/
  17393. var isArray = __webpack_require__(/*! isarray */ 107);
  17394. /*</replacement>*/
  17395. /*<replacement>*/
  17396. var Duplex;
  17397. /*</replacement>*/
  17398. Readable.ReadableState = ReadableState;
  17399. /*<replacement>*/
  17400. var EE = __webpack_require__(/*! events */ 115).EventEmitter;
  17401. var EElistenerCount = function (emitter, type) {
  17402. return emitter.listeners(type).length;
  17403. };
  17404. /*</replacement>*/
  17405. /*<replacement>*/
  17406. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 116);
  17407. /*</replacement>*/
  17408. /*<replacement>*/
  17409. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer;
  17410. var OurUint8Array = global.Uint8Array || function () {};
  17411. function _uint8ArrayToBuffer(chunk) {
  17412. return Buffer.from(chunk);
  17413. }
  17414. function _isUint8Array(obj) {
  17415. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  17416. }
  17417. /*</replacement>*/
  17418. /*<replacement>*/
  17419. var util = Object.create(__webpack_require__(/*! core-util-is */ 117));
  17420. util.inherits = __webpack_require__(/*! inherits */ 109);
  17421. /*</replacement>*/
  17422. /*<replacement>*/
  17423. var debugUtil = __webpack_require__(/*! util */ 118);
  17424. var debug = void 0;
  17425. if (debugUtil && debugUtil.debuglog) {
  17426. debug = debugUtil.debuglog('stream');
  17427. } else {
  17428. debug = function () {};
  17429. }
  17430. /*</replacement>*/
  17431. var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 119);
  17432. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 121);
  17433. var StringDecoder;
  17434. util.inherits(Readable, Stream);
  17435. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  17436. function prependListener(emitter, event, fn) {
  17437. // Sadly this is not cacheable as some libraries bundle their own
  17438. // event emitter implementation with them.
  17439. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  17440. // This is a hack to make sure that our error handler is attached before any
  17441. // userland ones. NEVER DO THIS. This is here only because this code needs
  17442. // to continue to work with older versions of Node.js that do not include
  17443. // the prependListener() method. The goal is to eventually remove this hack.
  17444. 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]];
  17445. }
  17446. function ReadableState(options, stream) {
  17447. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 122);
  17448. options = options || {};
  17449. // Duplex streams are both readable and writable, but share
  17450. // the same options object.
  17451. // However, some cases require setting options to different
  17452. // values for the readable and the writable sides of the duplex stream.
  17453. // These options can be provided separately as readableXXX and writableXXX.
  17454. var isDuplex = stream instanceof Duplex;
  17455. // object stream flag. Used to make read(n) ignore n and to
  17456. // make all the buffer merging and length checks go away
  17457. this.objectMode = !!options.objectMode;
  17458. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  17459. // the point at which it stops calling _read() to fill the buffer
  17460. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  17461. var hwm = options.highWaterMark;
  17462. var readableHwm = options.readableHighWaterMark;
  17463. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  17464. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  17465. // cast to ints.
  17466. this.highWaterMark = Math.floor(this.highWaterMark);
  17467. // A linked list is used to store data chunks instead of an array because the
  17468. // linked list can remove elements from the beginning faster than
  17469. // array.shift()
  17470. this.buffer = new BufferList();
  17471. this.length = 0;
  17472. this.pipes = null;
  17473. this.pipesCount = 0;
  17474. this.flowing = null;
  17475. this.ended = false;
  17476. this.endEmitted = false;
  17477. this.reading = false;
  17478. // a flag to be able to tell if the event 'readable'/'data' is emitted
  17479. // immediately, or on a later tick. We set this to true at first, because
  17480. // any actions that shouldn't happen until "later" should generally also
  17481. // not happen before the first read call.
  17482. this.sync = true;
  17483. // whenever we return null, then we set a flag to say
  17484. // that we're awaiting a 'readable' event emission.
  17485. this.needReadable = false;
  17486. this.emittedReadable = false;
  17487. this.readableListening = false;
  17488. this.resumeScheduled = false;
  17489. // has it been destroyed
  17490. this.destroyed = false;
  17491. // Crypto is kind of old and crusty. Historically, its default string
  17492. // encoding is 'binary' so we have to make this configurable.
  17493. // Everything else in the universe uses 'utf8', though.
  17494. this.defaultEncoding = options.defaultEncoding || 'utf8';
  17495. // the number of writers that are awaiting a drain event in .pipe()s
  17496. this.awaitDrain = 0;
  17497. // if true, a maybeReadMore has been scheduled
  17498. this.readingMore = false;
  17499. this.decoder = null;
  17500. this.encoding = null;
  17501. if (options.encoding) {
  17502. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 125).StringDecoder;
  17503. this.decoder = new StringDecoder(options.encoding);
  17504. this.encoding = options.encoding;
  17505. }
  17506. }
  17507. function Readable(options) {
  17508. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 122);
  17509. if (!(this instanceof Readable)) return new Readable(options);
  17510. this._readableState = new ReadableState(options, this);
  17511. // legacy
  17512. this.readable = true;
  17513. if (options) {
  17514. if (typeof options.read === 'function') this._read = options.read;
  17515. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  17516. }
  17517. Stream.call(this);
  17518. }
  17519. Object.defineProperty(Readable.prototype, 'destroyed', {
  17520. get: function () {
  17521. if (this._readableState === undefined) {
  17522. return false;
  17523. }
  17524. return this._readableState.destroyed;
  17525. },
  17526. set: function (value) {
  17527. // we ignore the value if the stream
  17528. // has not been initialized yet
  17529. if (!this._readableState) {
  17530. return;
  17531. }
  17532. // backward compatibility, the user is explicitly
  17533. // managing destroyed
  17534. this._readableState.destroyed = value;
  17535. }
  17536. });
  17537. Readable.prototype.destroy = destroyImpl.destroy;
  17538. Readable.prototype._undestroy = destroyImpl.undestroy;
  17539. Readable.prototype._destroy = function (err, cb) {
  17540. this.push(null);
  17541. cb(err);
  17542. };
  17543. // Manually shove something into the read() buffer.
  17544. // This returns true if the highWaterMark has not been hit yet,
  17545. // similar to how Writable.write() returns true if you should
  17546. // write() some more.
  17547. Readable.prototype.push = function (chunk, encoding) {
  17548. var state = this._readableState;
  17549. var skipChunkCheck;
  17550. if (!state.objectMode) {
  17551. if (typeof chunk === 'string') {
  17552. encoding = encoding || state.defaultEncoding;
  17553. if (encoding !== state.encoding) {
  17554. chunk = Buffer.from(chunk, encoding);
  17555. encoding = '';
  17556. }
  17557. skipChunkCheck = true;
  17558. }
  17559. } else {
  17560. skipChunkCheck = true;
  17561. }
  17562. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  17563. };
  17564. // Unshift should *always* be something directly out of read()
  17565. Readable.prototype.unshift = function (chunk) {
  17566. return readableAddChunk(this, chunk, null, true, false);
  17567. };
  17568. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  17569. var state = stream._readableState;
  17570. if (chunk === null) {
  17571. state.reading = false;
  17572. onEofChunk(stream, state);
  17573. } else {
  17574. var er;
  17575. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  17576. if (er) {
  17577. stream.emit('error', er);
  17578. } else if (state.objectMode || chunk && chunk.length > 0) {
  17579. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  17580. chunk = _uint8ArrayToBuffer(chunk);
  17581. }
  17582. if (addToFront) {
  17583. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  17584. } else if (state.ended) {
  17585. stream.emit('error', new Error('stream.push() after EOF'));
  17586. } else {
  17587. state.reading = false;
  17588. if (state.decoder && !encoding) {
  17589. chunk = state.decoder.write(chunk);
  17590. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  17591. } else {
  17592. addChunk(stream, state, chunk, false);
  17593. }
  17594. }
  17595. } else if (!addToFront) {
  17596. state.reading = false;
  17597. }
  17598. }
  17599. return needMoreData(state);
  17600. }
  17601. function addChunk(stream, state, chunk, addToFront) {
  17602. if (state.flowing && state.length === 0 && !state.sync) {
  17603. stream.emit('data', chunk);
  17604. stream.read(0);
  17605. } else {
  17606. // update the buffer info.
  17607. state.length += state.objectMode ? 1 : chunk.length;
  17608. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  17609. if (state.needReadable) emitReadable(stream);
  17610. }
  17611. maybeReadMore(stream, state);
  17612. }
  17613. function chunkInvalid(state, chunk) {
  17614. var er;
  17615. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  17616. er = new TypeError('Invalid non-string/buffer chunk');
  17617. }
  17618. return er;
  17619. }
  17620. // if it's past the high water mark, we can push in some more.
  17621. // Also, if we have no data yet, we can stand some
  17622. // more bytes. This is to work around cases where hwm=0,
  17623. // such as the repl. Also, if the push() triggered a
  17624. // readable event, and the user called read(largeNumber) such that
  17625. // needReadable was set, then we ought to push more, so that another
  17626. // 'readable' event will be triggered.
  17627. function needMoreData(state) {
  17628. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  17629. }
  17630. Readable.prototype.isPaused = function () {
  17631. return this._readableState.flowing === false;
  17632. };
  17633. // backwards compatibility.
  17634. Readable.prototype.setEncoding = function (enc) {
  17635. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 125).StringDecoder;
  17636. this._readableState.decoder = new StringDecoder(enc);
  17637. this._readableState.encoding = enc;
  17638. return this;
  17639. };
  17640. // Don't raise the hwm > 8MB
  17641. var MAX_HWM = 0x800000;
  17642. function computeNewHighWaterMark(n) {
  17643. if (n >= MAX_HWM) {
  17644. n = MAX_HWM;
  17645. } else {
  17646. // Get the next highest power of 2 to prevent increasing hwm excessively in
  17647. // tiny amounts
  17648. n--;
  17649. n |= n >>> 1;
  17650. n |= n >>> 2;
  17651. n |= n >>> 4;
  17652. n |= n >>> 8;
  17653. n |= n >>> 16;
  17654. n++;
  17655. }
  17656. return n;
  17657. }
  17658. // This function is designed to be inlinable, so please take care when making
  17659. // changes to the function body.
  17660. function howMuchToRead(n, state) {
  17661. if (n <= 0 || state.length === 0 && state.ended) return 0;
  17662. if (state.objectMode) return 1;
  17663. if (n !== n) {
  17664. // Only flow one buffer at a time
  17665. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  17666. }
  17667. // If we're asking for more than the current hwm, then raise the hwm.
  17668. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  17669. if (n <= state.length) return n;
  17670. // Don't have enough
  17671. if (!state.ended) {
  17672. state.needReadable = true;
  17673. return 0;
  17674. }
  17675. return state.length;
  17676. }
  17677. // you can override either this method, or the async _read(n) below.
  17678. Readable.prototype.read = function (n) {
  17679. debug('read', n);
  17680. n = parseInt(n, 10);
  17681. var state = this._readableState;
  17682. var nOrig = n;
  17683. if (n !== 0) state.emittedReadable = false;
  17684. // if we're doing read(0) to trigger a readable event, but we
  17685. // already have a bunch of data in the buffer, then just trigger
  17686. // the 'readable' event and move on.
  17687. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  17688. debug('read: emitReadable', state.length, state.ended);
  17689. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  17690. return null;
  17691. }
  17692. n = howMuchToRead(n, state);
  17693. // if we've ended, and we're now clear, then finish it up.
  17694. if (n === 0 && state.ended) {
  17695. if (state.length === 0) endReadable(this);
  17696. return null;
  17697. }
  17698. // All the actual chunk generation logic needs to be
  17699. // *below* the call to _read. The reason is that in certain
  17700. // synthetic stream cases, such as passthrough streams, _read
  17701. // may be a completely synchronous operation which may change
  17702. // the state of the read buffer, providing enough data when
  17703. // before there was *not* enough.
  17704. //
  17705. // So, the steps are:
  17706. // 1. Figure out what the state of things will be after we do
  17707. // a read from the buffer.
  17708. //
  17709. // 2. If that resulting state will trigger a _read, then call _read.
  17710. // Note that this may be asynchronous, or synchronous. Yes, it is
  17711. // deeply ugly to write APIs this way, but that still doesn't mean
  17712. // that the Readable class should behave improperly, as streams are
  17713. // designed to be sync/async agnostic.
  17714. // Take note if the _read call is sync or async (ie, if the read call
  17715. // has returned yet), so that we know whether or not it's safe to emit
  17716. // 'readable' etc.
  17717. //
  17718. // 3. Actually pull the requested chunks out of the buffer and return.
  17719. // if we need a readable event, then we need to do some reading.
  17720. var doRead = state.needReadable;
  17721. debug('need readable', doRead);
  17722. // if we currently have less than the highWaterMark, then also read some
  17723. if (state.length === 0 || state.length - n < state.highWaterMark) {
  17724. doRead = true;
  17725. debug('length less than watermark', doRead);
  17726. }
  17727. // however, if we've ended, then there's no point, and if we're already
  17728. // reading, then it's unnecessary.
  17729. if (state.ended || state.reading) {
  17730. doRead = false;
  17731. debug('reading or ended', doRead);
  17732. } else if (doRead) {
  17733. debug('do read');
  17734. state.reading = true;
  17735. state.sync = true;
  17736. // if the length is currently zero, then we *need* a readable event.
  17737. if (state.length === 0) state.needReadable = true;
  17738. // call internal read method
  17739. this._read(state.highWaterMark);
  17740. state.sync = false;
  17741. // If _read pushed data synchronously, then `reading` will be false,
  17742. // and we need to re-evaluate how much data we can return to the user.
  17743. if (!state.reading) n = howMuchToRead(nOrig, state);
  17744. }
  17745. var ret;
  17746. if (n > 0) ret = fromList(n, state);else ret = null;
  17747. if (ret === null) {
  17748. state.needReadable = true;
  17749. n = 0;
  17750. } else {
  17751. state.length -= n;
  17752. }
  17753. if (state.length === 0) {
  17754. // If we have nothing in the buffer, then we want to know
  17755. // as soon as we *do* get something into the buffer.
  17756. if (!state.ended) state.needReadable = true;
  17757. // If we tried to read() past the EOF, then emit end on the next tick.
  17758. if (nOrig !== n && state.ended) endReadable(this);
  17759. }
  17760. if (ret !== null) this.emit('data', ret);
  17761. return ret;
  17762. };
  17763. function onEofChunk(stream, state) {
  17764. if (state.ended) return;
  17765. if (state.decoder) {
  17766. var chunk = state.decoder.end();
  17767. if (chunk && chunk.length) {
  17768. state.buffer.push(chunk);
  17769. state.length += state.objectMode ? 1 : chunk.length;
  17770. }
  17771. }
  17772. state.ended = true;
  17773. // emit 'readable' now to make sure it gets picked up.
  17774. emitReadable(stream);
  17775. }
  17776. // Don't emit readable right away in sync mode, because this can trigger
  17777. // another read() call => stack overflow. This way, it might trigger
  17778. // a nextTick recursion warning, but that's not so bad.
  17779. function emitReadable(stream) {
  17780. var state = stream._readableState;
  17781. state.needReadable = false;
  17782. if (!state.emittedReadable) {
  17783. debug('emitReadable', state.flowing);
  17784. state.emittedReadable = true;
  17785. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  17786. }
  17787. }
  17788. function emitReadable_(stream) {
  17789. debug('emit readable');
  17790. stream.emit('readable');
  17791. flow(stream);
  17792. }
  17793. // at this point, the user has presumably seen the 'readable' event,
  17794. // and called read() to consume some data. that may have triggered
  17795. // in turn another _read(n) call, in which case reading = true if
  17796. // it's in progress.
  17797. // However, if we're not ended, or reading, and the length < hwm,
  17798. // then go ahead and try to read some more preemptively.
  17799. function maybeReadMore(stream, state) {
  17800. if (!state.readingMore) {
  17801. state.readingMore = true;
  17802. pna.nextTick(maybeReadMore_, stream, state);
  17803. }
  17804. }
  17805. function maybeReadMore_(stream, state) {
  17806. var len = state.length;
  17807. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  17808. debug('maybeReadMore read 0');
  17809. stream.read(0);
  17810. if (len === state.length)
  17811. // didn't get any data, stop spinning.
  17812. break;else len = state.length;
  17813. }
  17814. state.readingMore = false;
  17815. }
  17816. // abstract method. to be overridden in specific implementation classes.
  17817. // call cb(er, data) where data is <= n in length.
  17818. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  17819. // arbitrary, and perhaps not very meaningful.
  17820. Readable.prototype._read = function (n) {
  17821. this.emit('error', new Error('_read() is not implemented'));
  17822. };
  17823. Readable.prototype.pipe = function (dest, pipeOpts) {
  17824. var src = this;
  17825. var state = this._readableState;
  17826. switch (state.pipesCount) {
  17827. case 0:
  17828. state.pipes = dest;
  17829. break;
  17830. case 1:
  17831. state.pipes = [state.pipes, dest];
  17832. break;
  17833. default:
  17834. state.pipes.push(dest);
  17835. break;
  17836. }
  17837. state.pipesCount += 1;
  17838. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  17839. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  17840. var endFn = doEnd ? onend : unpipe;
  17841. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  17842. dest.on('unpipe', onunpipe);
  17843. function onunpipe(readable, unpipeInfo) {
  17844. debug('onunpipe');
  17845. if (readable === src) {
  17846. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  17847. unpipeInfo.hasUnpiped = true;
  17848. cleanup();
  17849. }
  17850. }
  17851. }
  17852. function onend() {
  17853. debug('onend');
  17854. dest.end();
  17855. }
  17856. // when the dest drains, it reduces the awaitDrain counter
  17857. // on the source. This would be more elegant with a .once()
  17858. // handler in flow(), but adding and removing repeatedly is
  17859. // too slow.
  17860. var ondrain = pipeOnDrain(src);
  17861. dest.on('drain', ondrain);
  17862. var cleanedUp = false;
  17863. function cleanup() {
  17864. debug('cleanup');
  17865. // cleanup event handlers once the pipe is broken
  17866. dest.removeListener('close', onclose);
  17867. dest.removeListener('finish', onfinish);
  17868. dest.removeListener('drain', ondrain);
  17869. dest.removeListener('error', onerror);
  17870. dest.removeListener('unpipe', onunpipe);
  17871. src.removeListener('end', onend);
  17872. src.removeListener('end', unpipe);
  17873. src.removeListener('data', ondata);
  17874. cleanedUp = true;
  17875. // if the reader is waiting for a drain event from this
  17876. // specific writer, then it would cause it to never start
  17877. // flowing again.
  17878. // So, if this is awaiting a drain, then we just call it now.
  17879. // If we don't know, then assume that we are waiting for one.
  17880. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  17881. }
  17882. // If the user pushes more data while we're writing to dest then we'll end up
  17883. // in ondata again. However, we only want to increase awaitDrain once because
  17884. // dest will only emit one 'drain' event for the multiple writes.
  17885. // => Introduce a guard on increasing awaitDrain.
  17886. var increasedAwaitDrain = false;
  17887. src.on('data', ondata);
  17888. function ondata(chunk) {
  17889. debug('ondata');
  17890. increasedAwaitDrain = false;
  17891. var ret = dest.write(chunk);
  17892. if (false === ret && !increasedAwaitDrain) {
  17893. // If the user unpiped during `dest.write()`, it is possible
  17894. // to get stuck in a permanently paused state if that write
  17895. // also returned false.
  17896. // => Check whether `dest` is still a piping destination.
  17897. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  17898. debug('false write response, pause', src._readableState.awaitDrain);
  17899. src._readableState.awaitDrain++;
  17900. increasedAwaitDrain = true;
  17901. }
  17902. src.pause();
  17903. }
  17904. }
  17905. // if the dest has an error, then stop piping into it.
  17906. // however, don't suppress the throwing behavior for this.
  17907. function onerror(er) {
  17908. debug('onerror', er);
  17909. unpipe();
  17910. dest.removeListener('error', onerror);
  17911. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  17912. }
  17913. // Make sure our error handler is attached before userland ones.
  17914. prependListener(dest, 'error', onerror);
  17915. // Both close and finish should trigger unpipe, but only once.
  17916. function onclose() {
  17917. dest.removeListener('finish', onfinish);
  17918. unpipe();
  17919. }
  17920. dest.once('close', onclose);
  17921. function onfinish() {
  17922. debug('onfinish');
  17923. dest.removeListener('close', onclose);
  17924. unpipe();
  17925. }
  17926. dest.once('finish', onfinish);
  17927. function unpipe() {
  17928. debug('unpipe');
  17929. src.unpipe(dest);
  17930. }
  17931. // tell the dest that it's being piped to
  17932. dest.emit('pipe', src);
  17933. // start the flow if it hasn't been started already.
  17934. if (!state.flowing) {
  17935. debug('pipe resume');
  17936. src.resume();
  17937. }
  17938. return dest;
  17939. };
  17940. function pipeOnDrain(src) {
  17941. return function () {
  17942. var state = src._readableState;
  17943. debug('pipeOnDrain', state.awaitDrain);
  17944. if (state.awaitDrain) state.awaitDrain--;
  17945. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  17946. state.flowing = true;
  17947. flow(src);
  17948. }
  17949. };
  17950. }
  17951. Readable.prototype.unpipe = function (dest) {
  17952. var state = this._readableState;
  17953. var unpipeInfo = { hasUnpiped: false };
  17954. // if we're not piping anywhere, then do nothing.
  17955. if (state.pipesCount === 0) return this;
  17956. // just one destination. most common case.
  17957. if (state.pipesCount === 1) {
  17958. // passed in one, but it's not the right one.
  17959. if (dest && dest !== state.pipes) return this;
  17960. if (!dest) dest = state.pipes;
  17961. // got a match.
  17962. state.pipes = null;
  17963. state.pipesCount = 0;
  17964. state.flowing = false;
  17965. if (dest) dest.emit('unpipe', this, unpipeInfo);
  17966. return this;
  17967. }
  17968. // slow case. multiple pipe destinations.
  17969. if (!dest) {
  17970. // remove all.
  17971. var dests = state.pipes;
  17972. var len = state.pipesCount;
  17973. state.pipes = null;
  17974. state.pipesCount = 0;
  17975. state.flowing = false;
  17976. for (var i = 0; i < len; i++) {
  17977. dests[i].emit('unpipe', this, unpipeInfo);
  17978. }return this;
  17979. }
  17980. // try to find the right one.
  17981. var index = indexOf(state.pipes, dest);
  17982. if (index === -1) return this;
  17983. state.pipes.splice(index, 1);
  17984. state.pipesCount -= 1;
  17985. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  17986. dest.emit('unpipe', this, unpipeInfo);
  17987. return this;
  17988. };
  17989. // set up data events if they are asked for
  17990. // Ensure readable listeners eventually get something
  17991. Readable.prototype.on = function (ev, fn) {
  17992. var res = Stream.prototype.on.call(this, ev, fn);
  17993. if (ev === 'data') {
  17994. // Start flowing on next tick if stream isn't explicitly paused
  17995. if (this._readableState.flowing !== false) this.resume();
  17996. } else if (ev === 'readable') {
  17997. var state = this._readableState;
  17998. if (!state.endEmitted && !state.readableListening) {
  17999. state.readableListening = state.needReadable = true;
  18000. state.emittedReadable = false;
  18001. if (!state.reading) {
  18002. pna.nextTick(nReadingNextTick, this);
  18003. } else if (state.length) {
  18004. emitReadable(this);
  18005. }
  18006. }
  18007. }
  18008. return res;
  18009. };
  18010. Readable.prototype.addListener = Readable.prototype.on;
  18011. function nReadingNextTick(self) {
  18012. debug('readable nexttick read 0');
  18013. self.read(0);
  18014. }
  18015. // pause() and resume() are remnants of the legacy readable stream API
  18016. // If the user uses them, then switch into old mode.
  18017. Readable.prototype.resume = function () {
  18018. var state = this._readableState;
  18019. if (!state.flowing) {
  18020. debug('resume');
  18021. state.flowing = true;
  18022. resume(this, state);
  18023. }
  18024. return this;
  18025. };
  18026. function resume(stream, state) {
  18027. if (!state.resumeScheduled) {
  18028. state.resumeScheduled = true;
  18029. pna.nextTick(resume_, stream, state);
  18030. }
  18031. }
  18032. function resume_(stream, state) {
  18033. if (!state.reading) {
  18034. debug('resume read 0');
  18035. stream.read(0);
  18036. }
  18037. state.resumeScheduled = false;
  18038. state.awaitDrain = 0;
  18039. stream.emit('resume');
  18040. flow(stream);
  18041. if (state.flowing && !state.reading) stream.read(0);
  18042. }
  18043. Readable.prototype.pause = function () {
  18044. debug('call pause flowing=%j', this._readableState.flowing);
  18045. if (false !== this._readableState.flowing) {
  18046. debug('pause');
  18047. this._readableState.flowing = false;
  18048. this.emit('pause');
  18049. }
  18050. return this;
  18051. };
  18052. function flow(stream) {
  18053. var state = stream._readableState;
  18054. debug('flow', state.flowing);
  18055. while (state.flowing && stream.read() !== null) {}
  18056. }
  18057. // wrap an old-style stream as the async data source.
  18058. // This is *not* part of the readable stream interface.
  18059. // It is an ugly unfortunate mess of history.
  18060. Readable.prototype.wrap = function (stream) {
  18061. var _this = this;
  18062. var state = this._readableState;
  18063. var paused = false;
  18064. stream.on('end', function () {
  18065. debug('wrapped end');
  18066. if (state.decoder && !state.ended) {
  18067. var chunk = state.decoder.end();
  18068. if (chunk && chunk.length) _this.push(chunk);
  18069. }
  18070. _this.push(null);
  18071. });
  18072. stream.on('data', function (chunk) {
  18073. debug('wrapped data');
  18074. if (state.decoder) chunk = state.decoder.write(chunk);
  18075. // don't skip over falsy values in objectMode
  18076. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  18077. var ret = _this.push(chunk);
  18078. if (!ret) {
  18079. paused = true;
  18080. stream.pause();
  18081. }
  18082. });
  18083. // proxy all the other methods.
  18084. // important when wrapping filters and duplexes.
  18085. for (var i in stream) {
  18086. if (this[i] === undefined && typeof stream[i] === 'function') {
  18087. this[i] = function (method) {
  18088. return function () {
  18089. return stream[method].apply(stream, arguments);
  18090. };
  18091. }(i);
  18092. }
  18093. }
  18094. // proxy certain important events.
  18095. for (var n = 0; n < kProxyEvents.length; n++) {
  18096. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  18097. }
  18098. // when we try to consume some more bytes, simply unpause the
  18099. // underlying stream.
  18100. this._read = function (n) {
  18101. debug('wrapped _read', n);
  18102. if (paused) {
  18103. paused = false;
  18104. stream.resume();
  18105. }
  18106. };
  18107. return this;
  18108. };
  18109. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  18110. // making it explicit this property is not enumerable
  18111. // because otherwise some prototype manipulation in
  18112. // userland will fail
  18113. enumerable: false,
  18114. get: function () {
  18115. return this._readableState.highWaterMark;
  18116. }
  18117. });
  18118. // exposed for testing purposes only.
  18119. Readable._fromList = fromList;
  18120. // Pluck off n bytes from an array of buffers.
  18121. // Length is the combined lengths of all the buffers in the list.
  18122. // This function is designed to be inlinable, so please take care when making
  18123. // changes to the function body.
  18124. function fromList(n, state) {
  18125. // nothing buffered
  18126. if (state.length === 0) return null;
  18127. var ret;
  18128. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  18129. // read it all, truncate the list
  18130. 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);
  18131. state.buffer.clear();
  18132. } else {
  18133. // read part of list
  18134. ret = fromListPartial(n, state.buffer, state.decoder);
  18135. }
  18136. return ret;
  18137. }
  18138. // Extracts only enough buffered data to satisfy the amount requested.
  18139. // This function is designed to be inlinable, so please take care when making
  18140. // changes to the function body.
  18141. function fromListPartial(n, list, hasStrings) {
  18142. var ret;
  18143. if (n < list.head.data.length) {
  18144. // slice is the same for buffers and strings
  18145. ret = list.head.data.slice(0, n);
  18146. list.head.data = list.head.data.slice(n);
  18147. } else if (n === list.head.data.length) {
  18148. // first chunk is a perfect match
  18149. ret = list.shift();
  18150. } else {
  18151. // result spans more than one buffer
  18152. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  18153. }
  18154. return ret;
  18155. }
  18156. // Copies a specified amount of characters from the list of buffered data
  18157. // chunks.
  18158. // This function is designed to be inlinable, so please take care when making
  18159. // changes to the function body.
  18160. function copyFromBufferString(n, list) {
  18161. var p = list.head;
  18162. var c = 1;
  18163. var ret = p.data;
  18164. n -= ret.length;
  18165. while (p = p.next) {
  18166. var str = p.data;
  18167. var nb = n > str.length ? str.length : n;
  18168. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  18169. n -= nb;
  18170. if (n === 0) {
  18171. if (nb === str.length) {
  18172. ++c;
  18173. if (p.next) list.head = p.next;else list.head = list.tail = null;
  18174. } else {
  18175. list.head = p;
  18176. p.data = str.slice(nb);
  18177. }
  18178. break;
  18179. }
  18180. ++c;
  18181. }
  18182. list.length -= c;
  18183. return ret;
  18184. }
  18185. // Copies a specified amount of bytes from the list of buffered data chunks.
  18186. // This function is designed to be inlinable, so please take care when making
  18187. // changes to the function body.
  18188. function copyFromBuffer(n, list) {
  18189. var ret = Buffer.allocUnsafe(n);
  18190. var p = list.head;
  18191. var c = 1;
  18192. p.data.copy(ret);
  18193. n -= p.data.length;
  18194. while (p = p.next) {
  18195. var buf = p.data;
  18196. var nb = n > buf.length ? buf.length : n;
  18197. buf.copy(ret, ret.length - n, 0, nb);
  18198. n -= nb;
  18199. if (n === 0) {
  18200. if (nb === buf.length) {
  18201. ++c;
  18202. if (p.next) list.head = p.next;else list.head = list.tail = null;
  18203. } else {
  18204. list.head = p;
  18205. p.data = buf.slice(nb);
  18206. }
  18207. break;
  18208. }
  18209. ++c;
  18210. }
  18211. list.length -= c;
  18212. return ret;
  18213. }
  18214. function endReadable(stream) {
  18215. var state = stream._readableState;
  18216. // If we get here before consuming all the bytes, then that is a
  18217. // bug in node. Should never happen.
  18218. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  18219. if (!state.endEmitted) {
  18220. state.ended = true;
  18221. pna.nextTick(endReadableNT, state, stream);
  18222. }
  18223. }
  18224. function endReadableNT(state, stream) {
  18225. // Check that we didn't get one last unshift.
  18226. if (!state.endEmitted && state.length === 0) {
  18227. state.endEmitted = true;
  18228. stream.readable = false;
  18229. stream.emit('end');
  18230. }
  18231. }
  18232. function indexOf(xs, x) {
  18233. for (var i = 0, l = xs.length; i < l; i++) {
  18234. if (xs[i] === x) return i;
  18235. }
  18236. return -1;
  18237. }
  18238. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 101)))
  18239. /***/ }),
  18240. /* 114 */
  18241. /*!****************************************************!*\
  18242. !*** ./node_modules/process-nextick-args/index.js ***!
  18243. \****************************************************/
  18244. /*! no static exports found */
  18245. /***/ (function(module, exports, __webpack_require__) {
  18246. "use strict";
  18247. /* WEBPACK VAR INJECTION */(function(process) {
  18248. if (typeof process === 'undefined' ||
  18249. !process.version ||
  18250. process.version.indexOf('v0.') === 0 ||
  18251. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  18252. module.exports = { nextTick: nextTick };
  18253. } else {
  18254. module.exports = process
  18255. }
  18256. function nextTick(fn, arg1, arg2, arg3) {
  18257. if (typeof fn !== 'function') {
  18258. throw new TypeError('"callback" argument must be a function');
  18259. }
  18260. var len = arguments.length;
  18261. var args, i;
  18262. switch (len) {
  18263. case 0:
  18264. case 1:
  18265. return process.nextTick(fn);
  18266. case 2:
  18267. return process.nextTick(function afterTickOne() {
  18268. fn.call(null, arg1);
  18269. });
  18270. case 3:
  18271. return process.nextTick(function afterTickTwo() {
  18272. fn.call(null, arg1, arg2);
  18273. });
  18274. case 4:
  18275. return process.nextTick(function afterTickThree() {
  18276. fn.call(null, arg1, arg2, arg3);
  18277. });
  18278. default:
  18279. args = new Array(len - 1);
  18280. i = 0;
  18281. while (i < args.length) {
  18282. args[i++] = arguments[i];
  18283. }
  18284. return process.nextTick(function afterTick() {
  18285. fn.apply(null, args);
  18286. });
  18287. }
  18288. }
  18289. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 101)))
  18290. /***/ }),
  18291. /* 115 */
  18292. /*!***************************************!*\
  18293. !*** ./node_modules/events/events.js ***!
  18294. \***************************************/
  18295. /*! no static exports found */
  18296. /***/ (function(module, exports, __webpack_require__) {
  18297. "use strict";
  18298. // Copyright Joyent, Inc. and other Node contributors.
  18299. //
  18300. // Permission is hereby granted, free of charge, to any person obtaining a
  18301. // copy of this software and associated documentation files (the
  18302. // "Software"), to deal in the Software without restriction, including
  18303. // without limitation the rights to use, copy, modify, merge, publish,
  18304. // distribute, sublicense, and/or sell copies of the Software, and to permit
  18305. // persons to whom the Software is furnished to do so, subject to the
  18306. // following conditions:
  18307. //
  18308. // The above copyright notice and this permission notice shall be included
  18309. // in all copies or substantial portions of the Software.
  18310. //
  18311. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18312. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18313. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  18314. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  18315. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  18316. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  18317. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  18318. var R = typeof Reflect === 'object' ? Reflect : null
  18319. var ReflectApply = R && typeof R.apply === 'function'
  18320. ? R.apply
  18321. : function ReflectApply(target, receiver, args) {
  18322. return Function.prototype.apply.call(target, receiver, args);
  18323. }
  18324. var ReflectOwnKeys
  18325. if (R && typeof R.ownKeys === 'function') {
  18326. ReflectOwnKeys = R.ownKeys
  18327. } else if (Object.getOwnPropertySymbols) {
  18328. ReflectOwnKeys = function ReflectOwnKeys(target) {
  18329. return Object.getOwnPropertyNames(target)
  18330. .concat(Object.getOwnPropertySymbols(target));
  18331. };
  18332. } else {
  18333. ReflectOwnKeys = function ReflectOwnKeys(target) {
  18334. return Object.getOwnPropertyNames(target);
  18335. };
  18336. }
  18337. function ProcessEmitWarning(warning) {
  18338. if (console && console.warn) console.warn(warning);
  18339. }
  18340. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  18341. return value !== value;
  18342. }
  18343. function EventEmitter() {
  18344. EventEmitter.init.call(this);
  18345. }
  18346. module.exports = EventEmitter;
  18347. module.exports.once = once;
  18348. // Backwards-compat with node 0.10.x
  18349. EventEmitter.EventEmitter = EventEmitter;
  18350. EventEmitter.prototype._events = undefined;
  18351. EventEmitter.prototype._eventsCount = 0;
  18352. EventEmitter.prototype._maxListeners = undefined;
  18353. // By default EventEmitters will print a warning if more than 10 listeners are
  18354. // added to it. This is a useful default which helps finding memory leaks.
  18355. var defaultMaxListeners = 10;
  18356. function checkListener(listener) {
  18357. if (typeof listener !== 'function') {
  18358. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  18359. }
  18360. }
  18361. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  18362. enumerable: true,
  18363. get: function() {
  18364. return defaultMaxListeners;
  18365. },
  18366. set: function(arg) {
  18367. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  18368. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  18369. }
  18370. defaultMaxListeners = arg;
  18371. }
  18372. });
  18373. EventEmitter.init = function() {
  18374. if (this._events === undefined ||
  18375. this._events === Object.getPrototypeOf(this)._events) {
  18376. this._events = Object.create(null);
  18377. this._eventsCount = 0;
  18378. }
  18379. this._maxListeners = this._maxListeners || undefined;
  18380. };
  18381. // Obviously not all Emitters should be limited to 10. This function allows
  18382. // that to be increased. Set to zero for unlimited.
  18383. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  18384. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  18385. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  18386. }
  18387. this._maxListeners = n;
  18388. return this;
  18389. };
  18390. function _getMaxListeners(that) {
  18391. if (that._maxListeners === undefined)
  18392. return EventEmitter.defaultMaxListeners;
  18393. return that._maxListeners;
  18394. }
  18395. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  18396. return _getMaxListeners(this);
  18397. };
  18398. EventEmitter.prototype.emit = function emit(type) {
  18399. var args = [];
  18400. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  18401. var doError = (type === 'error');
  18402. var events = this._events;
  18403. if (events !== undefined)
  18404. doError = (doError && events.error === undefined);
  18405. else if (!doError)
  18406. return false;
  18407. // If there is no 'error' event listener then throw.
  18408. if (doError) {
  18409. var er;
  18410. if (args.length > 0)
  18411. er = args[0];
  18412. if (er instanceof Error) {
  18413. // Note: The comments on the `throw` lines are intentional, they show
  18414. // up in Node's output if this results in an unhandled exception.
  18415. throw er; // Unhandled 'error' event
  18416. }
  18417. // At least give some kind of context to the user
  18418. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  18419. err.context = er;
  18420. throw err; // Unhandled 'error' event
  18421. }
  18422. var handler = events[type];
  18423. if (handler === undefined)
  18424. return false;
  18425. if (typeof handler === 'function') {
  18426. ReflectApply(handler, this, args);
  18427. } else {
  18428. var len = handler.length;
  18429. var listeners = arrayClone(handler, len);
  18430. for (var i = 0; i < len; ++i)
  18431. ReflectApply(listeners[i], this, args);
  18432. }
  18433. return true;
  18434. };
  18435. function _addListener(target, type, listener, prepend) {
  18436. var m;
  18437. var events;
  18438. var existing;
  18439. checkListener(listener);
  18440. events = target._events;
  18441. if (events === undefined) {
  18442. events = target._events = Object.create(null);
  18443. target._eventsCount = 0;
  18444. } else {
  18445. // To avoid recursion in the case that type === "newListener"! Before
  18446. // adding it to the listeners, first emit "newListener".
  18447. if (events.newListener !== undefined) {
  18448. target.emit('newListener', type,
  18449. listener.listener ? listener.listener : listener);
  18450. // Re-assign `events` because a newListener handler could have caused the
  18451. // this._events to be assigned to a new object
  18452. events = target._events;
  18453. }
  18454. existing = events[type];
  18455. }
  18456. if (existing === undefined) {
  18457. // Optimize the case of one listener. Don't need the extra array object.
  18458. existing = events[type] = listener;
  18459. ++target._eventsCount;
  18460. } else {
  18461. if (typeof existing === 'function') {
  18462. // Adding the second element, need to change to array.
  18463. existing = events[type] =
  18464. prepend ? [listener, existing] : [existing, listener];
  18465. // If we've already got an array, just append.
  18466. } else if (prepend) {
  18467. existing.unshift(listener);
  18468. } else {
  18469. existing.push(listener);
  18470. }
  18471. // Check for listener leak
  18472. m = _getMaxListeners(target);
  18473. if (m > 0 && existing.length > m && !existing.warned) {
  18474. existing.warned = true;
  18475. // No error code for this since it is a Warning
  18476. // eslint-disable-next-line no-restricted-syntax
  18477. var w = new Error('Possible EventEmitter memory leak detected. ' +
  18478. existing.length + ' ' + String(type) + ' listeners ' +
  18479. 'added. Use emitter.setMaxListeners() to ' +
  18480. 'increase limit');
  18481. w.name = 'MaxListenersExceededWarning';
  18482. w.emitter = target;
  18483. w.type = type;
  18484. w.count = existing.length;
  18485. ProcessEmitWarning(w);
  18486. }
  18487. }
  18488. return target;
  18489. }
  18490. EventEmitter.prototype.addListener = function addListener(type, listener) {
  18491. return _addListener(this, type, listener, false);
  18492. };
  18493. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  18494. EventEmitter.prototype.prependListener =
  18495. function prependListener(type, listener) {
  18496. return _addListener(this, type, listener, true);
  18497. };
  18498. function onceWrapper() {
  18499. if (!this.fired) {
  18500. this.target.removeListener(this.type, this.wrapFn);
  18501. this.fired = true;
  18502. if (arguments.length === 0)
  18503. return this.listener.call(this.target);
  18504. return this.listener.apply(this.target, arguments);
  18505. }
  18506. }
  18507. function _onceWrap(target, type, listener) {
  18508. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  18509. var wrapped = onceWrapper.bind(state);
  18510. wrapped.listener = listener;
  18511. state.wrapFn = wrapped;
  18512. return wrapped;
  18513. }
  18514. EventEmitter.prototype.once = function once(type, listener) {
  18515. checkListener(listener);
  18516. this.on(type, _onceWrap(this, type, listener));
  18517. return this;
  18518. };
  18519. EventEmitter.prototype.prependOnceListener =
  18520. function prependOnceListener(type, listener) {
  18521. checkListener(listener);
  18522. this.prependListener(type, _onceWrap(this, type, listener));
  18523. return this;
  18524. };
  18525. // Emits a 'removeListener' event if and only if the listener was removed.
  18526. EventEmitter.prototype.removeListener =
  18527. function removeListener(type, listener) {
  18528. var list, events, position, i, originalListener;
  18529. checkListener(listener);
  18530. events = this._events;
  18531. if (events === undefined)
  18532. return this;
  18533. list = events[type];
  18534. if (list === undefined)
  18535. return this;
  18536. if (list === listener || list.listener === listener) {
  18537. if (--this._eventsCount === 0)
  18538. this._events = Object.create(null);
  18539. else {
  18540. delete events[type];
  18541. if (events.removeListener)
  18542. this.emit('removeListener', type, list.listener || listener);
  18543. }
  18544. } else if (typeof list !== 'function') {
  18545. position = -1;
  18546. for (i = list.length - 1; i >= 0; i--) {
  18547. if (list[i] === listener || list[i].listener === listener) {
  18548. originalListener = list[i].listener;
  18549. position = i;
  18550. break;
  18551. }
  18552. }
  18553. if (position < 0)
  18554. return this;
  18555. if (position === 0)
  18556. list.shift();
  18557. else {
  18558. spliceOne(list, position);
  18559. }
  18560. if (list.length === 1)
  18561. events[type] = list[0];
  18562. if (events.removeListener !== undefined)
  18563. this.emit('removeListener', type, originalListener || listener);
  18564. }
  18565. return this;
  18566. };
  18567. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  18568. EventEmitter.prototype.removeAllListeners =
  18569. function removeAllListeners(type) {
  18570. var listeners, events, i;
  18571. events = this._events;
  18572. if (events === undefined)
  18573. return this;
  18574. // not listening for removeListener, no need to emit
  18575. if (events.removeListener === undefined) {
  18576. if (arguments.length === 0) {
  18577. this._events = Object.create(null);
  18578. this._eventsCount = 0;
  18579. } else if (events[type] !== undefined) {
  18580. if (--this._eventsCount === 0)
  18581. this._events = Object.create(null);
  18582. else
  18583. delete events[type];
  18584. }
  18585. return this;
  18586. }
  18587. // emit removeListener for all listeners on all events
  18588. if (arguments.length === 0) {
  18589. var keys = Object.keys(events);
  18590. var key;
  18591. for (i = 0; i < keys.length; ++i) {
  18592. key = keys[i];
  18593. if (key === 'removeListener') continue;
  18594. this.removeAllListeners(key);
  18595. }
  18596. this.removeAllListeners('removeListener');
  18597. this._events = Object.create(null);
  18598. this._eventsCount = 0;
  18599. return this;
  18600. }
  18601. listeners = events[type];
  18602. if (typeof listeners === 'function') {
  18603. this.removeListener(type, listeners);
  18604. } else if (listeners !== undefined) {
  18605. // LIFO order
  18606. for (i = listeners.length - 1; i >= 0; i--) {
  18607. this.removeListener(type, listeners[i]);
  18608. }
  18609. }
  18610. return this;
  18611. };
  18612. function _listeners(target, type, unwrap) {
  18613. var events = target._events;
  18614. if (events === undefined)
  18615. return [];
  18616. var evlistener = events[type];
  18617. if (evlistener === undefined)
  18618. return [];
  18619. if (typeof evlistener === 'function')
  18620. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  18621. return unwrap ?
  18622. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  18623. }
  18624. EventEmitter.prototype.listeners = function listeners(type) {
  18625. return _listeners(this, type, true);
  18626. };
  18627. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  18628. return _listeners(this, type, false);
  18629. };
  18630. EventEmitter.listenerCount = function(emitter, type) {
  18631. if (typeof emitter.listenerCount === 'function') {
  18632. return emitter.listenerCount(type);
  18633. } else {
  18634. return listenerCount.call(emitter, type);
  18635. }
  18636. };
  18637. EventEmitter.prototype.listenerCount = listenerCount;
  18638. function listenerCount(type) {
  18639. var events = this._events;
  18640. if (events !== undefined) {
  18641. var evlistener = events[type];
  18642. if (typeof evlistener === 'function') {
  18643. return 1;
  18644. } else if (evlistener !== undefined) {
  18645. return evlistener.length;
  18646. }
  18647. }
  18648. return 0;
  18649. }
  18650. EventEmitter.prototype.eventNames = function eventNames() {
  18651. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  18652. };
  18653. function arrayClone(arr, n) {
  18654. var copy = new Array(n);
  18655. for (var i = 0; i < n; ++i)
  18656. copy[i] = arr[i];
  18657. return copy;
  18658. }
  18659. function spliceOne(list, index) {
  18660. for (; index + 1 < list.length; index++)
  18661. list[index] = list[index + 1];
  18662. list.pop();
  18663. }
  18664. function unwrapListeners(arr) {
  18665. var ret = new Array(arr.length);
  18666. for (var i = 0; i < ret.length; ++i) {
  18667. ret[i] = arr[i].listener || arr[i];
  18668. }
  18669. return ret;
  18670. }
  18671. function once(emitter, name) {
  18672. return new Promise(function (resolve, reject) {
  18673. function errorListener(err) {
  18674. emitter.removeListener(name, resolver);
  18675. reject(err);
  18676. }
  18677. function resolver() {
  18678. if (typeof emitter.removeListener === 'function') {
  18679. emitter.removeListener('error', errorListener);
  18680. }
  18681. resolve([].slice.call(arguments));
  18682. };
  18683. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  18684. if (name !== 'error') {
  18685. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  18686. }
  18687. });
  18688. }
  18689. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  18690. if (typeof emitter.on === 'function') {
  18691. eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  18692. }
  18693. }
  18694. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  18695. if (typeof emitter.on === 'function') {
  18696. if (flags.once) {
  18697. emitter.once(name, listener);
  18698. } else {
  18699. emitter.on(name, listener);
  18700. }
  18701. } else if (typeof emitter.addEventListener === 'function') {
  18702. // EventTarget does not have `error` event semantics like Node
  18703. // EventEmitters, we do not listen for `error` events here.
  18704. emitter.addEventListener(name, function wrapListener(arg) {
  18705. // IE does not have builtin `{ once: true }` support so we
  18706. // have to do it manually.
  18707. if (flags.once) {
  18708. emitter.removeEventListener(name, wrapListener);
  18709. }
  18710. listener(arg);
  18711. });
  18712. } else {
  18713. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  18714. }
  18715. }
  18716. /***/ }),
  18717. /* 116 */
  18718. /*!*****************************************************************************!*\
  18719. !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  18720. \*****************************************************************************/
  18721. /*! no static exports found */
  18722. /***/ (function(module, exports, __webpack_require__) {
  18723. module.exports = __webpack_require__(/*! events */ 115).EventEmitter;
  18724. /***/ }),
  18725. /* 117 */
  18726. /*!***********************************************!*\
  18727. !*** ./node_modules/core-util-is/lib/util.js ***!
  18728. \***********************************************/
  18729. /*! no static exports found */
  18730. /***/ (function(module, exports, __webpack_require__) {
  18731. // Copyright Joyent, Inc. and other Node contributors.
  18732. //
  18733. // Permission is hereby granted, free of charge, to any person obtaining a
  18734. // copy of this software and associated documentation files (the
  18735. // "Software"), to deal in the Software without restriction, including
  18736. // without limitation the rights to use, copy, modify, merge, publish,
  18737. // distribute, sublicense, and/or sell copies of the Software, and to permit
  18738. // persons to whom the Software is furnished to do so, subject to the
  18739. // following conditions:
  18740. //
  18741. // The above copyright notice and this permission notice shall be included
  18742. // in all copies or substantial portions of the Software.
  18743. //
  18744. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18745. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18746. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  18747. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  18748. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  18749. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  18750. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  18751. // NOTE: These type checking functions intentionally don't use `instanceof`
  18752. // because it is fragile and can be easily faked with `Object.create()`.
  18753. function isArray(arg) {
  18754. if (Array.isArray) {
  18755. return Array.isArray(arg);
  18756. }
  18757. return objectToString(arg) === '[object Array]';
  18758. }
  18759. exports.isArray = isArray;
  18760. function isBoolean(arg) {
  18761. return typeof arg === 'boolean';
  18762. }
  18763. exports.isBoolean = isBoolean;
  18764. function isNull(arg) {
  18765. return arg === null;
  18766. }
  18767. exports.isNull = isNull;
  18768. function isNullOrUndefined(arg) {
  18769. return arg == null;
  18770. }
  18771. exports.isNullOrUndefined = isNullOrUndefined;
  18772. function isNumber(arg) {
  18773. return typeof arg === 'number';
  18774. }
  18775. exports.isNumber = isNumber;
  18776. function isString(arg) {
  18777. return typeof arg === 'string';
  18778. }
  18779. exports.isString = isString;
  18780. function isSymbol(arg) {
  18781. return typeof arg === 'symbol';
  18782. }
  18783. exports.isSymbol = isSymbol;
  18784. function isUndefined(arg) {
  18785. return arg === void 0;
  18786. }
  18787. exports.isUndefined = isUndefined;
  18788. function isRegExp(re) {
  18789. return objectToString(re) === '[object RegExp]';
  18790. }
  18791. exports.isRegExp = isRegExp;
  18792. function isObject(arg) {
  18793. return typeof arg === 'object' && arg !== null;
  18794. }
  18795. exports.isObject = isObject;
  18796. function isDate(d) {
  18797. return objectToString(d) === '[object Date]';
  18798. }
  18799. exports.isDate = isDate;
  18800. function isError(e) {
  18801. return (objectToString(e) === '[object Error]' || e instanceof Error);
  18802. }
  18803. exports.isError = isError;
  18804. function isFunction(arg) {
  18805. return typeof arg === 'function';
  18806. }
  18807. exports.isFunction = isFunction;
  18808. function isPrimitive(arg) {
  18809. return arg === null ||
  18810. typeof arg === 'boolean' ||
  18811. typeof arg === 'number' ||
  18812. typeof arg === 'string' ||
  18813. typeof arg === 'symbol' || // ES6 symbol
  18814. typeof arg === 'undefined';
  18815. }
  18816. exports.isPrimitive = isPrimitive;
  18817. exports.isBuffer = __webpack_require__(/*! buffer */ 104).Buffer.isBuffer;
  18818. function objectToString(o) {
  18819. return Object.prototype.toString.call(o);
  18820. }
  18821. /***/ }),
  18822. /* 118 */
  18823. /*!**********************!*\
  18824. !*** util (ignored) ***!
  18825. \**********************/
  18826. /*! no static exports found */
  18827. /***/ (function(module, exports) {
  18828. /* (ignored) */
  18829. /***/ }),
  18830. /* 119 */
  18831. /*!*************************************************************************!*\
  18832. !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
  18833. \*************************************************************************/
  18834. /*! no static exports found */
  18835. /***/ (function(module, exports, __webpack_require__) {
  18836. "use strict";
  18837. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18838. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer;
  18839. var util = __webpack_require__(/*! util */ 120);
  18840. function copyBuffer(src, target, offset) {
  18841. src.copy(target, offset);
  18842. }
  18843. module.exports = function () {
  18844. function BufferList() {
  18845. _classCallCheck(this, BufferList);
  18846. this.head = null;
  18847. this.tail = null;
  18848. this.length = 0;
  18849. }
  18850. BufferList.prototype.push = function push(v) {
  18851. var entry = { data: v, next: null };
  18852. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  18853. this.tail = entry;
  18854. ++this.length;
  18855. };
  18856. BufferList.prototype.unshift = function unshift(v) {
  18857. var entry = { data: v, next: this.head };
  18858. if (this.length === 0) this.tail = entry;
  18859. this.head = entry;
  18860. ++this.length;
  18861. };
  18862. BufferList.prototype.shift = function shift() {
  18863. if (this.length === 0) return;
  18864. var ret = this.head.data;
  18865. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  18866. --this.length;
  18867. return ret;
  18868. };
  18869. BufferList.prototype.clear = function clear() {
  18870. this.head = this.tail = null;
  18871. this.length = 0;
  18872. };
  18873. BufferList.prototype.join = function join(s) {
  18874. if (this.length === 0) return '';
  18875. var p = this.head;
  18876. var ret = '' + p.data;
  18877. while (p = p.next) {
  18878. ret += s + p.data;
  18879. }return ret;
  18880. };
  18881. BufferList.prototype.concat = function concat(n) {
  18882. if (this.length === 0) return Buffer.alloc(0);
  18883. if (this.length === 1) return this.head.data;
  18884. var ret = Buffer.allocUnsafe(n >>> 0);
  18885. var p = this.head;
  18886. var i = 0;
  18887. while (p) {
  18888. copyBuffer(p.data, ret, i);
  18889. i += p.data.length;
  18890. p = p.next;
  18891. }
  18892. return ret;
  18893. };
  18894. return BufferList;
  18895. }();
  18896. if (util && util.inspect && util.inspect.custom) {
  18897. module.exports.prototype[util.inspect.custom] = function () {
  18898. var obj = util.inspect({ length: this.length });
  18899. return this.constructor.name + ' ' + obj;
  18900. };
  18901. }
  18902. /***/ }),
  18903. /* 120 */
  18904. /*!**********************!*\
  18905. !*** util (ignored) ***!
  18906. \**********************/
  18907. /*! no static exports found */
  18908. /***/ (function(module, exports) {
  18909. /* (ignored) */
  18910. /***/ }),
  18911. /* 121 */
  18912. /*!**********************************************************************!*\
  18913. !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  18914. \**********************************************************************/
  18915. /*! no static exports found */
  18916. /***/ (function(module, exports, __webpack_require__) {
  18917. "use strict";
  18918. /*<replacement>*/
  18919. var pna = __webpack_require__(/*! process-nextick-args */ 114);
  18920. /*</replacement>*/
  18921. // undocumented cb() API, needed for core, not for public API
  18922. function destroy(err, cb) {
  18923. var _this = this;
  18924. var readableDestroyed = this._readableState && this._readableState.destroyed;
  18925. var writableDestroyed = this._writableState && this._writableState.destroyed;
  18926. if (readableDestroyed || writableDestroyed) {
  18927. if (cb) {
  18928. cb(err);
  18929. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  18930. pna.nextTick(emitErrorNT, this, err);
  18931. }
  18932. return this;
  18933. }
  18934. // we set destroyed to true before firing error callbacks in order
  18935. // to make it re-entrance safe in case destroy() is called within callbacks
  18936. if (this._readableState) {
  18937. this._readableState.destroyed = true;
  18938. }
  18939. // if this is a duplex stream mark the writable part as destroyed as well
  18940. if (this._writableState) {
  18941. this._writableState.destroyed = true;
  18942. }
  18943. this._destroy(err || null, function (err) {
  18944. if (!cb && err) {
  18945. pna.nextTick(emitErrorNT, _this, err);
  18946. if (_this._writableState) {
  18947. _this._writableState.errorEmitted = true;
  18948. }
  18949. } else if (cb) {
  18950. cb(err);
  18951. }
  18952. });
  18953. return this;
  18954. }
  18955. function undestroy() {
  18956. if (this._readableState) {
  18957. this._readableState.destroyed = false;
  18958. this._readableState.reading = false;
  18959. this._readableState.ended = false;
  18960. this._readableState.endEmitted = false;
  18961. }
  18962. if (this._writableState) {
  18963. this._writableState.destroyed = false;
  18964. this._writableState.ended = false;
  18965. this._writableState.ending = false;
  18966. this._writableState.finished = false;
  18967. this._writableState.errorEmitted = false;
  18968. }
  18969. }
  18970. function emitErrorNT(self, err) {
  18971. self.emit('error', err);
  18972. }
  18973. module.exports = {
  18974. destroy: destroy,
  18975. undestroy: undestroy
  18976. };
  18977. /***/ }),
  18978. /* 122 */
  18979. /*!************************************************************!*\
  18980. !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
  18981. \************************************************************/
  18982. /*! no static exports found */
  18983. /***/ (function(module, exports, __webpack_require__) {
  18984. "use strict";
  18985. // Copyright Joyent, Inc. and other Node contributors.
  18986. //
  18987. // Permission is hereby granted, free of charge, to any person obtaining a
  18988. // copy of this software and associated documentation files (the
  18989. // "Software"), to deal in the Software without restriction, including
  18990. // without limitation the rights to use, copy, modify, merge, publish,
  18991. // distribute, sublicense, and/or sell copies of the Software, and to permit
  18992. // persons to whom the Software is furnished to do so, subject to the
  18993. // following conditions:
  18994. //
  18995. // The above copyright notice and this permission notice shall be included
  18996. // in all copies or substantial portions of the Software.
  18997. //
  18998. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18999. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19000. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  19001. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  19002. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  19003. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  19004. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  19005. // a duplex stream is just a stream that is both readable and writable.
  19006. // Since JS doesn't have multiple prototypal inheritance, this class
  19007. // prototypally inherits from Readable, and then parasitically from
  19008. // Writable.
  19009. /*<replacement>*/
  19010. var pna = __webpack_require__(/*! process-nextick-args */ 114);
  19011. /*</replacement>*/
  19012. /*<replacement>*/
  19013. var objectKeys = Object.keys || function (obj) {
  19014. var keys = [];
  19015. for (var key in obj) {
  19016. keys.push(key);
  19017. }return keys;
  19018. };
  19019. /*</replacement>*/
  19020. module.exports = Duplex;
  19021. /*<replacement>*/
  19022. var util = Object.create(__webpack_require__(/*! core-util-is */ 117));
  19023. util.inherits = __webpack_require__(/*! inherits */ 109);
  19024. /*</replacement>*/
  19025. var Readable = __webpack_require__(/*! ./_stream_readable */ 113);
  19026. var Writable = __webpack_require__(/*! ./_stream_writable */ 123);
  19027. util.inherits(Duplex, Readable);
  19028. {
  19029. // avoid scope creep, the keys array can then be collected
  19030. var keys = objectKeys(Writable.prototype);
  19031. for (var v = 0; v < keys.length; v++) {
  19032. var method = keys[v];
  19033. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  19034. }
  19035. }
  19036. function Duplex(options) {
  19037. if (!(this instanceof Duplex)) return new Duplex(options);
  19038. Readable.call(this, options);
  19039. Writable.call(this, options);
  19040. if (options && options.readable === false) this.readable = false;
  19041. if (options && options.writable === false) this.writable = false;
  19042. this.allowHalfOpen = true;
  19043. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  19044. this.once('end', onend);
  19045. }
  19046. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  19047. // making it explicit this property is not enumerable
  19048. // because otherwise some prototype manipulation in
  19049. // userland will fail
  19050. enumerable: false,
  19051. get: function () {
  19052. return this._writableState.highWaterMark;
  19053. }
  19054. });
  19055. // the no-half-open enforcer
  19056. function onend() {
  19057. // if we allow half-open state, or if the writable side ended,
  19058. // then we're ok.
  19059. if (this.allowHalfOpen || this._writableState.ended) return;
  19060. // no more data can be written.
  19061. // But allow more writes to happen in this tick.
  19062. pna.nextTick(onEndNT, this);
  19063. }
  19064. function onEndNT(self) {
  19065. self.end();
  19066. }
  19067. Object.defineProperty(Duplex.prototype, 'destroyed', {
  19068. get: function () {
  19069. if (this._readableState === undefined || this._writableState === undefined) {
  19070. return false;
  19071. }
  19072. return this._readableState.destroyed && this._writableState.destroyed;
  19073. },
  19074. set: function (value) {
  19075. // we ignore the value if the stream
  19076. // has not been initialized yet
  19077. if (this._readableState === undefined || this._writableState === undefined) {
  19078. return;
  19079. }
  19080. // backward compatibility, the user is explicitly
  19081. // managing destroyed
  19082. this._readableState.destroyed = value;
  19083. this._writableState.destroyed = value;
  19084. }
  19085. });
  19086. Duplex.prototype._destroy = function (err, cb) {
  19087. this.push(null);
  19088. this.end();
  19089. pna.nextTick(cb, err);
  19090. };
  19091. /***/ }),
  19092. /* 123 */
  19093. /*!**************************************************************!*\
  19094. !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
  19095. \**************************************************************/
  19096. /*! no static exports found */
  19097. /***/ (function(module, exports, __webpack_require__) {
  19098. "use strict";
  19099. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  19100. //
  19101. // Permission is hereby granted, free of charge, to any person obtaining a
  19102. // copy of this software and associated documentation files (the
  19103. // "Software"), to deal in the Software without restriction, including
  19104. // without limitation the rights to use, copy, modify, merge, publish,
  19105. // distribute, sublicense, and/or sell copies of the Software, and to permit
  19106. // persons to whom the Software is furnished to do so, subject to the
  19107. // following conditions:
  19108. //
  19109. // The above copyright notice and this permission notice shall be included
  19110. // in all copies or substantial portions of the Software.
  19111. //
  19112. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19113. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19114. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  19115. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  19116. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  19117. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  19118. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  19119. // A bit simpler than readable streams.
  19120. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  19121. // the drain event emission and buffering.
  19122. /*<replacement>*/
  19123. var pna = __webpack_require__(/*! process-nextick-args */ 114);
  19124. /*</replacement>*/
  19125. module.exports = Writable;
  19126. /* <replacement> */
  19127. function WriteReq(chunk, encoding, cb) {
  19128. this.chunk = chunk;
  19129. this.encoding = encoding;
  19130. this.callback = cb;
  19131. this.next = null;
  19132. }
  19133. // It seems a linked list but it is not
  19134. // there will be only 2 of these for each stream
  19135. function CorkedRequest(state) {
  19136. var _this = this;
  19137. this.next = null;
  19138. this.entry = null;
  19139. this.finish = function () {
  19140. onCorkedFinish(_this, state);
  19141. };
  19142. }
  19143. /* </replacement> */
  19144. /*<replacement>*/
  19145. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  19146. /*</replacement>*/
  19147. /*<replacement>*/
  19148. var Duplex;
  19149. /*</replacement>*/
  19150. Writable.WritableState = WritableState;
  19151. /*<replacement>*/
  19152. var util = Object.create(__webpack_require__(/*! core-util-is */ 117));
  19153. util.inherits = __webpack_require__(/*! inherits */ 109);
  19154. /*</replacement>*/
  19155. /*<replacement>*/
  19156. var internalUtil = {
  19157. deprecate: __webpack_require__(/*! util-deprecate */ 124)
  19158. };
  19159. /*</replacement>*/
  19160. /*<replacement>*/
  19161. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 116);
  19162. /*</replacement>*/
  19163. /*<replacement>*/
  19164. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer;
  19165. var OurUint8Array = global.Uint8Array || function () {};
  19166. function _uint8ArrayToBuffer(chunk) {
  19167. return Buffer.from(chunk);
  19168. }
  19169. function _isUint8Array(obj) {
  19170. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  19171. }
  19172. /*</replacement>*/
  19173. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 121);
  19174. util.inherits(Writable, Stream);
  19175. function nop() {}
  19176. function WritableState(options, stream) {
  19177. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 122);
  19178. options = options || {};
  19179. // Duplex streams are both readable and writable, but share
  19180. // the same options object.
  19181. // However, some cases require setting options to different
  19182. // values for the readable and the writable sides of the duplex stream.
  19183. // These options can be provided separately as readableXXX and writableXXX.
  19184. var isDuplex = stream instanceof Duplex;
  19185. // object stream flag to indicate whether or not this stream
  19186. // contains buffers or objects.
  19187. this.objectMode = !!options.objectMode;
  19188. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  19189. // the point at which write() starts returning false
  19190. // Note: 0 is a valid value, means that we always return false if
  19191. // the entire buffer is not flushed immediately on write()
  19192. var hwm = options.highWaterMark;
  19193. var writableHwm = options.writableHighWaterMark;
  19194. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  19195. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  19196. // cast to ints.
  19197. this.highWaterMark = Math.floor(this.highWaterMark);
  19198. // if _final has been called
  19199. this.finalCalled = false;
  19200. // drain event flag.
  19201. this.needDrain = false;
  19202. // at the start of calling end()
  19203. this.ending = false;
  19204. // when end() has been called, and returned
  19205. this.ended = false;
  19206. // when 'finish' is emitted
  19207. this.finished = false;
  19208. // has it been destroyed
  19209. this.destroyed = false;
  19210. // should we decode strings into buffers before passing to _write?
  19211. // this is here so that some node-core streams can optimize string
  19212. // handling at a lower level.
  19213. var noDecode = options.decodeStrings === false;
  19214. this.decodeStrings = !noDecode;
  19215. // Crypto is kind of old and crusty. Historically, its default string
  19216. // encoding is 'binary' so we have to make this configurable.
  19217. // Everything else in the universe uses 'utf8', though.
  19218. this.defaultEncoding = options.defaultEncoding || 'utf8';
  19219. // not an actual buffer we keep track of, but a measurement
  19220. // of how much we're waiting to get pushed to some underlying
  19221. // socket or file.
  19222. this.length = 0;
  19223. // a flag to see when we're in the middle of a write.
  19224. this.writing = false;
  19225. // when true all writes will be buffered until .uncork() call
  19226. this.corked = 0;
  19227. // a flag to be able to tell if the onwrite cb is called immediately,
  19228. // or on a later tick. We set this to true at first, because any
  19229. // actions that shouldn't happen until "later" should generally also
  19230. // not happen before the first write call.
  19231. this.sync = true;
  19232. // a flag to know if we're processing previously buffered items, which
  19233. // may call the _write() callback in the same tick, so that we don't
  19234. // end up in an overlapped onwrite situation.
  19235. this.bufferProcessing = false;
  19236. // the callback that's passed to _write(chunk,cb)
  19237. this.onwrite = function (er) {
  19238. onwrite(stream, er);
  19239. };
  19240. // the callback that the user supplies to write(chunk,encoding,cb)
  19241. this.writecb = null;
  19242. // the amount that is being written when _write is called.
  19243. this.writelen = 0;
  19244. this.bufferedRequest = null;
  19245. this.lastBufferedRequest = null;
  19246. // number of pending user-supplied write callbacks
  19247. // this must be 0 before 'finish' can be emitted
  19248. this.pendingcb = 0;
  19249. // emit prefinish if the only thing we're waiting for is _write cbs
  19250. // This is relevant for synchronous Transform streams
  19251. this.prefinished = false;
  19252. // True if the error was already emitted and should not be thrown again
  19253. this.errorEmitted = false;
  19254. // count buffered requests
  19255. this.bufferedRequestCount = 0;
  19256. // allocate the first CorkedRequest, there is always
  19257. // one allocated and free to use, and we maintain at most two
  19258. this.corkedRequestsFree = new CorkedRequest(this);
  19259. }
  19260. WritableState.prototype.getBuffer = function getBuffer() {
  19261. var current = this.bufferedRequest;
  19262. var out = [];
  19263. while (current) {
  19264. out.push(current);
  19265. current = current.next;
  19266. }
  19267. return out;
  19268. };
  19269. (function () {
  19270. try {
  19271. Object.defineProperty(WritableState.prototype, 'buffer', {
  19272. get: internalUtil.deprecate(function () {
  19273. return this.getBuffer();
  19274. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  19275. });
  19276. } catch (_) {}
  19277. })();
  19278. // Test _writableState for inheritance to account for Duplex streams,
  19279. // whose prototype chain only points to Readable.
  19280. var realHasInstance;
  19281. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  19282. realHasInstance = Function.prototype[Symbol.hasInstance];
  19283. Object.defineProperty(Writable, Symbol.hasInstance, {
  19284. value: function (object) {
  19285. if (realHasInstance.call(this, object)) return true;
  19286. if (this !== Writable) return false;
  19287. return object && object._writableState instanceof WritableState;
  19288. }
  19289. });
  19290. } else {
  19291. realHasInstance = function (object) {
  19292. return object instanceof this;
  19293. };
  19294. }
  19295. function Writable(options) {
  19296. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 122);
  19297. // Writable ctor is applied to Duplexes, too.
  19298. // `realHasInstance` is necessary because using plain `instanceof`
  19299. // would return false, as no `_writableState` property is attached.
  19300. // Trying to use the custom `instanceof` for Writable here will also break the
  19301. // Node.js LazyTransform implementation, which has a non-trivial getter for
  19302. // `_writableState` that would lead to infinite recursion.
  19303. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  19304. return new Writable(options);
  19305. }
  19306. this._writableState = new WritableState(options, this);
  19307. // legacy.
  19308. this.writable = true;
  19309. if (options) {
  19310. if (typeof options.write === 'function') this._write = options.write;
  19311. if (typeof options.writev === 'function') this._writev = options.writev;
  19312. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  19313. if (typeof options.final === 'function') this._final = options.final;
  19314. }
  19315. Stream.call(this);
  19316. }
  19317. // Otherwise people can pipe Writable streams, which is just wrong.
  19318. Writable.prototype.pipe = function () {
  19319. this.emit('error', new Error('Cannot pipe, not readable'));
  19320. };
  19321. function writeAfterEnd(stream, cb) {
  19322. var er = new Error('write after end');
  19323. // TODO: defer error events consistently everywhere, not just the cb
  19324. stream.emit('error', er);
  19325. pna.nextTick(cb, er);
  19326. }
  19327. // Checks that a user-supplied chunk is valid, especially for the particular
  19328. // mode the stream is in. Currently this means that `null` is never accepted
  19329. // and undefined/non-string values are only allowed in object mode.
  19330. function validChunk(stream, state, chunk, cb) {
  19331. var valid = true;
  19332. var er = false;
  19333. if (chunk === null) {
  19334. er = new TypeError('May not write null values to stream');
  19335. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  19336. er = new TypeError('Invalid non-string/buffer chunk');
  19337. }
  19338. if (er) {
  19339. stream.emit('error', er);
  19340. pna.nextTick(cb, er);
  19341. valid = false;
  19342. }
  19343. return valid;
  19344. }
  19345. Writable.prototype.write = function (chunk, encoding, cb) {
  19346. var state = this._writableState;
  19347. var ret = false;
  19348. var isBuf = !state.objectMode && _isUint8Array(chunk);
  19349. if (isBuf && !Buffer.isBuffer(chunk)) {
  19350. chunk = _uint8ArrayToBuffer(chunk);
  19351. }
  19352. if (typeof encoding === 'function') {
  19353. cb = encoding;
  19354. encoding = null;
  19355. }
  19356. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  19357. if (typeof cb !== 'function') cb = nop;
  19358. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  19359. state.pendingcb++;
  19360. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  19361. }
  19362. return ret;
  19363. };
  19364. Writable.prototype.cork = function () {
  19365. var state = this._writableState;
  19366. state.corked++;
  19367. };
  19368. Writable.prototype.uncork = function () {
  19369. var state = this._writableState;
  19370. if (state.corked) {
  19371. state.corked--;
  19372. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  19373. }
  19374. };
  19375. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  19376. // node::ParseEncoding() requires lower case.
  19377. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  19378. 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);
  19379. this._writableState.defaultEncoding = encoding;
  19380. return this;
  19381. };
  19382. function decodeChunk(state, chunk, encoding) {
  19383. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  19384. chunk = Buffer.from(chunk, encoding);
  19385. }
  19386. return chunk;
  19387. }
  19388. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  19389. // making it explicit this property is not enumerable
  19390. // because otherwise some prototype manipulation in
  19391. // userland will fail
  19392. enumerable: false,
  19393. get: function () {
  19394. return this._writableState.highWaterMark;
  19395. }
  19396. });
  19397. // if we're already writing something, then just put this
  19398. // in the queue, and wait our turn. Otherwise, call _write
  19399. // If we return false, then we need a drain event, so set that flag.
  19400. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  19401. if (!isBuf) {
  19402. var newChunk = decodeChunk(state, chunk, encoding);
  19403. if (chunk !== newChunk) {
  19404. isBuf = true;
  19405. encoding = 'buffer';
  19406. chunk = newChunk;
  19407. }
  19408. }
  19409. var len = state.objectMode ? 1 : chunk.length;
  19410. state.length += len;
  19411. var ret = state.length < state.highWaterMark;
  19412. // we must ensure that previous needDrain will not be reset to false.
  19413. if (!ret) state.needDrain = true;
  19414. if (state.writing || state.corked) {
  19415. var last = state.lastBufferedRequest;
  19416. state.lastBufferedRequest = {
  19417. chunk: chunk,
  19418. encoding: encoding,
  19419. isBuf: isBuf,
  19420. callback: cb,
  19421. next: null
  19422. };
  19423. if (last) {
  19424. last.next = state.lastBufferedRequest;
  19425. } else {
  19426. state.bufferedRequest = state.lastBufferedRequest;
  19427. }
  19428. state.bufferedRequestCount += 1;
  19429. } else {
  19430. doWrite(stream, state, false, len, chunk, encoding, cb);
  19431. }
  19432. return ret;
  19433. }
  19434. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  19435. state.writelen = len;
  19436. state.writecb = cb;
  19437. state.writing = true;
  19438. state.sync = true;
  19439. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  19440. state.sync = false;
  19441. }
  19442. function onwriteError(stream, state, sync, er, cb) {
  19443. --state.pendingcb;
  19444. if (sync) {
  19445. // defer the callback if we are being called synchronously
  19446. // to avoid piling up things on the stack
  19447. pna.nextTick(cb, er);
  19448. // this can emit finish, and it will always happen
  19449. // after error
  19450. pna.nextTick(finishMaybe, stream, state);
  19451. stream._writableState.errorEmitted = true;
  19452. stream.emit('error', er);
  19453. } else {
  19454. // the caller expect this to happen before if
  19455. // it is async
  19456. cb(er);
  19457. stream._writableState.errorEmitted = true;
  19458. stream.emit('error', er);
  19459. // this can emit finish, but finish must
  19460. // always follow error
  19461. finishMaybe(stream, state);
  19462. }
  19463. }
  19464. function onwriteStateUpdate(state) {
  19465. state.writing = false;
  19466. state.writecb = null;
  19467. state.length -= state.writelen;
  19468. state.writelen = 0;
  19469. }
  19470. function onwrite(stream, er) {
  19471. var state = stream._writableState;
  19472. var sync = state.sync;
  19473. var cb = state.writecb;
  19474. onwriteStateUpdate(state);
  19475. if (er) onwriteError(stream, state, sync, er, cb);else {
  19476. // Check if we're actually ready to finish, but don't emit yet
  19477. var finished = needFinish(state);
  19478. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  19479. clearBuffer(stream, state);
  19480. }
  19481. if (sync) {
  19482. /*<replacement>*/
  19483. asyncWrite(afterWrite, stream, state, finished, cb);
  19484. /*</replacement>*/
  19485. } else {
  19486. afterWrite(stream, state, finished, cb);
  19487. }
  19488. }
  19489. }
  19490. function afterWrite(stream, state, finished, cb) {
  19491. if (!finished) onwriteDrain(stream, state);
  19492. state.pendingcb--;
  19493. cb();
  19494. finishMaybe(stream, state);
  19495. }
  19496. // Must force callback to be called on nextTick, so that we don't
  19497. // emit 'drain' before the write() consumer gets the 'false' return
  19498. // value, and has a chance to attach a 'drain' listener.
  19499. function onwriteDrain(stream, state) {
  19500. if (state.length === 0 && state.needDrain) {
  19501. state.needDrain = false;
  19502. stream.emit('drain');
  19503. }
  19504. }
  19505. // if there's something in the buffer waiting, then process it
  19506. function clearBuffer(stream, state) {
  19507. state.bufferProcessing = true;
  19508. var entry = state.bufferedRequest;
  19509. if (stream._writev && entry && entry.next) {
  19510. // Fast case, write everything using _writev()
  19511. var l = state.bufferedRequestCount;
  19512. var buffer = new Array(l);
  19513. var holder = state.corkedRequestsFree;
  19514. holder.entry = entry;
  19515. var count = 0;
  19516. var allBuffers = true;
  19517. while (entry) {
  19518. buffer[count] = entry;
  19519. if (!entry.isBuf) allBuffers = false;
  19520. entry = entry.next;
  19521. count += 1;
  19522. }
  19523. buffer.allBuffers = allBuffers;
  19524. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  19525. // doWrite is almost always async, defer these to save a bit of time
  19526. // as the hot path ends with doWrite
  19527. state.pendingcb++;
  19528. state.lastBufferedRequest = null;
  19529. if (holder.next) {
  19530. state.corkedRequestsFree = holder.next;
  19531. holder.next = null;
  19532. } else {
  19533. state.corkedRequestsFree = new CorkedRequest(state);
  19534. }
  19535. state.bufferedRequestCount = 0;
  19536. } else {
  19537. // Slow case, write chunks one-by-one
  19538. while (entry) {
  19539. var chunk = entry.chunk;
  19540. var encoding = entry.encoding;
  19541. var cb = entry.callback;
  19542. var len = state.objectMode ? 1 : chunk.length;
  19543. doWrite(stream, state, false, len, chunk, encoding, cb);
  19544. entry = entry.next;
  19545. state.bufferedRequestCount--;
  19546. // if we didn't call the onwrite immediately, then
  19547. // it means that we need to wait until it does.
  19548. // also, that means that the chunk and cb are currently
  19549. // being processed, so move the buffer counter past them.
  19550. if (state.writing) {
  19551. break;
  19552. }
  19553. }
  19554. if (entry === null) state.lastBufferedRequest = null;
  19555. }
  19556. state.bufferedRequest = entry;
  19557. state.bufferProcessing = false;
  19558. }
  19559. Writable.prototype._write = function (chunk, encoding, cb) {
  19560. cb(new Error('_write() is not implemented'));
  19561. };
  19562. Writable.prototype._writev = null;
  19563. Writable.prototype.end = function (chunk, encoding, cb) {
  19564. var state = this._writableState;
  19565. if (typeof chunk === 'function') {
  19566. cb = chunk;
  19567. chunk = null;
  19568. encoding = null;
  19569. } else if (typeof encoding === 'function') {
  19570. cb = encoding;
  19571. encoding = null;
  19572. }
  19573. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  19574. // .end() fully uncorks
  19575. if (state.corked) {
  19576. state.corked = 1;
  19577. this.uncork();
  19578. }
  19579. // ignore unnecessary end() calls.
  19580. if (!state.ending && !state.finished) endWritable(this, state, cb);
  19581. };
  19582. function needFinish(state) {
  19583. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  19584. }
  19585. function callFinal(stream, state) {
  19586. stream._final(function (err) {
  19587. state.pendingcb--;
  19588. if (err) {
  19589. stream.emit('error', err);
  19590. }
  19591. state.prefinished = true;
  19592. stream.emit('prefinish');
  19593. finishMaybe(stream, state);
  19594. });
  19595. }
  19596. function prefinish(stream, state) {
  19597. if (!state.prefinished && !state.finalCalled) {
  19598. if (typeof stream._final === 'function') {
  19599. state.pendingcb++;
  19600. state.finalCalled = true;
  19601. pna.nextTick(callFinal, stream, state);
  19602. } else {
  19603. state.prefinished = true;
  19604. stream.emit('prefinish');
  19605. }
  19606. }
  19607. }
  19608. function finishMaybe(stream, state) {
  19609. var need = needFinish(state);
  19610. if (need) {
  19611. prefinish(stream, state);
  19612. if (state.pendingcb === 0) {
  19613. state.finished = true;
  19614. stream.emit('finish');
  19615. }
  19616. }
  19617. return need;
  19618. }
  19619. function endWritable(stream, state, cb) {
  19620. state.ending = true;
  19621. finishMaybe(stream, state);
  19622. if (cb) {
  19623. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  19624. }
  19625. state.ended = true;
  19626. stream.writable = false;
  19627. }
  19628. function onCorkedFinish(corkReq, state, err) {
  19629. var entry = corkReq.entry;
  19630. corkReq.entry = null;
  19631. while (entry) {
  19632. var cb = entry.callback;
  19633. state.pendingcb--;
  19634. cb(err);
  19635. entry = entry.next;
  19636. }
  19637. if (state.corkedRequestsFree) {
  19638. state.corkedRequestsFree.next = corkReq;
  19639. } else {
  19640. state.corkedRequestsFree = corkReq;
  19641. }
  19642. }
  19643. Object.defineProperty(Writable.prototype, 'destroyed', {
  19644. get: function () {
  19645. if (this._writableState === undefined) {
  19646. return false;
  19647. }
  19648. return this._writableState.destroyed;
  19649. },
  19650. set: function (value) {
  19651. // we ignore the value if the stream
  19652. // has not been initialized yet
  19653. if (!this._writableState) {
  19654. return;
  19655. }
  19656. // backward compatibility, the user is explicitly
  19657. // managing destroyed
  19658. this._writableState.destroyed = value;
  19659. }
  19660. });
  19661. Writable.prototype.destroy = destroyImpl.destroy;
  19662. Writable.prototype._undestroy = destroyImpl.undestroy;
  19663. Writable.prototype._destroy = function (err, cb) {
  19664. this.end();
  19665. cb(err);
  19666. };
  19667. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 101), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  19668. /***/ }),
  19669. /* 124 */
  19670. /*!************************************************!*\
  19671. !*** ./node_modules/util-deprecate/browser.js ***!
  19672. \************************************************/
  19673. /*! no static exports found */
  19674. /***/ (function(module, exports, __webpack_require__) {
  19675. /* WEBPACK VAR INJECTION */(function(global) {
  19676. /**
  19677. * Module exports.
  19678. */
  19679. module.exports = deprecate;
  19680. /**
  19681. * Mark that a method should not be used.
  19682. * Returns a modified function which warns once by default.
  19683. *
  19684. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  19685. *
  19686. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  19687. * will throw an Error when invoked.
  19688. *
  19689. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  19690. * will invoke `console.trace()` instead of `console.error()`.
  19691. *
  19692. * @param {Function} fn - the function to deprecate
  19693. * @param {String} msg - the string to print to the console when `fn` is invoked
  19694. * @returns {Function} a new "deprecated" version of `fn`
  19695. * @api public
  19696. */
  19697. function deprecate (fn, msg) {
  19698. if (config('noDeprecation')) {
  19699. return fn;
  19700. }
  19701. var warned = false;
  19702. function deprecated() {
  19703. if (!warned) {
  19704. if (config('throwDeprecation')) {
  19705. throw new Error(msg);
  19706. } else if (config('traceDeprecation')) {
  19707. console.trace(msg);
  19708. } else {
  19709. console.warn(msg);
  19710. }
  19711. warned = true;
  19712. }
  19713. return fn.apply(this, arguments);
  19714. }
  19715. return deprecated;
  19716. }
  19717. /**
  19718. * Checks `localStorage` for boolean values for the given `name`.
  19719. *
  19720. * @param {String} name
  19721. * @returns {Boolean}
  19722. * @api private
  19723. */
  19724. function config (name) {
  19725. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  19726. try {
  19727. if (!global.localStorage) return false;
  19728. } catch (_) {
  19729. return false;
  19730. }
  19731. var val = global.localStorage[name];
  19732. if (null == val) return false;
  19733. return String(val).toLowerCase() === 'true';
  19734. }
  19735. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
  19736. /***/ }),
  19737. /* 125 */
  19738. /*!***********************************************************!*\
  19739. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  19740. \***********************************************************/
  19741. /*! no static exports found */
  19742. /***/ (function(module, exports, __webpack_require__) {
  19743. "use strict";
  19744. // Copyright Joyent, Inc. and other Node contributors.
  19745. //
  19746. // Permission is hereby granted, free of charge, to any person obtaining a
  19747. // copy of this software and associated documentation files (the
  19748. // "Software"), to deal in the Software without restriction, including
  19749. // without limitation the rights to use, copy, modify, merge, publish,
  19750. // distribute, sublicense, and/or sell copies of the Software, and to permit
  19751. // persons to whom the Software is furnished to do so, subject to the
  19752. // following conditions:
  19753. //
  19754. // The above copyright notice and this permission notice shall be included
  19755. // in all copies or substantial portions of the Software.
  19756. //
  19757. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19758. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19759. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  19760. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  19761. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  19762. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  19763. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  19764. /*<replacement>*/
  19765. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer;
  19766. /*</replacement>*/
  19767. var isEncoding = Buffer.isEncoding || function (encoding) {
  19768. encoding = '' + encoding;
  19769. switch (encoding && encoding.toLowerCase()) {
  19770. 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':
  19771. return true;
  19772. default:
  19773. return false;
  19774. }
  19775. };
  19776. function _normalizeEncoding(enc) {
  19777. if (!enc) return 'utf8';
  19778. var retried;
  19779. while (true) {
  19780. switch (enc) {
  19781. case 'utf8':
  19782. case 'utf-8':
  19783. return 'utf8';
  19784. case 'ucs2':
  19785. case 'ucs-2':
  19786. case 'utf16le':
  19787. case 'utf-16le':
  19788. return 'utf16le';
  19789. case 'latin1':
  19790. case 'binary':
  19791. return 'latin1';
  19792. case 'base64':
  19793. case 'ascii':
  19794. case 'hex':
  19795. return enc;
  19796. default:
  19797. if (retried) return; // undefined
  19798. enc = ('' + enc).toLowerCase();
  19799. retried = true;
  19800. }
  19801. }
  19802. };
  19803. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  19804. // modules monkey-patch it to support additional encodings
  19805. function normalizeEncoding(enc) {
  19806. var nenc = _normalizeEncoding(enc);
  19807. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  19808. return nenc || enc;
  19809. }
  19810. // StringDecoder provides an interface for efficiently splitting a series of
  19811. // buffers into a series of JS strings without breaking apart multi-byte
  19812. // characters.
  19813. exports.StringDecoder = StringDecoder;
  19814. function StringDecoder(encoding) {
  19815. this.encoding = normalizeEncoding(encoding);
  19816. var nb;
  19817. switch (this.encoding) {
  19818. case 'utf16le':
  19819. this.text = utf16Text;
  19820. this.end = utf16End;
  19821. nb = 4;
  19822. break;
  19823. case 'utf8':
  19824. this.fillLast = utf8FillLast;
  19825. nb = 4;
  19826. break;
  19827. case 'base64':
  19828. this.text = base64Text;
  19829. this.end = base64End;
  19830. nb = 3;
  19831. break;
  19832. default:
  19833. this.write = simpleWrite;
  19834. this.end = simpleEnd;
  19835. return;
  19836. }
  19837. this.lastNeed = 0;
  19838. this.lastTotal = 0;
  19839. this.lastChar = Buffer.allocUnsafe(nb);
  19840. }
  19841. StringDecoder.prototype.write = function (buf) {
  19842. if (buf.length === 0) return '';
  19843. var r;
  19844. var i;
  19845. if (this.lastNeed) {
  19846. r = this.fillLast(buf);
  19847. if (r === undefined) return '';
  19848. i = this.lastNeed;
  19849. this.lastNeed = 0;
  19850. } else {
  19851. i = 0;
  19852. }
  19853. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  19854. return r || '';
  19855. };
  19856. StringDecoder.prototype.end = utf8End;
  19857. // Returns only complete characters in a Buffer
  19858. StringDecoder.prototype.text = utf8Text;
  19859. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  19860. StringDecoder.prototype.fillLast = function (buf) {
  19861. if (this.lastNeed <= buf.length) {
  19862. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  19863. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  19864. }
  19865. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  19866. this.lastNeed -= buf.length;
  19867. };
  19868. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  19869. // continuation byte. If an invalid byte is detected, -2 is returned.
  19870. function utf8CheckByte(byte) {
  19871. 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;
  19872. return byte >> 6 === 0x02 ? -1 : -2;
  19873. }
  19874. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  19875. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  19876. // needed to complete the UTF-8 character (if applicable) are returned.
  19877. function utf8CheckIncomplete(self, buf, i) {
  19878. var j = buf.length - 1;
  19879. if (j < i) return 0;
  19880. var nb = utf8CheckByte(buf[j]);
  19881. if (nb >= 0) {
  19882. if (nb > 0) self.lastNeed = nb - 1;
  19883. return nb;
  19884. }
  19885. if (--j < i || nb === -2) return 0;
  19886. nb = utf8CheckByte(buf[j]);
  19887. if (nb >= 0) {
  19888. if (nb > 0) self.lastNeed = nb - 2;
  19889. return nb;
  19890. }
  19891. if (--j < i || nb === -2) return 0;
  19892. nb = utf8CheckByte(buf[j]);
  19893. if (nb >= 0) {
  19894. if (nb > 0) {
  19895. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  19896. }
  19897. return nb;
  19898. }
  19899. return 0;
  19900. }
  19901. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  19902. // needed or are available. If we see a non-continuation byte where we expect
  19903. // one, we "replace" the validated continuation bytes we've seen so far with
  19904. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  19905. // behavior. The continuation byte check is included three times in the case
  19906. // where all of the continuation bytes for a character exist in the same buffer.
  19907. // It is also done this way as a slight performance increase instead of using a
  19908. // loop.
  19909. function utf8CheckExtraBytes(self, buf, p) {
  19910. if ((buf[0] & 0xC0) !== 0x80) {
  19911. self.lastNeed = 0;
  19912. return '\ufffd';
  19913. }
  19914. if (self.lastNeed > 1 && buf.length > 1) {
  19915. if ((buf[1] & 0xC0) !== 0x80) {
  19916. self.lastNeed = 1;
  19917. return '\ufffd';
  19918. }
  19919. if (self.lastNeed > 2 && buf.length > 2) {
  19920. if ((buf[2] & 0xC0) !== 0x80) {
  19921. self.lastNeed = 2;
  19922. return '\ufffd';
  19923. }
  19924. }
  19925. }
  19926. }
  19927. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  19928. function utf8FillLast(buf) {
  19929. var p = this.lastTotal - this.lastNeed;
  19930. var r = utf8CheckExtraBytes(this, buf, p);
  19931. if (r !== undefined) return r;
  19932. if (this.lastNeed <= buf.length) {
  19933. buf.copy(this.lastChar, p, 0, this.lastNeed);
  19934. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  19935. }
  19936. buf.copy(this.lastChar, p, 0, buf.length);
  19937. this.lastNeed -= buf.length;
  19938. }
  19939. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  19940. // partial character, the character's bytes are buffered until the required
  19941. // number of bytes are available.
  19942. function utf8Text(buf, i) {
  19943. var total = utf8CheckIncomplete(this, buf, i);
  19944. if (!this.lastNeed) return buf.toString('utf8', i);
  19945. this.lastTotal = total;
  19946. var end = buf.length - (total - this.lastNeed);
  19947. buf.copy(this.lastChar, 0, end);
  19948. return buf.toString('utf8', i, end);
  19949. }
  19950. // For UTF-8, a replacement character is added when ending on a partial
  19951. // character.
  19952. function utf8End(buf) {
  19953. var r = buf && buf.length ? this.write(buf) : '';
  19954. if (this.lastNeed) return r + '\ufffd';
  19955. return r;
  19956. }
  19957. // UTF-16LE typically needs two bytes per character, but even if we have an even
  19958. // number of bytes available, we need to check if we end on a leading/high
  19959. // surrogate. In that case, we need to wait for the next two bytes in order to
  19960. // decode the last character properly.
  19961. function utf16Text(buf, i) {
  19962. if ((buf.length - i) % 2 === 0) {
  19963. var r = buf.toString('utf16le', i);
  19964. if (r) {
  19965. var c = r.charCodeAt(r.length - 1);
  19966. if (c >= 0xD800 && c <= 0xDBFF) {
  19967. this.lastNeed = 2;
  19968. this.lastTotal = 4;
  19969. this.lastChar[0] = buf[buf.length - 2];
  19970. this.lastChar[1] = buf[buf.length - 1];
  19971. return r.slice(0, -1);
  19972. }
  19973. }
  19974. return r;
  19975. }
  19976. this.lastNeed = 1;
  19977. this.lastTotal = 2;
  19978. this.lastChar[0] = buf[buf.length - 1];
  19979. return buf.toString('utf16le', i, buf.length - 1);
  19980. }
  19981. // For UTF-16LE we do not explicitly append special replacement characters if we
  19982. // end on a partial character, we simply let v8 handle that.
  19983. function utf16End(buf) {
  19984. var r = buf && buf.length ? this.write(buf) : '';
  19985. if (this.lastNeed) {
  19986. var end = this.lastTotal - this.lastNeed;
  19987. return r + this.lastChar.toString('utf16le', 0, end);
  19988. }
  19989. return r;
  19990. }
  19991. function base64Text(buf, i) {
  19992. var n = (buf.length - i) % 3;
  19993. if (n === 0) return buf.toString('base64', i);
  19994. this.lastNeed = 3 - n;
  19995. this.lastTotal = 3;
  19996. if (n === 1) {
  19997. this.lastChar[0] = buf[buf.length - 1];
  19998. } else {
  19999. this.lastChar[0] = buf[buf.length - 2];
  20000. this.lastChar[1] = buf[buf.length - 1];
  20001. }
  20002. return buf.toString('base64', i, buf.length - n);
  20003. }
  20004. function base64End(buf) {
  20005. var r = buf && buf.length ? this.write(buf) : '';
  20006. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  20007. return r;
  20008. }
  20009. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  20010. function simpleWrite(buf) {
  20011. return buf.toString(this.encoding);
  20012. }
  20013. function simpleEnd(buf) {
  20014. return buf && buf.length ? this.write(buf) : '';
  20015. }
  20016. /***/ }),
  20017. /* 126 */
  20018. /*!***************************************************************!*\
  20019. !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
  20020. \***************************************************************/
  20021. /*! no static exports found */
  20022. /***/ (function(module, exports, __webpack_require__) {
  20023. "use strict";
  20024. // Copyright Joyent, Inc. and other Node contributors.
  20025. //
  20026. // Permission is hereby granted, free of charge, to any person obtaining a
  20027. // copy of this software and associated documentation files (the
  20028. // "Software"), to deal in the Software without restriction, including
  20029. // without limitation the rights to use, copy, modify, merge, publish,
  20030. // distribute, sublicense, and/or sell copies of the Software, and to permit
  20031. // persons to whom the Software is furnished to do so, subject to the
  20032. // following conditions:
  20033. //
  20034. // The above copyright notice and this permission notice shall be included
  20035. // in all copies or substantial portions of the Software.
  20036. //
  20037. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20038. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20039. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  20040. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  20041. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20042. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20043. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  20044. // a transform stream is a readable/writable stream where you do
  20045. // something with the data. Sometimes it's called a "filter",
  20046. // but that's not a great name for it, since that implies a thing where
  20047. // some bits pass through, and others are simply ignored. (That would
  20048. // be a valid example of a transform, of course.)
  20049. //
  20050. // While the output is causally related to the input, it's not a
  20051. // necessarily symmetric or synchronous transformation. For example,
  20052. // a zlib stream might take multiple plain-text writes(), and then
  20053. // emit a single compressed chunk some time in the future.
  20054. //
  20055. // Here's how this works:
  20056. //
  20057. // The Transform stream has all the aspects of the readable and writable
  20058. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  20059. // internally, and returns false if there's a lot of pending writes
  20060. // buffered up. When you call read(), that calls _read(n) until
  20061. // there's enough pending readable data buffered up.
  20062. //
  20063. // In a transform stream, the written data is placed in a buffer. When
  20064. // _read(n) is called, it transforms the queued up data, calling the
  20065. // buffered _write cb's as it consumes chunks. If consuming a single
  20066. // written chunk would result in multiple output chunks, then the first
  20067. // outputted bit calls the readcb, and subsequent chunks just go into
  20068. // the read buffer, and will cause it to emit 'readable' if necessary.
  20069. //
  20070. // This way, back-pressure is actually determined by the reading side,
  20071. // since _read has to be called to start processing a new chunk. However,
  20072. // a pathological inflate type of transform can cause excessive buffering
  20073. // here. For example, imagine a stream where every byte of input is
  20074. // interpreted as an integer from 0-255, and then results in that many
  20075. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  20076. // 1kb of data being output. In this case, you could write a very small
  20077. // amount of input, and end up with a very large amount of output. In
  20078. // such a pathological inflating mechanism, there'd be no way to tell
  20079. // the system to stop doing the transform. A single 4MB write could
  20080. // cause the system to run out of memory.
  20081. //
  20082. // However, even in such a pathological case, only a single written chunk
  20083. // would be consumed, and then the rest would wait (un-transformed) until
  20084. // the results of the previous transformed chunk were consumed.
  20085. module.exports = Transform;
  20086. var Duplex = __webpack_require__(/*! ./_stream_duplex */ 122);
  20087. /*<replacement>*/
  20088. var util = Object.create(__webpack_require__(/*! core-util-is */ 117));
  20089. util.inherits = __webpack_require__(/*! inherits */ 109);
  20090. /*</replacement>*/
  20091. util.inherits(Transform, Duplex);
  20092. function afterTransform(er, data) {
  20093. var ts = this._transformState;
  20094. ts.transforming = false;
  20095. var cb = ts.writecb;
  20096. if (!cb) {
  20097. return this.emit('error', new Error('write callback called multiple times'));
  20098. }
  20099. ts.writechunk = null;
  20100. ts.writecb = null;
  20101. if (data != null) // single equals check for both `null` and `undefined`
  20102. this.push(data);
  20103. cb(er);
  20104. var rs = this._readableState;
  20105. rs.reading = false;
  20106. if (rs.needReadable || rs.length < rs.highWaterMark) {
  20107. this._read(rs.highWaterMark);
  20108. }
  20109. }
  20110. function Transform(options) {
  20111. if (!(this instanceof Transform)) return new Transform(options);
  20112. Duplex.call(this, options);
  20113. this._transformState = {
  20114. afterTransform: afterTransform.bind(this),
  20115. needTransform: false,
  20116. transforming: false,
  20117. writecb: null,
  20118. writechunk: null,
  20119. writeencoding: null
  20120. };
  20121. // start out asking for a readable event once data is transformed.
  20122. this._readableState.needReadable = true;
  20123. // we have implemented the _read method, and done the other things
  20124. // that Readable wants before the first _read call, so unset the
  20125. // sync guard flag.
  20126. this._readableState.sync = false;
  20127. if (options) {
  20128. if (typeof options.transform === 'function') this._transform = options.transform;
  20129. if (typeof options.flush === 'function') this._flush = options.flush;
  20130. }
  20131. // When the writable side finishes, then flush out anything remaining.
  20132. this.on('prefinish', prefinish);
  20133. }
  20134. function prefinish() {
  20135. var _this = this;
  20136. if (typeof this._flush === 'function') {
  20137. this._flush(function (er, data) {
  20138. done(_this, er, data);
  20139. });
  20140. } else {
  20141. done(this, null, null);
  20142. }
  20143. }
  20144. Transform.prototype.push = function (chunk, encoding) {
  20145. this._transformState.needTransform = false;
  20146. return Duplex.prototype.push.call(this, chunk, encoding);
  20147. };
  20148. // This is the part where you do stuff!
  20149. // override this function in implementation classes.
  20150. // 'chunk' is an input chunk.
  20151. //
  20152. // Call `push(newChunk)` to pass along transformed output
  20153. // to the readable side. You may call 'push' zero or more times.
  20154. //
  20155. // Call `cb(err)` when you are done with this chunk. If you pass
  20156. // an error, then that'll put the hurt on the whole operation. If you
  20157. // never call cb(), then you'll never get another chunk.
  20158. Transform.prototype._transform = function (chunk, encoding, cb) {
  20159. throw new Error('_transform() is not implemented');
  20160. };
  20161. Transform.prototype._write = function (chunk, encoding, cb) {
  20162. var ts = this._transformState;
  20163. ts.writecb = cb;
  20164. ts.writechunk = chunk;
  20165. ts.writeencoding = encoding;
  20166. if (!ts.transforming) {
  20167. var rs = this._readableState;
  20168. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  20169. }
  20170. };
  20171. // Doesn't matter what the args are here.
  20172. // _transform does all the work.
  20173. // That we got here means that the readable side wants more data.
  20174. Transform.prototype._read = function (n) {
  20175. var ts = this._transformState;
  20176. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  20177. ts.transforming = true;
  20178. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  20179. } else {
  20180. // mark that we need a transform, so that any data that comes in
  20181. // will get processed, now that we've asked for it.
  20182. ts.needTransform = true;
  20183. }
  20184. };
  20185. Transform.prototype._destroy = function (err, cb) {
  20186. var _this2 = this;
  20187. Duplex.prototype._destroy.call(this, err, function (err2) {
  20188. cb(err2);
  20189. _this2.emit('close');
  20190. });
  20191. };
  20192. function done(stream, er, data) {
  20193. if (er) return stream.emit('error', er);
  20194. if (data != null) // single equals check for both `null` and `undefined`
  20195. stream.push(data);
  20196. // if there's nothing in the write buffer, then that means
  20197. // that nothing more will ever be provided
  20198. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  20199. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  20200. return stream.push(null);
  20201. }
  20202. /***/ }),
  20203. /* 127 */
  20204. /*!*****************************************************************!*\
  20205. !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
  20206. \*****************************************************************/
  20207. /*! no static exports found */
  20208. /***/ (function(module, exports, __webpack_require__) {
  20209. "use strict";
  20210. // Copyright Joyent, Inc. and other Node contributors.
  20211. //
  20212. // Permission is hereby granted, free of charge, to any person obtaining a
  20213. // copy of this software and associated documentation files (the
  20214. // "Software"), to deal in the Software without restriction, including
  20215. // without limitation the rights to use, copy, modify, merge, publish,
  20216. // distribute, sublicense, and/or sell copies of the Software, and to permit
  20217. // persons to whom the Software is furnished to do so, subject to the
  20218. // following conditions:
  20219. //
  20220. // The above copyright notice and this permission notice shall be included
  20221. // in all copies or substantial portions of the Software.
  20222. //
  20223. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20224. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20225. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  20226. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  20227. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20228. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20229. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  20230. // a passthrough stream.
  20231. // basically just the most minimal sort of Transform stream.
  20232. // Every written chunk gets output as-is.
  20233. module.exports = PassThrough;
  20234. var Transform = __webpack_require__(/*! ./_stream_transform */ 126);
  20235. /*<replacement>*/
  20236. var util = Object.create(__webpack_require__(/*! core-util-is */ 117));
  20237. util.inherits = __webpack_require__(/*! inherits */ 109);
  20238. /*</replacement>*/
  20239. util.inherits(PassThrough, Transform);
  20240. function PassThrough(options) {
  20241. if (!(this instanceof PassThrough)) return new PassThrough(options);
  20242. Transform.call(this, options);
  20243. }
  20244. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  20245. cb(null, chunk);
  20246. };
  20247. /***/ }),
  20248. /* 128 */
  20249. /*!*****************************************!*\
  20250. !*** ./node_modules/ripemd160/index.js ***!
  20251. \*****************************************/
  20252. /*! no static exports found */
  20253. /***/ (function(module, exports, __webpack_require__) {
  20254. "use strict";
  20255. var Buffer = __webpack_require__(/*! buffer */ 104).Buffer
  20256. var inherits = __webpack_require__(/*! inherits */ 109)
  20257. var HashBase = __webpack_require__(/*! hash-base */ 111)
  20258. var ARRAY16 = new Array(16)
  20259. var zl = [
  20260. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  20261. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  20262. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  20263. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  20264. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  20265. ]
  20266. var zr = [
  20267. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  20268. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  20269. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  20270. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  20271. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  20272. ]
  20273. var sl = [
  20274. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  20275. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  20276. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  20277. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  20278. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  20279. ]
  20280. var sr = [
  20281. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  20282. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  20283. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  20284. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  20285. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  20286. ]
  20287. var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
  20288. var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
  20289. function RIPEMD160 () {
  20290. HashBase.call(this, 64)
  20291. // state
  20292. this._a = 0x67452301
  20293. this._b = 0xefcdab89
  20294. this._c = 0x98badcfe
  20295. this._d = 0x10325476
  20296. this._e = 0xc3d2e1f0
  20297. }
  20298. inherits(RIPEMD160, HashBase)
  20299. RIPEMD160.prototype._update = function () {
  20300. var words = ARRAY16
  20301. for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
  20302. var al = this._a | 0
  20303. var bl = this._b | 0
  20304. var cl = this._c | 0
  20305. var dl = this._d | 0
  20306. var el = this._e | 0
  20307. var ar = this._a | 0
  20308. var br = this._b | 0
  20309. var cr = this._c | 0
  20310. var dr = this._d | 0
  20311. var er = this._e | 0
  20312. // computation
  20313. for (var i = 0; i < 80; i += 1) {
  20314. var tl
  20315. var tr
  20316. if (i < 16) {
  20317. tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
  20318. tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
  20319. } else if (i < 32) {
  20320. tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
  20321. tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
  20322. } else if (i < 48) {
  20323. tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
  20324. tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
  20325. } else if (i < 64) {
  20326. tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
  20327. tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
  20328. } else { // if (i<80) {
  20329. tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
  20330. tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])
  20331. }
  20332. al = el
  20333. el = dl
  20334. dl = rotl(cl, 10)
  20335. cl = bl
  20336. bl = tl
  20337. ar = er
  20338. er = dr
  20339. dr = rotl(cr, 10)
  20340. cr = br
  20341. br = tr
  20342. }
  20343. // update state
  20344. var t = (this._b + cl + dr) | 0
  20345. this._b = (this._c + dl + er) | 0
  20346. this._c = (this._d + el + ar) | 0
  20347. this._d = (this._e + al + br) | 0
  20348. this._e = (this._a + bl + cr) | 0
  20349. this._a = t
  20350. }
  20351. RIPEMD160.prototype._digest = function () {
  20352. // create padding and handle blocks
  20353. this._block[this._blockOffset++] = 0x80
  20354. if (this._blockOffset > 56) {
  20355. this._block.fill(0, this._blockOffset, 64)
  20356. this._update()
  20357. this._blockOffset = 0
  20358. }
  20359. this._block.fill(0, this._blockOffset, 56)
  20360. this._block.writeUInt32LE(this._length[0], 56)
  20361. this._block.writeUInt32LE(this._length[1], 60)
  20362. this._update()
  20363. // produce result
  20364. var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
  20365. buffer.writeInt32LE(this._a, 0)
  20366. buffer.writeInt32LE(this._b, 4)
  20367. buffer.writeInt32LE(this._c, 8)
  20368. buffer.writeInt32LE(this._d, 12)
  20369. buffer.writeInt32LE(this._e, 16)
  20370. return buffer
  20371. }
  20372. function rotl (x, n) {
  20373. return (x << n) | (x >>> (32 - n))
  20374. }
  20375. function fn1 (a, b, c, d, e, m, k, s) {
  20376. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
  20377. }
  20378. function fn2 (a, b, c, d, e, m, k, s) {
  20379. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
  20380. }
  20381. function fn3 (a, b, c, d, e, m, k, s) {
  20382. return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
  20383. }
  20384. function fn4 (a, b, c, d, e, m, k, s) {
  20385. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
  20386. }
  20387. function fn5 (a, b, c, d, e, m, k, s) {
  20388. return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
  20389. }
  20390. module.exports = RIPEMD160
  20391. /***/ }),
  20392. /* 129 */
  20393. /*!**************************************!*\
  20394. !*** ./node_modules/sha.js/index.js ***!
  20395. \**************************************/
  20396. /*! no static exports found */
  20397. /***/ (function(module, exports, __webpack_require__) {
  20398. var exports = module.exports = function SHA (algorithm) {
  20399. algorithm = algorithm.toLowerCase()
  20400. var Algorithm = exports[algorithm]
  20401. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  20402. return new Algorithm()
  20403. }
  20404. exports.sha = __webpack_require__(/*! ./sha */ 130)
  20405. exports.sha1 = __webpack_require__(/*! ./sha1 */ 132)
  20406. exports.sha224 = __webpack_require__(/*! ./sha224 */ 133)
  20407. exports.sha256 = __webpack_require__(/*! ./sha256 */ 134)
  20408. exports.sha384 = __webpack_require__(/*! ./sha384 */ 135)
  20409. exports.sha512 = __webpack_require__(/*! ./sha512 */ 136)
  20410. /***/ }),
  20411. /* 130 */
  20412. /*!************************************!*\
  20413. !*** ./node_modules/sha.js/sha.js ***!
  20414. \************************************/
  20415. /*! no static exports found */
  20416. /***/ (function(module, exports, __webpack_require__) {
  20417. /*
  20418. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  20419. * in FIPS PUB 180-1
  20420. * This source code is derived from sha1.js of the same repository.
  20421. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  20422. * operation was added.
  20423. */
  20424. var inherits = __webpack_require__(/*! inherits */ 109)
  20425. var Hash = __webpack_require__(/*! ./hash */ 131)
  20426. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20427. var K = [
  20428. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  20429. ]
  20430. var W = new Array(80)
  20431. function Sha () {
  20432. this.init()
  20433. this._w = W
  20434. Hash.call(this, 64, 56)
  20435. }
  20436. inherits(Sha, Hash)
  20437. Sha.prototype.init = function () {
  20438. this._a = 0x67452301
  20439. this._b = 0xefcdab89
  20440. this._c = 0x98badcfe
  20441. this._d = 0x10325476
  20442. this._e = 0xc3d2e1f0
  20443. return this
  20444. }
  20445. function rotl5 (num) {
  20446. return (num << 5) | (num >>> 27)
  20447. }
  20448. function rotl30 (num) {
  20449. return (num << 30) | (num >>> 2)
  20450. }
  20451. function ft (s, b, c, d) {
  20452. if (s === 0) return (b & c) | ((~b) & d)
  20453. if (s === 2) return (b & c) | (b & d) | (c & d)
  20454. return b ^ c ^ d
  20455. }
  20456. Sha.prototype._update = function (M) {
  20457. var W = this._w
  20458. var a = this._a | 0
  20459. var b = this._b | 0
  20460. var c = this._c | 0
  20461. var d = this._d | 0
  20462. var e = this._e | 0
  20463. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  20464. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  20465. for (var j = 0; j < 80; ++j) {
  20466. var s = ~~(j / 20)
  20467. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  20468. e = d
  20469. d = c
  20470. c = rotl30(b)
  20471. b = a
  20472. a = t
  20473. }
  20474. this._a = (a + this._a) | 0
  20475. this._b = (b + this._b) | 0
  20476. this._c = (c + this._c) | 0
  20477. this._d = (d + this._d) | 0
  20478. this._e = (e + this._e) | 0
  20479. }
  20480. Sha.prototype._hash = function () {
  20481. var H = Buffer.allocUnsafe(20)
  20482. H.writeInt32BE(this._a | 0, 0)
  20483. H.writeInt32BE(this._b | 0, 4)
  20484. H.writeInt32BE(this._c | 0, 8)
  20485. H.writeInt32BE(this._d | 0, 12)
  20486. H.writeInt32BE(this._e | 0, 16)
  20487. return H
  20488. }
  20489. module.exports = Sha
  20490. /***/ }),
  20491. /* 131 */
  20492. /*!*************************************!*\
  20493. !*** ./node_modules/sha.js/hash.js ***!
  20494. \*************************************/
  20495. /*! no static exports found */
  20496. /***/ (function(module, exports, __webpack_require__) {
  20497. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20498. // prototype class for hash functions
  20499. function Hash (blockSize, finalSize) {
  20500. this._block = Buffer.alloc(blockSize)
  20501. this._finalSize = finalSize
  20502. this._blockSize = blockSize
  20503. this._len = 0
  20504. }
  20505. Hash.prototype.update = function (data, enc) {
  20506. if (typeof data === 'string') {
  20507. enc = enc || 'utf8'
  20508. data = Buffer.from(data, enc)
  20509. }
  20510. var block = this._block
  20511. var blockSize = this._blockSize
  20512. var length = data.length
  20513. var accum = this._len
  20514. for (var offset = 0; offset < length;) {
  20515. var assigned = accum % blockSize
  20516. var remainder = Math.min(length - offset, blockSize - assigned)
  20517. for (var i = 0; i < remainder; i++) {
  20518. block[assigned + i] = data[offset + i]
  20519. }
  20520. accum += remainder
  20521. offset += remainder
  20522. if ((accum % blockSize) === 0) {
  20523. this._update(block)
  20524. }
  20525. }
  20526. this._len += length
  20527. return this
  20528. }
  20529. Hash.prototype.digest = function (enc) {
  20530. var rem = this._len % this._blockSize
  20531. this._block[rem] = 0x80
  20532. // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
  20533. // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
  20534. this._block.fill(0, rem + 1)
  20535. if (rem >= this._finalSize) {
  20536. this._update(this._block)
  20537. this._block.fill(0)
  20538. }
  20539. var bits = this._len * 8
  20540. // uint32
  20541. if (bits <= 0xffffffff) {
  20542. this._block.writeUInt32BE(bits, this._blockSize - 4)
  20543. // uint64
  20544. } else {
  20545. var lowBits = (bits & 0xffffffff) >>> 0
  20546. var highBits = (bits - lowBits) / 0x100000000
  20547. this._block.writeUInt32BE(highBits, this._blockSize - 8)
  20548. this._block.writeUInt32BE(lowBits, this._blockSize - 4)
  20549. }
  20550. this._update(this._block)
  20551. var hash = this._hash()
  20552. return enc ? hash.toString(enc) : hash
  20553. }
  20554. Hash.prototype._update = function () {
  20555. throw new Error('_update must be implemented by subclass')
  20556. }
  20557. module.exports = Hash
  20558. /***/ }),
  20559. /* 132 */
  20560. /*!*************************************!*\
  20561. !*** ./node_modules/sha.js/sha1.js ***!
  20562. \*************************************/
  20563. /*! no static exports found */
  20564. /***/ (function(module, exports, __webpack_require__) {
  20565. /*
  20566. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  20567. * in FIPS PUB 180-1
  20568. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  20569. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  20570. * Distributed under the BSD License
  20571. * See http://pajhome.org.uk/crypt/md5 for details.
  20572. */
  20573. var inherits = __webpack_require__(/*! inherits */ 109)
  20574. var Hash = __webpack_require__(/*! ./hash */ 131)
  20575. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20576. var K = [
  20577. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  20578. ]
  20579. var W = new Array(80)
  20580. function Sha1 () {
  20581. this.init()
  20582. this._w = W
  20583. Hash.call(this, 64, 56)
  20584. }
  20585. inherits(Sha1, Hash)
  20586. Sha1.prototype.init = function () {
  20587. this._a = 0x67452301
  20588. this._b = 0xefcdab89
  20589. this._c = 0x98badcfe
  20590. this._d = 0x10325476
  20591. this._e = 0xc3d2e1f0
  20592. return this
  20593. }
  20594. function rotl1 (num) {
  20595. return (num << 1) | (num >>> 31)
  20596. }
  20597. function rotl5 (num) {
  20598. return (num << 5) | (num >>> 27)
  20599. }
  20600. function rotl30 (num) {
  20601. return (num << 30) | (num >>> 2)
  20602. }
  20603. function ft (s, b, c, d) {
  20604. if (s === 0) return (b & c) | ((~b) & d)
  20605. if (s === 2) return (b & c) | (b & d) | (c & d)
  20606. return b ^ c ^ d
  20607. }
  20608. Sha1.prototype._update = function (M) {
  20609. var W = this._w
  20610. var a = this._a | 0
  20611. var b = this._b | 0
  20612. var c = this._c | 0
  20613. var d = this._d | 0
  20614. var e = this._e | 0
  20615. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  20616. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  20617. for (var j = 0; j < 80; ++j) {
  20618. var s = ~~(j / 20)
  20619. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  20620. e = d
  20621. d = c
  20622. c = rotl30(b)
  20623. b = a
  20624. a = t
  20625. }
  20626. this._a = (a + this._a) | 0
  20627. this._b = (b + this._b) | 0
  20628. this._c = (c + this._c) | 0
  20629. this._d = (d + this._d) | 0
  20630. this._e = (e + this._e) | 0
  20631. }
  20632. Sha1.prototype._hash = function () {
  20633. var H = Buffer.allocUnsafe(20)
  20634. H.writeInt32BE(this._a | 0, 0)
  20635. H.writeInt32BE(this._b | 0, 4)
  20636. H.writeInt32BE(this._c | 0, 8)
  20637. H.writeInt32BE(this._d | 0, 12)
  20638. H.writeInt32BE(this._e | 0, 16)
  20639. return H
  20640. }
  20641. module.exports = Sha1
  20642. /***/ }),
  20643. /* 133 */
  20644. /*!***************************************!*\
  20645. !*** ./node_modules/sha.js/sha224.js ***!
  20646. \***************************************/
  20647. /*! no static exports found */
  20648. /***/ (function(module, exports, __webpack_require__) {
  20649. /**
  20650. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  20651. * in FIPS 180-2
  20652. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  20653. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  20654. *
  20655. */
  20656. var inherits = __webpack_require__(/*! inherits */ 109)
  20657. var Sha256 = __webpack_require__(/*! ./sha256 */ 134)
  20658. var Hash = __webpack_require__(/*! ./hash */ 131)
  20659. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20660. var W = new Array(64)
  20661. function Sha224 () {
  20662. this.init()
  20663. this._w = W // new Array(64)
  20664. Hash.call(this, 64, 56)
  20665. }
  20666. inherits(Sha224, Sha256)
  20667. Sha224.prototype.init = function () {
  20668. this._a = 0xc1059ed8
  20669. this._b = 0x367cd507
  20670. this._c = 0x3070dd17
  20671. this._d = 0xf70e5939
  20672. this._e = 0xffc00b31
  20673. this._f = 0x68581511
  20674. this._g = 0x64f98fa7
  20675. this._h = 0xbefa4fa4
  20676. return this
  20677. }
  20678. Sha224.prototype._hash = function () {
  20679. var H = Buffer.allocUnsafe(28)
  20680. H.writeInt32BE(this._a, 0)
  20681. H.writeInt32BE(this._b, 4)
  20682. H.writeInt32BE(this._c, 8)
  20683. H.writeInt32BE(this._d, 12)
  20684. H.writeInt32BE(this._e, 16)
  20685. H.writeInt32BE(this._f, 20)
  20686. H.writeInt32BE(this._g, 24)
  20687. return H
  20688. }
  20689. module.exports = Sha224
  20690. /***/ }),
  20691. /* 134 */
  20692. /*!***************************************!*\
  20693. !*** ./node_modules/sha.js/sha256.js ***!
  20694. \***************************************/
  20695. /*! no static exports found */
  20696. /***/ (function(module, exports, __webpack_require__) {
  20697. /**
  20698. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  20699. * in FIPS 180-2
  20700. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  20701. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  20702. *
  20703. */
  20704. var inherits = __webpack_require__(/*! inherits */ 109)
  20705. var Hash = __webpack_require__(/*! ./hash */ 131)
  20706. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20707. var K = [
  20708. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  20709. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  20710. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  20711. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  20712. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  20713. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  20714. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  20715. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  20716. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  20717. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  20718. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  20719. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  20720. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  20721. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  20722. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  20723. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  20724. ]
  20725. var W = new Array(64)
  20726. function Sha256 () {
  20727. this.init()
  20728. this._w = W // new Array(64)
  20729. Hash.call(this, 64, 56)
  20730. }
  20731. inherits(Sha256, Hash)
  20732. Sha256.prototype.init = function () {
  20733. this._a = 0x6a09e667
  20734. this._b = 0xbb67ae85
  20735. this._c = 0x3c6ef372
  20736. this._d = 0xa54ff53a
  20737. this._e = 0x510e527f
  20738. this._f = 0x9b05688c
  20739. this._g = 0x1f83d9ab
  20740. this._h = 0x5be0cd19
  20741. return this
  20742. }
  20743. function ch (x, y, z) {
  20744. return z ^ (x & (y ^ z))
  20745. }
  20746. function maj (x, y, z) {
  20747. return (x & y) | (z & (x | y))
  20748. }
  20749. function sigma0 (x) {
  20750. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  20751. }
  20752. function sigma1 (x) {
  20753. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  20754. }
  20755. function gamma0 (x) {
  20756. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  20757. }
  20758. function gamma1 (x) {
  20759. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  20760. }
  20761. Sha256.prototype._update = function (M) {
  20762. var W = this._w
  20763. var a = this._a | 0
  20764. var b = this._b | 0
  20765. var c = this._c | 0
  20766. var d = this._d | 0
  20767. var e = this._e | 0
  20768. var f = this._f | 0
  20769. var g = this._g | 0
  20770. var h = this._h | 0
  20771. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  20772. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  20773. for (var j = 0; j < 64; ++j) {
  20774. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  20775. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  20776. h = g
  20777. g = f
  20778. f = e
  20779. e = (d + T1) | 0
  20780. d = c
  20781. c = b
  20782. b = a
  20783. a = (T1 + T2) | 0
  20784. }
  20785. this._a = (a + this._a) | 0
  20786. this._b = (b + this._b) | 0
  20787. this._c = (c + this._c) | 0
  20788. this._d = (d + this._d) | 0
  20789. this._e = (e + this._e) | 0
  20790. this._f = (f + this._f) | 0
  20791. this._g = (g + this._g) | 0
  20792. this._h = (h + this._h) | 0
  20793. }
  20794. Sha256.prototype._hash = function () {
  20795. var H = Buffer.allocUnsafe(32)
  20796. H.writeInt32BE(this._a, 0)
  20797. H.writeInt32BE(this._b, 4)
  20798. H.writeInt32BE(this._c, 8)
  20799. H.writeInt32BE(this._d, 12)
  20800. H.writeInt32BE(this._e, 16)
  20801. H.writeInt32BE(this._f, 20)
  20802. H.writeInt32BE(this._g, 24)
  20803. H.writeInt32BE(this._h, 28)
  20804. return H
  20805. }
  20806. module.exports = Sha256
  20807. /***/ }),
  20808. /* 135 */
  20809. /*!***************************************!*\
  20810. !*** ./node_modules/sha.js/sha384.js ***!
  20811. \***************************************/
  20812. /*! no static exports found */
  20813. /***/ (function(module, exports, __webpack_require__) {
  20814. var inherits = __webpack_require__(/*! inherits */ 109)
  20815. var SHA512 = __webpack_require__(/*! ./sha512 */ 136)
  20816. var Hash = __webpack_require__(/*! ./hash */ 131)
  20817. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20818. var W = new Array(160)
  20819. function Sha384 () {
  20820. this.init()
  20821. this._w = W
  20822. Hash.call(this, 128, 112)
  20823. }
  20824. inherits(Sha384, SHA512)
  20825. Sha384.prototype.init = function () {
  20826. this._ah = 0xcbbb9d5d
  20827. this._bh = 0x629a292a
  20828. this._ch = 0x9159015a
  20829. this._dh = 0x152fecd8
  20830. this._eh = 0x67332667
  20831. this._fh = 0x8eb44a87
  20832. this._gh = 0xdb0c2e0d
  20833. this._hh = 0x47b5481d
  20834. this._al = 0xc1059ed8
  20835. this._bl = 0x367cd507
  20836. this._cl = 0x3070dd17
  20837. this._dl = 0xf70e5939
  20838. this._el = 0xffc00b31
  20839. this._fl = 0x68581511
  20840. this._gl = 0x64f98fa7
  20841. this._hl = 0xbefa4fa4
  20842. return this
  20843. }
  20844. Sha384.prototype._hash = function () {
  20845. var H = Buffer.allocUnsafe(48)
  20846. function writeInt64BE (h, l, offset) {
  20847. H.writeInt32BE(h, offset)
  20848. H.writeInt32BE(l, offset + 4)
  20849. }
  20850. writeInt64BE(this._ah, this._al, 0)
  20851. writeInt64BE(this._bh, this._bl, 8)
  20852. writeInt64BE(this._ch, this._cl, 16)
  20853. writeInt64BE(this._dh, this._dl, 24)
  20854. writeInt64BE(this._eh, this._el, 32)
  20855. writeInt64BE(this._fh, this._fl, 40)
  20856. return H
  20857. }
  20858. module.exports = Sha384
  20859. /***/ }),
  20860. /* 136 */
  20861. /*!***************************************!*\
  20862. !*** ./node_modules/sha.js/sha512.js ***!
  20863. \***************************************/
  20864. /*! no static exports found */
  20865. /***/ (function(module, exports, __webpack_require__) {
  20866. var inherits = __webpack_require__(/*! inherits */ 109)
  20867. var Hash = __webpack_require__(/*! ./hash */ 131)
  20868. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  20869. var K = [
  20870. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  20871. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  20872. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  20873. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  20874. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  20875. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  20876. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  20877. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  20878. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  20879. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  20880. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  20881. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  20882. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  20883. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  20884. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  20885. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  20886. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  20887. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  20888. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  20889. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  20890. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  20891. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  20892. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  20893. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  20894. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  20895. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  20896. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  20897. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  20898. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  20899. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  20900. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  20901. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  20902. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  20903. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  20904. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  20905. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  20906. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  20907. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  20908. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  20909. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  20910. ]
  20911. var W = new Array(160)
  20912. function Sha512 () {
  20913. this.init()
  20914. this._w = W
  20915. Hash.call(this, 128, 112)
  20916. }
  20917. inherits(Sha512, Hash)
  20918. Sha512.prototype.init = function () {
  20919. this._ah = 0x6a09e667
  20920. this._bh = 0xbb67ae85
  20921. this._ch = 0x3c6ef372
  20922. this._dh = 0xa54ff53a
  20923. this._eh = 0x510e527f
  20924. this._fh = 0x9b05688c
  20925. this._gh = 0x1f83d9ab
  20926. this._hh = 0x5be0cd19
  20927. this._al = 0xf3bcc908
  20928. this._bl = 0x84caa73b
  20929. this._cl = 0xfe94f82b
  20930. this._dl = 0x5f1d36f1
  20931. this._el = 0xade682d1
  20932. this._fl = 0x2b3e6c1f
  20933. this._gl = 0xfb41bd6b
  20934. this._hl = 0x137e2179
  20935. return this
  20936. }
  20937. function Ch (x, y, z) {
  20938. return z ^ (x & (y ^ z))
  20939. }
  20940. function maj (x, y, z) {
  20941. return (x & y) | (z & (x | y))
  20942. }
  20943. function sigma0 (x, xl) {
  20944. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  20945. }
  20946. function sigma1 (x, xl) {
  20947. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  20948. }
  20949. function Gamma0 (x, xl) {
  20950. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  20951. }
  20952. function Gamma0l (x, xl) {
  20953. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  20954. }
  20955. function Gamma1 (x, xl) {
  20956. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  20957. }
  20958. function Gamma1l (x, xl) {
  20959. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  20960. }
  20961. function getCarry (a, b) {
  20962. return (a >>> 0) < (b >>> 0) ? 1 : 0
  20963. }
  20964. Sha512.prototype._update = function (M) {
  20965. var W = this._w
  20966. var ah = this._ah | 0
  20967. var bh = this._bh | 0
  20968. var ch = this._ch | 0
  20969. var dh = this._dh | 0
  20970. var eh = this._eh | 0
  20971. var fh = this._fh | 0
  20972. var gh = this._gh | 0
  20973. var hh = this._hh | 0
  20974. var al = this._al | 0
  20975. var bl = this._bl | 0
  20976. var cl = this._cl | 0
  20977. var dl = this._dl | 0
  20978. var el = this._el | 0
  20979. var fl = this._fl | 0
  20980. var gl = this._gl | 0
  20981. var hl = this._hl | 0
  20982. for (var i = 0; i < 32; i += 2) {
  20983. W[i] = M.readInt32BE(i * 4)
  20984. W[i + 1] = M.readInt32BE(i * 4 + 4)
  20985. }
  20986. for (; i < 160; i += 2) {
  20987. var xh = W[i - 15 * 2]
  20988. var xl = W[i - 15 * 2 + 1]
  20989. var gamma0 = Gamma0(xh, xl)
  20990. var gamma0l = Gamma0l(xl, xh)
  20991. xh = W[i - 2 * 2]
  20992. xl = W[i - 2 * 2 + 1]
  20993. var gamma1 = Gamma1(xh, xl)
  20994. var gamma1l = Gamma1l(xl, xh)
  20995. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  20996. var Wi7h = W[i - 7 * 2]
  20997. var Wi7l = W[i - 7 * 2 + 1]
  20998. var Wi16h = W[i - 16 * 2]
  20999. var Wi16l = W[i - 16 * 2 + 1]
  21000. var Wil = (gamma0l + Wi7l) | 0
  21001. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  21002. Wil = (Wil + gamma1l) | 0
  21003. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  21004. Wil = (Wil + Wi16l) | 0
  21005. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  21006. W[i] = Wih
  21007. W[i + 1] = Wil
  21008. }
  21009. for (var j = 0; j < 160; j += 2) {
  21010. Wih = W[j]
  21011. Wil = W[j + 1]
  21012. var majh = maj(ah, bh, ch)
  21013. var majl = maj(al, bl, cl)
  21014. var sigma0h = sigma0(ah, al)
  21015. var sigma0l = sigma0(al, ah)
  21016. var sigma1h = sigma1(eh, el)
  21017. var sigma1l = sigma1(el, eh)
  21018. // t1 = h + sigma1 + ch + K[j] + W[j]
  21019. var Kih = K[j]
  21020. var Kil = K[j + 1]
  21021. var chh = Ch(eh, fh, gh)
  21022. var chl = Ch(el, fl, gl)
  21023. var t1l = (hl + sigma1l) | 0
  21024. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  21025. t1l = (t1l + chl) | 0
  21026. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  21027. t1l = (t1l + Kil) | 0
  21028. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  21029. t1l = (t1l + Wil) | 0
  21030. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  21031. // t2 = sigma0 + maj
  21032. var t2l = (sigma0l + majl) | 0
  21033. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  21034. hh = gh
  21035. hl = gl
  21036. gh = fh
  21037. gl = fl
  21038. fh = eh
  21039. fl = el
  21040. el = (dl + t1l) | 0
  21041. eh = (dh + t1h + getCarry(el, dl)) | 0
  21042. dh = ch
  21043. dl = cl
  21044. ch = bh
  21045. cl = bl
  21046. bh = ah
  21047. bl = al
  21048. al = (t1l + t2l) | 0
  21049. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  21050. }
  21051. this._al = (this._al + al) | 0
  21052. this._bl = (this._bl + bl) | 0
  21053. this._cl = (this._cl + cl) | 0
  21054. this._dl = (this._dl + dl) | 0
  21055. this._el = (this._el + el) | 0
  21056. this._fl = (this._fl + fl) | 0
  21057. this._gl = (this._gl + gl) | 0
  21058. this._hl = (this._hl + hl) | 0
  21059. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  21060. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  21061. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  21062. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  21063. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  21064. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  21065. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  21066. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  21067. }
  21068. Sha512.prototype._hash = function () {
  21069. var H = Buffer.allocUnsafe(64)
  21070. function writeInt64BE (h, l, offset) {
  21071. H.writeInt32BE(h, offset)
  21072. H.writeInt32BE(l, offset + 4)
  21073. }
  21074. writeInt64BE(this._ah, this._al, 0)
  21075. writeInt64BE(this._bh, this._bl, 8)
  21076. writeInt64BE(this._ch, this._cl, 16)
  21077. writeInt64BE(this._dh, this._dl, 24)
  21078. writeInt64BE(this._eh, this._el, 32)
  21079. writeInt64BE(this._fh, this._fl, 40)
  21080. writeInt64BE(this._gh, this._gl, 48)
  21081. writeInt64BE(this._hh, this._hl, 56)
  21082. return H
  21083. }
  21084. module.exports = Sha512
  21085. /***/ }),
  21086. /* 137 */
  21087. /*!*******************************************!*\
  21088. !*** ./node_modules/cipher-base/index.js ***!
  21089. \*******************************************/
  21090. /*! no static exports found */
  21091. /***/ (function(module, exports, __webpack_require__) {
  21092. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21093. var Transform = __webpack_require__(/*! stream */ 138).Transform
  21094. var StringDecoder = __webpack_require__(/*! string_decoder */ 125).StringDecoder
  21095. var inherits = __webpack_require__(/*! inherits */ 109)
  21096. function CipherBase (hashMode) {
  21097. Transform.call(this)
  21098. this.hashMode = typeof hashMode === 'string'
  21099. if (this.hashMode) {
  21100. this[hashMode] = this._finalOrDigest
  21101. } else {
  21102. this.final = this._finalOrDigest
  21103. }
  21104. if (this._final) {
  21105. this.__final = this._final
  21106. this._final = null
  21107. }
  21108. this._decoder = null
  21109. this._encoding = null
  21110. }
  21111. inherits(CipherBase, Transform)
  21112. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  21113. if (typeof data === 'string') {
  21114. data = Buffer.from(data, inputEnc)
  21115. }
  21116. var outData = this._update(data)
  21117. if (this.hashMode) return this
  21118. if (outputEnc) {
  21119. outData = this._toString(outData, outputEnc)
  21120. }
  21121. return outData
  21122. }
  21123. CipherBase.prototype.setAutoPadding = function () {}
  21124. CipherBase.prototype.getAuthTag = function () {
  21125. throw new Error('trying to get auth tag in unsupported state')
  21126. }
  21127. CipherBase.prototype.setAuthTag = function () {
  21128. throw new Error('trying to set auth tag in unsupported state')
  21129. }
  21130. CipherBase.prototype.setAAD = function () {
  21131. throw new Error('trying to set aad in unsupported state')
  21132. }
  21133. CipherBase.prototype._transform = function (data, _, next) {
  21134. var err
  21135. try {
  21136. if (this.hashMode) {
  21137. this._update(data)
  21138. } else {
  21139. this.push(this._update(data))
  21140. }
  21141. } catch (e) {
  21142. err = e
  21143. } finally {
  21144. next(err)
  21145. }
  21146. }
  21147. CipherBase.prototype._flush = function (done) {
  21148. var err
  21149. try {
  21150. this.push(this.__final())
  21151. } catch (e) {
  21152. err = e
  21153. }
  21154. done(err)
  21155. }
  21156. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  21157. var outData = this.__final() || Buffer.alloc(0)
  21158. if (outputEnc) {
  21159. outData = this._toString(outData, outputEnc, true)
  21160. }
  21161. return outData
  21162. }
  21163. CipherBase.prototype._toString = function (value, enc, fin) {
  21164. if (!this._decoder) {
  21165. this._decoder = new StringDecoder(enc)
  21166. this._encoding = enc
  21167. }
  21168. if (this._encoding !== enc) throw new Error('can\'t switch encodings')
  21169. var out = this._decoder.write(value)
  21170. if (fin) {
  21171. out += this._decoder.end()
  21172. }
  21173. return out
  21174. }
  21175. module.exports = CipherBase
  21176. /***/ }),
  21177. /* 138 */
  21178. /*!*************************************************!*\
  21179. !*** ./node_modules/stream-browserify/index.js ***!
  21180. \*************************************************/
  21181. /*! no static exports found */
  21182. /***/ (function(module, exports, __webpack_require__) {
  21183. // Copyright Joyent, Inc. and other Node contributors.
  21184. //
  21185. // Permission is hereby granted, free of charge, to any person obtaining a
  21186. // copy of this software and associated documentation files (the
  21187. // "Software"), to deal in the Software without restriction, including
  21188. // without limitation the rights to use, copy, modify, merge, publish,
  21189. // distribute, sublicense, and/or sell copies of the Software, and to permit
  21190. // persons to whom the Software is furnished to do so, subject to the
  21191. // following conditions:
  21192. //
  21193. // The above copyright notice and this permission notice shall be included
  21194. // in all copies or substantial portions of the Software.
  21195. //
  21196. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21197. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21198. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  21199. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  21200. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21201. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21202. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  21203. module.exports = Stream;
  21204. var EE = __webpack_require__(/*! events */ 115).EventEmitter;
  21205. var inherits = __webpack_require__(/*! inherits */ 109);
  21206. inherits(Stream, EE);
  21207. Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 112);
  21208. Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 139);
  21209. Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 140);
  21210. Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 141);
  21211. Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 142);
  21212. // Backwards-compat with node 0.4.x
  21213. Stream.Stream = Stream;
  21214. // old-style streams. Note that the pipe method (the only relevant
  21215. // part of this class) is overridden in the Readable class.
  21216. function Stream() {
  21217. EE.call(this);
  21218. }
  21219. Stream.prototype.pipe = function(dest, options) {
  21220. var source = this;
  21221. function ondata(chunk) {
  21222. if (dest.writable) {
  21223. if (false === dest.write(chunk) && source.pause) {
  21224. source.pause();
  21225. }
  21226. }
  21227. }
  21228. source.on('data', ondata);
  21229. function ondrain() {
  21230. if (source.readable && source.resume) {
  21231. source.resume();
  21232. }
  21233. }
  21234. dest.on('drain', ondrain);
  21235. // If the 'end' option is not supplied, dest.end() will be called when
  21236. // source gets the 'end' or 'close' events. Only dest.end() once.
  21237. if (!dest._isStdio && (!options || options.end !== false)) {
  21238. source.on('end', onend);
  21239. source.on('close', onclose);
  21240. }
  21241. var didOnEnd = false;
  21242. function onend() {
  21243. if (didOnEnd) return;
  21244. didOnEnd = true;
  21245. dest.end();
  21246. }
  21247. function onclose() {
  21248. if (didOnEnd) return;
  21249. didOnEnd = true;
  21250. if (typeof dest.destroy === 'function') dest.destroy();
  21251. }
  21252. // don't leave dangling pipes when there are errors.
  21253. function onerror(er) {
  21254. cleanup();
  21255. if (EE.listenerCount(this, 'error') === 0) {
  21256. throw er; // Unhandled stream error in pipe.
  21257. }
  21258. }
  21259. source.on('error', onerror);
  21260. dest.on('error', onerror);
  21261. // remove all the event listeners that were added.
  21262. function cleanup() {
  21263. source.removeListener('data', ondata);
  21264. dest.removeListener('drain', ondrain);
  21265. source.removeListener('end', onend);
  21266. source.removeListener('close', onclose);
  21267. source.removeListener('error', onerror);
  21268. dest.removeListener('error', onerror);
  21269. source.removeListener('end', cleanup);
  21270. source.removeListener('close', cleanup);
  21271. dest.removeListener('close', cleanup);
  21272. }
  21273. source.on('end', cleanup);
  21274. source.on('close', cleanup);
  21275. dest.on('close', cleanup);
  21276. dest.emit('pipe', source);
  21277. // Allow for unix-like usage: A.pipe(B).pipe(C)
  21278. return dest;
  21279. };
  21280. /***/ }),
  21281. /* 139 */
  21282. /*!**********************************************************!*\
  21283. !*** ./node_modules/readable-stream/writable-browser.js ***!
  21284. \**********************************************************/
  21285. /*! no static exports found */
  21286. /***/ (function(module, exports, __webpack_require__) {
  21287. module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 123);
  21288. /***/ }),
  21289. /* 140 */
  21290. /*!********************************************************!*\
  21291. !*** ./node_modules/readable-stream/duplex-browser.js ***!
  21292. \********************************************************/
  21293. /*! no static exports found */
  21294. /***/ (function(module, exports, __webpack_require__) {
  21295. module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 122);
  21296. /***/ }),
  21297. /* 141 */
  21298. /*!***************************************************!*\
  21299. !*** ./node_modules/readable-stream/transform.js ***!
  21300. \***************************************************/
  21301. /*! no static exports found */
  21302. /***/ (function(module, exports, __webpack_require__) {
  21303. module.exports = __webpack_require__(/*! ./readable */ 112).Transform
  21304. /***/ }),
  21305. /* 142 */
  21306. /*!*****************************************************!*\
  21307. !*** ./node_modules/readable-stream/passthrough.js ***!
  21308. \*****************************************************/
  21309. /*! no static exports found */
  21310. /***/ (function(module, exports, __webpack_require__) {
  21311. module.exports = __webpack_require__(/*! ./readable */ 112).PassThrough
  21312. /***/ }),
  21313. /* 143 */
  21314. /*!*********************************************!*\
  21315. !*** ./node_modules/create-hmac/browser.js ***!
  21316. \*********************************************/
  21317. /*! no static exports found */
  21318. /***/ (function(module, exports, __webpack_require__) {
  21319. "use strict";
  21320. var inherits = __webpack_require__(/*! inherits */ 109)
  21321. var Legacy = __webpack_require__(/*! ./legacy */ 144)
  21322. var Base = __webpack_require__(/*! cipher-base */ 137)
  21323. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21324. var md5 = __webpack_require__(/*! create-hash/md5 */ 145)
  21325. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 128)
  21326. var sha = __webpack_require__(/*! sha.js */ 129)
  21327. var ZEROS = Buffer.alloc(128)
  21328. function Hmac (alg, key) {
  21329. Base.call(this, 'digest')
  21330. if (typeof key === 'string') {
  21331. key = Buffer.from(key)
  21332. }
  21333. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  21334. this._alg = alg
  21335. this._key = key
  21336. if (key.length > blocksize) {
  21337. var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  21338. key = hash.update(key).digest()
  21339. } else if (key.length < blocksize) {
  21340. key = Buffer.concat([key, ZEROS], blocksize)
  21341. }
  21342. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  21343. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  21344. for (var i = 0; i < blocksize; i++) {
  21345. ipad[i] = key[i] ^ 0x36
  21346. opad[i] = key[i] ^ 0x5C
  21347. }
  21348. this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  21349. this._hash.update(ipad)
  21350. }
  21351. inherits(Hmac, Base)
  21352. Hmac.prototype._update = function (data) {
  21353. this._hash.update(data)
  21354. }
  21355. Hmac.prototype._final = function () {
  21356. var h = this._hash.digest()
  21357. var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
  21358. return hash.update(this._opad).update(h).digest()
  21359. }
  21360. module.exports = function createHmac (alg, key) {
  21361. alg = alg.toLowerCase()
  21362. if (alg === 'rmd160' || alg === 'ripemd160') {
  21363. return new Hmac('rmd160', key)
  21364. }
  21365. if (alg === 'md5') {
  21366. return new Legacy(md5, key)
  21367. }
  21368. return new Hmac(alg, key)
  21369. }
  21370. /***/ }),
  21371. /* 144 */
  21372. /*!********************************************!*\
  21373. !*** ./node_modules/create-hmac/legacy.js ***!
  21374. \********************************************/
  21375. /*! no static exports found */
  21376. /***/ (function(module, exports, __webpack_require__) {
  21377. "use strict";
  21378. var inherits = __webpack_require__(/*! inherits */ 109)
  21379. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21380. var Base = __webpack_require__(/*! cipher-base */ 137)
  21381. var ZEROS = Buffer.alloc(128)
  21382. var blocksize = 64
  21383. function Hmac (alg, key) {
  21384. Base.call(this, 'digest')
  21385. if (typeof key === 'string') {
  21386. key = Buffer.from(key)
  21387. }
  21388. this._alg = alg
  21389. this._key = key
  21390. if (key.length > blocksize) {
  21391. key = alg(key)
  21392. } else if (key.length < blocksize) {
  21393. key = Buffer.concat([key, ZEROS], blocksize)
  21394. }
  21395. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  21396. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  21397. for (var i = 0; i < blocksize; i++) {
  21398. ipad[i] = key[i] ^ 0x36
  21399. opad[i] = key[i] ^ 0x5C
  21400. }
  21401. this._hash = [ipad]
  21402. }
  21403. inherits(Hmac, Base)
  21404. Hmac.prototype._update = function (data) {
  21405. this._hash.push(data)
  21406. }
  21407. Hmac.prototype._final = function () {
  21408. var h = this._alg(Buffer.concat(this._hash))
  21409. return this._alg(Buffer.concat([this._opad, h]))
  21410. }
  21411. module.exports = Hmac
  21412. /***/ }),
  21413. /* 145 */
  21414. /*!*****************************************!*\
  21415. !*** ./node_modules/create-hash/md5.js ***!
  21416. \*****************************************/
  21417. /*! no static exports found */
  21418. /***/ (function(module, exports, __webpack_require__) {
  21419. var MD5 = __webpack_require__(/*! md5.js */ 110)
  21420. module.exports = function (buffer) {
  21421. return new MD5().update(buffer).digest()
  21422. }
  21423. /***/ }),
  21424. /* 146 */
  21425. /*!***********************************************!*\
  21426. !*** ./node_modules/browserify-sign/algos.js ***!
  21427. \***********************************************/
  21428. /*! no static exports found */
  21429. /***/ (function(module, exports, __webpack_require__) {
  21430. module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 147)
  21431. /***/ }),
  21432. /* 147 */
  21433. /*!**************************************************************!*\
  21434. !*** ./node_modules/browserify-sign/browser/algorithms.json ***!
  21435. \**************************************************************/
  21436. /*! 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 */
  21437. /***/ (function(module) {
  21438. 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\"}}");
  21439. /***/ }),
  21440. /* 148 */
  21441. /*!****************************************!*\
  21442. !*** ./node_modules/pbkdf2/browser.js ***!
  21443. \****************************************/
  21444. /*! no static exports found */
  21445. /***/ (function(module, exports, __webpack_require__) {
  21446. exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 149)
  21447. exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 152)
  21448. /***/ }),
  21449. /* 149 */
  21450. /*!******************************************!*\
  21451. !*** ./node_modules/pbkdf2/lib/async.js ***!
  21452. \******************************************/
  21453. /*! no static exports found */
  21454. /***/ (function(module, exports, __webpack_require__) {
  21455. /* WEBPACK VAR INJECTION */(function(global) {var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21456. var checkParameters = __webpack_require__(/*! ./precondition */ 150)
  21457. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 151)
  21458. var sync = __webpack_require__(/*! ./sync */ 152)
  21459. var toBuffer = __webpack_require__(/*! ./to-buffer */ 153)
  21460. var ZERO_BUF
  21461. var subtle = global.crypto && global.crypto.subtle
  21462. var toBrowser = {
  21463. sha: 'SHA-1',
  21464. 'sha-1': 'SHA-1',
  21465. sha1: 'SHA-1',
  21466. sha256: 'SHA-256',
  21467. 'sha-256': 'SHA-256',
  21468. sha384: 'SHA-384',
  21469. 'sha-384': 'SHA-384',
  21470. 'sha-512': 'SHA-512',
  21471. sha512: 'SHA-512'
  21472. }
  21473. var checks = []
  21474. function checkNative (algo) {
  21475. if (global.process && !global.process.browser) {
  21476. return Promise.resolve(false)
  21477. }
  21478. if (!subtle || !subtle.importKey || !subtle.deriveBits) {
  21479. return Promise.resolve(false)
  21480. }
  21481. if (checks[algo] !== undefined) {
  21482. return checks[algo]
  21483. }
  21484. ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
  21485. var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
  21486. .then(function () {
  21487. return true
  21488. }).catch(function () {
  21489. return false
  21490. })
  21491. checks[algo] = prom
  21492. return prom
  21493. }
  21494. var nextTick
  21495. function getNextTick () {
  21496. if (nextTick) {
  21497. return nextTick
  21498. }
  21499. if (global.process && global.process.nextTick) {
  21500. nextTick = global.process.nextTick
  21501. } else if (global.queueMicrotask) {
  21502. nextTick = global.queueMicrotask
  21503. } else if (global.setImmediate) {
  21504. nextTick = global.setImmediate
  21505. } else {
  21506. nextTick = global.setTimeout
  21507. }
  21508. return nextTick
  21509. }
  21510. function browserPbkdf2 (password, salt, iterations, length, algo) {
  21511. return subtle.importKey(
  21512. 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']
  21513. ).then(function (key) {
  21514. return subtle.deriveBits({
  21515. name: 'PBKDF2',
  21516. salt: salt,
  21517. iterations: iterations,
  21518. hash: {
  21519. name: algo
  21520. }
  21521. }, key, length << 3)
  21522. }).then(function (res) {
  21523. return Buffer.from(res)
  21524. })
  21525. }
  21526. function resolvePromise (promise, callback) {
  21527. promise.then(function (out) {
  21528. getNextTick()(function () {
  21529. callback(null, out)
  21530. })
  21531. }, function (e) {
  21532. getNextTick()(function () {
  21533. callback(e)
  21534. })
  21535. })
  21536. }
  21537. module.exports = function (password, salt, iterations, keylen, digest, callback) {
  21538. if (typeof digest === 'function') {
  21539. callback = digest
  21540. digest = undefined
  21541. }
  21542. digest = digest || 'sha1'
  21543. var algo = toBrowser[digest.toLowerCase()]
  21544. if (!algo || typeof global.Promise !== 'function') {
  21545. getNextTick()(function () {
  21546. var out
  21547. try {
  21548. out = sync(password, salt, iterations, keylen, digest)
  21549. } catch (e) {
  21550. return callback(e)
  21551. }
  21552. callback(null, out)
  21553. })
  21554. return
  21555. }
  21556. checkParameters(iterations, keylen)
  21557. password = toBuffer(password, defaultEncoding, 'Password')
  21558. salt = toBuffer(salt, defaultEncoding, 'Salt')
  21559. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  21560. resolvePromise(checkNative(algo).then(function (resp) {
  21561. if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
  21562. return sync(password, salt, iterations, keylen, digest)
  21563. }), callback)
  21564. }
  21565. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  21566. /***/ }),
  21567. /* 150 */
  21568. /*!*************************************************!*\
  21569. !*** ./node_modules/pbkdf2/lib/precondition.js ***!
  21570. \*************************************************/
  21571. /*! no static exports found */
  21572. /***/ (function(module, exports) {
  21573. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  21574. module.exports = function (iterations, keylen) {
  21575. if (typeof iterations !== 'number') {
  21576. throw new TypeError('Iterations not a number')
  21577. }
  21578. if (iterations < 0) {
  21579. throw new TypeError('Bad iterations')
  21580. }
  21581. if (typeof keylen !== 'number') {
  21582. throw new TypeError('Key length not a number')
  21583. }
  21584. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  21585. throw new TypeError('Bad key length')
  21586. }
  21587. }
  21588. /***/ }),
  21589. /* 151 */
  21590. /*!*****************************************************!*\
  21591. !*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
  21592. \*****************************************************/
  21593. /*! no static exports found */
  21594. /***/ (function(module, exports, __webpack_require__) {
  21595. /* WEBPACK VAR INJECTION */(function(global, process) {var defaultEncoding
  21596. /* istanbul ignore next */
  21597. if (global.process && global.process.browser) {
  21598. defaultEncoding = 'utf-8'
  21599. } else if (global.process && global.process.version) {
  21600. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  21601. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  21602. } else {
  21603. defaultEncoding = 'utf-8'
  21604. }
  21605. module.exports = defaultEncoding
  21606. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 101)))
  21607. /***/ }),
  21608. /* 152 */
  21609. /*!*************************************************!*\
  21610. !*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
  21611. \*************************************************/
  21612. /*! no static exports found */
  21613. /***/ (function(module, exports, __webpack_require__) {
  21614. var md5 = __webpack_require__(/*! create-hash/md5 */ 145)
  21615. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 128)
  21616. var sha = __webpack_require__(/*! sha.js */ 129)
  21617. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21618. var checkParameters = __webpack_require__(/*! ./precondition */ 150)
  21619. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 151)
  21620. var toBuffer = __webpack_require__(/*! ./to-buffer */ 153)
  21621. var ZEROS = Buffer.alloc(128)
  21622. var sizes = {
  21623. md5: 16,
  21624. sha1: 20,
  21625. sha224: 28,
  21626. sha256: 32,
  21627. sha384: 48,
  21628. sha512: 64,
  21629. rmd160: 20,
  21630. ripemd160: 20
  21631. }
  21632. function Hmac (alg, key, saltLen) {
  21633. var hash = getDigest(alg)
  21634. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  21635. if (key.length > blocksize) {
  21636. key = hash(key)
  21637. } else if (key.length < blocksize) {
  21638. key = Buffer.concat([key, ZEROS], blocksize)
  21639. }
  21640. var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
  21641. var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
  21642. for (var i = 0; i < blocksize; i++) {
  21643. ipad[i] = key[i] ^ 0x36
  21644. opad[i] = key[i] ^ 0x5C
  21645. }
  21646. var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
  21647. ipad.copy(ipad1, 0, 0, blocksize)
  21648. this.ipad1 = ipad1
  21649. this.ipad2 = ipad
  21650. this.opad = opad
  21651. this.alg = alg
  21652. this.blocksize = blocksize
  21653. this.hash = hash
  21654. this.size = sizes[alg]
  21655. }
  21656. Hmac.prototype.run = function (data, ipad) {
  21657. data.copy(ipad, this.blocksize)
  21658. var h = this.hash(ipad)
  21659. h.copy(this.opad, this.blocksize)
  21660. return this.hash(this.opad)
  21661. }
  21662. function getDigest (alg) {
  21663. function shaFunc (data) {
  21664. return sha(alg).update(data).digest()
  21665. }
  21666. function rmd160Func (data) {
  21667. return new RIPEMD160().update(data).digest()
  21668. }
  21669. if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
  21670. if (alg === 'md5') return md5
  21671. return shaFunc
  21672. }
  21673. function pbkdf2 (password, salt, iterations, keylen, digest) {
  21674. checkParameters(iterations, keylen)
  21675. password = toBuffer(password, defaultEncoding, 'Password')
  21676. salt = toBuffer(salt, defaultEncoding, 'Salt')
  21677. digest = digest || 'sha1'
  21678. var hmac = new Hmac(digest, password, salt.length)
  21679. var DK = Buffer.allocUnsafe(keylen)
  21680. var block1 = Buffer.allocUnsafe(salt.length + 4)
  21681. salt.copy(block1, 0, 0, salt.length)
  21682. var destPos = 0
  21683. var hLen = sizes[digest]
  21684. var l = Math.ceil(keylen / hLen)
  21685. for (var i = 1; i <= l; i++) {
  21686. block1.writeUInt32BE(i, salt.length)
  21687. var T = hmac.run(block1, hmac.ipad1)
  21688. var U = T
  21689. for (var j = 1; j < iterations; j++) {
  21690. U = hmac.run(U, hmac.ipad2)
  21691. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  21692. }
  21693. T.copy(DK, destPos)
  21694. destPos += hLen
  21695. }
  21696. return DK
  21697. }
  21698. module.exports = pbkdf2
  21699. /***/ }),
  21700. /* 153 */
  21701. /*!**********************************************!*\
  21702. !*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
  21703. \**********************************************/
  21704. /*! no static exports found */
  21705. /***/ (function(module, exports, __webpack_require__) {
  21706. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21707. module.exports = function (thing, encoding, name) {
  21708. if (Buffer.isBuffer(thing)) {
  21709. return thing
  21710. } else if (typeof thing === 'string') {
  21711. return Buffer.from(thing, encoding)
  21712. } else if (ArrayBuffer.isView(thing)) {
  21713. return Buffer.from(thing.buffer)
  21714. } else {
  21715. throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
  21716. }
  21717. }
  21718. /***/ }),
  21719. /* 154 */
  21720. /*!***************************************************!*\
  21721. !*** ./node_modules/browserify-cipher/browser.js ***!
  21722. \***************************************************/
  21723. /*! no static exports found */
  21724. /***/ (function(module, exports, __webpack_require__) {
  21725. var DES = __webpack_require__(/*! browserify-des */ 155)
  21726. var aes = __webpack_require__(/*! browserify-aes/browser */ 163)
  21727. var aesModes = __webpack_require__(/*! browserify-aes/modes */ 165)
  21728. var desModes = __webpack_require__(/*! browserify-des/modes */ 182)
  21729. var ebtk = __webpack_require__(/*! evp_bytestokey */ 180)
  21730. function createCipher (suite, password) {
  21731. suite = suite.toLowerCase()
  21732. var keyLen, ivLen
  21733. if (aesModes[suite]) {
  21734. keyLen = aesModes[suite].key
  21735. ivLen = aesModes[suite].iv
  21736. } else if (desModes[suite]) {
  21737. keyLen = desModes[suite].key * 8
  21738. ivLen = desModes[suite].iv
  21739. } else {
  21740. throw new TypeError('invalid suite type')
  21741. }
  21742. var keys = ebtk(password, false, keyLen, ivLen)
  21743. return createCipheriv(suite, keys.key, keys.iv)
  21744. }
  21745. function createDecipher (suite, password) {
  21746. suite = suite.toLowerCase()
  21747. var keyLen, ivLen
  21748. if (aesModes[suite]) {
  21749. keyLen = aesModes[suite].key
  21750. ivLen = aesModes[suite].iv
  21751. } else if (desModes[suite]) {
  21752. keyLen = desModes[suite].key * 8
  21753. ivLen = desModes[suite].iv
  21754. } else {
  21755. throw new TypeError('invalid suite type')
  21756. }
  21757. var keys = ebtk(password, false, keyLen, ivLen)
  21758. return createDecipheriv(suite, keys.key, keys.iv)
  21759. }
  21760. function createCipheriv (suite, key, iv) {
  21761. suite = suite.toLowerCase()
  21762. if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
  21763. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
  21764. throw new TypeError('invalid suite type')
  21765. }
  21766. function createDecipheriv (suite, key, iv) {
  21767. suite = suite.toLowerCase()
  21768. if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
  21769. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
  21770. throw new TypeError('invalid suite type')
  21771. }
  21772. function getCiphers () {
  21773. return Object.keys(desModes).concat(aes.getCiphers())
  21774. }
  21775. exports.createCipher = exports.Cipher = createCipher
  21776. exports.createCipheriv = exports.Cipheriv = createCipheriv
  21777. exports.createDecipher = exports.Decipher = createDecipher
  21778. exports.createDecipheriv = exports.Decipheriv = createDecipheriv
  21779. exports.listCiphers = exports.getCiphers = getCiphers
  21780. /***/ }),
  21781. /* 155 */
  21782. /*!**********************************************!*\
  21783. !*** ./node_modules/browserify-des/index.js ***!
  21784. \**********************************************/
  21785. /*! no static exports found */
  21786. /***/ (function(module, exports, __webpack_require__) {
  21787. var CipherBase = __webpack_require__(/*! cipher-base */ 137)
  21788. var des = __webpack_require__(/*! des.js */ 156)
  21789. var inherits = __webpack_require__(/*! inherits */ 109)
  21790. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  21791. var modes = {
  21792. 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
  21793. 'des-ede3': des.EDE,
  21794. 'des-ede-cbc': des.CBC.instantiate(des.EDE),
  21795. 'des-ede': des.EDE,
  21796. 'des-cbc': des.CBC.instantiate(des.DES),
  21797. 'des-ecb': des.DES
  21798. }
  21799. modes.des = modes['des-cbc']
  21800. modes.des3 = modes['des-ede3-cbc']
  21801. module.exports = DES
  21802. inherits(DES, CipherBase)
  21803. function DES (opts) {
  21804. CipherBase.call(this)
  21805. var modeName = opts.mode.toLowerCase()
  21806. var mode = modes[modeName]
  21807. var type
  21808. if (opts.decrypt) {
  21809. type = 'decrypt'
  21810. } else {
  21811. type = 'encrypt'
  21812. }
  21813. var key = opts.key
  21814. if (!Buffer.isBuffer(key)) {
  21815. key = Buffer.from(key)
  21816. }
  21817. if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
  21818. key = Buffer.concat([key, key.slice(0, 8)])
  21819. }
  21820. var iv = opts.iv
  21821. if (!Buffer.isBuffer(iv)) {
  21822. iv = Buffer.from(iv)
  21823. }
  21824. this._des = mode.create({
  21825. key: key,
  21826. iv: iv,
  21827. type: type
  21828. })
  21829. }
  21830. DES.prototype._update = function (data) {
  21831. return Buffer.from(this._des.update(data))
  21832. }
  21833. DES.prototype._final = function () {
  21834. return Buffer.from(this._des.final())
  21835. }
  21836. /***/ }),
  21837. /* 156 */
  21838. /*!****************************************!*\
  21839. !*** ./node_modules/des.js/lib/des.js ***!
  21840. \****************************************/
  21841. /*! no static exports found */
  21842. /***/ (function(module, exports, __webpack_require__) {
  21843. "use strict";
  21844. exports.utils = __webpack_require__(/*! ./des/utils */ 157);
  21845. exports.Cipher = __webpack_require__(/*! ./des/cipher */ 158);
  21846. exports.DES = __webpack_require__(/*! ./des/des */ 160);
  21847. exports.CBC = __webpack_require__(/*! ./des/cbc */ 161);
  21848. exports.EDE = __webpack_require__(/*! ./des/ede */ 162);
  21849. /***/ }),
  21850. /* 157 */
  21851. /*!**********************************************!*\
  21852. !*** ./node_modules/des.js/lib/des/utils.js ***!
  21853. \**********************************************/
  21854. /*! no static exports found */
  21855. /***/ (function(module, exports, __webpack_require__) {
  21856. "use strict";
  21857. exports.readUInt32BE = function readUInt32BE(bytes, off) {
  21858. var res = (bytes[0 + off] << 24) |
  21859. (bytes[1 + off] << 16) |
  21860. (bytes[2 + off] << 8) |
  21861. bytes[3 + off];
  21862. return res >>> 0;
  21863. };
  21864. exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
  21865. bytes[0 + off] = value >>> 24;
  21866. bytes[1 + off] = (value >>> 16) & 0xff;
  21867. bytes[2 + off] = (value >>> 8) & 0xff;
  21868. bytes[3 + off] = value & 0xff;
  21869. };
  21870. exports.ip = function ip(inL, inR, out, off) {
  21871. var outL = 0;
  21872. var outR = 0;
  21873. for (var i = 6; i >= 0; i -= 2) {
  21874. for (var j = 0; j <= 24; j += 8) {
  21875. outL <<= 1;
  21876. outL |= (inR >>> (j + i)) & 1;
  21877. }
  21878. for (var j = 0; j <= 24; j += 8) {
  21879. outL <<= 1;
  21880. outL |= (inL >>> (j + i)) & 1;
  21881. }
  21882. }
  21883. for (var i = 6; i >= 0; i -= 2) {
  21884. for (var j = 1; j <= 25; j += 8) {
  21885. outR <<= 1;
  21886. outR |= (inR >>> (j + i)) & 1;
  21887. }
  21888. for (var j = 1; j <= 25; j += 8) {
  21889. outR <<= 1;
  21890. outR |= (inL >>> (j + i)) & 1;
  21891. }
  21892. }
  21893. out[off + 0] = outL >>> 0;
  21894. out[off + 1] = outR >>> 0;
  21895. };
  21896. exports.rip = function rip(inL, inR, out, off) {
  21897. var outL = 0;
  21898. var outR = 0;
  21899. for (var i = 0; i < 4; i++) {
  21900. for (var j = 24; j >= 0; j -= 8) {
  21901. outL <<= 1;
  21902. outL |= (inR >>> (j + i)) & 1;
  21903. outL <<= 1;
  21904. outL |= (inL >>> (j + i)) & 1;
  21905. }
  21906. }
  21907. for (var i = 4; i < 8; i++) {
  21908. for (var j = 24; j >= 0; j -= 8) {
  21909. outR <<= 1;
  21910. outR |= (inR >>> (j + i)) & 1;
  21911. outR <<= 1;
  21912. outR |= (inL >>> (j + i)) & 1;
  21913. }
  21914. }
  21915. out[off + 0] = outL >>> 0;
  21916. out[off + 1] = outR >>> 0;
  21917. };
  21918. exports.pc1 = function pc1(inL, inR, out, off) {
  21919. var outL = 0;
  21920. var outR = 0;
  21921. // 7, 15, 23, 31, 39, 47, 55, 63
  21922. // 6, 14, 22, 30, 39, 47, 55, 63
  21923. // 5, 13, 21, 29, 39, 47, 55, 63
  21924. // 4, 12, 20, 28
  21925. for (var i = 7; i >= 5; i--) {
  21926. for (var j = 0; j <= 24; j += 8) {
  21927. outL <<= 1;
  21928. outL |= (inR >> (j + i)) & 1;
  21929. }
  21930. for (var j = 0; j <= 24; j += 8) {
  21931. outL <<= 1;
  21932. outL |= (inL >> (j + i)) & 1;
  21933. }
  21934. }
  21935. for (var j = 0; j <= 24; j += 8) {
  21936. outL <<= 1;
  21937. outL |= (inR >> (j + i)) & 1;
  21938. }
  21939. // 1, 9, 17, 25, 33, 41, 49, 57
  21940. // 2, 10, 18, 26, 34, 42, 50, 58
  21941. // 3, 11, 19, 27, 35, 43, 51, 59
  21942. // 36, 44, 52, 60
  21943. for (var i = 1; i <= 3; i++) {
  21944. for (var j = 0; j <= 24; j += 8) {
  21945. outR <<= 1;
  21946. outR |= (inR >> (j + i)) & 1;
  21947. }
  21948. for (var j = 0; j <= 24; j += 8) {
  21949. outR <<= 1;
  21950. outR |= (inL >> (j + i)) & 1;
  21951. }
  21952. }
  21953. for (var j = 0; j <= 24; j += 8) {
  21954. outR <<= 1;
  21955. outR |= (inL >> (j + i)) & 1;
  21956. }
  21957. out[off + 0] = outL >>> 0;
  21958. out[off + 1] = outR >>> 0;
  21959. };
  21960. exports.r28shl = function r28shl(num, shift) {
  21961. return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
  21962. };
  21963. var pc2table = [
  21964. // inL => outL
  21965. 14, 11, 17, 4, 27, 23, 25, 0,
  21966. 13, 22, 7, 18, 5, 9, 16, 24,
  21967. 2, 20, 12, 21, 1, 8, 15, 26,
  21968. // inR => outR
  21969. 15, 4, 25, 19, 9, 1, 26, 16,
  21970. 5, 11, 23, 8, 12, 7, 17, 0,
  21971. 22, 3, 10, 14, 6, 20, 27, 24
  21972. ];
  21973. exports.pc2 = function pc2(inL, inR, out, off) {
  21974. var outL = 0;
  21975. var outR = 0;
  21976. var len = pc2table.length >>> 1;
  21977. for (var i = 0; i < len; i++) {
  21978. outL <<= 1;
  21979. outL |= (inL >>> pc2table[i]) & 0x1;
  21980. }
  21981. for (var i = len; i < pc2table.length; i++) {
  21982. outR <<= 1;
  21983. outR |= (inR >>> pc2table[i]) & 0x1;
  21984. }
  21985. out[off + 0] = outL >>> 0;
  21986. out[off + 1] = outR >>> 0;
  21987. };
  21988. exports.expand = function expand(r, out, off) {
  21989. var outL = 0;
  21990. var outR = 0;
  21991. outL = ((r & 1) << 5) | (r >>> 27);
  21992. for (var i = 23; i >= 15; i -= 4) {
  21993. outL <<= 6;
  21994. outL |= (r >>> i) & 0x3f;
  21995. }
  21996. for (var i = 11; i >= 3; i -= 4) {
  21997. outR |= (r >>> i) & 0x3f;
  21998. outR <<= 6;
  21999. }
  22000. outR |= ((r & 0x1f) << 1) | (r >>> 31);
  22001. out[off + 0] = outL >>> 0;
  22002. out[off + 1] = outR >>> 0;
  22003. };
  22004. var sTable = [
  22005. 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
  22006. 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
  22007. 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
  22008. 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
  22009. 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
  22010. 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
  22011. 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
  22012. 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
  22013. 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
  22014. 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
  22015. 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
  22016. 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
  22017. 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
  22018. 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
  22019. 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
  22020. 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
  22021. 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
  22022. 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
  22023. 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
  22024. 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
  22025. 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
  22026. 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
  22027. 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
  22028. 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
  22029. 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
  22030. 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
  22031. 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
  22032. 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
  22033. 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
  22034. 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
  22035. 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
  22036. 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
  22037. ];
  22038. exports.substitute = function substitute(inL, inR) {
  22039. var out = 0;
  22040. for (var i = 0; i < 4; i++) {
  22041. var b = (inL >>> (18 - i * 6)) & 0x3f;
  22042. var sb = sTable[i * 0x40 + b];
  22043. out <<= 4;
  22044. out |= sb;
  22045. }
  22046. for (var i = 0; i < 4; i++) {
  22047. var b = (inR >>> (18 - i * 6)) & 0x3f;
  22048. var sb = sTable[4 * 0x40 + i * 0x40 + b];
  22049. out <<= 4;
  22050. out |= sb;
  22051. }
  22052. return out >>> 0;
  22053. };
  22054. var permuteTable = [
  22055. 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
  22056. 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
  22057. ];
  22058. exports.permute = function permute(num) {
  22059. var out = 0;
  22060. for (var i = 0; i < permuteTable.length; i++) {
  22061. out <<= 1;
  22062. out |= (num >>> permuteTable[i]) & 0x1;
  22063. }
  22064. return out >>> 0;
  22065. };
  22066. exports.padSplit = function padSplit(num, size, group) {
  22067. var str = num.toString(2);
  22068. while (str.length < size)
  22069. str = '0' + str;
  22070. var out = [];
  22071. for (var i = 0; i < size; i += group)
  22072. out.push(str.slice(i, i + group));
  22073. return out.join(' ');
  22074. };
  22075. /***/ }),
  22076. /* 158 */
  22077. /*!***********************************************!*\
  22078. !*** ./node_modules/des.js/lib/des/cipher.js ***!
  22079. \***********************************************/
  22080. /*! no static exports found */
  22081. /***/ (function(module, exports, __webpack_require__) {
  22082. "use strict";
  22083. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  22084. function Cipher(options) {
  22085. this.options = options;
  22086. this.type = this.options.type;
  22087. this.blockSize = 8;
  22088. this._init();
  22089. this.buffer = new Array(this.blockSize);
  22090. this.bufferOff = 0;
  22091. }
  22092. module.exports = Cipher;
  22093. Cipher.prototype._init = function _init() {
  22094. // Might be overrided
  22095. };
  22096. Cipher.prototype.update = function update(data) {
  22097. if (data.length === 0)
  22098. return [];
  22099. if (this.type === 'decrypt')
  22100. return this._updateDecrypt(data);
  22101. else
  22102. return this._updateEncrypt(data);
  22103. };
  22104. Cipher.prototype._buffer = function _buffer(data, off) {
  22105. // Append data to buffer
  22106. var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
  22107. for (var i = 0; i < min; i++)
  22108. this.buffer[this.bufferOff + i] = data[off + i];
  22109. this.bufferOff += min;
  22110. // Shift next
  22111. return min;
  22112. };
  22113. Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
  22114. this._update(this.buffer, 0, out, off);
  22115. this.bufferOff = 0;
  22116. return this.blockSize;
  22117. };
  22118. Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
  22119. var inputOff = 0;
  22120. var outputOff = 0;
  22121. var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
  22122. var out = new Array(count * this.blockSize);
  22123. if (this.bufferOff !== 0) {
  22124. inputOff += this._buffer(data, inputOff);
  22125. if (this.bufferOff === this.buffer.length)
  22126. outputOff += this._flushBuffer(out, outputOff);
  22127. }
  22128. // Write blocks
  22129. var max = data.length - ((data.length - inputOff) % this.blockSize);
  22130. for (; inputOff < max; inputOff += this.blockSize) {
  22131. this._update(data, inputOff, out, outputOff);
  22132. outputOff += this.blockSize;
  22133. }
  22134. // Queue rest
  22135. for (; inputOff < data.length; inputOff++, this.bufferOff++)
  22136. this.buffer[this.bufferOff] = data[inputOff];
  22137. return out;
  22138. };
  22139. Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
  22140. var inputOff = 0;
  22141. var outputOff = 0;
  22142. var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
  22143. var out = new Array(count * this.blockSize);
  22144. // TODO(indutny): optimize it, this is far from optimal
  22145. for (; count > 0; count--) {
  22146. inputOff += this._buffer(data, inputOff);
  22147. outputOff += this._flushBuffer(out, outputOff);
  22148. }
  22149. // Buffer rest of the input
  22150. inputOff += this._buffer(data, inputOff);
  22151. return out;
  22152. };
  22153. Cipher.prototype.final = function final(buffer) {
  22154. var first;
  22155. if (buffer)
  22156. first = this.update(buffer);
  22157. var last;
  22158. if (this.type === 'encrypt')
  22159. last = this._finalEncrypt();
  22160. else
  22161. last = this._finalDecrypt();
  22162. if (first)
  22163. return first.concat(last);
  22164. else
  22165. return last;
  22166. };
  22167. Cipher.prototype._pad = function _pad(buffer, off) {
  22168. if (off === 0)
  22169. return false;
  22170. while (off < buffer.length)
  22171. buffer[off++] = 0;
  22172. return true;
  22173. };
  22174. Cipher.prototype._finalEncrypt = function _finalEncrypt() {
  22175. if (!this._pad(this.buffer, this.bufferOff))
  22176. return [];
  22177. var out = new Array(this.blockSize);
  22178. this._update(this.buffer, 0, out, 0);
  22179. return out;
  22180. };
  22181. Cipher.prototype._unpad = function _unpad(buffer) {
  22182. return buffer;
  22183. };
  22184. Cipher.prototype._finalDecrypt = function _finalDecrypt() {
  22185. assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
  22186. var out = new Array(this.blockSize);
  22187. this._flushBuffer(out, 0);
  22188. return this._unpad(out);
  22189. };
  22190. /***/ }),
  22191. /* 159 */
  22192. /*!***************************************************!*\
  22193. !*** ./node_modules/minimalistic-assert/index.js ***!
  22194. \***************************************************/
  22195. /*! no static exports found */
  22196. /***/ (function(module, exports) {
  22197. module.exports = assert;
  22198. function assert(val, msg) {
  22199. if (!val)
  22200. throw new Error(msg || 'Assertion failed');
  22201. }
  22202. assert.equal = function assertEqual(l, r, msg) {
  22203. if (l != r)
  22204. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  22205. };
  22206. /***/ }),
  22207. /* 160 */
  22208. /*!********************************************!*\
  22209. !*** ./node_modules/des.js/lib/des/des.js ***!
  22210. \********************************************/
  22211. /*! no static exports found */
  22212. /***/ (function(module, exports, __webpack_require__) {
  22213. "use strict";
  22214. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  22215. var inherits = __webpack_require__(/*! inherits */ 109);
  22216. var utils = __webpack_require__(/*! ./utils */ 157);
  22217. var Cipher = __webpack_require__(/*! ./cipher */ 158);
  22218. function DESState() {
  22219. this.tmp = new Array(2);
  22220. this.keys = null;
  22221. }
  22222. function DES(options) {
  22223. Cipher.call(this, options);
  22224. var state = new DESState();
  22225. this._desState = state;
  22226. this.deriveKeys(state, options.key);
  22227. }
  22228. inherits(DES, Cipher);
  22229. module.exports = DES;
  22230. DES.create = function create(options) {
  22231. return new DES(options);
  22232. };
  22233. var shiftTable = [
  22234. 1, 1, 2, 2, 2, 2, 2, 2,
  22235. 1, 2, 2, 2, 2, 2, 2, 1
  22236. ];
  22237. DES.prototype.deriveKeys = function deriveKeys(state, key) {
  22238. state.keys = new Array(16 * 2);
  22239. assert.equal(key.length, this.blockSize, 'Invalid key length');
  22240. var kL = utils.readUInt32BE(key, 0);
  22241. var kR = utils.readUInt32BE(key, 4);
  22242. utils.pc1(kL, kR, state.tmp, 0);
  22243. kL = state.tmp[0];
  22244. kR = state.tmp[1];
  22245. for (var i = 0; i < state.keys.length; i += 2) {
  22246. var shift = shiftTable[i >>> 1];
  22247. kL = utils.r28shl(kL, shift);
  22248. kR = utils.r28shl(kR, shift);
  22249. utils.pc2(kL, kR, state.keys, i);
  22250. }
  22251. };
  22252. DES.prototype._update = function _update(inp, inOff, out, outOff) {
  22253. var state = this._desState;
  22254. var l = utils.readUInt32BE(inp, inOff);
  22255. var r = utils.readUInt32BE(inp, inOff + 4);
  22256. // Initial Permutation
  22257. utils.ip(l, r, state.tmp, 0);
  22258. l = state.tmp[0];
  22259. r = state.tmp[1];
  22260. if (this.type === 'encrypt')
  22261. this._encrypt(state, l, r, state.tmp, 0);
  22262. else
  22263. this._decrypt(state, l, r, state.tmp, 0);
  22264. l = state.tmp[0];
  22265. r = state.tmp[1];
  22266. utils.writeUInt32BE(out, l, outOff);
  22267. utils.writeUInt32BE(out, r, outOff + 4);
  22268. };
  22269. DES.prototype._pad = function _pad(buffer, off) {
  22270. var value = buffer.length - off;
  22271. for (var i = off; i < buffer.length; i++)
  22272. buffer[i] = value;
  22273. return true;
  22274. };
  22275. DES.prototype._unpad = function _unpad(buffer) {
  22276. var pad = buffer[buffer.length - 1];
  22277. for (var i = buffer.length - pad; i < buffer.length; i++)
  22278. assert.equal(buffer[i], pad);
  22279. return buffer.slice(0, buffer.length - pad);
  22280. };
  22281. DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
  22282. var l = lStart;
  22283. var r = rStart;
  22284. // Apply f() x16 times
  22285. for (var i = 0; i < state.keys.length; i += 2) {
  22286. var keyL = state.keys[i];
  22287. var keyR = state.keys[i + 1];
  22288. // f(r, k)
  22289. utils.expand(r, state.tmp, 0);
  22290. keyL ^= state.tmp[0];
  22291. keyR ^= state.tmp[1];
  22292. var s = utils.substitute(keyL, keyR);
  22293. var f = utils.permute(s);
  22294. var t = r;
  22295. r = (l ^ f) >>> 0;
  22296. l = t;
  22297. }
  22298. // Reverse Initial Permutation
  22299. utils.rip(r, l, out, off);
  22300. };
  22301. DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
  22302. var l = rStart;
  22303. var r = lStart;
  22304. // Apply f() x16 times
  22305. for (var i = state.keys.length - 2; i >= 0; i -= 2) {
  22306. var keyL = state.keys[i];
  22307. var keyR = state.keys[i + 1];
  22308. // f(r, k)
  22309. utils.expand(l, state.tmp, 0);
  22310. keyL ^= state.tmp[0];
  22311. keyR ^= state.tmp[1];
  22312. var s = utils.substitute(keyL, keyR);
  22313. var f = utils.permute(s);
  22314. var t = l;
  22315. l = (r ^ f) >>> 0;
  22316. r = t;
  22317. }
  22318. // Reverse Initial Permutation
  22319. utils.rip(l, r, out, off);
  22320. };
  22321. /***/ }),
  22322. /* 161 */
  22323. /*!********************************************!*\
  22324. !*** ./node_modules/des.js/lib/des/cbc.js ***!
  22325. \********************************************/
  22326. /*! no static exports found */
  22327. /***/ (function(module, exports, __webpack_require__) {
  22328. "use strict";
  22329. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  22330. var inherits = __webpack_require__(/*! inherits */ 109);
  22331. var proto = {};
  22332. function CBCState(iv) {
  22333. assert.equal(iv.length, 8, 'Invalid IV length');
  22334. this.iv = new Array(8);
  22335. for (var i = 0; i < this.iv.length; i++)
  22336. this.iv[i] = iv[i];
  22337. }
  22338. function instantiate(Base) {
  22339. function CBC(options) {
  22340. Base.call(this, options);
  22341. this._cbcInit();
  22342. }
  22343. inherits(CBC, Base);
  22344. var keys = Object.keys(proto);
  22345. for (var i = 0; i < keys.length; i++) {
  22346. var key = keys[i];
  22347. CBC.prototype[key] = proto[key];
  22348. }
  22349. CBC.create = function create(options) {
  22350. return new CBC(options);
  22351. };
  22352. return CBC;
  22353. }
  22354. exports.instantiate = instantiate;
  22355. proto._cbcInit = function _cbcInit() {
  22356. var state = new CBCState(this.options.iv);
  22357. this._cbcState = state;
  22358. };
  22359. proto._update = function _update(inp, inOff, out, outOff) {
  22360. var state = this._cbcState;
  22361. var superProto = this.constructor.super_.prototype;
  22362. var iv = state.iv;
  22363. if (this.type === 'encrypt') {
  22364. for (var i = 0; i < this.blockSize; i++)
  22365. iv[i] ^= inp[inOff + i];
  22366. superProto._update.call(this, iv, 0, out, outOff);
  22367. for (var i = 0; i < this.blockSize; i++)
  22368. iv[i] = out[outOff + i];
  22369. } else {
  22370. superProto._update.call(this, inp, inOff, out, outOff);
  22371. for (var i = 0; i < this.blockSize; i++)
  22372. out[outOff + i] ^= iv[i];
  22373. for (var i = 0; i < this.blockSize; i++)
  22374. iv[i] = inp[inOff + i];
  22375. }
  22376. };
  22377. /***/ }),
  22378. /* 162 */
  22379. /*!********************************************!*\
  22380. !*** ./node_modules/des.js/lib/des/ede.js ***!
  22381. \********************************************/
  22382. /*! no static exports found */
  22383. /***/ (function(module, exports, __webpack_require__) {
  22384. "use strict";
  22385. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  22386. var inherits = __webpack_require__(/*! inherits */ 109);
  22387. var Cipher = __webpack_require__(/*! ./cipher */ 158);
  22388. var DES = __webpack_require__(/*! ./des */ 160);
  22389. function EDEState(type, key) {
  22390. assert.equal(key.length, 24, 'Invalid key length');
  22391. var k1 = key.slice(0, 8);
  22392. var k2 = key.slice(8, 16);
  22393. var k3 = key.slice(16, 24);
  22394. if (type === 'encrypt') {
  22395. this.ciphers = [
  22396. DES.create({ type: 'encrypt', key: k1 }),
  22397. DES.create({ type: 'decrypt', key: k2 }),
  22398. DES.create({ type: 'encrypt', key: k3 })
  22399. ];
  22400. } else {
  22401. this.ciphers = [
  22402. DES.create({ type: 'decrypt', key: k3 }),
  22403. DES.create({ type: 'encrypt', key: k2 }),
  22404. DES.create({ type: 'decrypt', key: k1 })
  22405. ];
  22406. }
  22407. }
  22408. function EDE(options) {
  22409. Cipher.call(this, options);
  22410. var state = new EDEState(this.type, this.options.key);
  22411. this._edeState = state;
  22412. }
  22413. inherits(EDE, Cipher);
  22414. module.exports = EDE;
  22415. EDE.create = function create(options) {
  22416. return new EDE(options);
  22417. };
  22418. EDE.prototype._update = function _update(inp, inOff, out, outOff) {
  22419. var state = this._edeState;
  22420. state.ciphers[0]._update(inp, inOff, out, outOff);
  22421. state.ciphers[1]._update(out, outOff, out, outOff);
  22422. state.ciphers[2]._update(out, outOff, out, outOff);
  22423. };
  22424. EDE.prototype._pad = DES.prototype._pad;
  22425. EDE.prototype._unpad = DES.prototype._unpad;
  22426. /***/ }),
  22427. /* 163 */
  22428. /*!************************************************!*\
  22429. !*** ./node_modules/browserify-aes/browser.js ***!
  22430. \************************************************/
  22431. /*! no static exports found */
  22432. /***/ (function(module, exports, __webpack_require__) {
  22433. var ciphers = __webpack_require__(/*! ./encrypter */ 164)
  22434. var deciphers = __webpack_require__(/*! ./decrypter */ 181)
  22435. var modes = __webpack_require__(/*! ./modes/list.json */ 175)
  22436. function getCiphers () {
  22437. return Object.keys(modes)
  22438. }
  22439. exports.createCipher = exports.Cipher = ciphers.createCipher
  22440. exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
  22441. exports.createDecipher = exports.Decipher = deciphers.createDecipher
  22442. exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
  22443. exports.listCiphers = exports.getCiphers = getCiphers
  22444. /***/ }),
  22445. /* 164 */
  22446. /*!**************************************************!*\
  22447. !*** ./node_modules/browserify-aes/encrypter.js ***!
  22448. \**************************************************/
  22449. /*! no static exports found */
  22450. /***/ (function(module, exports, __webpack_require__) {
  22451. var MODES = __webpack_require__(/*! ./modes */ 165)
  22452. var AuthCipher = __webpack_require__(/*! ./authCipher */ 176)
  22453. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22454. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 179)
  22455. var Transform = __webpack_require__(/*! cipher-base */ 137)
  22456. var aes = __webpack_require__(/*! ./aes */ 177)
  22457. var ebtk = __webpack_require__(/*! evp_bytestokey */ 180)
  22458. var inherits = __webpack_require__(/*! inherits */ 109)
  22459. function Cipher (mode, key, iv) {
  22460. Transform.call(this)
  22461. this._cache = new Splitter()
  22462. this._cipher = new aes.AES(key)
  22463. this._prev = Buffer.from(iv)
  22464. this._mode = mode
  22465. this._autopadding = true
  22466. }
  22467. inherits(Cipher, Transform)
  22468. Cipher.prototype._update = function (data) {
  22469. this._cache.add(data)
  22470. var chunk
  22471. var thing
  22472. var out = []
  22473. while ((chunk = this._cache.get())) {
  22474. thing = this._mode.encrypt(this, chunk)
  22475. out.push(thing)
  22476. }
  22477. return Buffer.concat(out)
  22478. }
  22479. var PADDING = Buffer.alloc(16, 0x10)
  22480. Cipher.prototype._final = function () {
  22481. var chunk = this._cache.flush()
  22482. if (this._autopadding) {
  22483. chunk = this._mode.encrypt(this, chunk)
  22484. this._cipher.scrub()
  22485. return chunk
  22486. }
  22487. if (!chunk.equals(PADDING)) {
  22488. this._cipher.scrub()
  22489. throw new Error('data not multiple of block length')
  22490. }
  22491. }
  22492. Cipher.prototype.setAutoPadding = function (setTo) {
  22493. this._autopadding = !!setTo
  22494. return this
  22495. }
  22496. function Splitter () {
  22497. this.cache = Buffer.allocUnsafe(0)
  22498. }
  22499. Splitter.prototype.add = function (data) {
  22500. this.cache = Buffer.concat([this.cache, data])
  22501. }
  22502. Splitter.prototype.get = function () {
  22503. if (this.cache.length > 15) {
  22504. var out = this.cache.slice(0, 16)
  22505. this.cache = this.cache.slice(16)
  22506. return out
  22507. }
  22508. return null
  22509. }
  22510. Splitter.prototype.flush = function () {
  22511. var len = 16 - this.cache.length
  22512. var padBuff = Buffer.allocUnsafe(len)
  22513. var i = -1
  22514. while (++i < len) {
  22515. padBuff.writeUInt8(len, i)
  22516. }
  22517. return Buffer.concat([this.cache, padBuff])
  22518. }
  22519. function createCipheriv (suite, password, iv) {
  22520. var config = MODES[suite.toLowerCase()]
  22521. if (!config) throw new TypeError('invalid suite type')
  22522. if (typeof password === 'string') password = Buffer.from(password)
  22523. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  22524. if (typeof iv === 'string') iv = Buffer.from(iv)
  22525. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  22526. if (config.type === 'stream') {
  22527. return new StreamCipher(config.module, password, iv)
  22528. } else if (config.type === 'auth') {
  22529. return new AuthCipher(config.module, password, iv)
  22530. }
  22531. return new Cipher(config.module, password, iv)
  22532. }
  22533. function createCipher (suite, password) {
  22534. var config = MODES[suite.toLowerCase()]
  22535. if (!config) throw new TypeError('invalid suite type')
  22536. var keys = ebtk(password, false, config.key, config.iv)
  22537. return createCipheriv(suite, keys.key, keys.iv)
  22538. }
  22539. exports.createCipheriv = createCipheriv
  22540. exports.createCipher = createCipher
  22541. /***/ }),
  22542. /* 165 */
  22543. /*!****************************************************!*\
  22544. !*** ./node_modules/browserify-aes/modes/index.js ***!
  22545. \****************************************************/
  22546. /*! no static exports found */
  22547. /***/ (function(module, exports, __webpack_require__) {
  22548. var modeModules = {
  22549. ECB: __webpack_require__(/*! ./ecb */ 166),
  22550. CBC: __webpack_require__(/*! ./cbc */ 167),
  22551. CFB: __webpack_require__(/*! ./cfb */ 169),
  22552. CFB8: __webpack_require__(/*! ./cfb8 */ 170),
  22553. CFB1: __webpack_require__(/*! ./cfb1 */ 171),
  22554. OFB: __webpack_require__(/*! ./ofb */ 172),
  22555. CTR: __webpack_require__(/*! ./ctr */ 173),
  22556. GCM: __webpack_require__(/*! ./ctr */ 173)
  22557. }
  22558. var modes = __webpack_require__(/*! ./list.json */ 175)
  22559. for (var key in modes) {
  22560. modes[key].module = modeModules[modes[key].mode]
  22561. }
  22562. module.exports = modes
  22563. /***/ }),
  22564. /* 166 */
  22565. /*!**************************************************!*\
  22566. !*** ./node_modules/browserify-aes/modes/ecb.js ***!
  22567. \**************************************************/
  22568. /*! no static exports found */
  22569. /***/ (function(module, exports) {
  22570. exports.encrypt = function (self, block) {
  22571. return self._cipher.encryptBlock(block)
  22572. }
  22573. exports.decrypt = function (self, block) {
  22574. return self._cipher.decryptBlock(block)
  22575. }
  22576. /***/ }),
  22577. /* 167 */
  22578. /*!**************************************************!*\
  22579. !*** ./node_modules/browserify-aes/modes/cbc.js ***!
  22580. \**************************************************/
  22581. /*! no static exports found */
  22582. /***/ (function(module, exports, __webpack_require__) {
  22583. var xor = __webpack_require__(/*! buffer-xor */ 168)
  22584. exports.encrypt = function (self, block) {
  22585. var data = xor(block, self._prev)
  22586. self._prev = self._cipher.encryptBlock(data)
  22587. return self._prev
  22588. }
  22589. exports.decrypt = function (self, block) {
  22590. var pad = self._prev
  22591. self._prev = block
  22592. var out = self._cipher.decryptBlock(block)
  22593. return xor(out, pad)
  22594. }
  22595. /***/ }),
  22596. /* 168 */
  22597. /*!******************************************!*\
  22598. !*** ./node_modules/buffer-xor/index.js ***!
  22599. \******************************************/
  22600. /*! no static exports found */
  22601. /***/ (function(module, exports, __webpack_require__) {
  22602. /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
  22603. var length = Math.min(a.length, b.length)
  22604. var buffer = new Buffer(length)
  22605. for (var i = 0; i < length; ++i) {
  22606. buffer[i] = a[i] ^ b[i]
  22607. }
  22608. return buffer
  22609. }
  22610. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 104).Buffer))
  22611. /***/ }),
  22612. /* 169 */
  22613. /*!**************************************************!*\
  22614. !*** ./node_modules/browserify-aes/modes/cfb.js ***!
  22615. \**************************************************/
  22616. /*! no static exports found */
  22617. /***/ (function(module, exports, __webpack_require__) {
  22618. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22619. var xor = __webpack_require__(/*! buffer-xor */ 168)
  22620. function encryptStart (self, data, decrypt) {
  22621. var len = data.length
  22622. var out = xor(data, self._cache)
  22623. self._cache = self._cache.slice(len)
  22624. self._prev = Buffer.concat([self._prev, decrypt ? data : out])
  22625. return out
  22626. }
  22627. exports.encrypt = function (self, data, decrypt) {
  22628. var out = Buffer.allocUnsafe(0)
  22629. var len
  22630. while (data.length) {
  22631. if (self._cache.length === 0) {
  22632. self._cache = self._cipher.encryptBlock(self._prev)
  22633. self._prev = Buffer.allocUnsafe(0)
  22634. }
  22635. if (self._cache.length <= data.length) {
  22636. len = self._cache.length
  22637. out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
  22638. data = data.slice(len)
  22639. } else {
  22640. out = Buffer.concat([out, encryptStart(self, data, decrypt)])
  22641. break
  22642. }
  22643. }
  22644. return out
  22645. }
  22646. /***/ }),
  22647. /* 170 */
  22648. /*!***************************************************!*\
  22649. !*** ./node_modules/browserify-aes/modes/cfb8.js ***!
  22650. \***************************************************/
  22651. /*! no static exports found */
  22652. /***/ (function(module, exports, __webpack_require__) {
  22653. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22654. function encryptByte (self, byteParam, decrypt) {
  22655. var pad = self._cipher.encryptBlock(self._prev)
  22656. var out = pad[0] ^ byteParam
  22657. self._prev = Buffer.concat([
  22658. self._prev.slice(1),
  22659. Buffer.from([decrypt ? byteParam : out])
  22660. ])
  22661. return out
  22662. }
  22663. exports.encrypt = function (self, chunk, decrypt) {
  22664. var len = chunk.length
  22665. var out = Buffer.allocUnsafe(len)
  22666. var i = -1
  22667. while (++i < len) {
  22668. out[i] = encryptByte(self, chunk[i], decrypt)
  22669. }
  22670. return out
  22671. }
  22672. /***/ }),
  22673. /* 171 */
  22674. /*!***************************************************!*\
  22675. !*** ./node_modules/browserify-aes/modes/cfb1.js ***!
  22676. \***************************************************/
  22677. /*! no static exports found */
  22678. /***/ (function(module, exports, __webpack_require__) {
  22679. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22680. function encryptByte (self, byteParam, decrypt) {
  22681. var pad
  22682. var i = -1
  22683. var len = 8
  22684. var out = 0
  22685. var bit, value
  22686. while (++i < len) {
  22687. pad = self._cipher.encryptBlock(self._prev)
  22688. bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
  22689. value = pad[0] ^ bit
  22690. out += ((value & 0x80) >> (i % 8))
  22691. self._prev = shiftIn(self._prev, decrypt ? bit : value)
  22692. }
  22693. return out
  22694. }
  22695. function shiftIn (buffer, value) {
  22696. var len = buffer.length
  22697. var i = -1
  22698. var out = Buffer.allocUnsafe(buffer.length)
  22699. buffer = Buffer.concat([buffer, Buffer.from([value])])
  22700. while (++i < len) {
  22701. out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
  22702. }
  22703. return out
  22704. }
  22705. exports.encrypt = function (self, chunk, decrypt) {
  22706. var len = chunk.length
  22707. var out = Buffer.allocUnsafe(len)
  22708. var i = -1
  22709. while (++i < len) {
  22710. out[i] = encryptByte(self, chunk[i], decrypt)
  22711. }
  22712. return out
  22713. }
  22714. /***/ }),
  22715. /* 172 */
  22716. /*!**************************************************!*\
  22717. !*** ./node_modules/browserify-aes/modes/ofb.js ***!
  22718. \**************************************************/
  22719. /*! no static exports found */
  22720. /***/ (function(module, exports, __webpack_require__) {
  22721. /* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 168)
  22722. function getBlock (self) {
  22723. self._prev = self._cipher.encryptBlock(self._prev)
  22724. return self._prev
  22725. }
  22726. exports.encrypt = function (self, chunk) {
  22727. while (self._cache.length < chunk.length) {
  22728. self._cache = Buffer.concat([self._cache, getBlock(self)])
  22729. }
  22730. var pad = self._cache.slice(0, chunk.length)
  22731. self._cache = self._cache.slice(chunk.length)
  22732. return xor(chunk, pad)
  22733. }
  22734. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 104).Buffer))
  22735. /***/ }),
  22736. /* 173 */
  22737. /*!**************************************************!*\
  22738. !*** ./node_modules/browserify-aes/modes/ctr.js ***!
  22739. \**************************************************/
  22740. /*! no static exports found */
  22741. /***/ (function(module, exports, __webpack_require__) {
  22742. var xor = __webpack_require__(/*! buffer-xor */ 168)
  22743. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22744. var incr32 = __webpack_require__(/*! ../incr32 */ 174)
  22745. function getBlock (self) {
  22746. var out = self._cipher.encryptBlockRaw(self._prev)
  22747. incr32(self._prev)
  22748. return out
  22749. }
  22750. var blockSize = 16
  22751. exports.encrypt = function (self, chunk) {
  22752. var chunkNum = Math.ceil(chunk.length / blockSize)
  22753. var start = self._cache.length
  22754. self._cache = Buffer.concat([
  22755. self._cache,
  22756. Buffer.allocUnsafe(chunkNum * blockSize)
  22757. ])
  22758. for (var i = 0; i < chunkNum; i++) {
  22759. var out = getBlock(self)
  22760. var offset = start + i * blockSize
  22761. self._cache.writeUInt32BE(out[0], offset + 0)
  22762. self._cache.writeUInt32BE(out[1], offset + 4)
  22763. self._cache.writeUInt32BE(out[2], offset + 8)
  22764. self._cache.writeUInt32BE(out[3], offset + 12)
  22765. }
  22766. var pad = self._cache.slice(0, chunk.length)
  22767. self._cache = self._cache.slice(chunk.length)
  22768. return xor(chunk, pad)
  22769. }
  22770. /***/ }),
  22771. /* 174 */
  22772. /*!***********************************************!*\
  22773. !*** ./node_modules/browserify-aes/incr32.js ***!
  22774. \***********************************************/
  22775. /*! no static exports found */
  22776. /***/ (function(module, exports) {
  22777. function incr32 (iv) {
  22778. var len = iv.length
  22779. var item
  22780. while (len--) {
  22781. item = iv.readUInt8(len)
  22782. if (item === 255) {
  22783. iv.writeUInt8(0, len)
  22784. } else {
  22785. item++
  22786. iv.writeUInt8(item, len)
  22787. break
  22788. }
  22789. }
  22790. }
  22791. module.exports = incr32
  22792. /***/ }),
  22793. /* 175 */
  22794. /*!*****************************************************!*\
  22795. !*** ./node_modules/browserify-aes/modes/list.json ***!
  22796. \*****************************************************/
  22797. /*! 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 */
  22798. /***/ (function(module) {
  22799. 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\"}}");
  22800. /***/ }),
  22801. /* 176 */
  22802. /*!***************************************************!*\
  22803. !*** ./node_modules/browserify-aes/authCipher.js ***!
  22804. \***************************************************/
  22805. /*! no static exports found */
  22806. /***/ (function(module, exports, __webpack_require__) {
  22807. var aes = __webpack_require__(/*! ./aes */ 177)
  22808. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22809. var Transform = __webpack_require__(/*! cipher-base */ 137)
  22810. var inherits = __webpack_require__(/*! inherits */ 109)
  22811. var GHASH = __webpack_require__(/*! ./ghash */ 178)
  22812. var xor = __webpack_require__(/*! buffer-xor */ 168)
  22813. var incr32 = __webpack_require__(/*! ./incr32 */ 174)
  22814. function xorTest (a, b) {
  22815. var out = 0
  22816. if (a.length !== b.length) out++
  22817. var len = Math.min(a.length, b.length)
  22818. for (var i = 0; i < len; ++i) {
  22819. out += (a[i] ^ b[i])
  22820. }
  22821. return out
  22822. }
  22823. function calcIv (self, iv, ck) {
  22824. if (iv.length === 12) {
  22825. self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
  22826. return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
  22827. }
  22828. var ghash = new GHASH(ck)
  22829. var len = iv.length
  22830. var toPad = len % 16
  22831. ghash.update(iv)
  22832. if (toPad) {
  22833. toPad = 16 - toPad
  22834. ghash.update(Buffer.alloc(toPad, 0))
  22835. }
  22836. ghash.update(Buffer.alloc(8, 0))
  22837. var ivBits = len * 8
  22838. var tail = Buffer.alloc(8)
  22839. tail.writeUIntBE(ivBits, 0, 8)
  22840. ghash.update(tail)
  22841. self._finID = ghash.state
  22842. var out = Buffer.from(self._finID)
  22843. incr32(out)
  22844. return out
  22845. }
  22846. function StreamCipher (mode, key, iv, decrypt) {
  22847. Transform.call(this)
  22848. var h = Buffer.alloc(4, 0)
  22849. this._cipher = new aes.AES(key)
  22850. var ck = this._cipher.encryptBlock(h)
  22851. this._ghash = new GHASH(ck)
  22852. iv = calcIv(this, iv, ck)
  22853. this._prev = Buffer.from(iv)
  22854. this._cache = Buffer.allocUnsafe(0)
  22855. this._secCache = Buffer.allocUnsafe(0)
  22856. this._decrypt = decrypt
  22857. this._alen = 0
  22858. this._len = 0
  22859. this._mode = mode
  22860. this._authTag = null
  22861. this._called = false
  22862. }
  22863. inherits(StreamCipher, Transform)
  22864. StreamCipher.prototype._update = function (chunk) {
  22865. if (!this._called && this._alen) {
  22866. var rump = 16 - (this._alen % 16)
  22867. if (rump < 16) {
  22868. rump = Buffer.alloc(rump, 0)
  22869. this._ghash.update(rump)
  22870. }
  22871. }
  22872. this._called = true
  22873. var out = this._mode.encrypt(this, chunk)
  22874. if (this._decrypt) {
  22875. this._ghash.update(chunk)
  22876. } else {
  22877. this._ghash.update(out)
  22878. }
  22879. this._len += chunk.length
  22880. return out
  22881. }
  22882. StreamCipher.prototype._final = function () {
  22883. if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
  22884. var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
  22885. if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
  22886. this._authTag = tag
  22887. this._cipher.scrub()
  22888. }
  22889. StreamCipher.prototype.getAuthTag = function getAuthTag () {
  22890. if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
  22891. return this._authTag
  22892. }
  22893. StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
  22894. if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
  22895. this._authTag = tag
  22896. }
  22897. StreamCipher.prototype.setAAD = function setAAD (buf) {
  22898. if (this._called) throw new Error('Attempting to set AAD in unsupported state')
  22899. this._ghash.update(buf)
  22900. this._alen += buf.length
  22901. }
  22902. module.exports = StreamCipher
  22903. /***/ }),
  22904. /* 177 */
  22905. /*!********************************************!*\
  22906. !*** ./node_modules/browserify-aes/aes.js ***!
  22907. \********************************************/
  22908. /*! no static exports found */
  22909. /***/ (function(module, exports, __webpack_require__) {
  22910. // based on the aes implimentation in triple sec
  22911. // https://github.com/keybase/triplesec
  22912. // which is in turn based on the one from crypto-js
  22913. // https://code.google.com/p/crypto-js/
  22914. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  22915. function asUInt32Array (buf) {
  22916. if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
  22917. var len = (buf.length / 4) | 0
  22918. var out = new Array(len)
  22919. for (var i = 0; i < len; i++) {
  22920. out[i] = buf.readUInt32BE(i * 4)
  22921. }
  22922. return out
  22923. }
  22924. function scrubVec (v) {
  22925. for (var i = 0; i < v.length; v++) {
  22926. v[i] = 0
  22927. }
  22928. }
  22929. function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
  22930. var SUB_MIX0 = SUB_MIX[0]
  22931. var SUB_MIX1 = SUB_MIX[1]
  22932. var SUB_MIX2 = SUB_MIX[2]
  22933. var SUB_MIX3 = SUB_MIX[3]
  22934. var s0 = M[0] ^ keySchedule[0]
  22935. var s1 = M[1] ^ keySchedule[1]
  22936. var s2 = M[2] ^ keySchedule[2]
  22937. var s3 = M[3] ^ keySchedule[3]
  22938. var t0, t1, t2, t3
  22939. var ksRow = 4
  22940. for (var round = 1; round < nRounds; round++) {
  22941. t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
  22942. t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
  22943. t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
  22944. t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
  22945. s0 = t0
  22946. s1 = t1
  22947. s2 = t2
  22948. s3 = t3
  22949. }
  22950. t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
  22951. t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
  22952. t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
  22953. t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
  22954. t0 = t0 >>> 0
  22955. t1 = t1 >>> 0
  22956. t2 = t2 >>> 0
  22957. t3 = t3 >>> 0
  22958. return [t0, t1, t2, t3]
  22959. }
  22960. // AES constants
  22961. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
  22962. var G = (function () {
  22963. // Compute double table
  22964. var d = new Array(256)
  22965. for (var j = 0; j < 256; j++) {
  22966. if (j < 128) {
  22967. d[j] = j << 1
  22968. } else {
  22969. d[j] = (j << 1) ^ 0x11b
  22970. }
  22971. }
  22972. var SBOX = []
  22973. var INV_SBOX = []
  22974. var SUB_MIX = [[], [], [], []]
  22975. var INV_SUB_MIX = [[], [], [], []]
  22976. // Walk GF(2^8)
  22977. var x = 0
  22978. var xi = 0
  22979. for (var i = 0; i < 256; ++i) {
  22980. // Compute sbox
  22981. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
  22982. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
  22983. SBOX[x] = sx
  22984. INV_SBOX[sx] = x
  22985. // Compute multiplication
  22986. var x2 = d[x]
  22987. var x4 = d[x2]
  22988. var x8 = d[x4]
  22989. // Compute sub bytes, mix columns tables
  22990. var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
  22991. SUB_MIX[0][x] = (t << 24) | (t >>> 8)
  22992. SUB_MIX[1][x] = (t << 16) | (t >>> 16)
  22993. SUB_MIX[2][x] = (t << 8) | (t >>> 24)
  22994. SUB_MIX[3][x] = t
  22995. // Compute inv sub bytes, inv mix columns tables
  22996. t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
  22997. INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
  22998. INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
  22999. INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
  23000. INV_SUB_MIX[3][sx] = t
  23001. if (x === 0) {
  23002. x = xi = 1
  23003. } else {
  23004. x = x2 ^ d[d[d[x8 ^ x2]]]
  23005. xi ^= d[d[xi]]
  23006. }
  23007. }
  23008. return {
  23009. SBOX: SBOX,
  23010. INV_SBOX: INV_SBOX,
  23011. SUB_MIX: SUB_MIX,
  23012. INV_SUB_MIX: INV_SUB_MIX
  23013. }
  23014. })()
  23015. function AES (key) {
  23016. this._key = asUInt32Array(key)
  23017. this._reset()
  23018. }
  23019. AES.blockSize = 4 * 4
  23020. AES.keySize = 256 / 8
  23021. AES.prototype.blockSize = AES.blockSize
  23022. AES.prototype.keySize = AES.keySize
  23023. AES.prototype._reset = function () {
  23024. var keyWords = this._key
  23025. var keySize = keyWords.length
  23026. var nRounds = keySize + 6
  23027. var ksRows = (nRounds + 1) * 4
  23028. var keySchedule = []
  23029. for (var k = 0; k < keySize; k++) {
  23030. keySchedule[k] = keyWords[k]
  23031. }
  23032. for (k = keySize; k < ksRows; k++) {
  23033. var t = keySchedule[k - 1]
  23034. if (k % keySize === 0) {
  23035. t = (t << 8) | (t >>> 24)
  23036. t =
  23037. (G.SBOX[t >>> 24] << 24) |
  23038. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  23039. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  23040. (G.SBOX[t & 0xff])
  23041. t ^= RCON[(k / keySize) | 0] << 24
  23042. } else if (keySize > 6 && k % keySize === 4) {
  23043. t =
  23044. (G.SBOX[t >>> 24] << 24) |
  23045. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  23046. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  23047. (G.SBOX[t & 0xff])
  23048. }
  23049. keySchedule[k] = keySchedule[k - keySize] ^ t
  23050. }
  23051. var invKeySchedule = []
  23052. for (var ik = 0; ik < ksRows; ik++) {
  23053. var ksR = ksRows - ik
  23054. var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
  23055. if (ik < 4 || ksR <= 4) {
  23056. invKeySchedule[ik] = tt
  23057. } else {
  23058. invKeySchedule[ik] =
  23059. G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
  23060. G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
  23061. G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
  23062. G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
  23063. }
  23064. }
  23065. this._nRounds = nRounds
  23066. this._keySchedule = keySchedule
  23067. this._invKeySchedule = invKeySchedule
  23068. }
  23069. AES.prototype.encryptBlockRaw = function (M) {
  23070. M = asUInt32Array(M)
  23071. return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
  23072. }
  23073. AES.prototype.encryptBlock = function (M) {
  23074. var out = this.encryptBlockRaw(M)
  23075. var buf = Buffer.allocUnsafe(16)
  23076. buf.writeUInt32BE(out[0], 0)
  23077. buf.writeUInt32BE(out[1], 4)
  23078. buf.writeUInt32BE(out[2], 8)
  23079. buf.writeUInt32BE(out[3], 12)
  23080. return buf
  23081. }
  23082. AES.prototype.decryptBlock = function (M) {
  23083. M = asUInt32Array(M)
  23084. // swap
  23085. var m1 = M[1]
  23086. M[1] = M[3]
  23087. M[3] = m1
  23088. var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
  23089. var buf = Buffer.allocUnsafe(16)
  23090. buf.writeUInt32BE(out[0], 0)
  23091. buf.writeUInt32BE(out[3], 4)
  23092. buf.writeUInt32BE(out[2], 8)
  23093. buf.writeUInt32BE(out[1], 12)
  23094. return buf
  23095. }
  23096. AES.prototype.scrub = function () {
  23097. scrubVec(this._keySchedule)
  23098. scrubVec(this._invKeySchedule)
  23099. scrubVec(this._key)
  23100. }
  23101. module.exports.AES = AES
  23102. /***/ }),
  23103. /* 178 */
  23104. /*!**********************************************!*\
  23105. !*** ./node_modules/browserify-aes/ghash.js ***!
  23106. \**********************************************/
  23107. /*! no static exports found */
  23108. /***/ (function(module, exports, __webpack_require__) {
  23109. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  23110. var ZEROES = Buffer.alloc(16, 0)
  23111. function toArray (buf) {
  23112. return [
  23113. buf.readUInt32BE(0),
  23114. buf.readUInt32BE(4),
  23115. buf.readUInt32BE(8),
  23116. buf.readUInt32BE(12)
  23117. ]
  23118. }
  23119. function fromArray (out) {
  23120. var buf = Buffer.allocUnsafe(16)
  23121. buf.writeUInt32BE(out[0] >>> 0, 0)
  23122. buf.writeUInt32BE(out[1] >>> 0, 4)
  23123. buf.writeUInt32BE(out[2] >>> 0, 8)
  23124. buf.writeUInt32BE(out[3] >>> 0, 12)
  23125. return buf
  23126. }
  23127. function GHASH (key) {
  23128. this.h = key
  23129. this.state = Buffer.alloc(16, 0)
  23130. this.cache = Buffer.allocUnsafe(0)
  23131. }
  23132. // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
  23133. // by Juho Vähä-Herttua
  23134. GHASH.prototype.ghash = function (block) {
  23135. var i = -1
  23136. while (++i < block.length) {
  23137. this.state[i] ^= block[i]
  23138. }
  23139. this._multiply()
  23140. }
  23141. GHASH.prototype._multiply = function () {
  23142. var Vi = toArray(this.h)
  23143. var Zi = [0, 0, 0, 0]
  23144. var j, xi, lsbVi
  23145. var i = -1
  23146. while (++i < 128) {
  23147. xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
  23148. if (xi) {
  23149. // Z_i+1 = Z_i ^ V_i
  23150. Zi[0] ^= Vi[0]
  23151. Zi[1] ^= Vi[1]
  23152. Zi[2] ^= Vi[2]
  23153. Zi[3] ^= Vi[3]
  23154. }
  23155. // Store the value of LSB(V_i)
  23156. lsbVi = (Vi[3] & 1) !== 0
  23157. // V_i+1 = V_i >> 1
  23158. for (j = 3; j > 0; j--) {
  23159. Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
  23160. }
  23161. Vi[0] = Vi[0] >>> 1
  23162. // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
  23163. if (lsbVi) {
  23164. Vi[0] = Vi[0] ^ (0xe1 << 24)
  23165. }
  23166. }
  23167. this.state = fromArray(Zi)
  23168. }
  23169. GHASH.prototype.update = function (buf) {
  23170. this.cache = Buffer.concat([this.cache, buf])
  23171. var chunk
  23172. while (this.cache.length >= 16) {
  23173. chunk = this.cache.slice(0, 16)
  23174. this.cache = this.cache.slice(16)
  23175. this.ghash(chunk)
  23176. }
  23177. }
  23178. GHASH.prototype.final = function (abl, bl) {
  23179. if (this.cache.length) {
  23180. this.ghash(Buffer.concat([this.cache, ZEROES], 16))
  23181. }
  23182. this.ghash(fromArray([0, abl, 0, bl]))
  23183. return this.state
  23184. }
  23185. module.exports = GHASH
  23186. /***/ }),
  23187. /* 179 */
  23188. /*!*****************************************************!*\
  23189. !*** ./node_modules/browserify-aes/streamCipher.js ***!
  23190. \*****************************************************/
  23191. /*! no static exports found */
  23192. /***/ (function(module, exports, __webpack_require__) {
  23193. var aes = __webpack_require__(/*! ./aes */ 177)
  23194. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  23195. var Transform = __webpack_require__(/*! cipher-base */ 137)
  23196. var inherits = __webpack_require__(/*! inherits */ 109)
  23197. function StreamCipher (mode, key, iv, decrypt) {
  23198. Transform.call(this)
  23199. this._cipher = new aes.AES(key)
  23200. this._prev = Buffer.from(iv)
  23201. this._cache = Buffer.allocUnsafe(0)
  23202. this._secCache = Buffer.allocUnsafe(0)
  23203. this._decrypt = decrypt
  23204. this._mode = mode
  23205. }
  23206. inherits(StreamCipher, Transform)
  23207. StreamCipher.prototype._update = function (chunk) {
  23208. return this._mode.encrypt(this, chunk, this._decrypt)
  23209. }
  23210. StreamCipher.prototype._final = function () {
  23211. this._cipher.scrub()
  23212. }
  23213. module.exports = StreamCipher
  23214. /***/ }),
  23215. /* 180 */
  23216. /*!**********************************************!*\
  23217. !*** ./node_modules/evp_bytestokey/index.js ***!
  23218. \**********************************************/
  23219. /*! no static exports found */
  23220. /***/ (function(module, exports, __webpack_require__) {
  23221. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  23222. var MD5 = __webpack_require__(/*! md5.js */ 110)
  23223. /* eslint-disable camelcase */
  23224. function EVP_BytesToKey (password, salt, keyBits, ivLen) {
  23225. if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
  23226. if (salt) {
  23227. if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
  23228. if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
  23229. }
  23230. var keyLen = keyBits / 8
  23231. var key = Buffer.alloc(keyLen)
  23232. var iv = Buffer.alloc(ivLen || 0)
  23233. var tmp = Buffer.alloc(0)
  23234. while (keyLen > 0 || ivLen > 0) {
  23235. var hash = new MD5()
  23236. hash.update(tmp)
  23237. hash.update(password)
  23238. if (salt) hash.update(salt)
  23239. tmp = hash.digest()
  23240. var used = 0
  23241. if (keyLen > 0) {
  23242. var keyStart = key.length - keyLen
  23243. used = Math.min(keyLen, tmp.length)
  23244. tmp.copy(key, keyStart, 0, used)
  23245. keyLen -= used
  23246. }
  23247. if (used < tmp.length && ivLen > 0) {
  23248. var ivStart = iv.length - ivLen
  23249. var length = Math.min(ivLen, tmp.length - used)
  23250. tmp.copy(iv, ivStart, used, used + length)
  23251. ivLen -= length
  23252. }
  23253. }
  23254. tmp.fill(0)
  23255. return { key: key, iv: iv }
  23256. }
  23257. module.exports = EVP_BytesToKey
  23258. /***/ }),
  23259. /* 181 */
  23260. /*!**************************************************!*\
  23261. !*** ./node_modules/browserify-aes/decrypter.js ***!
  23262. \**************************************************/
  23263. /*! no static exports found */
  23264. /***/ (function(module, exports, __webpack_require__) {
  23265. var AuthCipher = __webpack_require__(/*! ./authCipher */ 176)
  23266. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  23267. var MODES = __webpack_require__(/*! ./modes */ 165)
  23268. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 179)
  23269. var Transform = __webpack_require__(/*! cipher-base */ 137)
  23270. var aes = __webpack_require__(/*! ./aes */ 177)
  23271. var ebtk = __webpack_require__(/*! evp_bytestokey */ 180)
  23272. var inherits = __webpack_require__(/*! inherits */ 109)
  23273. function Decipher (mode, key, iv) {
  23274. Transform.call(this)
  23275. this._cache = new Splitter()
  23276. this._last = void 0
  23277. this._cipher = new aes.AES(key)
  23278. this._prev = Buffer.from(iv)
  23279. this._mode = mode
  23280. this._autopadding = true
  23281. }
  23282. inherits(Decipher, Transform)
  23283. Decipher.prototype._update = function (data) {
  23284. this._cache.add(data)
  23285. var chunk
  23286. var thing
  23287. var out = []
  23288. while ((chunk = this._cache.get(this._autopadding))) {
  23289. thing = this._mode.decrypt(this, chunk)
  23290. out.push(thing)
  23291. }
  23292. return Buffer.concat(out)
  23293. }
  23294. Decipher.prototype._final = function () {
  23295. var chunk = this._cache.flush()
  23296. if (this._autopadding) {
  23297. return unpad(this._mode.decrypt(this, chunk))
  23298. } else if (chunk) {
  23299. throw new Error('data not multiple of block length')
  23300. }
  23301. }
  23302. Decipher.prototype.setAutoPadding = function (setTo) {
  23303. this._autopadding = !!setTo
  23304. return this
  23305. }
  23306. function Splitter () {
  23307. this.cache = Buffer.allocUnsafe(0)
  23308. }
  23309. Splitter.prototype.add = function (data) {
  23310. this.cache = Buffer.concat([this.cache, data])
  23311. }
  23312. Splitter.prototype.get = function (autoPadding) {
  23313. var out
  23314. if (autoPadding) {
  23315. if (this.cache.length > 16) {
  23316. out = this.cache.slice(0, 16)
  23317. this.cache = this.cache.slice(16)
  23318. return out
  23319. }
  23320. } else {
  23321. if (this.cache.length >= 16) {
  23322. out = this.cache.slice(0, 16)
  23323. this.cache = this.cache.slice(16)
  23324. return out
  23325. }
  23326. }
  23327. return null
  23328. }
  23329. Splitter.prototype.flush = function () {
  23330. if (this.cache.length) return this.cache
  23331. }
  23332. function unpad (last) {
  23333. var padded = last[15]
  23334. if (padded < 1 || padded > 16) {
  23335. throw new Error('unable to decrypt data')
  23336. }
  23337. var i = -1
  23338. while (++i < padded) {
  23339. if (last[(i + (16 - padded))] !== padded) {
  23340. throw new Error('unable to decrypt data')
  23341. }
  23342. }
  23343. if (padded === 16) return
  23344. return last.slice(0, 16 - padded)
  23345. }
  23346. function createDecipheriv (suite, password, iv) {
  23347. var config = MODES[suite.toLowerCase()]
  23348. if (!config) throw new TypeError('invalid suite type')
  23349. if (typeof iv === 'string') iv = Buffer.from(iv)
  23350. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  23351. if (typeof password === 'string') password = Buffer.from(password)
  23352. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  23353. if (config.type === 'stream') {
  23354. return new StreamCipher(config.module, password, iv, true)
  23355. } else if (config.type === 'auth') {
  23356. return new AuthCipher(config.module, password, iv, true)
  23357. }
  23358. return new Decipher(config.module, password, iv)
  23359. }
  23360. function createDecipher (suite, password) {
  23361. var config = MODES[suite.toLowerCase()]
  23362. if (!config) throw new TypeError('invalid suite type')
  23363. var keys = ebtk(password, false, config.key, config.iv)
  23364. return createDecipheriv(suite, keys.key, keys.iv)
  23365. }
  23366. exports.createDecipher = createDecipher
  23367. exports.createDecipheriv = createDecipheriv
  23368. /***/ }),
  23369. /* 182 */
  23370. /*!**********************************************!*\
  23371. !*** ./node_modules/browserify-des/modes.js ***!
  23372. \**********************************************/
  23373. /*! no static exports found */
  23374. /***/ (function(module, exports) {
  23375. exports['des-ecb'] = {
  23376. key: 8,
  23377. iv: 0
  23378. }
  23379. exports['des-cbc'] = exports.des = {
  23380. key: 8,
  23381. iv: 8
  23382. }
  23383. exports['des-ede3-cbc'] = exports.des3 = {
  23384. key: 24,
  23385. iv: 8
  23386. }
  23387. exports['des-ede3'] = {
  23388. key: 24,
  23389. iv: 0
  23390. }
  23391. exports['des-ede-cbc'] = {
  23392. key: 16,
  23393. iv: 8
  23394. }
  23395. exports['des-ede'] = {
  23396. key: 16,
  23397. iv: 0
  23398. }
  23399. /***/ }),
  23400. /* 183 */
  23401. /*!************************************************!*\
  23402. !*** ./node_modules/diffie-hellman/browser.js ***!
  23403. \************************************************/
  23404. /*! no static exports found */
  23405. /***/ (function(module, exports, __webpack_require__) {
  23406. /* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 184)
  23407. var primes = __webpack_require__(/*! ./lib/primes.json */ 191)
  23408. var DH = __webpack_require__(/*! ./lib/dh */ 192)
  23409. function getDiffieHellman (mod) {
  23410. var prime = new Buffer(primes[mod].prime, 'hex')
  23411. var gen = new Buffer(primes[mod].gen, 'hex')
  23412. return new DH(prime, gen)
  23413. }
  23414. var ENCODINGS = {
  23415. 'binary': true, 'hex': true, 'base64': true
  23416. }
  23417. function createDiffieHellman (prime, enc, generator, genc) {
  23418. if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
  23419. return createDiffieHellman(prime, 'binary', enc, generator)
  23420. }
  23421. enc = enc || 'binary'
  23422. genc = genc || 'binary'
  23423. generator = generator || new Buffer([2])
  23424. if (!Buffer.isBuffer(generator)) {
  23425. generator = new Buffer(generator, genc)
  23426. }
  23427. if (typeof prime === 'number') {
  23428. return new DH(generatePrime(prime, generator), generator, true)
  23429. }
  23430. if (!Buffer.isBuffer(prime)) {
  23431. prime = new Buffer(prime, enc)
  23432. }
  23433. return new DH(prime, generator, true)
  23434. }
  23435. exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
  23436. exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
  23437. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 104).Buffer))
  23438. /***/ }),
  23439. /* 184 */
  23440. /*!**********************************************************!*\
  23441. !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
  23442. \**********************************************************/
  23443. /*! no static exports found */
  23444. /***/ (function(module, exports, __webpack_require__) {
  23445. var randomBytes = __webpack_require__(/*! randombytes */ 100);
  23446. module.exports = findPrime;
  23447. findPrime.simpleSieve = simpleSieve;
  23448. findPrime.fermatTest = fermatTest;
  23449. var BN = __webpack_require__(/*! bn.js */ 185);
  23450. var TWENTYFOUR = new BN(24);
  23451. var MillerRabin = __webpack_require__(/*! miller-rabin */ 188);
  23452. var millerRabin = new MillerRabin();
  23453. var ONE = new BN(1);
  23454. var TWO = new BN(2);
  23455. var FIVE = new BN(5);
  23456. var SIXTEEN = new BN(16);
  23457. var EIGHT = new BN(8);
  23458. var TEN = new BN(10);
  23459. var THREE = new BN(3);
  23460. var SEVEN = new BN(7);
  23461. var ELEVEN = new BN(11);
  23462. var FOUR = new BN(4);
  23463. var TWELVE = new BN(12);
  23464. var primes = null;
  23465. function _getPrimes() {
  23466. if (primes !== null)
  23467. return primes;
  23468. var limit = 0x100000;
  23469. var res = [];
  23470. res[0] = 2;
  23471. for (var i = 1, k = 3; k < limit; k += 2) {
  23472. var sqrt = Math.ceil(Math.sqrt(k));
  23473. for (var j = 0; j < i && res[j] <= sqrt; j++)
  23474. if (k % res[j] === 0)
  23475. break;
  23476. if (i !== j && res[j] <= sqrt)
  23477. continue;
  23478. res[i++] = k;
  23479. }
  23480. primes = res;
  23481. return res;
  23482. }
  23483. function simpleSieve(p) {
  23484. var primes = _getPrimes();
  23485. for (var i = 0; i < primes.length; i++)
  23486. if (p.modn(primes[i]) === 0) {
  23487. if (p.cmpn(primes[i]) === 0) {
  23488. return true;
  23489. } else {
  23490. return false;
  23491. }
  23492. }
  23493. return true;
  23494. }
  23495. function fermatTest(p) {
  23496. var red = BN.mont(p);
  23497. return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
  23498. }
  23499. function findPrime(bits, gen) {
  23500. if (bits < 16) {
  23501. // this is what openssl does
  23502. if (gen === 2 || gen === 5) {
  23503. return new BN([0x8c, 0x7b]);
  23504. } else {
  23505. return new BN([0x8c, 0x27]);
  23506. }
  23507. }
  23508. gen = new BN(gen);
  23509. var num, n2;
  23510. while (true) {
  23511. num = new BN(randomBytes(Math.ceil(bits / 8)));
  23512. while (num.bitLength() > bits) {
  23513. num.ishrn(1);
  23514. }
  23515. if (num.isEven()) {
  23516. num.iadd(ONE);
  23517. }
  23518. if (!num.testn(1)) {
  23519. num.iadd(TWO);
  23520. }
  23521. if (!gen.cmp(TWO)) {
  23522. while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
  23523. num.iadd(FOUR);
  23524. }
  23525. } else if (!gen.cmp(FIVE)) {
  23526. while (num.mod(TEN).cmp(THREE)) {
  23527. num.iadd(FOUR);
  23528. }
  23529. }
  23530. n2 = num.shrn(1);
  23531. if (simpleSieve(n2) && simpleSieve(num) &&
  23532. fermatTest(n2) && fermatTest(num) &&
  23533. millerRabin.test(n2) && millerRabin.test(num)) {
  23534. return num;
  23535. }
  23536. }
  23537. }
  23538. /***/ }),
  23539. /* 185 */
  23540. /*!**************************************!*\
  23541. !*** ./node_modules/bn.js/lib/bn.js ***!
  23542. \**************************************/
  23543. /*! no static exports found */
  23544. /***/ (function(module, exports, __webpack_require__) {
  23545. /* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
  23546. 'use strict';
  23547. // Utils
  23548. function assert (val, msg) {
  23549. if (!val) throw new Error(msg || 'Assertion failed');
  23550. }
  23551. // Could use `inherits` module, but don't want to move from single file
  23552. // architecture yet.
  23553. function inherits (ctor, superCtor) {
  23554. ctor.super_ = superCtor;
  23555. var TempCtor = function () {};
  23556. TempCtor.prototype = superCtor.prototype;
  23557. ctor.prototype = new TempCtor();
  23558. ctor.prototype.constructor = ctor;
  23559. }
  23560. // BN
  23561. function BN (number, base, endian) {
  23562. if (BN.isBN(number)) {
  23563. return number;
  23564. }
  23565. this.negative = 0;
  23566. this.words = null;
  23567. this.length = 0;
  23568. // Reduction context
  23569. this.red = null;
  23570. if (number !== null) {
  23571. if (base === 'le' || base === 'be') {
  23572. endian = base;
  23573. base = 10;
  23574. }
  23575. this._init(number || 0, base || 10, endian || 'be');
  23576. }
  23577. }
  23578. if (typeof module === 'object') {
  23579. module.exports = BN;
  23580. } else {
  23581. exports.BN = BN;
  23582. }
  23583. BN.BN = BN;
  23584. BN.wordSize = 26;
  23585. var Buffer;
  23586. try {
  23587. if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {
  23588. Buffer = window.Buffer;
  23589. } else {
  23590. Buffer = __webpack_require__(/*! buffer */ 187).Buffer;
  23591. }
  23592. } catch (e) {
  23593. }
  23594. BN.isBN = function isBN (num) {
  23595. if (num instanceof BN) {
  23596. return true;
  23597. }
  23598. return num !== null && typeof num === 'object' &&
  23599. num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  23600. };
  23601. BN.max = function max (left, right) {
  23602. if (left.cmp(right) > 0) return left;
  23603. return right;
  23604. };
  23605. BN.min = function min (left, right) {
  23606. if (left.cmp(right) < 0) return left;
  23607. return right;
  23608. };
  23609. BN.prototype._init = function init (number, base, endian) {
  23610. if (typeof number === 'number') {
  23611. return this._initNumber(number, base, endian);
  23612. }
  23613. if (typeof number === 'object') {
  23614. return this._initArray(number, base, endian);
  23615. }
  23616. if (base === 'hex') {
  23617. base = 16;
  23618. }
  23619. assert(base === (base | 0) && base >= 2 && base <= 36);
  23620. number = number.toString().replace(/\s+/g, '');
  23621. var start = 0;
  23622. if (number[0] === '-') {
  23623. start++;
  23624. this.negative = 1;
  23625. }
  23626. if (start < number.length) {
  23627. if (base === 16) {
  23628. this._parseHex(number, start, endian);
  23629. } else {
  23630. this._parseBase(number, base, start);
  23631. if (endian === 'le') {
  23632. this._initArray(this.toArray(), base, endian);
  23633. }
  23634. }
  23635. }
  23636. };
  23637. BN.prototype._initNumber = function _initNumber (number, base, endian) {
  23638. if (number < 0) {
  23639. this.negative = 1;
  23640. number = -number;
  23641. }
  23642. if (number < 0x4000000) {
  23643. this.words = [ number & 0x3ffffff ];
  23644. this.length = 1;
  23645. } else if (number < 0x10000000000000) {
  23646. this.words = [
  23647. number & 0x3ffffff,
  23648. (number / 0x4000000) & 0x3ffffff
  23649. ];
  23650. this.length = 2;
  23651. } else {
  23652. assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
  23653. this.words = [
  23654. number & 0x3ffffff,
  23655. (number / 0x4000000) & 0x3ffffff,
  23656. 1
  23657. ];
  23658. this.length = 3;
  23659. }
  23660. if (endian !== 'le') return;
  23661. // Reverse the bytes
  23662. this._initArray(this.toArray(), base, endian);
  23663. };
  23664. BN.prototype._initArray = function _initArray (number, base, endian) {
  23665. // Perhaps a Uint8Array
  23666. assert(typeof number.length === 'number');
  23667. if (number.length <= 0) {
  23668. this.words = [ 0 ];
  23669. this.length = 1;
  23670. return this;
  23671. }
  23672. this.length = Math.ceil(number.length / 3);
  23673. this.words = new Array(this.length);
  23674. for (var i = 0; i < this.length; i++) {
  23675. this.words[i] = 0;
  23676. }
  23677. var j, w;
  23678. var off = 0;
  23679. if (endian === 'be') {
  23680. for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
  23681. w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
  23682. this.words[j] |= (w << off) & 0x3ffffff;
  23683. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  23684. off += 24;
  23685. if (off >= 26) {
  23686. off -= 26;
  23687. j++;
  23688. }
  23689. }
  23690. } else if (endian === 'le') {
  23691. for (i = 0, j = 0; i < number.length; i += 3) {
  23692. w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
  23693. this.words[j] |= (w << off) & 0x3ffffff;
  23694. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  23695. off += 24;
  23696. if (off >= 26) {
  23697. off -= 26;
  23698. j++;
  23699. }
  23700. }
  23701. }
  23702. return this.strip();
  23703. };
  23704. function parseHex4Bits (string, index) {
  23705. var c = string.charCodeAt(index);
  23706. // 'A' - 'F'
  23707. if (c >= 65 && c <= 70) {
  23708. return c - 55;
  23709. // 'a' - 'f'
  23710. } else if (c >= 97 && c <= 102) {
  23711. return c - 87;
  23712. // '0' - '9'
  23713. } else {
  23714. return (c - 48) & 0xf;
  23715. }
  23716. }
  23717. function parseHexByte (string, lowerBound, index) {
  23718. var r = parseHex4Bits(string, index);
  23719. if (index - 1 >= lowerBound) {
  23720. r |= parseHex4Bits(string, index - 1) << 4;
  23721. }
  23722. return r;
  23723. }
  23724. BN.prototype._parseHex = function _parseHex (number, start, endian) {
  23725. // Create possibly bigger array to ensure that it fits the number
  23726. this.length = Math.ceil((number.length - start) / 6);
  23727. this.words = new Array(this.length);
  23728. for (var i = 0; i < this.length; i++) {
  23729. this.words[i] = 0;
  23730. }
  23731. // 24-bits chunks
  23732. var off = 0;
  23733. var j = 0;
  23734. var w;
  23735. if (endian === 'be') {
  23736. for (i = number.length - 1; i >= start; i -= 2) {
  23737. w = parseHexByte(number, start, i) << off;
  23738. this.words[j] |= w & 0x3ffffff;
  23739. if (off >= 18) {
  23740. off -= 18;
  23741. j += 1;
  23742. this.words[j] |= w >>> 26;
  23743. } else {
  23744. off += 8;
  23745. }
  23746. }
  23747. } else {
  23748. var parseLength = number.length - start;
  23749. for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
  23750. w = parseHexByte(number, start, i) << off;
  23751. this.words[j] |= w & 0x3ffffff;
  23752. if (off >= 18) {
  23753. off -= 18;
  23754. j += 1;
  23755. this.words[j] |= w >>> 26;
  23756. } else {
  23757. off += 8;
  23758. }
  23759. }
  23760. }
  23761. this.strip();
  23762. };
  23763. function parseBase (str, start, end, mul) {
  23764. var r = 0;
  23765. var len = Math.min(str.length, end);
  23766. for (var i = start; i < len; i++) {
  23767. var c = str.charCodeAt(i) - 48;
  23768. r *= mul;
  23769. // 'a'
  23770. if (c >= 49) {
  23771. r += c - 49 + 0xa;
  23772. // 'A'
  23773. } else if (c >= 17) {
  23774. r += c - 17 + 0xa;
  23775. // '0' - '9'
  23776. } else {
  23777. r += c;
  23778. }
  23779. }
  23780. return r;
  23781. }
  23782. BN.prototype._parseBase = function _parseBase (number, base, start) {
  23783. // Initialize as zero
  23784. this.words = [ 0 ];
  23785. this.length = 1;
  23786. // Find length of limb in base
  23787. for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
  23788. limbLen++;
  23789. }
  23790. limbLen--;
  23791. limbPow = (limbPow / base) | 0;
  23792. var total = number.length - start;
  23793. var mod = total % limbLen;
  23794. var end = Math.min(total, total - mod) + start;
  23795. var word = 0;
  23796. for (var i = start; i < end; i += limbLen) {
  23797. word = parseBase(number, i, i + limbLen, base);
  23798. this.imuln(limbPow);
  23799. if (this.words[0] + word < 0x4000000) {
  23800. this.words[0] += word;
  23801. } else {
  23802. this._iaddn(word);
  23803. }
  23804. }
  23805. if (mod !== 0) {
  23806. var pow = 1;
  23807. word = parseBase(number, i, number.length, base);
  23808. for (i = 0; i < mod; i++) {
  23809. pow *= base;
  23810. }
  23811. this.imuln(pow);
  23812. if (this.words[0] + word < 0x4000000) {
  23813. this.words[0] += word;
  23814. } else {
  23815. this._iaddn(word);
  23816. }
  23817. }
  23818. this.strip();
  23819. };
  23820. BN.prototype.copy = function copy (dest) {
  23821. dest.words = new Array(this.length);
  23822. for (var i = 0; i < this.length; i++) {
  23823. dest.words[i] = this.words[i];
  23824. }
  23825. dest.length = this.length;
  23826. dest.negative = this.negative;
  23827. dest.red = this.red;
  23828. };
  23829. BN.prototype.clone = function clone () {
  23830. var r = new BN(null);
  23831. this.copy(r);
  23832. return r;
  23833. };
  23834. BN.prototype._expand = function _expand (size) {
  23835. while (this.length < size) {
  23836. this.words[this.length++] = 0;
  23837. }
  23838. return this;
  23839. };
  23840. // Remove leading `0` from `this`
  23841. BN.prototype.strip = function strip () {
  23842. while (this.length > 1 && this.words[this.length - 1] === 0) {
  23843. this.length--;
  23844. }
  23845. return this._normSign();
  23846. };
  23847. BN.prototype._normSign = function _normSign () {
  23848. // -0 = 0
  23849. if (this.length === 1 && this.words[0] === 0) {
  23850. this.negative = 0;
  23851. }
  23852. return this;
  23853. };
  23854. BN.prototype.inspect = function inspect () {
  23855. return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  23856. };
  23857. /*
  23858. var zeros = [];
  23859. var groupSizes = [];
  23860. var groupBases = [];
  23861. var s = '';
  23862. var i = -1;
  23863. while (++i < BN.wordSize) {
  23864. zeros[i] = s;
  23865. s += '0';
  23866. }
  23867. groupSizes[0] = 0;
  23868. groupSizes[1] = 0;
  23869. groupBases[0] = 0;
  23870. groupBases[1] = 0;
  23871. var base = 2 - 1;
  23872. while (++base < 36 + 1) {
  23873. var groupSize = 0;
  23874. var groupBase = 1;
  23875. while (groupBase < (1 << BN.wordSize) / base) {
  23876. groupBase *= base;
  23877. groupSize += 1;
  23878. }
  23879. groupSizes[base] = groupSize;
  23880. groupBases[base] = groupBase;
  23881. }
  23882. */
  23883. var zeros = [
  23884. '',
  23885. '0',
  23886. '00',
  23887. '000',
  23888. '0000',
  23889. '00000',
  23890. '000000',
  23891. '0000000',
  23892. '00000000',
  23893. '000000000',
  23894. '0000000000',
  23895. '00000000000',
  23896. '000000000000',
  23897. '0000000000000',
  23898. '00000000000000',
  23899. '000000000000000',
  23900. '0000000000000000',
  23901. '00000000000000000',
  23902. '000000000000000000',
  23903. '0000000000000000000',
  23904. '00000000000000000000',
  23905. '000000000000000000000',
  23906. '0000000000000000000000',
  23907. '00000000000000000000000',
  23908. '000000000000000000000000',
  23909. '0000000000000000000000000'
  23910. ];
  23911. var groupSizes = [
  23912. 0, 0,
  23913. 25, 16, 12, 11, 10, 9, 8,
  23914. 8, 7, 7, 7, 7, 6, 6,
  23915. 6, 6, 6, 6, 6, 5, 5,
  23916. 5, 5, 5, 5, 5, 5, 5,
  23917. 5, 5, 5, 5, 5, 5, 5
  23918. ];
  23919. var groupBases = [
  23920. 0, 0,
  23921. 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
  23922. 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
  23923. 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
  23924. 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
  23925. 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
  23926. ];
  23927. BN.prototype.toString = function toString (base, padding) {
  23928. base = base || 10;
  23929. padding = padding | 0 || 1;
  23930. var out;
  23931. if (base === 16 || base === 'hex') {
  23932. out = '';
  23933. var off = 0;
  23934. var carry = 0;
  23935. for (var i = 0; i < this.length; i++) {
  23936. var w = this.words[i];
  23937. var word = (((w << off) | carry) & 0xffffff).toString(16);
  23938. carry = (w >>> (24 - off)) & 0xffffff;
  23939. if (carry !== 0 || i !== this.length - 1) {
  23940. out = zeros[6 - word.length] + word + out;
  23941. } else {
  23942. out = word + out;
  23943. }
  23944. off += 2;
  23945. if (off >= 26) {
  23946. off -= 26;
  23947. i--;
  23948. }
  23949. }
  23950. if (carry !== 0) {
  23951. out = carry.toString(16) + out;
  23952. }
  23953. while (out.length % padding !== 0) {
  23954. out = '0' + out;
  23955. }
  23956. if (this.negative !== 0) {
  23957. out = '-' + out;
  23958. }
  23959. return out;
  23960. }
  23961. if (base === (base | 0) && base >= 2 && base <= 36) {
  23962. // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
  23963. var groupSize = groupSizes[base];
  23964. // var groupBase = Math.pow(base, groupSize);
  23965. var groupBase = groupBases[base];
  23966. out = '';
  23967. var c = this.clone();
  23968. c.negative = 0;
  23969. while (!c.isZero()) {
  23970. var r = c.modn(groupBase).toString(base);
  23971. c = c.idivn(groupBase);
  23972. if (!c.isZero()) {
  23973. out = zeros[groupSize - r.length] + r + out;
  23974. } else {
  23975. out = r + out;
  23976. }
  23977. }
  23978. if (this.isZero()) {
  23979. out = '0' + out;
  23980. }
  23981. while (out.length % padding !== 0) {
  23982. out = '0' + out;
  23983. }
  23984. if (this.negative !== 0) {
  23985. out = '-' + out;
  23986. }
  23987. return out;
  23988. }
  23989. assert(false, 'Base should be between 2 and 36');
  23990. };
  23991. BN.prototype.toNumber = function toNumber () {
  23992. var ret = this.words[0];
  23993. if (this.length === 2) {
  23994. ret += this.words[1] * 0x4000000;
  23995. } else if (this.length === 3 && this.words[2] === 0x01) {
  23996. // NOTE: at this stage it is known that the top bit is set
  23997. ret += 0x10000000000000 + (this.words[1] * 0x4000000);
  23998. } else if (this.length > 2) {
  23999. assert(false, 'Number can only safely store up to 53 bits');
  24000. }
  24001. return (this.negative !== 0) ? -ret : ret;
  24002. };
  24003. BN.prototype.toJSON = function toJSON () {
  24004. return this.toString(16);
  24005. };
  24006. BN.prototype.toBuffer = function toBuffer (endian, length) {
  24007. assert(typeof Buffer !== 'undefined');
  24008. return this.toArrayLike(Buffer, endian, length);
  24009. };
  24010. BN.prototype.toArray = function toArray (endian, length) {
  24011. return this.toArrayLike(Array, endian, length);
  24012. };
  24013. BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
  24014. var byteLength = this.byteLength();
  24015. var reqLength = length || Math.max(1, byteLength);
  24016. assert(byteLength <= reqLength, 'byte array longer than desired length');
  24017. assert(reqLength > 0, 'Requested array length <= 0');
  24018. this.strip();
  24019. var littleEndian = endian === 'le';
  24020. var res = new ArrayType(reqLength);
  24021. var b, i;
  24022. var q = this.clone();
  24023. if (!littleEndian) {
  24024. // Assume big-endian
  24025. for (i = 0; i < reqLength - byteLength; i++) {
  24026. res[i] = 0;
  24027. }
  24028. for (i = 0; !q.isZero(); i++) {
  24029. b = q.andln(0xff);
  24030. q.iushrn(8);
  24031. res[reqLength - i - 1] = b;
  24032. }
  24033. } else {
  24034. for (i = 0; !q.isZero(); i++) {
  24035. b = q.andln(0xff);
  24036. q.iushrn(8);
  24037. res[i] = b;
  24038. }
  24039. for (; i < reqLength; i++) {
  24040. res[i] = 0;
  24041. }
  24042. }
  24043. return res;
  24044. };
  24045. if (Math.clz32) {
  24046. BN.prototype._countBits = function _countBits (w) {
  24047. return 32 - Math.clz32(w);
  24048. };
  24049. } else {
  24050. BN.prototype._countBits = function _countBits (w) {
  24051. var t = w;
  24052. var r = 0;
  24053. if (t >= 0x1000) {
  24054. r += 13;
  24055. t >>>= 13;
  24056. }
  24057. if (t >= 0x40) {
  24058. r += 7;
  24059. t >>>= 7;
  24060. }
  24061. if (t >= 0x8) {
  24062. r += 4;
  24063. t >>>= 4;
  24064. }
  24065. if (t >= 0x02) {
  24066. r += 2;
  24067. t >>>= 2;
  24068. }
  24069. return r + t;
  24070. };
  24071. }
  24072. BN.prototype._zeroBits = function _zeroBits (w) {
  24073. // Short-cut
  24074. if (w === 0) return 26;
  24075. var t = w;
  24076. var r = 0;
  24077. if ((t & 0x1fff) === 0) {
  24078. r += 13;
  24079. t >>>= 13;
  24080. }
  24081. if ((t & 0x7f) === 0) {
  24082. r += 7;
  24083. t >>>= 7;
  24084. }
  24085. if ((t & 0xf) === 0) {
  24086. r += 4;
  24087. t >>>= 4;
  24088. }
  24089. if ((t & 0x3) === 0) {
  24090. r += 2;
  24091. t >>>= 2;
  24092. }
  24093. if ((t & 0x1) === 0) {
  24094. r++;
  24095. }
  24096. return r;
  24097. };
  24098. // Return number of used bits in a BN
  24099. BN.prototype.bitLength = function bitLength () {
  24100. var w = this.words[this.length - 1];
  24101. var hi = this._countBits(w);
  24102. return (this.length - 1) * 26 + hi;
  24103. };
  24104. function toBitArray (num) {
  24105. var w = new Array(num.bitLength());
  24106. for (var bit = 0; bit < w.length; bit++) {
  24107. var off = (bit / 26) | 0;
  24108. var wbit = bit % 26;
  24109. w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
  24110. }
  24111. return w;
  24112. }
  24113. // Number of trailing zero bits
  24114. BN.prototype.zeroBits = function zeroBits () {
  24115. if (this.isZero()) return 0;
  24116. var r = 0;
  24117. for (var i = 0; i < this.length; i++) {
  24118. var b = this._zeroBits(this.words[i]);
  24119. r += b;
  24120. if (b !== 26) break;
  24121. }
  24122. return r;
  24123. };
  24124. BN.prototype.byteLength = function byteLength () {
  24125. return Math.ceil(this.bitLength() / 8);
  24126. };
  24127. BN.prototype.toTwos = function toTwos (width) {
  24128. if (this.negative !== 0) {
  24129. return this.abs().inotn(width).iaddn(1);
  24130. }
  24131. return this.clone();
  24132. };
  24133. BN.prototype.fromTwos = function fromTwos (width) {
  24134. if (this.testn(width - 1)) {
  24135. return this.notn(width).iaddn(1).ineg();
  24136. }
  24137. return this.clone();
  24138. };
  24139. BN.prototype.isNeg = function isNeg () {
  24140. return this.negative !== 0;
  24141. };
  24142. // Return negative clone of `this`
  24143. BN.prototype.neg = function neg () {
  24144. return this.clone().ineg();
  24145. };
  24146. BN.prototype.ineg = function ineg () {
  24147. if (!this.isZero()) {
  24148. this.negative ^= 1;
  24149. }
  24150. return this;
  24151. };
  24152. // Or `num` with `this` in-place
  24153. BN.prototype.iuor = function iuor (num) {
  24154. while (this.length < num.length) {
  24155. this.words[this.length++] = 0;
  24156. }
  24157. for (var i = 0; i < num.length; i++) {
  24158. this.words[i] = this.words[i] | num.words[i];
  24159. }
  24160. return this.strip();
  24161. };
  24162. BN.prototype.ior = function ior (num) {
  24163. assert((this.negative | num.negative) === 0);
  24164. return this.iuor(num);
  24165. };
  24166. // Or `num` with `this`
  24167. BN.prototype.or = function or (num) {
  24168. if (this.length > num.length) return this.clone().ior(num);
  24169. return num.clone().ior(this);
  24170. };
  24171. BN.prototype.uor = function uor (num) {
  24172. if (this.length > num.length) return this.clone().iuor(num);
  24173. return num.clone().iuor(this);
  24174. };
  24175. // And `num` with `this` in-place
  24176. BN.prototype.iuand = function iuand (num) {
  24177. // b = min-length(num, this)
  24178. var b;
  24179. if (this.length > num.length) {
  24180. b = num;
  24181. } else {
  24182. b = this;
  24183. }
  24184. for (var i = 0; i < b.length; i++) {
  24185. this.words[i] = this.words[i] & num.words[i];
  24186. }
  24187. this.length = b.length;
  24188. return this.strip();
  24189. };
  24190. BN.prototype.iand = function iand (num) {
  24191. assert((this.negative | num.negative) === 0);
  24192. return this.iuand(num);
  24193. };
  24194. // And `num` with `this`
  24195. BN.prototype.and = function and (num) {
  24196. if (this.length > num.length) return this.clone().iand(num);
  24197. return num.clone().iand(this);
  24198. };
  24199. BN.prototype.uand = function uand (num) {
  24200. if (this.length > num.length) return this.clone().iuand(num);
  24201. return num.clone().iuand(this);
  24202. };
  24203. // Xor `num` with `this` in-place
  24204. BN.prototype.iuxor = function iuxor (num) {
  24205. // a.length > b.length
  24206. var a;
  24207. var b;
  24208. if (this.length > num.length) {
  24209. a = this;
  24210. b = num;
  24211. } else {
  24212. a = num;
  24213. b = this;
  24214. }
  24215. for (var i = 0; i < b.length; i++) {
  24216. this.words[i] = a.words[i] ^ b.words[i];
  24217. }
  24218. if (this !== a) {
  24219. for (; i < a.length; i++) {
  24220. this.words[i] = a.words[i];
  24221. }
  24222. }
  24223. this.length = a.length;
  24224. return this.strip();
  24225. };
  24226. BN.prototype.ixor = function ixor (num) {
  24227. assert((this.negative | num.negative) === 0);
  24228. return this.iuxor(num);
  24229. };
  24230. // Xor `num` with `this`
  24231. BN.prototype.xor = function xor (num) {
  24232. if (this.length > num.length) return this.clone().ixor(num);
  24233. return num.clone().ixor(this);
  24234. };
  24235. BN.prototype.uxor = function uxor (num) {
  24236. if (this.length > num.length) return this.clone().iuxor(num);
  24237. return num.clone().iuxor(this);
  24238. };
  24239. // Not ``this`` with ``width`` bitwidth
  24240. BN.prototype.inotn = function inotn (width) {
  24241. assert(typeof width === 'number' && width >= 0);
  24242. var bytesNeeded = Math.ceil(width / 26) | 0;
  24243. var bitsLeft = width % 26;
  24244. // Extend the buffer with leading zeroes
  24245. this._expand(bytesNeeded);
  24246. if (bitsLeft > 0) {
  24247. bytesNeeded--;
  24248. }
  24249. // Handle complete words
  24250. for (var i = 0; i < bytesNeeded; i++) {
  24251. this.words[i] = ~this.words[i] & 0x3ffffff;
  24252. }
  24253. // Handle the residue
  24254. if (bitsLeft > 0) {
  24255. this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
  24256. }
  24257. // And remove leading zeroes
  24258. return this.strip();
  24259. };
  24260. BN.prototype.notn = function notn (width) {
  24261. return this.clone().inotn(width);
  24262. };
  24263. // Set `bit` of `this`
  24264. BN.prototype.setn = function setn (bit, val) {
  24265. assert(typeof bit === 'number' && bit >= 0);
  24266. var off = (bit / 26) | 0;
  24267. var wbit = bit % 26;
  24268. this._expand(off + 1);
  24269. if (val) {
  24270. this.words[off] = this.words[off] | (1 << wbit);
  24271. } else {
  24272. this.words[off] = this.words[off] & ~(1 << wbit);
  24273. }
  24274. return this.strip();
  24275. };
  24276. // Add `num` to `this` in-place
  24277. BN.prototype.iadd = function iadd (num) {
  24278. var r;
  24279. // negative + positive
  24280. if (this.negative !== 0 && num.negative === 0) {
  24281. this.negative = 0;
  24282. r = this.isub(num);
  24283. this.negative ^= 1;
  24284. return this._normSign();
  24285. // positive + negative
  24286. } else if (this.negative === 0 && num.negative !== 0) {
  24287. num.negative = 0;
  24288. r = this.isub(num);
  24289. num.negative = 1;
  24290. return r._normSign();
  24291. }
  24292. // a.length > b.length
  24293. var a, b;
  24294. if (this.length > num.length) {
  24295. a = this;
  24296. b = num;
  24297. } else {
  24298. a = num;
  24299. b = this;
  24300. }
  24301. var carry = 0;
  24302. for (var i = 0; i < b.length; i++) {
  24303. r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
  24304. this.words[i] = r & 0x3ffffff;
  24305. carry = r >>> 26;
  24306. }
  24307. for (; carry !== 0 && i < a.length; i++) {
  24308. r = (a.words[i] | 0) + carry;
  24309. this.words[i] = r & 0x3ffffff;
  24310. carry = r >>> 26;
  24311. }
  24312. this.length = a.length;
  24313. if (carry !== 0) {
  24314. this.words[this.length] = carry;
  24315. this.length++;
  24316. // Copy the rest of the words
  24317. } else if (a !== this) {
  24318. for (; i < a.length; i++) {
  24319. this.words[i] = a.words[i];
  24320. }
  24321. }
  24322. return this;
  24323. };
  24324. // Add `num` to `this`
  24325. BN.prototype.add = function add (num) {
  24326. var res;
  24327. if (num.negative !== 0 && this.negative === 0) {
  24328. num.negative = 0;
  24329. res = this.sub(num);
  24330. num.negative ^= 1;
  24331. return res;
  24332. } else if (num.negative === 0 && this.negative !== 0) {
  24333. this.negative = 0;
  24334. res = num.sub(this);
  24335. this.negative = 1;
  24336. return res;
  24337. }
  24338. if (this.length > num.length) return this.clone().iadd(num);
  24339. return num.clone().iadd(this);
  24340. };
  24341. // Subtract `num` from `this` in-place
  24342. BN.prototype.isub = function isub (num) {
  24343. // this - (-num) = this + num
  24344. if (num.negative !== 0) {
  24345. num.negative = 0;
  24346. var r = this.iadd(num);
  24347. num.negative = 1;
  24348. return r._normSign();
  24349. // -this - num = -(this + num)
  24350. } else if (this.negative !== 0) {
  24351. this.negative = 0;
  24352. this.iadd(num);
  24353. this.negative = 1;
  24354. return this._normSign();
  24355. }
  24356. // At this point both numbers are positive
  24357. var cmp = this.cmp(num);
  24358. // Optimization - zeroify
  24359. if (cmp === 0) {
  24360. this.negative = 0;
  24361. this.length = 1;
  24362. this.words[0] = 0;
  24363. return this;
  24364. }
  24365. // a > b
  24366. var a, b;
  24367. if (cmp > 0) {
  24368. a = this;
  24369. b = num;
  24370. } else {
  24371. a = num;
  24372. b = this;
  24373. }
  24374. var carry = 0;
  24375. for (var i = 0; i < b.length; i++) {
  24376. r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
  24377. carry = r >> 26;
  24378. this.words[i] = r & 0x3ffffff;
  24379. }
  24380. for (; carry !== 0 && i < a.length; i++) {
  24381. r = (a.words[i] | 0) + carry;
  24382. carry = r >> 26;
  24383. this.words[i] = r & 0x3ffffff;
  24384. }
  24385. // Copy rest of the words
  24386. if (carry === 0 && i < a.length && a !== this) {
  24387. for (; i < a.length; i++) {
  24388. this.words[i] = a.words[i];
  24389. }
  24390. }
  24391. this.length = Math.max(this.length, i);
  24392. if (a !== this) {
  24393. this.negative = 1;
  24394. }
  24395. return this.strip();
  24396. };
  24397. // Subtract `num` from `this`
  24398. BN.prototype.sub = function sub (num) {
  24399. return this.clone().isub(num);
  24400. };
  24401. function smallMulTo (self, num, out) {
  24402. out.negative = num.negative ^ self.negative;
  24403. var len = (self.length + num.length) | 0;
  24404. out.length = len;
  24405. len = (len - 1) | 0;
  24406. // Peel one iteration (compiler can't do it, because of code complexity)
  24407. var a = self.words[0] | 0;
  24408. var b = num.words[0] | 0;
  24409. var r = a * b;
  24410. var lo = r & 0x3ffffff;
  24411. var carry = (r / 0x4000000) | 0;
  24412. out.words[0] = lo;
  24413. for (var k = 1; k < len; k++) {
  24414. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  24415. // note that ncarry could be >= 0x3ffffff
  24416. var ncarry = carry >>> 26;
  24417. var rword = carry & 0x3ffffff;
  24418. var maxJ = Math.min(k, num.length - 1);
  24419. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  24420. var i = (k - j) | 0;
  24421. a = self.words[i] | 0;
  24422. b = num.words[j] | 0;
  24423. r = a * b + rword;
  24424. ncarry += (r / 0x4000000) | 0;
  24425. rword = r & 0x3ffffff;
  24426. }
  24427. out.words[k] = rword | 0;
  24428. carry = ncarry | 0;
  24429. }
  24430. if (carry !== 0) {
  24431. out.words[k] = carry | 0;
  24432. } else {
  24433. out.length--;
  24434. }
  24435. return out.strip();
  24436. }
  24437. // TODO(indutny): it may be reasonable to omit it for users who don't need
  24438. // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  24439. // multiplication (like elliptic secp256k1).
  24440. var comb10MulTo = function comb10MulTo (self, num, out) {
  24441. var a = self.words;
  24442. var b = num.words;
  24443. var o = out.words;
  24444. var c = 0;
  24445. var lo;
  24446. var mid;
  24447. var hi;
  24448. var a0 = a[0] | 0;
  24449. var al0 = a0 & 0x1fff;
  24450. var ah0 = a0 >>> 13;
  24451. var a1 = a[1] | 0;
  24452. var al1 = a1 & 0x1fff;
  24453. var ah1 = a1 >>> 13;
  24454. var a2 = a[2] | 0;
  24455. var al2 = a2 & 0x1fff;
  24456. var ah2 = a2 >>> 13;
  24457. var a3 = a[3] | 0;
  24458. var al3 = a3 & 0x1fff;
  24459. var ah3 = a3 >>> 13;
  24460. var a4 = a[4] | 0;
  24461. var al4 = a4 & 0x1fff;
  24462. var ah4 = a4 >>> 13;
  24463. var a5 = a[5] | 0;
  24464. var al5 = a5 & 0x1fff;
  24465. var ah5 = a5 >>> 13;
  24466. var a6 = a[6] | 0;
  24467. var al6 = a6 & 0x1fff;
  24468. var ah6 = a6 >>> 13;
  24469. var a7 = a[7] | 0;
  24470. var al7 = a7 & 0x1fff;
  24471. var ah7 = a7 >>> 13;
  24472. var a8 = a[8] | 0;
  24473. var al8 = a8 & 0x1fff;
  24474. var ah8 = a8 >>> 13;
  24475. var a9 = a[9] | 0;
  24476. var al9 = a9 & 0x1fff;
  24477. var ah9 = a9 >>> 13;
  24478. var b0 = b[0] | 0;
  24479. var bl0 = b0 & 0x1fff;
  24480. var bh0 = b0 >>> 13;
  24481. var b1 = b[1] | 0;
  24482. var bl1 = b1 & 0x1fff;
  24483. var bh1 = b1 >>> 13;
  24484. var b2 = b[2] | 0;
  24485. var bl2 = b2 & 0x1fff;
  24486. var bh2 = b2 >>> 13;
  24487. var b3 = b[3] | 0;
  24488. var bl3 = b3 & 0x1fff;
  24489. var bh3 = b3 >>> 13;
  24490. var b4 = b[4] | 0;
  24491. var bl4 = b4 & 0x1fff;
  24492. var bh4 = b4 >>> 13;
  24493. var b5 = b[5] | 0;
  24494. var bl5 = b5 & 0x1fff;
  24495. var bh5 = b5 >>> 13;
  24496. var b6 = b[6] | 0;
  24497. var bl6 = b6 & 0x1fff;
  24498. var bh6 = b6 >>> 13;
  24499. var b7 = b[7] | 0;
  24500. var bl7 = b7 & 0x1fff;
  24501. var bh7 = b7 >>> 13;
  24502. var b8 = b[8] | 0;
  24503. var bl8 = b8 & 0x1fff;
  24504. var bh8 = b8 >>> 13;
  24505. var b9 = b[9] | 0;
  24506. var bl9 = b9 & 0x1fff;
  24507. var bh9 = b9 >>> 13;
  24508. out.negative = self.negative ^ num.negative;
  24509. out.length = 19;
  24510. /* k = 0 */
  24511. lo = Math.imul(al0, bl0);
  24512. mid = Math.imul(al0, bh0);
  24513. mid = (mid + Math.imul(ah0, bl0)) | 0;
  24514. hi = Math.imul(ah0, bh0);
  24515. var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24516. c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
  24517. w0 &= 0x3ffffff;
  24518. /* k = 1 */
  24519. lo = Math.imul(al1, bl0);
  24520. mid = Math.imul(al1, bh0);
  24521. mid = (mid + Math.imul(ah1, bl0)) | 0;
  24522. hi = Math.imul(ah1, bh0);
  24523. lo = (lo + Math.imul(al0, bl1)) | 0;
  24524. mid = (mid + Math.imul(al0, bh1)) | 0;
  24525. mid = (mid + Math.imul(ah0, bl1)) | 0;
  24526. hi = (hi + Math.imul(ah0, bh1)) | 0;
  24527. var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24528. c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
  24529. w1 &= 0x3ffffff;
  24530. /* k = 2 */
  24531. lo = Math.imul(al2, bl0);
  24532. mid = Math.imul(al2, bh0);
  24533. mid = (mid + Math.imul(ah2, bl0)) | 0;
  24534. hi = Math.imul(ah2, bh0);
  24535. lo = (lo + Math.imul(al1, bl1)) | 0;
  24536. mid = (mid + Math.imul(al1, bh1)) | 0;
  24537. mid = (mid + Math.imul(ah1, bl1)) | 0;
  24538. hi = (hi + Math.imul(ah1, bh1)) | 0;
  24539. lo = (lo + Math.imul(al0, bl2)) | 0;
  24540. mid = (mid + Math.imul(al0, bh2)) | 0;
  24541. mid = (mid + Math.imul(ah0, bl2)) | 0;
  24542. hi = (hi + Math.imul(ah0, bh2)) | 0;
  24543. var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24544. c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
  24545. w2 &= 0x3ffffff;
  24546. /* k = 3 */
  24547. lo = Math.imul(al3, bl0);
  24548. mid = Math.imul(al3, bh0);
  24549. mid = (mid + Math.imul(ah3, bl0)) | 0;
  24550. hi = Math.imul(ah3, bh0);
  24551. lo = (lo + Math.imul(al2, bl1)) | 0;
  24552. mid = (mid + Math.imul(al2, bh1)) | 0;
  24553. mid = (mid + Math.imul(ah2, bl1)) | 0;
  24554. hi = (hi + Math.imul(ah2, bh1)) | 0;
  24555. lo = (lo + Math.imul(al1, bl2)) | 0;
  24556. mid = (mid + Math.imul(al1, bh2)) | 0;
  24557. mid = (mid + Math.imul(ah1, bl2)) | 0;
  24558. hi = (hi + Math.imul(ah1, bh2)) | 0;
  24559. lo = (lo + Math.imul(al0, bl3)) | 0;
  24560. mid = (mid + Math.imul(al0, bh3)) | 0;
  24561. mid = (mid + Math.imul(ah0, bl3)) | 0;
  24562. hi = (hi + Math.imul(ah0, bh3)) | 0;
  24563. var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24564. c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
  24565. w3 &= 0x3ffffff;
  24566. /* k = 4 */
  24567. lo = Math.imul(al4, bl0);
  24568. mid = Math.imul(al4, bh0);
  24569. mid = (mid + Math.imul(ah4, bl0)) | 0;
  24570. hi = Math.imul(ah4, bh0);
  24571. lo = (lo + Math.imul(al3, bl1)) | 0;
  24572. mid = (mid + Math.imul(al3, bh1)) | 0;
  24573. mid = (mid + Math.imul(ah3, bl1)) | 0;
  24574. hi = (hi + Math.imul(ah3, bh1)) | 0;
  24575. lo = (lo + Math.imul(al2, bl2)) | 0;
  24576. mid = (mid + Math.imul(al2, bh2)) | 0;
  24577. mid = (mid + Math.imul(ah2, bl2)) | 0;
  24578. hi = (hi + Math.imul(ah2, bh2)) | 0;
  24579. lo = (lo + Math.imul(al1, bl3)) | 0;
  24580. mid = (mid + Math.imul(al1, bh3)) | 0;
  24581. mid = (mid + Math.imul(ah1, bl3)) | 0;
  24582. hi = (hi + Math.imul(ah1, bh3)) | 0;
  24583. lo = (lo + Math.imul(al0, bl4)) | 0;
  24584. mid = (mid + Math.imul(al0, bh4)) | 0;
  24585. mid = (mid + Math.imul(ah0, bl4)) | 0;
  24586. hi = (hi + Math.imul(ah0, bh4)) | 0;
  24587. var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24588. c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
  24589. w4 &= 0x3ffffff;
  24590. /* k = 5 */
  24591. lo = Math.imul(al5, bl0);
  24592. mid = Math.imul(al5, bh0);
  24593. mid = (mid + Math.imul(ah5, bl0)) | 0;
  24594. hi = Math.imul(ah5, bh0);
  24595. lo = (lo + Math.imul(al4, bl1)) | 0;
  24596. mid = (mid + Math.imul(al4, bh1)) | 0;
  24597. mid = (mid + Math.imul(ah4, bl1)) | 0;
  24598. hi = (hi + Math.imul(ah4, bh1)) | 0;
  24599. lo = (lo + Math.imul(al3, bl2)) | 0;
  24600. mid = (mid + Math.imul(al3, bh2)) | 0;
  24601. mid = (mid + Math.imul(ah3, bl2)) | 0;
  24602. hi = (hi + Math.imul(ah3, bh2)) | 0;
  24603. lo = (lo + Math.imul(al2, bl3)) | 0;
  24604. mid = (mid + Math.imul(al2, bh3)) | 0;
  24605. mid = (mid + Math.imul(ah2, bl3)) | 0;
  24606. hi = (hi + Math.imul(ah2, bh3)) | 0;
  24607. lo = (lo + Math.imul(al1, bl4)) | 0;
  24608. mid = (mid + Math.imul(al1, bh4)) | 0;
  24609. mid = (mid + Math.imul(ah1, bl4)) | 0;
  24610. hi = (hi + Math.imul(ah1, bh4)) | 0;
  24611. lo = (lo + Math.imul(al0, bl5)) | 0;
  24612. mid = (mid + Math.imul(al0, bh5)) | 0;
  24613. mid = (mid + Math.imul(ah0, bl5)) | 0;
  24614. hi = (hi + Math.imul(ah0, bh5)) | 0;
  24615. var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24616. c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
  24617. w5 &= 0x3ffffff;
  24618. /* k = 6 */
  24619. lo = Math.imul(al6, bl0);
  24620. mid = Math.imul(al6, bh0);
  24621. mid = (mid + Math.imul(ah6, bl0)) | 0;
  24622. hi = Math.imul(ah6, bh0);
  24623. lo = (lo + Math.imul(al5, bl1)) | 0;
  24624. mid = (mid + Math.imul(al5, bh1)) | 0;
  24625. mid = (mid + Math.imul(ah5, bl1)) | 0;
  24626. hi = (hi + Math.imul(ah5, bh1)) | 0;
  24627. lo = (lo + Math.imul(al4, bl2)) | 0;
  24628. mid = (mid + Math.imul(al4, bh2)) | 0;
  24629. mid = (mid + Math.imul(ah4, bl2)) | 0;
  24630. hi = (hi + Math.imul(ah4, bh2)) | 0;
  24631. lo = (lo + Math.imul(al3, bl3)) | 0;
  24632. mid = (mid + Math.imul(al3, bh3)) | 0;
  24633. mid = (mid + Math.imul(ah3, bl3)) | 0;
  24634. hi = (hi + Math.imul(ah3, bh3)) | 0;
  24635. lo = (lo + Math.imul(al2, bl4)) | 0;
  24636. mid = (mid + Math.imul(al2, bh4)) | 0;
  24637. mid = (mid + Math.imul(ah2, bl4)) | 0;
  24638. hi = (hi + Math.imul(ah2, bh4)) | 0;
  24639. lo = (lo + Math.imul(al1, bl5)) | 0;
  24640. mid = (mid + Math.imul(al1, bh5)) | 0;
  24641. mid = (mid + Math.imul(ah1, bl5)) | 0;
  24642. hi = (hi + Math.imul(ah1, bh5)) | 0;
  24643. lo = (lo + Math.imul(al0, bl6)) | 0;
  24644. mid = (mid + Math.imul(al0, bh6)) | 0;
  24645. mid = (mid + Math.imul(ah0, bl6)) | 0;
  24646. hi = (hi + Math.imul(ah0, bh6)) | 0;
  24647. var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24648. c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
  24649. w6 &= 0x3ffffff;
  24650. /* k = 7 */
  24651. lo = Math.imul(al7, bl0);
  24652. mid = Math.imul(al7, bh0);
  24653. mid = (mid + Math.imul(ah7, bl0)) | 0;
  24654. hi = Math.imul(ah7, bh0);
  24655. lo = (lo + Math.imul(al6, bl1)) | 0;
  24656. mid = (mid + Math.imul(al6, bh1)) | 0;
  24657. mid = (mid + Math.imul(ah6, bl1)) | 0;
  24658. hi = (hi + Math.imul(ah6, bh1)) | 0;
  24659. lo = (lo + Math.imul(al5, bl2)) | 0;
  24660. mid = (mid + Math.imul(al5, bh2)) | 0;
  24661. mid = (mid + Math.imul(ah5, bl2)) | 0;
  24662. hi = (hi + Math.imul(ah5, bh2)) | 0;
  24663. lo = (lo + Math.imul(al4, bl3)) | 0;
  24664. mid = (mid + Math.imul(al4, bh3)) | 0;
  24665. mid = (mid + Math.imul(ah4, bl3)) | 0;
  24666. hi = (hi + Math.imul(ah4, bh3)) | 0;
  24667. lo = (lo + Math.imul(al3, bl4)) | 0;
  24668. mid = (mid + Math.imul(al3, bh4)) | 0;
  24669. mid = (mid + Math.imul(ah3, bl4)) | 0;
  24670. hi = (hi + Math.imul(ah3, bh4)) | 0;
  24671. lo = (lo + Math.imul(al2, bl5)) | 0;
  24672. mid = (mid + Math.imul(al2, bh5)) | 0;
  24673. mid = (mid + Math.imul(ah2, bl5)) | 0;
  24674. hi = (hi + Math.imul(ah2, bh5)) | 0;
  24675. lo = (lo + Math.imul(al1, bl6)) | 0;
  24676. mid = (mid + Math.imul(al1, bh6)) | 0;
  24677. mid = (mid + Math.imul(ah1, bl6)) | 0;
  24678. hi = (hi + Math.imul(ah1, bh6)) | 0;
  24679. lo = (lo + Math.imul(al0, bl7)) | 0;
  24680. mid = (mid + Math.imul(al0, bh7)) | 0;
  24681. mid = (mid + Math.imul(ah0, bl7)) | 0;
  24682. hi = (hi + Math.imul(ah0, bh7)) | 0;
  24683. var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24684. c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
  24685. w7 &= 0x3ffffff;
  24686. /* k = 8 */
  24687. lo = Math.imul(al8, bl0);
  24688. mid = Math.imul(al8, bh0);
  24689. mid = (mid + Math.imul(ah8, bl0)) | 0;
  24690. hi = Math.imul(ah8, bh0);
  24691. lo = (lo + Math.imul(al7, bl1)) | 0;
  24692. mid = (mid + Math.imul(al7, bh1)) | 0;
  24693. mid = (mid + Math.imul(ah7, bl1)) | 0;
  24694. hi = (hi + Math.imul(ah7, bh1)) | 0;
  24695. lo = (lo + Math.imul(al6, bl2)) | 0;
  24696. mid = (mid + Math.imul(al6, bh2)) | 0;
  24697. mid = (mid + Math.imul(ah6, bl2)) | 0;
  24698. hi = (hi + Math.imul(ah6, bh2)) | 0;
  24699. lo = (lo + Math.imul(al5, bl3)) | 0;
  24700. mid = (mid + Math.imul(al5, bh3)) | 0;
  24701. mid = (mid + Math.imul(ah5, bl3)) | 0;
  24702. hi = (hi + Math.imul(ah5, bh3)) | 0;
  24703. lo = (lo + Math.imul(al4, bl4)) | 0;
  24704. mid = (mid + Math.imul(al4, bh4)) | 0;
  24705. mid = (mid + Math.imul(ah4, bl4)) | 0;
  24706. hi = (hi + Math.imul(ah4, bh4)) | 0;
  24707. lo = (lo + Math.imul(al3, bl5)) | 0;
  24708. mid = (mid + Math.imul(al3, bh5)) | 0;
  24709. mid = (mid + Math.imul(ah3, bl5)) | 0;
  24710. hi = (hi + Math.imul(ah3, bh5)) | 0;
  24711. lo = (lo + Math.imul(al2, bl6)) | 0;
  24712. mid = (mid + Math.imul(al2, bh6)) | 0;
  24713. mid = (mid + Math.imul(ah2, bl6)) | 0;
  24714. hi = (hi + Math.imul(ah2, bh6)) | 0;
  24715. lo = (lo + Math.imul(al1, bl7)) | 0;
  24716. mid = (mid + Math.imul(al1, bh7)) | 0;
  24717. mid = (mid + Math.imul(ah1, bl7)) | 0;
  24718. hi = (hi + Math.imul(ah1, bh7)) | 0;
  24719. lo = (lo + Math.imul(al0, bl8)) | 0;
  24720. mid = (mid + Math.imul(al0, bh8)) | 0;
  24721. mid = (mid + Math.imul(ah0, bl8)) | 0;
  24722. hi = (hi + Math.imul(ah0, bh8)) | 0;
  24723. var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24724. c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
  24725. w8 &= 0x3ffffff;
  24726. /* k = 9 */
  24727. lo = Math.imul(al9, bl0);
  24728. mid = Math.imul(al9, bh0);
  24729. mid = (mid + Math.imul(ah9, bl0)) | 0;
  24730. hi = Math.imul(ah9, bh0);
  24731. lo = (lo + Math.imul(al8, bl1)) | 0;
  24732. mid = (mid + Math.imul(al8, bh1)) | 0;
  24733. mid = (mid + Math.imul(ah8, bl1)) | 0;
  24734. hi = (hi + Math.imul(ah8, bh1)) | 0;
  24735. lo = (lo + Math.imul(al7, bl2)) | 0;
  24736. mid = (mid + Math.imul(al7, bh2)) | 0;
  24737. mid = (mid + Math.imul(ah7, bl2)) | 0;
  24738. hi = (hi + Math.imul(ah7, bh2)) | 0;
  24739. lo = (lo + Math.imul(al6, bl3)) | 0;
  24740. mid = (mid + Math.imul(al6, bh3)) | 0;
  24741. mid = (mid + Math.imul(ah6, bl3)) | 0;
  24742. hi = (hi + Math.imul(ah6, bh3)) | 0;
  24743. lo = (lo + Math.imul(al5, bl4)) | 0;
  24744. mid = (mid + Math.imul(al5, bh4)) | 0;
  24745. mid = (mid + Math.imul(ah5, bl4)) | 0;
  24746. hi = (hi + Math.imul(ah5, bh4)) | 0;
  24747. lo = (lo + Math.imul(al4, bl5)) | 0;
  24748. mid = (mid + Math.imul(al4, bh5)) | 0;
  24749. mid = (mid + Math.imul(ah4, bl5)) | 0;
  24750. hi = (hi + Math.imul(ah4, bh5)) | 0;
  24751. lo = (lo + Math.imul(al3, bl6)) | 0;
  24752. mid = (mid + Math.imul(al3, bh6)) | 0;
  24753. mid = (mid + Math.imul(ah3, bl6)) | 0;
  24754. hi = (hi + Math.imul(ah3, bh6)) | 0;
  24755. lo = (lo + Math.imul(al2, bl7)) | 0;
  24756. mid = (mid + Math.imul(al2, bh7)) | 0;
  24757. mid = (mid + Math.imul(ah2, bl7)) | 0;
  24758. hi = (hi + Math.imul(ah2, bh7)) | 0;
  24759. lo = (lo + Math.imul(al1, bl8)) | 0;
  24760. mid = (mid + Math.imul(al1, bh8)) | 0;
  24761. mid = (mid + Math.imul(ah1, bl8)) | 0;
  24762. hi = (hi + Math.imul(ah1, bh8)) | 0;
  24763. lo = (lo + Math.imul(al0, bl9)) | 0;
  24764. mid = (mid + Math.imul(al0, bh9)) | 0;
  24765. mid = (mid + Math.imul(ah0, bl9)) | 0;
  24766. hi = (hi + Math.imul(ah0, bh9)) | 0;
  24767. var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24768. c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
  24769. w9 &= 0x3ffffff;
  24770. /* k = 10 */
  24771. lo = Math.imul(al9, bl1);
  24772. mid = Math.imul(al9, bh1);
  24773. mid = (mid + Math.imul(ah9, bl1)) | 0;
  24774. hi = Math.imul(ah9, bh1);
  24775. lo = (lo + Math.imul(al8, bl2)) | 0;
  24776. mid = (mid + Math.imul(al8, bh2)) | 0;
  24777. mid = (mid + Math.imul(ah8, bl2)) | 0;
  24778. hi = (hi + Math.imul(ah8, bh2)) | 0;
  24779. lo = (lo + Math.imul(al7, bl3)) | 0;
  24780. mid = (mid + Math.imul(al7, bh3)) | 0;
  24781. mid = (mid + Math.imul(ah7, bl3)) | 0;
  24782. hi = (hi + Math.imul(ah7, bh3)) | 0;
  24783. lo = (lo + Math.imul(al6, bl4)) | 0;
  24784. mid = (mid + Math.imul(al6, bh4)) | 0;
  24785. mid = (mid + Math.imul(ah6, bl4)) | 0;
  24786. hi = (hi + Math.imul(ah6, bh4)) | 0;
  24787. lo = (lo + Math.imul(al5, bl5)) | 0;
  24788. mid = (mid + Math.imul(al5, bh5)) | 0;
  24789. mid = (mid + Math.imul(ah5, bl5)) | 0;
  24790. hi = (hi + Math.imul(ah5, bh5)) | 0;
  24791. lo = (lo + Math.imul(al4, bl6)) | 0;
  24792. mid = (mid + Math.imul(al4, bh6)) | 0;
  24793. mid = (mid + Math.imul(ah4, bl6)) | 0;
  24794. hi = (hi + Math.imul(ah4, bh6)) | 0;
  24795. lo = (lo + Math.imul(al3, bl7)) | 0;
  24796. mid = (mid + Math.imul(al3, bh7)) | 0;
  24797. mid = (mid + Math.imul(ah3, bl7)) | 0;
  24798. hi = (hi + Math.imul(ah3, bh7)) | 0;
  24799. lo = (lo + Math.imul(al2, bl8)) | 0;
  24800. mid = (mid + Math.imul(al2, bh8)) | 0;
  24801. mid = (mid + Math.imul(ah2, bl8)) | 0;
  24802. hi = (hi + Math.imul(ah2, bh8)) | 0;
  24803. lo = (lo + Math.imul(al1, bl9)) | 0;
  24804. mid = (mid + Math.imul(al1, bh9)) | 0;
  24805. mid = (mid + Math.imul(ah1, bl9)) | 0;
  24806. hi = (hi + Math.imul(ah1, bh9)) | 0;
  24807. var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24808. c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
  24809. w10 &= 0x3ffffff;
  24810. /* k = 11 */
  24811. lo = Math.imul(al9, bl2);
  24812. mid = Math.imul(al9, bh2);
  24813. mid = (mid + Math.imul(ah9, bl2)) | 0;
  24814. hi = Math.imul(ah9, bh2);
  24815. lo = (lo + Math.imul(al8, bl3)) | 0;
  24816. mid = (mid + Math.imul(al8, bh3)) | 0;
  24817. mid = (mid + Math.imul(ah8, bl3)) | 0;
  24818. hi = (hi + Math.imul(ah8, bh3)) | 0;
  24819. lo = (lo + Math.imul(al7, bl4)) | 0;
  24820. mid = (mid + Math.imul(al7, bh4)) | 0;
  24821. mid = (mid + Math.imul(ah7, bl4)) | 0;
  24822. hi = (hi + Math.imul(ah7, bh4)) | 0;
  24823. lo = (lo + Math.imul(al6, bl5)) | 0;
  24824. mid = (mid + Math.imul(al6, bh5)) | 0;
  24825. mid = (mid + Math.imul(ah6, bl5)) | 0;
  24826. hi = (hi + Math.imul(ah6, bh5)) | 0;
  24827. lo = (lo + Math.imul(al5, bl6)) | 0;
  24828. mid = (mid + Math.imul(al5, bh6)) | 0;
  24829. mid = (mid + Math.imul(ah5, bl6)) | 0;
  24830. hi = (hi + Math.imul(ah5, bh6)) | 0;
  24831. lo = (lo + Math.imul(al4, bl7)) | 0;
  24832. mid = (mid + Math.imul(al4, bh7)) | 0;
  24833. mid = (mid + Math.imul(ah4, bl7)) | 0;
  24834. hi = (hi + Math.imul(ah4, bh7)) | 0;
  24835. lo = (lo + Math.imul(al3, bl8)) | 0;
  24836. mid = (mid + Math.imul(al3, bh8)) | 0;
  24837. mid = (mid + Math.imul(ah3, bl8)) | 0;
  24838. hi = (hi + Math.imul(ah3, bh8)) | 0;
  24839. lo = (lo + Math.imul(al2, bl9)) | 0;
  24840. mid = (mid + Math.imul(al2, bh9)) | 0;
  24841. mid = (mid + Math.imul(ah2, bl9)) | 0;
  24842. hi = (hi + Math.imul(ah2, bh9)) | 0;
  24843. var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24844. c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
  24845. w11 &= 0x3ffffff;
  24846. /* k = 12 */
  24847. lo = Math.imul(al9, bl3);
  24848. mid = Math.imul(al9, bh3);
  24849. mid = (mid + Math.imul(ah9, bl3)) | 0;
  24850. hi = Math.imul(ah9, bh3);
  24851. lo = (lo + Math.imul(al8, bl4)) | 0;
  24852. mid = (mid + Math.imul(al8, bh4)) | 0;
  24853. mid = (mid + Math.imul(ah8, bl4)) | 0;
  24854. hi = (hi + Math.imul(ah8, bh4)) | 0;
  24855. lo = (lo + Math.imul(al7, bl5)) | 0;
  24856. mid = (mid + Math.imul(al7, bh5)) | 0;
  24857. mid = (mid + Math.imul(ah7, bl5)) | 0;
  24858. hi = (hi + Math.imul(ah7, bh5)) | 0;
  24859. lo = (lo + Math.imul(al6, bl6)) | 0;
  24860. mid = (mid + Math.imul(al6, bh6)) | 0;
  24861. mid = (mid + Math.imul(ah6, bl6)) | 0;
  24862. hi = (hi + Math.imul(ah6, bh6)) | 0;
  24863. lo = (lo + Math.imul(al5, bl7)) | 0;
  24864. mid = (mid + Math.imul(al5, bh7)) | 0;
  24865. mid = (mid + Math.imul(ah5, bl7)) | 0;
  24866. hi = (hi + Math.imul(ah5, bh7)) | 0;
  24867. lo = (lo + Math.imul(al4, bl8)) | 0;
  24868. mid = (mid + Math.imul(al4, bh8)) | 0;
  24869. mid = (mid + Math.imul(ah4, bl8)) | 0;
  24870. hi = (hi + Math.imul(ah4, bh8)) | 0;
  24871. lo = (lo + Math.imul(al3, bl9)) | 0;
  24872. mid = (mid + Math.imul(al3, bh9)) | 0;
  24873. mid = (mid + Math.imul(ah3, bl9)) | 0;
  24874. hi = (hi + Math.imul(ah3, bh9)) | 0;
  24875. var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24876. c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
  24877. w12 &= 0x3ffffff;
  24878. /* k = 13 */
  24879. lo = Math.imul(al9, bl4);
  24880. mid = Math.imul(al9, bh4);
  24881. mid = (mid + Math.imul(ah9, bl4)) | 0;
  24882. hi = Math.imul(ah9, bh4);
  24883. lo = (lo + Math.imul(al8, bl5)) | 0;
  24884. mid = (mid + Math.imul(al8, bh5)) | 0;
  24885. mid = (mid + Math.imul(ah8, bl5)) | 0;
  24886. hi = (hi + Math.imul(ah8, bh5)) | 0;
  24887. lo = (lo + Math.imul(al7, bl6)) | 0;
  24888. mid = (mid + Math.imul(al7, bh6)) | 0;
  24889. mid = (mid + Math.imul(ah7, bl6)) | 0;
  24890. hi = (hi + Math.imul(ah7, bh6)) | 0;
  24891. lo = (lo + Math.imul(al6, bl7)) | 0;
  24892. mid = (mid + Math.imul(al6, bh7)) | 0;
  24893. mid = (mid + Math.imul(ah6, bl7)) | 0;
  24894. hi = (hi + Math.imul(ah6, bh7)) | 0;
  24895. lo = (lo + Math.imul(al5, bl8)) | 0;
  24896. mid = (mid + Math.imul(al5, bh8)) | 0;
  24897. mid = (mid + Math.imul(ah5, bl8)) | 0;
  24898. hi = (hi + Math.imul(ah5, bh8)) | 0;
  24899. lo = (lo + Math.imul(al4, bl9)) | 0;
  24900. mid = (mid + Math.imul(al4, bh9)) | 0;
  24901. mid = (mid + Math.imul(ah4, bl9)) | 0;
  24902. hi = (hi + Math.imul(ah4, bh9)) | 0;
  24903. var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24904. c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
  24905. w13 &= 0x3ffffff;
  24906. /* k = 14 */
  24907. lo = Math.imul(al9, bl5);
  24908. mid = Math.imul(al9, bh5);
  24909. mid = (mid + Math.imul(ah9, bl5)) | 0;
  24910. hi = Math.imul(ah9, bh5);
  24911. lo = (lo + Math.imul(al8, bl6)) | 0;
  24912. mid = (mid + Math.imul(al8, bh6)) | 0;
  24913. mid = (mid + Math.imul(ah8, bl6)) | 0;
  24914. hi = (hi + Math.imul(ah8, bh6)) | 0;
  24915. lo = (lo + Math.imul(al7, bl7)) | 0;
  24916. mid = (mid + Math.imul(al7, bh7)) | 0;
  24917. mid = (mid + Math.imul(ah7, bl7)) | 0;
  24918. hi = (hi + Math.imul(ah7, bh7)) | 0;
  24919. lo = (lo + Math.imul(al6, bl8)) | 0;
  24920. mid = (mid + Math.imul(al6, bh8)) | 0;
  24921. mid = (mid + Math.imul(ah6, bl8)) | 0;
  24922. hi = (hi + Math.imul(ah6, bh8)) | 0;
  24923. lo = (lo + Math.imul(al5, bl9)) | 0;
  24924. mid = (mid + Math.imul(al5, bh9)) | 0;
  24925. mid = (mid + Math.imul(ah5, bl9)) | 0;
  24926. hi = (hi + Math.imul(ah5, bh9)) | 0;
  24927. var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24928. c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
  24929. w14 &= 0x3ffffff;
  24930. /* k = 15 */
  24931. lo = Math.imul(al9, bl6);
  24932. mid = Math.imul(al9, bh6);
  24933. mid = (mid + Math.imul(ah9, bl6)) | 0;
  24934. hi = Math.imul(ah9, bh6);
  24935. lo = (lo + Math.imul(al8, bl7)) | 0;
  24936. mid = (mid + Math.imul(al8, bh7)) | 0;
  24937. mid = (mid + Math.imul(ah8, bl7)) | 0;
  24938. hi = (hi + Math.imul(ah8, bh7)) | 0;
  24939. lo = (lo + Math.imul(al7, bl8)) | 0;
  24940. mid = (mid + Math.imul(al7, bh8)) | 0;
  24941. mid = (mid + Math.imul(ah7, bl8)) | 0;
  24942. hi = (hi + Math.imul(ah7, bh8)) | 0;
  24943. lo = (lo + Math.imul(al6, bl9)) | 0;
  24944. mid = (mid + Math.imul(al6, bh9)) | 0;
  24945. mid = (mid + Math.imul(ah6, bl9)) | 0;
  24946. hi = (hi + Math.imul(ah6, bh9)) | 0;
  24947. var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24948. c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
  24949. w15 &= 0x3ffffff;
  24950. /* k = 16 */
  24951. lo = Math.imul(al9, bl7);
  24952. mid = Math.imul(al9, bh7);
  24953. mid = (mid + Math.imul(ah9, bl7)) | 0;
  24954. hi = Math.imul(ah9, bh7);
  24955. lo = (lo + Math.imul(al8, bl8)) | 0;
  24956. mid = (mid + Math.imul(al8, bh8)) | 0;
  24957. mid = (mid + Math.imul(ah8, bl8)) | 0;
  24958. hi = (hi + Math.imul(ah8, bh8)) | 0;
  24959. lo = (lo + Math.imul(al7, bl9)) | 0;
  24960. mid = (mid + Math.imul(al7, bh9)) | 0;
  24961. mid = (mid + Math.imul(ah7, bl9)) | 0;
  24962. hi = (hi + Math.imul(ah7, bh9)) | 0;
  24963. var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24964. c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
  24965. w16 &= 0x3ffffff;
  24966. /* k = 17 */
  24967. lo = Math.imul(al9, bl8);
  24968. mid = Math.imul(al9, bh8);
  24969. mid = (mid + Math.imul(ah9, bl8)) | 0;
  24970. hi = Math.imul(ah9, bh8);
  24971. lo = (lo + Math.imul(al8, bl9)) | 0;
  24972. mid = (mid + Math.imul(al8, bh9)) | 0;
  24973. mid = (mid + Math.imul(ah8, bl9)) | 0;
  24974. hi = (hi + Math.imul(ah8, bh9)) | 0;
  24975. var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24976. c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
  24977. w17 &= 0x3ffffff;
  24978. /* k = 18 */
  24979. lo = Math.imul(al9, bl9);
  24980. mid = Math.imul(al9, bh9);
  24981. mid = (mid + Math.imul(ah9, bl9)) | 0;
  24982. hi = Math.imul(ah9, bh9);
  24983. var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  24984. c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
  24985. w18 &= 0x3ffffff;
  24986. o[0] = w0;
  24987. o[1] = w1;
  24988. o[2] = w2;
  24989. o[3] = w3;
  24990. o[4] = w4;
  24991. o[5] = w5;
  24992. o[6] = w6;
  24993. o[7] = w7;
  24994. o[8] = w8;
  24995. o[9] = w9;
  24996. o[10] = w10;
  24997. o[11] = w11;
  24998. o[12] = w12;
  24999. o[13] = w13;
  25000. o[14] = w14;
  25001. o[15] = w15;
  25002. o[16] = w16;
  25003. o[17] = w17;
  25004. o[18] = w18;
  25005. if (c !== 0) {
  25006. o[19] = c;
  25007. out.length++;
  25008. }
  25009. return out;
  25010. };
  25011. // Polyfill comb
  25012. if (!Math.imul) {
  25013. comb10MulTo = smallMulTo;
  25014. }
  25015. function bigMulTo (self, num, out) {
  25016. out.negative = num.negative ^ self.negative;
  25017. out.length = self.length + num.length;
  25018. var carry = 0;
  25019. var hncarry = 0;
  25020. for (var k = 0; k < out.length - 1; k++) {
  25021. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  25022. // note that ncarry could be >= 0x3ffffff
  25023. var ncarry = hncarry;
  25024. hncarry = 0;
  25025. var rword = carry & 0x3ffffff;
  25026. var maxJ = Math.min(k, num.length - 1);
  25027. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  25028. var i = k - j;
  25029. var a = self.words[i] | 0;
  25030. var b = num.words[j] | 0;
  25031. var r = a * b;
  25032. var lo = r & 0x3ffffff;
  25033. ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
  25034. lo = (lo + rword) | 0;
  25035. rword = lo & 0x3ffffff;
  25036. ncarry = (ncarry + (lo >>> 26)) | 0;
  25037. hncarry += ncarry >>> 26;
  25038. ncarry &= 0x3ffffff;
  25039. }
  25040. out.words[k] = rword;
  25041. carry = ncarry;
  25042. ncarry = hncarry;
  25043. }
  25044. if (carry !== 0) {
  25045. out.words[k] = carry;
  25046. } else {
  25047. out.length--;
  25048. }
  25049. return out.strip();
  25050. }
  25051. function jumboMulTo (self, num, out) {
  25052. var fftm = new FFTM();
  25053. return fftm.mulp(self, num, out);
  25054. }
  25055. BN.prototype.mulTo = function mulTo (num, out) {
  25056. var res;
  25057. var len = this.length + num.length;
  25058. if (this.length === 10 && num.length === 10) {
  25059. res = comb10MulTo(this, num, out);
  25060. } else if (len < 63) {
  25061. res = smallMulTo(this, num, out);
  25062. } else if (len < 1024) {
  25063. res = bigMulTo(this, num, out);
  25064. } else {
  25065. res = jumboMulTo(this, num, out);
  25066. }
  25067. return res;
  25068. };
  25069. // Cooley-Tukey algorithm for FFT
  25070. // slightly revisited to rely on looping instead of recursion
  25071. function FFTM (x, y) {
  25072. this.x = x;
  25073. this.y = y;
  25074. }
  25075. FFTM.prototype.makeRBT = function makeRBT (N) {
  25076. var t = new Array(N);
  25077. var l = BN.prototype._countBits(N) - 1;
  25078. for (var i = 0; i < N; i++) {
  25079. t[i] = this.revBin(i, l, N);
  25080. }
  25081. return t;
  25082. };
  25083. // Returns binary-reversed representation of `x`
  25084. FFTM.prototype.revBin = function revBin (x, l, N) {
  25085. if (x === 0 || x === N - 1) return x;
  25086. var rb = 0;
  25087. for (var i = 0; i < l; i++) {
  25088. rb |= (x & 1) << (l - i - 1);
  25089. x >>= 1;
  25090. }
  25091. return rb;
  25092. };
  25093. // Performs "tweedling" phase, therefore 'emulating'
  25094. // behaviour of the recursive algorithm
  25095. FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
  25096. for (var i = 0; i < N; i++) {
  25097. rtws[i] = rws[rbt[i]];
  25098. itws[i] = iws[rbt[i]];
  25099. }
  25100. };
  25101. FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
  25102. this.permute(rbt, rws, iws, rtws, itws, N);
  25103. for (var s = 1; s < N; s <<= 1) {
  25104. var l = s << 1;
  25105. var rtwdf = Math.cos(2 * Math.PI / l);
  25106. var itwdf = Math.sin(2 * Math.PI / l);
  25107. for (var p = 0; p < N; p += l) {
  25108. var rtwdf_ = rtwdf;
  25109. var itwdf_ = itwdf;
  25110. for (var j = 0; j < s; j++) {
  25111. var re = rtws[p + j];
  25112. var ie = itws[p + j];
  25113. var ro = rtws[p + j + s];
  25114. var io = itws[p + j + s];
  25115. var rx = rtwdf_ * ro - itwdf_ * io;
  25116. io = rtwdf_ * io + itwdf_ * ro;
  25117. ro = rx;
  25118. rtws[p + j] = re + ro;
  25119. itws[p + j] = ie + io;
  25120. rtws[p + j + s] = re - ro;
  25121. itws[p + j + s] = ie - io;
  25122. /* jshint maxdepth : false */
  25123. if (j !== l) {
  25124. rx = rtwdf * rtwdf_ - itwdf * itwdf_;
  25125. itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
  25126. rtwdf_ = rx;
  25127. }
  25128. }
  25129. }
  25130. }
  25131. };
  25132. FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
  25133. var N = Math.max(m, n) | 1;
  25134. var odd = N & 1;
  25135. var i = 0;
  25136. for (N = N / 2 | 0; N; N = N >>> 1) {
  25137. i++;
  25138. }
  25139. return 1 << i + 1 + odd;
  25140. };
  25141. FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
  25142. if (N <= 1) return;
  25143. for (var i = 0; i < N / 2; i++) {
  25144. var t = rws[i];
  25145. rws[i] = rws[N - i - 1];
  25146. rws[N - i - 1] = t;
  25147. t = iws[i];
  25148. iws[i] = -iws[N - i - 1];
  25149. iws[N - i - 1] = -t;
  25150. }
  25151. };
  25152. FFTM.prototype.normalize13b = function normalize13b (ws, N) {
  25153. var carry = 0;
  25154. for (var i = 0; i < N / 2; i++) {
  25155. var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
  25156. Math.round(ws[2 * i] / N) +
  25157. carry;
  25158. ws[i] = w & 0x3ffffff;
  25159. if (w < 0x4000000) {
  25160. carry = 0;
  25161. } else {
  25162. carry = w / 0x4000000 | 0;
  25163. }
  25164. }
  25165. return ws;
  25166. };
  25167. FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
  25168. var carry = 0;
  25169. for (var i = 0; i < len; i++) {
  25170. carry = carry + (ws[i] | 0);
  25171. rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
  25172. rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
  25173. }
  25174. // Pad with zeroes
  25175. for (i = 2 * len; i < N; ++i) {
  25176. rws[i] = 0;
  25177. }
  25178. assert(carry === 0);
  25179. assert((carry & ~0x1fff) === 0);
  25180. };
  25181. FFTM.prototype.stub = function stub (N) {
  25182. var ph = new Array(N);
  25183. for (var i = 0; i < N; i++) {
  25184. ph[i] = 0;
  25185. }
  25186. return ph;
  25187. };
  25188. FFTM.prototype.mulp = function mulp (x, y, out) {
  25189. var N = 2 * this.guessLen13b(x.length, y.length);
  25190. var rbt = this.makeRBT(N);
  25191. var _ = this.stub(N);
  25192. var rws = new Array(N);
  25193. var rwst = new Array(N);
  25194. var iwst = new Array(N);
  25195. var nrws = new Array(N);
  25196. var nrwst = new Array(N);
  25197. var niwst = new Array(N);
  25198. var rmws = out.words;
  25199. rmws.length = N;
  25200. this.convert13b(x.words, x.length, rws, N);
  25201. this.convert13b(y.words, y.length, nrws, N);
  25202. this.transform(rws, _, rwst, iwst, N, rbt);
  25203. this.transform(nrws, _, nrwst, niwst, N, rbt);
  25204. for (var i = 0; i < N; i++) {
  25205. var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
  25206. iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
  25207. rwst[i] = rx;
  25208. }
  25209. this.conjugate(rwst, iwst, N);
  25210. this.transform(rwst, iwst, rmws, _, N, rbt);
  25211. this.conjugate(rmws, _, N);
  25212. this.normalize13b(rmws, N);
  25213. out.negative = x.negative ^ y.negative;
  25214. out.length = x.length + y.length;
  25215. return out.strip();
  25216. };
  25217. // Multiply `this` by `num`
  25218. BN.prototype.mul = function mul (num) {
  25219. var out = new BN(null);
  25220. out.words = new Array(this.length + num.length);
  25221. return this.mulTo(num, out);
  25222. };
  25223. // Multiply employing FFT
  25224. BN.prototype.mulf = function mulf (num) {
  25225. var out = new BN(null);
  25226. out.words = new Array(this.length + num.length);
  25227. return jumboMulTo(this, num, out);
  25228. };
  25229. // In-place Multiplication
  25230. BN.prototype.imul = function imul (num) {
  25231. return this.clone().mulTo(num, this);
  25232. };
  25233. BN.prototype.imuln = function imuln (num) {
  25234. assert(typeof num === 'number');
  25235. assert(num < 0x4000000);
  25236. // Carry
  25237. var carry = 0;
  25238. for (var i = 0; i < this.length; i++) {
  25239. var w = (this.words[i] | 0) * num;
  25240. var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
  25241. carry >>= 26;
  25242. carry += (w / 0x4000000) | 0;
  25243. // NOTE: lo is 27bit maximum
  25244. carry += lo >>> 26;
  25245. this.words[i] = lo & 0x3ffffff;
  25246. }
  25247. if (carry !== 0) {
  25248. this.words[i] = carry;
  25249. this.length++;
  25250. }
  25251. return this;
  25252. };
  25253. BN.prototype.muln = function muln (num) {
  25254. return this.clone().imuln(num);
  25255. };
  25256. // `this` * `this`
  25257. BN.prototype.sqr = function sqr () {
  25258. return this.mul(this);
  25259. };
  25260. // `this` * `this` in-place
  25261. BN.prototype.isqr = function isqr () {
  25262. return this.imul(this.clone());
  25263. };
  25264. // Math.pow(`this`, `num`)
  25265. BN.prototype.pow = function pow (num) {
  25266. var w = toBitArray(num);
  25267. if (w.length === 0) return new BN(1);
  25268. // Skip leading zeroes
  25269. var res = this;
  25270. for (var i = 0; i < w.length; i++, res = res.sqr()) {
  25271. if (w[i] !== 0) break;
  25272. }
  25273. if (++i < w.length) {
  25274. for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
  25275. if (w[i] === 0) continue;
  25276. res = res.mul(q);
  25277. }
  25278. }
  25279. return res;
  25280. };
  25281. // Shift-left in-place
  25282. BN.prototype.iushln = function iushln (bits) {
  25283. assert(typeof bits === 'number' && bits >= 0);
  25284. var r = bits % 26;
  25285. var s = (bits - r) / 26;
  25286. var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
  25287. var i;
  25288. if (r !== 0) {
  25289. var carry = 0;
  25290. for (i = 0; i < this.length; i++) {
  25291. var newCarry = this.words[i] & carryMask;
  25292. var c = ((this.words[i] | 0) - newCarry) << r;
  25293. this.words[i] = c | carry;
  25294. carry = newCarry >>> (26 - r);
  25295. }
  25296. if (carry) {
  25297. this.words[i] = carry;
  25298. this.length++;
  25299. }
  25300. }
  25301. if (s !== 0) {
  25302. for (i = this.length - 1; i >= 0; i--) {
  25303. this.words[i + s] = this.words[i];
  25304. }
  25305. for (i = 0; i < s; i++) {
  25306. this.words[i] = 0;
  25307. }
  25308. this.length += s;
  25309. }
  25310. return this.strip();
  25311. };
  25312. BN.prototype.ishln = function ishln (bits) {
  25313. // TODO(indutny): implement me
  25314. assert(this.negative === 0);
  25315. return this.iushln(bits);
  25316. };
  25317. // Shift-right in-place
  25318. // NOTE: `hint` is a lowest bit before trailing zeroes
  25319. // NOTE: if `extended` is present - it will be filled with destroyed bits
  25320. BN.prototype.iushrn = function iushrn (bits, hint, extended) {
  25321. assert(typeof bits === 'number' && bits >= 0);
  25322. var h;
  25323. if (hint) {
  25324. h = (hint - (hint % 26)) / 26;
  25325. } else {
  25326. h = 0;
  25327. }
  25328. var r = bits % 26;
  25329. var s = Math.min((bits - r) / 26, this.length);
  25330. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  25331. var maskedWords = extended;
  25332. h -= s;
  25333. h = Math.max(0, h);
  25334. // Extended mode, copy masked part
  25335. if (maskedWords) {
  25336. for (var i = 0; i < s; i++) {
  25337. maskedWords.words[i] = this.words[i];
  25338. }
  25339. maskedWords.length = s;
  25340. }
  25341. if (s === 0) {
  25342. // No-op, we should not move anything at all
  25343. } else if (this.length > s) {
  25344. this.length -= s;
  25345. for (i = 0; i < this.length; i++) {
  25346. this.words[i] = this.words[i + s];
  25347. }
  25348. } else {
  25349. this.words[0] = 0;
  25350. this.length = 1;
  25351. }
  25352. var carry = 0;
  25353. for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
  25354. var word = this.words[i] | 0;
  25355. this.words[i] = (carry << (26 - r)) | (word >>> r);
  25356. carry = word & mask;
  25357. }
  25358. // Push carried bits as a mask
  25359. if (maskedWords && carry !== 0) {
  25360. maskedWords.words[maskedWords.length++] = carry;
  25361. }
  25362. if (this.length === 0) {
  25363. this.words[0] = 0;
  25364. this.length = 1;
  25365. }
  25366. return this.strip();
  25367. };
  25368. BN.prototype.ishrn = function ishrn (bits, hint, extended) {
  25369. // TODO(indutny): implement me
  25370. assert(this.negative === 0);
  25371. return this.iushrn(bits, hint, extended);
  25372. };
  25373. // Shift-left
  25374. BN.prototype.shln = function shln (bits) {
  25375. return this.clone().ishln(bits);
  25376. };
  25377. BN.prototype.ushln = function ushln (bits) {
  25378. return this.clone().iushln(bits);
  25379. };
  25380. // Shift-right
  25381. BN.prototype.shrn = function shrn (bits) {
  25382. return this.clone().ishrn(bits);
  25383. };
  25384. BN.prototype.ushrn = function ushrn (bits) {
  25385. return this.clone().iushrn(bits);
  25386. };
  25387. // Test if n bit is set
  25388. BN.prototype.testn = function testn (bit) {
  25389. assert(typeof bit === 'number' && bit >= 0);
  25390. var r = bit % 26;
  25391. var s = (bit - r) / 26;
  25392. var q = 1 << r;
  25393. // Fast case: bit is much higher than all existing words
  25394. if (this.length <= s) return false;
  25395. // Check bit and return
  25396. var w = this.words[s];
  25397. return !!(w & q);
  25398. };
  25399. // Return only lowers bits of number (in-place)
  25400. BN.prototype.imaskn = function imaskn (bits) {
  25401. assert(typeof bits === 'number' && bits >= 0);
  25402. var r = bits % 26;
  25403. var s = (bits - r) / 26;
  25404. assert(this.negative === 0, 'imaskn works only with positive numbers');
  25405. if (this.length <= s) {
  25406. return this;
  25407. }
  25408. if (r !== 0) {
  25409. s++;
  25410. }
  25411. this.length = Math.min(s, this.length);
  25412. if (r !== 0) {
  25413. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  25414. this.words[this.length - 1] &= mask;
  25415. }
  25416. return this.strip();
  25417. };
  25418. // Return only lowers bits of number
  25419. BN.prototype.maskn = function maskn (bits) {
  25420. return this.clone().imaskn(bits);
  25421. };
  25422. // Add plain number `num` to `this`
  25423. BN.prototype.iaddn = function iaddn (num) {
  25424. assert(typeof num === 'number');
  25425. assert(num < 0x4000000);
  25426. if (num < 0) return this.isubn(-num);
  25427. // Possible sign change
  25428. if (this.negative !== 0) {
  25429. if (this.length === 1 && (this.words[0] | 0) < num) {
  25430. this.words[0] = num - (this.words[0] | 0);
  25431. this.negative = 0;
  25432. return this;
  25433. }
  25434. this.negative = 0;
  25435. this.isubn(num);
  25436. this.negative = 1;
  25437. return this;
  25438. }
  25439. // Add without checks
  25440. return this._iaddn(num);
  25441. };
  25442. BN.prototype._iaddn = function _iaddn (num) {
  25443. this.words[0] += num;
  25444. // Carry
  25445. for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
  25446. this.words[i] -= 0x4000000;
  25447. if (i === this.length - 1) {
  25448. this.words[i + 1] = 1;
  25449. } else {
  25450. this.words[i + 1]++;
  25451. }
  25452. }
  25453. this.length = Math.max(this.length, i + 1);
  25454. return this;
  25455. };
  25456. // Subtract plain number `num` from `this`
  25457. BN.prototype.isubn = function isubn (num) {
  25458. assert(typeof num === 'number');
  25459. assert(num < 0x4000000);
  25460. if (num < 0) return this.iaddn(-num);
  25461. if (this.negative !== 0) {
  25462. this.negative = 0;
  25463. this.iaddn(num);
  25464. this.negative = 1;
  25465. return this;
  25466. }
  25467. this.words[0] -= num;
  25468. if (this.length === 1 && this.words[0] < 0) {
  25469. this.words[0] = -this.words[0];
  25470. this.negative = 1;
  25471. } else {
  25472. // Carry
  25473. for (var i = 0; i < this.length && this.words[i] < 0; i++) {
  25474. this.words[i] += 0x4000000;
  25475. this.words[i + 1] -= 1;
  25476. }
  25477. }
  25478. return this.strip();
  25479. };
  25480. BN.prototype.addn = function addn (num) {
  25481. return this.clone().iaddn(num);
  25482. };
  25483. BN.prototype.subn = function subn (num) {
  25484. return this.clone().isubn(num);
  25485. };
  25486. BN.prototype.iabs = function iabs () {
  25487. this.negative = 0;
  25488. return this;
  25489. };
  25490. BN.prototype.abs = function abs () {
  25491. return this.clone().iabs();
  25492. };
  25493. BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
  25494. var len = num.length + shift;
  25495. var i;
  25496. this._expand(len);
  25497. var w;
  25498. var carry = 0;
  25499. for (i = 0; i < num.length; i++) {
  25500. w = (this.words[i + shift] | 0) + carry;
  25501. var right = (num.words[i] | 0) * mul;
  25502. w -= right & 0x3ffffff;
  25503. carry = (w >> 26) - ((right / 0x4000000) | 0);
  25504. this.words[i + shift] = w & 0x3ffffff;
  25505. }
  25506. for (; i < this.length - shift; i++) {
  25507. w = (this.words[i + shift] | 0) + carry;
  25508. carry = w >> 26;
  25509. this.words[i + shift] = w & 0x3ffffff;
  25510. }
  25511. if (carry === 0) return this.strip();
  25512. // Subtraction overflow
  25513. assert(carry === -1);
  25514. carry = 0;
  25515. for (i = 0; i < this.length; i++) {
  25516. w = -(this.words[i] | 0) + carry;
  25517. carry = w >> 26;
  25518. this.words[i] = w & 0x3ffffff;
  25519. }
  25520. this.negative = 1;
  25521. return this.strip();
  25522. };
  25523. BN.prototype._wordDiv = function _wordDiv (num, mode) {
  25524. var shift = this.length - num.length;
  25525. var a = this.clone();
  25526. var b = num;
  25527. // Normalize
  25528. var bhi = b.words[b.length - 1] | 0;
  25529. var bhiBits = this._countBits(bhi);
  25530. shift = 26 - bhiBits;
  25531. if (shift !== 0) {
  25532. b = b.ushln(shift);
  25533. a.iushln(shift);
  25534. bhi = b.words[b.length - 1] | 0;
  25535. }
  25536. // Initialize quotient
  25537. var m = a.length - b.length;
  25538. var q;
  25539. if (mode !== 'mod') {
  25540. q = new BN(null);
  25541. q.length = m + 1;
  25542. q.words = new Array(q.length);
  25543. for (var i = 0; i < q.length; i++) {
  25544. q.words[i] = 0;
  25545. }
  25546. }
  25547. var diff = a.clone()._ishlnsubmul(b, 1, m);
  25548. if (diff.negative === 0) {
  25549. a = diff;
  25550. if (q) {
  25551. q.words[m] = 1;
  25552. }
  25553. }
  25554. for (var j = m - 1; j >= 0; j--) {
  25555. var qj = (a.words[b.length + j] | 0) * 0x4000000 +
  25556. (a.words[b.length + j - 1] | 0);
  25557. // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
  25558. // (0x7ffffff)
  25559. qj = Math.min((qj / bhi) | 0, 0x3ffffff);
  25560. a._ishlnsubmul(b, qj, j);
  25561. while (a.negative !== 0) {
  25562. qj--;
  25563. a.negative = 0;
  25564. a._ishlnsubmul(b, 1, j);
  25565. if (!a.isZero()) {
  25566. a.negative ^= 1;
  25567. }
  25568. }
  25569. if (q) {
  25570. q.words[j] = qj;
  25571. }
  25572. }
  25573. if (q) {
  25574. q.strip();
  25575. }
  25576. a.strip();
  25577. // Denormalize
  25578. if (mode !== 'div' && shift !== 0) {
  25579. a.iushrn(shift);
  25580. }
  25581. return {
  25582. div: q || null,
  25583. mod: a
  25584. };
  25585. };
  25586. // NOTE: 1) `mode` can be set to `mod` to request mod only,
  25587. // to `div` to request div only, or be absent to
  25588. // request both div & mod
  25589. // 2) `positive` is true if unsigned mod is requested
  25590. BN.prototype.divmod = function divmod (num, mode, positive) {
  25591. assert(!num.isZero());
  25592. if (this.isZero()) {
  25593. return {
  25594. div: new BN(0),
  25595. mod: new BN(0)
  25596. };
  25597. }
  25598. var div, mod, res;
  25599. if (this.negative !== 0 && num.negative === 0) {
  25600. res = this.neg().divmod(num, mode);
  25601. if (mode !== 'mod') {
  25602. div = res.div.neg();
  25603. }
  25604. if (mode !== 'div') {
  25605. mod = res.mod.neg();
  25606. if (positive && mod.negative !== 0) {
  25607. mod.iadd(num);
  25608. }
  25609. }
  25610. return {
  25611. div: div,
  25612. mod: mod
  25613. };
  25614. }
  25615. if (this.negative === 0 && num.negative !== 0) {
  25616. res = this.divmod(num.neg(), mode);
  25617. if (mode !== 'mod') {
  25618. div = res.div.neg();
  25619. }
  25620. return {
  25621. div: div,
  25622. mod: res.mod
  25623. };
  25624. }
  25625. if ((this.negative & num.negative) !== 0) {
  25626. res = this.neg().divmod(num.neg(), mode);
  25627. if (mode !== 'div') {
  25628. mod = res.mod.neg();
  25629. if (positive && mod.negative !== 0) {
  25630. mod.isub(num);
  25631. }
  25632. }
  25633. return {
  25634. div: res.div,
  25635. mod: mod
  25636. };
  25637. }
  25638. // Both numbers are positive at this point
  25639. // Strip both numbers to approximate shift value
  25640. if (num.length > this.length || this.cmp(num) < 0) {
  25641. return {
  25642. div: new BN(0),
  25643. mod: this
  25644. };
  25645. }
  25646. // Very short reduction
  25647. if (num.length === 1) {
  25648. if (mode === 'div') {
  25649. return {
  25650. div: this.divn(num.words[0]),
  25651. mod: null
  25652. };
  25653. }
  25654. if (mode === 'mod') {
  25655. return {
  25656. div: null,
  25657. mod: new BN(this.modn(num.words[0]))
  25658. };
  25659. }
  25660. return {
  25661. div: this.divn(num.words[0]),
  25662. mod: new BN(this.modn(num.words[0]))
  25663. };
  25664. }
  25665. return this._wordDiv(num, mode);
  25666. };
  25667. // Find `this` / `num`
  25668. BN.prototype.div = function div (num) {
  25669. return this.divmod(num, 'div', false).div;
  25670. };
  25671. // Find `this` % `num`
  25672. BN.prototype.mod = function mod (num) {
  25673. return this.divmod(num, 'mod', false).mod;
  25674. };
  25675. BN.prototype.umod = function umod (num) {
  25676. return this.divmod(num, 'mod', true).mod;
  25677. };
  25678. // Find Round(`this` / `num`)
  25679. BN.prototype.divRound = function divRound (num) {
  25680. var dm = this.divmod(num);
  25681. // Fast case - exact division
  25682. if (dm.mod.isZero()) return dm.div;
  25683. var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
  25684. var half = num.ushrn(1);
  25685. var r2 = num.andln(1);
  25686. var cmp = mod.cmp(half);
  25687. // Round down
  25688. if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
  25689. // Round up
  25690. return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  25691. };
  25692. BN.prototype.modn = function modn (num) {
  25693. assert(num <= 0x3ffffff);
  25694. var p = (1 << 26) % num;
  25695. var acc = 0;
  25696. for (var i = this.length - 1; i >= 0; i--) {
  25697. acc = (p * acc + (this.words[i] | 0)) % num;
  25698. }
  25699. return acc;
  25700. };
  25701. // In-place division by number
  25702. BN.prototype.idivn = function idivn (num) {
  25703. assert(num <= 0x3ffffff);
  25704. var carry = 0;
  25705. for (var i = this.length - 1; i >= 0; i--) {
  25706. var w = (this.words[i] | 0) + carry * 0x4000000;
  25707. this.words[i] = (w / num) | 0;
  25708. carry = w % num;
  25709. }
  25710. return this.strip();
  25711. };
  25712. BN.prototype.divn = function divn (num) {
  25713. return this.clone().idivn(num);
  25714. };
  25715. BN.prototype.egcd = function egcd (p) {
  25716. assert(p.negative === 0);
  25717. assert(!p.isZero());
  25718. var x = this;
  25719. var y = p.clone();
  25720. if (x.negative !== 0) {
  25721. x = x.umod(p);
  25722. } else {
  25723. x = x.clone();
  25724. }
  25725. // A * x + B * y = x
  25726. var A = new BN(1);
  25727. var B = new BN(0);
  25728. // C * x + D * y = y
  25729. var C = new BN(0);
  25730. var D = new BN(1);
  25731. var g = 0;
  25732. while (x.isEven() && y.isEven()) {
  25733. x.iushrn(1);
  25734. y.iushrn(1);
  25735. ++g;
  25736. }
  25737. var yp = y.clone();
  25738. var xp = x.clone();
  25739. while (!x.isZero()) {
  25740. for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  25741. if (i > 0) {
  25742. x.iushrn(i);
  25743. while (i-- > 0) {
  25744. if (A.isOdd() || B.isOdd()) {
  25745. A.iadd(yp);
  25746. B.isub(xp);
  25747. }
  25748. A.iushrn(1);
  25749. B.iushrn(1);
  25750. }
  25751. }
  25752. for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  25753. if (j > 0) {
  25754. y.iushrn(j);
  25755. while (j-- > 0) {
  25756. if (C.isOdd() || D.isOdd()) {
  25757. C.iadd(yp);
  25758. D.isub(xp);
  25759. }
  25760. C.iushrn(1);
  25761. D.iushrn(1);
  25762. }
  25763. }
  25764. if (x.cmp(y) >= 0) {
  25765. x.isub(y);
  25766. A.isub(C);
  25767. B.isub(D);
  25768. } else {
  25769. y.isub(x);
  25770. C.isub(A);
  25771. D.isub(B);
  25772. }
  25773. }
  25774. return {
  25775. a: C,
  25776. b: D,
  25777. gcd: y.iushln(g)
  25778. };
  25779. };
  25780. // This is reduced incarnation of the binary EEA
  25781. // above, designated to invert members of the
  25782. // _prime_ fields F(p) at a maximal speed
  25783. BN.prototype._invmp = function _invmp (p) {
  25784. assert(p.negative === 0);
  25785. assert(!p.isZero());
  25786. var a = this;
  25787. var b = p.clone();
  25788. if (a.negative !== 0) {
  25789. a = a.umod(p);
  25790. } else {
  25791. a = a.clone();
  25792. }
  25793. var x1 = new BN(1);
  25794. var x2 = new BN(0);
  25795. var delta = b.clone();
  25796. while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
  25797. for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  25798. if (i > 0) {
  25799. a.iushrn(i);
  25800. while (i-- > 0) {
  25801. if (x1.isOdd()) {
  25802. x1.iadd(delta);
  25803. }
  25804. x1.iushrn(1);
  25805. }
  25806. }
  25807. for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  25808. if (j > 0) {
  25809. b.iushrn(j);
  25810. while (j-- > 0) {
  25811. if (x2.isOdd()) {
  25812. x2.iadd(delta);
  25813. }
  25814. x2.iushrn(1);
  25815. }
  25816. }
  25817. if (a.cmp(b) >= 0) {
  25818. a.isub(b);
  25819. x1.isub(x2);
  25820. } else {
  25821. b.isub(a);
  25822. x2.isub(x1);
  25823. }
  25824. }
  25825. var res;
  25826. if (a.cmpn(1) === 0) {
  25827. res = x1;
  25828. } else {
  25829. res = x2;
  25830. }
  25831. if (res.cmpn(0) < 0) {
  25832. res.iadd(p);
  25833. }
  25834. return res;
  25835. };
  25836. BN.prototype.gcd = function gcd (num) {
  25837. if (this.isZero()) return num.abs();
  25838. if (num.isZero()) return this.abs();
  25839. var a = this.clone();
  25840. var b = num.clone();
  25841. a.negative = 0;
  25842. b.negative = 0;
  25843. // Remove common factor of two
  25844. for (var shift = 0; a.isEven() && b.isEven(); shift++) {
  25845. a.iushrn(1);
  25846. b.iushrn(1);
  25847. }
  25848. do {
  25849. while (a.isEven()) {
  25850. a.iushrn(1);
  25851. }
  25852. while (b.isEven()) {
  25853. b.iushrn(1);
  25854. }
  25855. var r = a.cmp(b);
  25856. if (r < 0) {
  25857. // Swap `a` and `b` to make `a` always bigger than `b`
  25858. var t = a;
  25859. a = b;
  25860. b = t;
  25861. } else if (r === 0 || b.cmpn(1) === 0) {
  25862. break;
  25863. }
  25864. a.isub(b);
  25865. } while (true);
  25866. return b.iushln(shift);
  25867. };
  25868. // Invert number in the field F(num)
  25869. BN.prototype.invm = function invm (num) {
  25870. return this.egcd(num).a.umod(num);
  25871. };
  25872. BN.prototype.isEven = function isEven () {
  25873. return (this.words[0] & 1) === 0;
  25874. };
  25875. BN.prototype.isOdd = function isOdd () {
  25876. return (this.words[0] & 1) === 1;
  25877. };
  25878. // And first word and num
  25879. BN.prototype.andln = function andln (num) {
  25880. return this.words[0] & num;
  25881. };
  25882. // Increment at the bit position in-line
  25883. BN.prototype.bincn = function bincn (bit) {
  25884. assert(typeof bit === 'number');
  25885. var r = bit % 26;
  25886. var s = (bit - r) / 26;
  25887. var q = 1 << r;
  25888. // Fast case: bit is much higher than all existing words
  25889. if (this.length <= s) {
  25890. this._expand(s + 1);
  25891. this.words[s] |= q;
  25892. return this;
  25893. }
  25894. // Add bit and propagate, if needed
  25895. var carry = q;
  25896. for (var i = s; carry !== 0 && i < this.length; i++) {
  25897. var w = this.words[i] | 0;
  25898. w += carry;
  25899. carry = w >>> 26;
  25900. w &= 0x3ffffff;
  25901. this.words[i] = w;
  25902. }
  25903. if (carry !== 0) {
  25904. this.words[i] = carry;
  25905. this.length++;
  25906. }
  25907. return this;
  25908. };
  25909. BN.prototype.isZero = function isZero () {
  25910. return this.length === 1 && this.words[0] === 0;
  25911. };
  25912. BN.prototype.cmpn = function cmpn (num) {
  25913. var negative = num < 0;
  25914. if (this.negative !== 0 && !negative) return -1;
  25915. if (this.negative === 0 && negative) return 1;
  25916. this.strip();
  25917. var res;
  25918. if (this.length > 1) {
  25919. res = 1;
  25920. } else {
  25921. if (negative) {
  25922. num = -num;
  25923. }
  25924. assert(num <= 0x3ffffff, 'Number is too big');
  25925. var w = this.words[0] | 0;
  25926. res = w === num ? 0 : w < num ? -1 : 1;
  25927. }
  25928. if (this.negative !== 0) return -res | 0;
  25929. return res;
  25930. };
  25931. // Compare two numbers and return:
  25932. // 1 - if `this` > `num`
  25933. // 0 - if `this` == `num`
  25934. // -1 - if `this` < `num`
  25935. BN.prototype.cmp = function cmp (num) {
  25936. if (this.negative !== 0 && num.negative === 0) return -1;
  25937. if (this.negative === 0 && num.negative !== 0) return 1;
  25938. var res = this.ucmp(num);
  25939. if (this.negative !== 0) return -res | 0;
  25940. return res;
  25941. };
  25942. // Unsigned comparison
  25943. BN.prototype.ucmp = function ucmp (num) {
  25944. // At this point both numbers have the same sign
  25945. if (this.length > num.length) return 1;
  25946. if (this.length < num.length) return -1;
  25947. var res = 0;
  25948. for (var i = this.length - 1; i >= 0; i--) {
  25949. var a = this.words[i] | 0;
  25950. var b = num.words[i] | 0;
  25951. if (a === b) continue;
  25952. if (a < b) {
  25953. res = -1;
  25954. } else if (a > b) {
  25955. res = 1;
  25956. }
  25957. break;
  25958. }
  25959. return res;
  25960. };
  25961. BN.prototype.gtn = function gtn (num) {
  25962. return this.cmpn(num) === 1;
  25963. };
  25964. BN.prototype.gt = function gt (num) {
  25965. return this.cmp(num) === 1;
  25966. };
  25967. BN.prototype.gten = function gten (num) {
  25968. return this.cmpn(num) >= 0;
  25969. };
  25970. BN.prototype.gte = function gte (num) {
  25971. return this.cmp(num) >= 0;
  25972. };
  25973. BN.prototype.ltn = function ltn (num) {
  25974. return this.cmpn(num) === -1;
  25975. };
  25976. BN.prototype.lt = function lt (num) {
  25977. return this.cmp(num) === -1;
  25978. };
  25979. BN.prototype.lten = function lten (num) {
  25980. return this.cmpn(num) <= 0;
  25981. };
  25982. BN.prototype.lte = function lte (num) {
  25983. return this.cmp(num) <= 0;
  25984. };
  25985. BN.prototype.eqn = function eqn (num) {
  25986. return this.cmpn(num) === 0;
  25987. };
  25988. BN.prototype.eq = function eq (num) {
  25989. return this.cmp(num) === 0;
  25990. };
  25991. //
  25992. // A reduce context, could be using montgomery or something better, depending
  25993. // on the `m` itself.
  25994. //
  25995. BN.red = function red (num) {
  25996. return new Red(num);
  25997. };
  25998. BN.prototype.toRed = function toRed (ctx) {
  25999. assert(!this.red, 'Already a number in reduction context');
  26000. assert(this.negative === 0, 'red works only with positives');
  26001. return ctx.convertTo(this)._forceRed(ctx);
  26002. };
  26003. BN.prototype.fromRed = function fromRed () {
  26004. assert(this.red, 'fromRed works only with numbers in reduction context');
  26005. return this.red.convertFrom(this);
  26006. };
  26007. BN.prototype._forceRed = function _forceRed (ctx) {
  26008. this.red = ctx;
  26009. return this;
  26010. };
  26011. BN.prototype.forceRed = function forceRed (ctx) {
  26012. assert(!this.red, 'Already a number in reduction context');
  26013. return this._forceRed(ctx);
  26014. };
  26015. BN.prototype.redAdd = function redAdd (num) {
  26016. assert(this.red, 'redAdd works only with red numbers');
  26017. return this.red.add(this, num);
  26018. };
  26019. BN.prototype.redIAdd = function redIAdd (num) {
  26020. assert(this.red, 'redIAdd works only with red numbers');
  26021. return this.red.iadd(this, num);
  26022. };
  26023. BN.prototype.redSub = function redSub (num) {
  26024. assert(this.red, 'redSub works only with red numbers');
  26025. return this.red.sub(this, num);
  26026. };
  26027. BN.prototype.redISub = function redISub (num) {
  26028. assert(this.red, 'redISub works only with red numbers');
  26029. return this.red.isub(this, num);
  26030. };
  26031. BN.prototype.redShl = function redShl (num) {
  26032. assert(this.red, 'redShl works only with red numbers');
  26033. return this.red.shl(this, num);
  26034. };
  26035. BN.prototype.redMul = function redMul (num) {
  26036. assert(this.red, 'redMul works only with red numbers');
  26037. this.red._verify2(this, num);
  26038. return this.red.mul(this, num);
  26039. };
  26040. BN.prototype.redIMul = function redIMul (num) {
  26041. assert(this.red, 'redMul works only with red numbers');
  26042. this.red._verify2(this, num);
  26043. return this.red.imul(this, num);
  26044. };
  26045. BN.prototype.redSqr = function redSqr () {
  26046. assert(this.red, 'redSqr works only with red numbers');
  26047. this.red._verify1(this);
  26048. return this.red.sqr(this);
  26049. };
  26050. BN.prototype.redISqr = function redISqr () {
  26051. assert(this.red, 'redISqr works only with red numbers');
  26052. this.red._verify1(this);
  26053. return this.red.isqr(this);
  26054. };
  26055. // Square root over p
  26056. BN.prototype.redSqrt = function redSqrt () {
  26057. assert(this.red, 'redSqrt works only with red numbers');
  26058. this.red._verify1(this);
  26059. return this.red.sqrt(this);
  26060. };
  26061. BN.prototype.redInvm = function redInvm () {
  26062. assert(this.red, 'redInvm works only with red numbers');
  26063. this.red._verify1(this);
  26064. return this.red.invm(this);
  26065. };
  26066. // Return negative clone of `this` % `red modulo`
  26067. BN.prototype.redNeg = function redNeg () {
  26068. assert(this.red, 'redNeg works only with red numbers');
  26069. this.red._verify1(this);
  26070. return this.red.neg(this);
  26071. };
  26072. BN.prototype.redPow = function redPow (num) {
  26073. assert(this.red && !num.red, 'redPow(normalNum)');
  26074. this.red._verify1(this);
  26075. return this.red.pow(this, num);
  26076. };
  26077. // Prime numbers with efficient reduction
  26078. var primes = {
  26079. k256: null,
  26080. p224: null,
  26081. p192: null,
  26082. p25519: null
  26083. };
  26084. // Pseudo-Mersenne prime
  26085. function MPrime (name, p) {
  26086. // P = 2 ^ N - K
  26087. this.name = name;
  26088. this.p = new BN(p, 16);
  26089. this.n = this.p.bitLength();
  26090. this.k = new BN(1).iushln(this.n).isub(this.p);
  26091. this.tmp = this._tmp();
  26092. }
  26093. MPrime.prototype._tmp = function _tmp () {
  26094. var tmp = new BN(null);
  26095. tmp.words = new Array(Math.ceil(this.n / 13));
  26096. return tmp;
  26097. };
  26098. MPrime.prototype.ireduce = function ireduce (num) {
  26099. // Assumes that `num` is less than `P^2`
  26100. // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
  26101. var r = num;
  26102. var rlen;
  26103. do {
  26104. this.split(r, this.tmp);
  26105. r = this.imulK(r);
  26106. r = r.iadd(this.tmp);
  26107. rlen = r.bitLength();
  26108. } while (rlen > this.n);
  26109. var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
  26110. if (cmp === 0) {
  26111. r.words[0] = 0;
  26112. r.length = 1;
  26113. } else if (cmp > 0) {
  26114. r.isub(this.p);
  26115. } else {
  26116. if (r.strip !== undefined) {
  26117. // r is BN v4 instance
  26118. r.strip();
  26119. } else {
  26120. // r is BN v5 instance
  26121. r._strip();
  26122. }
  26123. }
  26124. return r;
  26125. };
  26126. MPrime.prototype.split = function split (input, out) {
  26127. input.iushrn(this.n, 0, out);
  26128. };
  26129. MPrime.prototype.imulK = function imulK (num) {
  26130. return num.imul(this.k);
  26131. };
  26132. function K256 () {
  26133. MPrime.call(
  26134. this,
  26135. 'k256',
  26136. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  26137. }
  26138. inherits(K256, MPrime);
  26139. K256.prototype.split = function split (input, output) {
  26140. // 256 = 9 * 26 + 22
  26141. var mask = 0x3fffff;
  26142. var outLen = Math.min(input.length, 9);
  26143. for (var i = 0; i < outLen; i++) {
  26144. output.words[i] = input.words[i];
  26145. }
  26146. output.length = outLen;
  26147. if (input.length <= 9) {
  26148. input.words[0] = 0;
  26149. input.length = 1;
  26150. return;
  26151. }
  26152. // Shift by 9 limbs
  26153. var prev = input.words[9];
  26154. output.words[output.length++] = prev & mask;
  26155. for (i = 10; i < input.length; i++) {
  26156. var next = input.words[i] | 0;
  26157. input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
  26158. prev = next;
  26159. }
  26160. prev >>>= 22;
  26161. input.words[i - 10] = prev;
  26162. if (prev === 0 && input.length > 10) {
  26163. input.length -= 10;
  26164. } else {
  26165. input.length -= 9;
  26166. }
  26167. };
  26168. K256.prototype.imulK = function imulK (num) {
  26169. // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
  26170. num.words[num.length] = 0;
  26171. num.words[num.length + 1] = 0;
  26172. num.length += 2;
  26173. // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
  26174. var lo = 0;
  26175. for (var i = 0; i < num.length; i++) {
  26176. var w = num.words[i] | 0;
  26177. lo += w * 0x3d1;
  26178. num.words[i] = lo & 0x3ffffff;
  26179. lo = w * 0x40 + ((lo / 0x4000000) | 0);
  26180. }
  26181. // Fast length reduction
  26182. if (num.words[num.length - 1] === 0) {
  26183. num.length--;
  26184. if (num.words[num.length - 1] === 0) {
  26185. num.length--;
  26186. }
  26187. }
  26188. return num;
  26189. };
  26190. function P224 () {
  26191. MPrime.call(
  26192. this,
  26193. 'p224',
  26194. 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  26195. }
  26196. inherits(P224, MPrime);
  26197. function P192 () {
  26198. MPrime.call(
  26199. this,
  26200. 'p192',
  26201. 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  26202. }
  26203. inherits(P192, MPrime);
  26204. function P25519 () {
  26205. // 2 ^ 255 - 19
  26206. MPrime.call(
  26207. this,
  26208. '25519',
  26209. '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  26210. }
  26211. inherits(P25519, MPrime);
  26212. P25519.prototype.imulK = function imulK (num) {
  26213. // K = 0x13
  26214. var carry = 0;
  26215. for (var i = 0; i < num.length; i++) {
  26216. var hi = (num.words[i] | 0) * 0x13 + carry;
  26217. var lo = hi & 0x3ffffff;
  26218. hi >>>= 26;
  26219. num.words[i] = lo;
  26220. carry = hi;
  26221. }
  26222. if (carry !== 0) {
  26223. num.words[num.length++] = carry;
  26224. }
  26225. return num;
  26226. };
  26227. // Exported mostly for testing purposes, use plain name instead
  26228. BN._prime = function prime (name) {
  26229. // Cached version of prime
  26230. if (primes[name]) return primes[name];
  26231. var prime;
  26232. if (name === 'k256') {
  26233. prime = new K256();
  26234. } else if (name === 'p224') {
  26235. prime = new P224();
  26236. } else if (name === 'p192') {
  26237. prime = new P192();
  26238. } else if (name === 'p25519') {
  26239. prime = new P25519();
  26240. } else {
  26241. throw new Error('Unknown prime ' + name);
  26242. }
  26243. primes[name] = prime;
  26244. return prime;
  26245. };
  26246. //
  26247. // Base reduction engine
  26248. //
  26249. function Red (m) {
  26250. if (typeof m === 'string') {
  26251. var prime = BN._prime(m);
  26252. this.m = prime.p;
  26253. this.prime = prime;
  26254. } else {
  26255. assert(m.gtn(1), 'modulus must be greater than 1');
  26256. this.m = m;
  26257. this.prime = null;
  26258. }
  26259. }
  26260. Red.prototype._verify1 = function _verify1 (a) {
  26261. assert(a.negative === 0, 'red works only with positives');
  26262. assert(a.red, 'red works only with red numbers');
  26263. };
  26264. Red.prototype._verify2 = function _verify2 (a, b) {
  26265. assert((a.negative | b.negative) === 0, 'red works only with positives');
  26266. assert(a.red && a.red === b.red,
  26267. 'red works only with red numbers');
  26268. };
  26269. Red.prototype.imod = function imod (a) {
  26270. if (this.prime) return this.prime.ireduce(a)._forceRed(this);
  26271. return a.umod(this.m)._forceRed(this);
  26272. };
  26273. Red.prototype.neg = function neg (a) {
  26274. if (a.isZero()) {
  26275. return a.clone();
  26276. }
  26277. return this.m.sub(a)._forceRed(this);
  26278. };
  26279. Red.prototype.add = function add (a, b) {
  26280. this._verify2(a, b);
  26281. var res = a.add(b);
  26282. if (res.cmp(this.m) >= 0) {
  26283. res.isub(this.m);
  26284. }
  26285. return res._forceRed(this);
  26286. };
  26287. Red.prototype.iadd = function iadd (a, b) {
  26288. this._verify2(a, b);
  26289. var res = a.iadd(b);
  26290. if (res.cmp(this.m) >= 0) {
  26291. res.isub(this.m);
  26292. }
  26293. return res;
  26294. };
  26295. Red.prototype.sub = function sub (a, b) {
  26296. this._verify2(a, b);
  26297. var res = a.sub(b);
  26298. if (res.cmpn(0) < 0) {
  26299. res.iadd(this.m);
  26300. }
  26301. return res._forceRed(this);
  26302. };
  26303. Red.prototype.isub = function isub (a, b) {
  26304. this._verify2(a, b);
  26305. var res = a.isub(b);
  26306. if (res.cmpn(0) < 0) {
  26307. res.iadd(this.m);
  26308. }
  26309. return res;
  26310. };
  26311. Red.prototype.shl = function shl (a, num) {
  26312. this._verify1(a);
  26313. return this.imod(a.ushln(num));
  26314. };
  26315. Red.prototype.imul = function imul (a, b) {
  26316. this._verify2(a, b);
  26317. return this.imod(a.imul(b));
  26318. };
  26319. Red.prototype.mul = function mul (a, b) {
  26320. this._verify2(a, b);
  26321. return this.imod(a.mul(b));
  26322. };
  26323. Red.prototype.isqr = function isqr (a) {
  26324. return this.imul(a, a.clone());
  26325. };
  26326. Red.prototype.sqr = function sqr (a) {
  26327. return this.mul(a, a);
  26328. };
  26329. Red.prototype.sqrt = function sqrt (a) {
  26330. if (a.isZero()) return a.clone();
  26331. var mod3 = this.m.andln(3);
  26332. assert(mod3 % 2 === 1);
  26333. // Fast case
  26334. if (mod3 === 3) {
  26335. var pow = this.m.add(new BN(1)).iushrn(2);
  26336. return this.pow(a, pow);
  26337. }
  26338. // Tonelli-Shanks algorithm (Totally unoptimized and slow)
  26339. //
  26340. // Find Q and S, that Q * 2 ^ S = (P - 1)
  26341. var q = this.m.subn(1);
  26342. var s = 0;
  26343. while (!q.isZero() && q.andln(1) === 0) {
  26344. s++;
  26345. q.iushrn(1);
  26346. }
  26347. assert(!q.isZero());
  26348. var one = new BN(1).toRed(this);
  26349. var nOne = one.redNeg();
  26350. // Find quadratic non-residue
  26351. // NOTE: Max is such because of generalized Riemann hypothesis.
  26352. var lpow = this.m.subn(1).iushrn(1);
  26353. var z = this.m.bitLength();
  26354. z = new BN(2 * z * z).toRed(this);
  26355. while (this.pow(z, lpow).cmp(nOne) !== 0) {
  26356. z.redIAdd(nOne);
  26357. }
  26358. var c = this.pow(z, q);
  26359. var r = this.pow(a, q.addn(1).iushrn(1));
  26360. var t = this.pow(a, q);
  26361. var m = s;
  26362. while (t.cmp(one) !== 0) {
  26363. var tmp = t;
  26364. for (var i = 0; tmp.cmp(one) !== 0; i++) {
  26365. tmp = tmp.redSqr();
  26366. }
  26367. assert(i < m);
  26368. var b = this.pow(c, new BN(1).iushln(m - i - 1));
  26369. r = r.redMul(b);
  26370. c = b.redSqr();
  26371. t = t.redMul(c);
  26372. m = i;
  26373. }
  26374. return r;
  26375. };
  26376. Red.prototype.invm = function invm (a) {
  26377. var inv = a._invmp(this.m);
  26378. if (inv.negative !== 0) {
  26379. inv.negative = 0;
  26380. return this.imod(inv).redNeg();
  26381. } else {
  26382. return this.imod(inv);
  26383. }
  26384. };
  26385. Red.prototype.pow = function pow (a, num) {
  26386. if (num.isZero()) return new BN(1).toRed(this);
  26387. if (num.cmpn(1) === 0) return a.clone();
  26388. var windowSize = 4;
  26389. var wnd = new Array(1 << windowSize);
  26390. wnd[0] = new BN(1).toRed(this);
  26391. wnd[1] = a;
  26392. for (var i = 2; i < wnd.length; i++) {
  26393. wnd[i] = this.mul(wnd[i - 1], a);
  26394. }
  26395. var res = wnd[0];
  26396. var current = 0;
  26397. var currentLen = 0;
  26398. var start = num.bitLength() % 26;
  26399. if (start === 0) {
  26400. start = 26;
  26401. }
  26402. for (i = num.length - 1; i >= 0; i--) {
  26403. var word = num.words[i];
  26404. for (var j = start - 1; j >= 0; j--) {
  26405. var bit = (word >> j) & 1;
  26406. if (res !== wnd[0]) {
  26407. res = this.sqr(res);
  26408. }
  26409. if (bit === 0 && current === 0) {
  26410. currentLen = 0;
  26411. continue;
  26412. }
  26413. current <<= 1;
  26414. current |= bit;
  26415. currentLen++;
  26416. if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
  26417. res = this.mul(res, wnd[current]);
  26418. currentLen = 0;
  26419. current = 0;
  26420. }
  26421. start = 26;
  26422. }
  26423. return res;
  26424. };
  26425. Red.prototype.convertTo = function convertTo (num) {
  26426. var r = num.umod(this.m);
  26427. return r === num ? r.clone() : r;
  26428. };
  26429. Red.prototype.convertFrom = function convertFrom (num) {
  26430. var res = num.clone();
  26431. res.red = null;
  26432. return res;
  26433. };
  26434. //
  26435. // Montgomery method engine
  26436. //
  26437. BN.mont = function mont (num) {
  26438. return new Mont(num);
  26439. };
  26440. function Mont (m) {
  26441. Red.call(this, m);
  26442. this.shift = this.m.bitLength();
  26443. if (this.shift % 26 !== 0) {
  26444. this.shift += 26 - (this.shift % 26);
  26445. }
  26446. this.r = new BN(1).iushln(this.shift);
  26447. this.r2 = this.imod(this.r.sqr());
  26448. this.rinv = this.r._invmp(this.m);
  26449. this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
  26450. this.minv = this.minv.umod(this.r);
  26451. this.minv = this.r.sub(this.minv);
  26452. }
  26453. inherits(Mont, Red);
  26454. Mont.prototype.convertTo = function convertTo (num) {
  26455. return this.imod(num.ushln(this.shift));
  26456. };
  26457. Mont.prototype.convertFrom = function convertFrom (num) {
  26458. var r = this.imod(num.mul(this.rinv));
  26459. r.red = null;
  26460. return r;
  26461. };
  26462. Mont.prototype.imul = function imul (a, b) {
  26463. if (a.isZero() || b.isZero()) {
  26464. a.words[0] = 0;
  26465. a.length = 1;
  26466. return a;
  26467. }
  26468. var t = a.imul(b);
  26469. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  26470. var u = t.isub(c).iushrn(this.shift);
  26471. var res = u;
  26472. if (u.cmp(this.m) >= 0) {
  26473. res = u.isub(this.m);
  26474. } else if (u.cmpn(0) < 0) {
  26475. res = u.iadd(this.m);
  26476. }
  26477. return res._forceRed(this);
  26478. };
  26479. Mont.prototype.mul = function mul (a, b) {
  26480. if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
  26481. var t = a.mul(b);
  26482. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  26483. var u = t.isub(c).iushrn(this.shift);
  26484. var res = u;
  26485. if (u.cmp(this.m) >= 0) {
  26486. res = u.isub(this.m);
  26487. } else if (u.cmpn(0) < 0) {
  26488. res = u.iadd(this.m);
  26489. }
  26490. return res._forceRed(this);
  26491. };
  26492. Mont.prototype.invm = function invm (a) {
  26493. // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
  26494. var res = this.imod(a._invmp(this.m).mul(this.r2));
  26495. return res._forceRed(this);
  26496. };
  26497. })( false || module, this);
  26498. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 186)(module)))
  26499. /***/ }),
  26500. /* 186 */
  26501. /*!***********************************!*\
  26502. !*** (webpack)/buildin/module.js ***!
  26503. \***********************************/
  26504. /*! no static exports found */
  26505. /***/ (function(module, exports) {
  26506. module.exports = function(module) {
  26507. if (!module.webpackPolyfill) {
  26508. module.deprecate = function() {};
  26509. module.paths = [];
  26510. // module.parent = undefined by default
  26511. if (!module.children) module.children = [];
  26512. Object.defineProperty(module, "loaded", {
  26513. enumerable: true,
  26514. get: function() {
  26515. return module.l;
  26516. }
  26517. });
  26518. Object.defineProperty(module, "id", {
  26519. enumerable: true,
  26520. get: function() {
  26521. return module.i;
  26522. }
  26523. });
  26524. module.webpackPolyfill = 1;
  26525. }
  26526. return module;
  26527. };
  26528. /***/ }),
  26529. /* 187 */
  26530. /*!************************!*\
  26531. !*** buffer (ignored) ***!
  26532. \************************/
  26533. /*! no static exports found */
  26534. /***/ (function(module, exports) {
  26535. /* (ignored) */
  26536. /***/ }),
  26537. /* 188 */
  26538. /*!*********************************************!*\
  26539. !*** ./node_modules/miller-rabin/lib/mr.js ***!
  26540. \*********************************************/
  26541. /*! no static exports found */
  26542. /***/ (function(module, exports, __webpack_require__) {
  26543. var bn = __webpack_require__(/*! bn.js */ 185);
  26544. var brorand = __webpack_require__(/*! brorand */ 189);
  26545. function MillerRabin(rand) {
  26546. this.rand = rand || new brorand.Rand();
  26547. }
  26548. module.exports = MillerRabin;
  26549. MillerRabin.create = function create(rand) {
  26550. return new MillerRabin(rand);
  26551. };
  26552. MillerRabin.prototype._randbelow = function _randbelow(n) {
  26553. var len = n.bitLength();
  26554. var min_bytes = Math.ceil(len / 8);
  26555. // Generage random bytes until a number less than n is found.
  26556. // This ensures that 0..n-1 have an equal probability of being selected.
  26557. do
  26558. var a = new bn(this.rand.generate(min_bytes));
  26559. while (a.cmp(n) >= 0);
  26560. return a;
  26561. };
  26562. MillerRabin.prototype._randrange = function _randrange(start, stop) {
  26563. // Generate a random number greater than or equal to start and less than stop.
  26564. var size = stop.sub(start);
  26565. return start.add(this._randbelow(size));
  26566. };
  26567. MillerRabin.prototype.test = function test(n, k, cb) {
  26568. var len = n.bitLength();
  26569. var red = bn.mont(n);
  26570. var rone = new bn(1).toRed(red);
  26571. if (!k)
  26572. k = Math.max(1, (len / 48) | 0);
  26573. // Find d and s, (n - 1) = (2 ^ s) * d;
  26574. var n1 = n.subn(1);
  26575. for (var s = 0; !n1.testn(s); s++) {}
  26576. var d = n.shrn(s);
  26577. var rn1 = n1.toRed(red);
  26578. var prime = true;
  26579. for (; k > 0; k--) {
  26580. var a = this._randrange(new bn(2), n1);
  26581. if (cb)
  26582. cb(a);
  26583. var x = a.toRed(red).redPow(d);
  26584. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  26585. continue;
  26586. for (var i = 1; i < s; i++) {
  26587. x = x.redSqr();
  26588. if (x.cmp(rone) === 0)
  26589. return false;
  26590. if (x.cmp(rn1) === 0)
  26591. break;
  26592. }
  26593. if (i === s)
  26594. return false;
  26595. }
  26596. return prime;
  26597. };
  26598. MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
  26599. var len = n.bitLength();
  26600. var red = bn.mont(n);
  26601. var rone = new bn(1).toRed(red);
  26602. if (!k)
  26603. k = Math.max(1, (len / 48) | 0);
  26604. // Find d and s, (n - 1) = (2 ^ s) * d;
  26605. var n1 = n.subn(1);
  26606. for (var s = 0; !n1.testn(s); s++) {}
  26607. var d = n.shrn(s);
  26608. var rn1 = n1.toRed(red);
  26609. for (; k > 0; k--) {
  26610. var a = this._randrange(new bn(2), n1);
  26611. var g = n.gcd(a);
  26612. if (g.cmpn(1) !== 0)
  26613. return g;
  26614. var x = a.toRed(red).redPow(d);
  26615. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  26616. continue;
  26617. for (var i = 1; i < s; i++) {
  26618. x = x.redSqr();
  26619. if (x.cmp(rone) === 0)
  26620. return x.fromRed().subn(1).gcd(n);
  26621. if (x.cmp(rn1) === 0)
  26622. break;
  26623. }
  26624. if (i === s) {
  26625. x = x.redSqr();
  26626. return x.fromRed().subn(1).gcd(n);
  26627. }
  26628. }
  26629. return false;
  26630. };
  26631. /***/ }),
  26632. /* 189 */
  26633. /*!***************************************!*\
  26634. !*** ./node_modules/brorand/index.js ***!
  26635. \***************************************/
  26636. /*! no static exports found */
  26637. /***/ (function(module, exports, __webpack_require__) {
  26638. var r;
  26639. module.exports = function rand(len) {
  26640. if (!r)
  26641. r = new Rand(null);
  26642. return r.generate(len);
  26643. };
  26644. function Rand(rand) {
  26645. this.rand = rand;
  26646. }
  26647. module.exports.Rand = Rand;
  26648. Rand.prototype.generate = function generate(len) {
  26649. return this._rand(len);
  26650. };
  26651. // Emulate crypto API using randy
  26652. Rand.prototype._rand = function _rand(n) {
  26653. if (this.rand.getBytes)
  26654. return this.rand.getBytes(n);
  26655. var res = new Uint8Array(n);
  26656. for (var i = 0; i < res.length; i++)
  26657. res[i] = this.rand.getByte();
  26658. return res;
  26659. };
  26660. if (typeof self === 'object') {
  26661. if (self.crypto && self.crypto.getRandomValues) {
  26662. // Modern browsers
  26663. Rand.prototype._rand = function _rand(n) {
  26664. var arr = new Uint8Array(n);
  26665. self.crypto.getRandomValues(arr);
  26666. return arr;
  26667. };
  26668. } else if (self.msCrypto && self.msCrypto.getRandomValues) {
  26669. // IE
  26670. Rand.prototype._rand = function _rand(n) {
  26671. var arr = new Uint8Array(n);
  26672. self.msCrypto.getRandomValues(arr);
  26673. return arr;
  26674. };
  26675. // Safari's WebWorkers do not have `crypto`
  26676. } else if (typeof window === 'object') {
  26677. // Old junk
  26678. Rand.prototype._rand = function() {
  26679. throw new Error('Not implemented yet');
  26680. };
  26681. }
  26682. } else {
  26683. // Node.js or Web worker with no crypto support
  26684. try {
  26685. var crypto = __webpack_require__(/*! crypto */ 190);
  26686. if (typeof crypto.randomBytes !== 'function')
  26687. throw new Error('Not supported');
  26688. Rand.prototype._rand = function _rand(n) {
  26689. return crypto.randomBytes(n);
  26690. };
  26691. } catch (e) {
  26692. }
  26693. }
  26694. /***/ }),
  26695. /* 190 */
  26696. /*!************************!*\
  26697. !*** crypto (ignored) ***!
  26698. \************************/
  26699. /*! no static exports found */
  26700. /***/ (function(module, exports) {
  26701. /* (ignored) */
  26702. /***/ }),
  26703. /* 191 */
  26704. /*!*****************************************************!*\
  26705. !*** ./node_modules/diffie-hellman/lib/primes.json ***!
  26706. \*****************************************************/
  26707. /*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
  26708. /***/ (function(module) {
  26709. 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\"}}");
  26710. /***/ }),
  26711. /* 192 */
  26712. /*!***********************************************!*\
  26713. !*** ./node_modules/diffie-hellman/lib/dh.js ***!
  26714. \***********************************************/
  26715. /*! no static exports found */
  26716. /***/ (function(module, exports, __webpack_require__) {
  26717. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 185);
  26718. var MillerRabin = __webpack_require__(/*! miller-rabin */ 188);
  26719. var millerRabin = new MillerRabin();
  26720. var TWENTYFOUR = new BN(24);
  26721. var ELEVEN = new BN(11);
  26722. var TEN = new BN(10);
  26723. var THREE = new BN(3);
  26724. var SEVEN = new BN(7);
  26725. var primes = __webpack_require__(/*! ./generatePrime */ 184);
  26726. var randomBytes = __webpack_require__(/*! randombytes */ 100);
  26727. module.exports = DH;
  26728. function setPublicKey(pub, enc) {
  26729. enc = enc || 'utf8';
  26730. if (!Buffer.isBuffer(pub)) {
  26731. pub = new Buffer(pub, enc);
  26732. }
  26733. this._pub = new BN(pub);
  26734. return this;
  26735. }
  26736. function setPrivateKey(priv, enc) {
  26737. enc = enc || 'utf8';
  26738. if (!Buffer.isBuffer(priv)) {
  26739. priv = new Buffer(priv, enc);
  26740. }
  26741. this._priv = new BN(priv);
  26742. return this;
  26743. }
  26744. var primeCache = {};
  26745. function checkPrime(prime, generator) {
  26746. var gen = generator.toString('hex');
  26747. var hex = [gen, prime.toString(16)].join('_');
  26748. if (hex in primeCache) {
  26749. return primeCache[hex];
  26750. }
  26751. var error = 0;
  26752. if (prime.isEven() ||
  26753. !primes.simpleSieve ||
  26754. !primes.fermatTest(prime) ||
  26755. !millerRabin.test(prime)) {
  26756. //not a prime so +1
  26757. error += 1;
  26758. if (gen === '02' || gen === '05') {
  26759. // we'd be able to check the generator
  26760. // it would fail so +8
  26761. error += 8;
  26762. } else {
  26763. //we wouldn't be able to test the generator
  26764. // so +4
  26765. error += 4;
  26766. }
  26767. primeCache[hex] = error;
  26768. return error;
  26769. }
  26770. if (!millerRabin.test(prime.shrn(1))) {
  26771. //not a safe prime
  26772. error += 2;
  26773. }
  26774. var rem;
  26775. switch (gen) {
  26776. case '02':
  26777. if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
  26778. // unsuidable generator
  26779. error += 8;
  26780. }
  26781. break;
  26782. case '05':
  26783. rem = prime.mod(TEN);
  26784. if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
  26785. // prime mod 10 needs to equal 3 or 7
  26786. error += 8;
  26787. }
  26788. break;
  26789. default:
  26790. error += 4;
  26791. }
  26792. primeCache[hex] = error;
  26793. return error;
  26794. }
  26795. function DH(prime, generator, malleable) {
  26796. this.setGenerator(generator);
  26797. this.__prime = new BN(prime);
  26798. this._prime = BN.mont(this.__prime);
  26799. this._primeLen = prime.length;
  26800. this._pub = undefined;
  26801. this._priv = undefined;
  26802. this._primeCode = undefined;
  26803. if (malleable) {
  26804. this.setPublicKey = setPublicKey;
  26805. this.setPrivateKey = setPrivateKey;
  26806. } else {
  26807. this._primeCode = 8;
  26808. }
  26809. }
  26810. Object.defineProperty(DH.prototype, 'verifyError', {
  26811. enumerable: true,
  26812. get: function () {
  26813. if (typeof this._primeCode !== 'number') {
  26814. this._primeCode = checkPrime(this.__prime, this.__gen);
  26815. }
  26816. return this._primeCode;
  26817. }
  26818. });
  26819. DH.prototype.generateKeys = function () {
  26820. if (!this._priv) {
  26821. this._priv = new BN(randomBytes(this._primeLen));
  26822. }
  26823. this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
  26824. return this.getPublicKey();
  26825. };
  26826. DH.prototype.computeSecret = function (other) {
  26827. other = new BN(other);
  26828. other = other.toRed(this._prime);
  26829. var secret = other.redPow(this._priv).fromRed();
  26830. var out = new Buffer(secret.toArray());
  26831. var prime = this.getPrime();
  26832. if (out.length < prime.length) {
  26833. var front = new Buffer(prime.length - out.length);
  26834. front.fill(0);
  26835. out = Buffer.concat([front, out]);
  26836. }
  26837. return out;
  26838. };
  26839. DH.prototype.getPublicKey = function getPublicKey(enc) {
  26840. return formatReturnValue(this._pub, enc);
  26841. };
  26842. DH.prototype.getPrivateKey = function getPrivateKey(enc) {
  26843. return formatReturnValue(this._priv, enc);
  26844. };
  26845. DH.prototype.getPrime = function (enc) {
  26846. return formatReturnValue(this.__prime, enc);
  26847. };
  26848. DH.prototype.getGenerator = function (enc) {
  26849. return formatReturnValue(this._gen, enc);
  26850. };
  26851. DH.prototype.setGenerator = function (gen, enc) {
  26852. enc = enc || 'utf8';
  26853. if (!Buffer.isBuffer(gen)) {
  26854. gen = new Buffer(gen, enc);
  26855. }
  26856. this.__gen = gen;
  26857. this._gen = new BN(gen);
  26858. return this;
  26859. };
  26860. function formatReturnValue(bn, enc) {
  26861. var buf = new Buffer(bn.toArray());
  26862. if (!enc) {
  26863. return buf;
  26864. } else {
  26865. return buf.toString(enc);
  26866. }
  26867. }
  26868. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 104).Buffer))
  26869. /***/ }),
  26870. /* 193 */
  26871. /*!*******************************************************!*\
  26872. !*** ./node_modules/browserify-sign/browser/index.js ***!
  26873. \*******************************************************/
  26874. /*! no static exports found */
  26875. /***/ (function(module, exports, __webpack_require__) {
  26876. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  26877. var createHash = __webpack_require__(/*! create-hash */ 108)
  26878. var stream = __webpack_require__(/*! readable-stream */ 112)
  26879. var inherits = __webpack_require__(/*! inherits */ 109)
  26880. var sign = __webpack_require__(/*! ./sign */ 194)
  26881. var verify = __webpack_require__(/*! ./verify */ 247)
  26882. var algorithms = __webpack_require__(/*! ./algorithms.json */ 147)
  26883. Object.keys(algorithms).forEach(function (key) {
  26884. algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
  26885. algorithms[key.toLowerCase()] = algorithms[key]
  26886. })
  26887. function Sign (algorithm) {
  26888. stream.Writable.call(this)
  26889. var data = algorithms[algorithm]
  26890. if (!data) throw new Error('Unknown message digest')
  26891. this._hashType = data.hash
  26892. this._hash = createHash(data.hash)
  26893. this._tag = data.id
  26894. this._signType = data.sign
  26895. }
  26896. inherits(Sign, stream.Writable)
  26897. Sign.prototype._write = function _write (data, _, done) {
  26898. this._hash.update(data)
  26899. done()
  26900. }
  26901. Sign.prototype.update = function update (data, enc) {
  26902. if (typeof data === 'string') data = Buffer.from(data, enc)
  26903. this._hash.update(data)
  26904. return this
  26905. }
  26906. Sign.prototype.sign = function signMethod (key, enc) {
  26907. this.end()
  26908. var hash = this._hash.digest()
  26909. var sig = sign(hash, key, this._hashType, this._signType, this._tag)
  26910. return enc ? sig.toString(enc) : sig
  26911. }
  26912. function Verify (algorithm) {
  26913. stream.Writable.call(this)
  26914. var data = algorithms[algorithm]
  26915. if (!data) throw new Error('Unknown message digest')
  26916. this._hash = createHash(data.hash)
  26917. this._tag = data.id
  26918. this._signType = data.sign
  26919. }
  26920. inherits(Verify, stream.Writable)
  26921. Verify.prototype._write = function _write (data, _, done) {
  26922. this._hash.update(data)
  26923. done()
  26924. }
  26925. Verify.prototype.update = function update (data, enc) {
  26926. if (typeof data === 'string') data = Buffer.from(data, enc)
  26927. this._hash.update(data)
  26928. return this
  26929. }
  26930. Verify.prototype.verify = function verifyMethod (key, sig, enc) {
  26931. if (typeof sig === 'string') sig = Buffer.from(sig, enc)
  26932. this.end()
  26933. var hash = this._hash.digest()
  26934. return verify(sig, hash, key, this._signType, this._tag)
  26935. }
  26936. function createSign (algorithm) {
  26937. return new Sign(algorithm)
  26938. }
  26939. function createVerify (algorithm) {
  26940. return new Verify(algorithm)
  26941. }
  26942. module.exports = {
  26943. Sign: createSign,
  26944. Verify: createVerify,
  26945. createSign: createSign,
  26946. createVerify: createVerify
  26947. }
  26948. /***/ }),
  26949. /* 194 */
  26950. /*!******************************************************!*\
  26951. !*** ./node_modules/browserify-sign/browser/sign.js ***!
  26952. \******************************************************/
  26953. /*! no static exports found */
  26954. /***/ (function(module, exports, __webpack_require__) {
  26955. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  26956. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  26957. var createHmac = __webpack_require__(/*! create-hmac */ 143)
  26958. var crt = __webpack_require__(/*! browserify-rsa */ 195)
  26959. var EC = __webpack_require__(/*! elliptic */ 196).ec
  26960. var BN = __webpack_require__(/*! bn.js */ 185)
  26961. var parseKeys = __webpack_require__(/*! parse-asn1 */ 226)
  26962. var curves = __webpack_require__(/*! ./curves.json */ 246)
  26963. function sign (hash, key, hashType, signType, tag) {
  26964. var priv = parseKeys(key)
  26965. if (priv.curve) {
  26966. // rsa keys can be interpreted as ecdsa ones in openssl
  26967. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  26968. return ecSign(hash, priv)
  26969. } else if (priv.type === 'dsa') {
  26970. if (signType !== 'dsa') throw new Error('wrong private key type')
  26971. return dsaSign(hash, priv, hashType)
  26972. } else {
  26973. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  26974. }
  26975. hash = Buffer.concat([tag, hash])
  26976. var len = priv.modulus.byteLength()
  26977. var pad = [0, 1]
  26978. while (hash.length + pad.length + 1 < len) pad.push(0xff)
  26979. pad.push(0x00)
  26980. var i = -1
  26981. while (++i < hash.length) pad.push(hash[i])
  26982. var out = crt(pad, priv)
  26983. return out
  26984. }
  26985. function ecSign (hash, priv) {
  26986. var curveId = curves[priv.curve.join('.')]
  26987. if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
  26988. var curve = new EC(curveId)
  26989. var key = curve.keyFromPrivate(priv.privateKey)
  26990. var out = key.sign(hash)
  26991. return Buffer.from(out.toDER())
  26992. }
  26993. function dsaSign (hash, priv, algo) {
  26994. var x = priv.params.priv_key
  26995. var p = priv.params.p
  26996. var q = priv.params.q
  26997. var g = priv.params.g
  26998. var r = new BN(0)
  26999. var k
  27000. var H = bits2int(hash, q).mod(q)
  27001. var s = false
  27002. var kv = getKey(x, q, hash, algo)
  27003. while (s === false) {
  27004. k = makeKey(q, kv, algo)
  27005. r = makeR(g, k, p, q)
  27006. s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
  27007. if (s.cmpn(0) === 0) {
  27008. s = false
  27009. r = new BN(0)
  27010. }
  27011. }
  27012. return toDER(r, s)
  27013. }
  27014. function toDER (r, s) {
  27015. r = r.toArray()
  27016. s = s.toArray()
  27017. // Pad values
  27018. if (r[0] & 0x80) r = [0].concat(r)
  27019. if (s[0] & 0x80) s = [0].concat(s)
  27020. var total = r.length + s.length + 4
  27021. var res = [0x30, total, 0x02, r.length]
  27022. res = res.concat(r, [0x02, s.length], s)
  27023. return Buffer.from(res)
  27024. }
  27025. function getKey (x, q, hash, algo) {
  27026. x = Buffer.from(x.toArray())
  27027. if (x.length < q.byteLength()) {
  27028. var zeros = Buffer.alloc(q.byteLength() - x.length)
  27029. x = Buffer.concat([zeros, x])
  27030. }
  27031. var hlen = hash.length
  27032. var hbits = bits2octets(hash, q)
  27033. var v = Buffer.alloc(hlen)
  27034. v.fill(1)
  27035. var k = Buffer.alloc(hlen)
  27036. k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
  27037. v = createHmac(algo, k).update(v).digest()
  27038. k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
  27039. v = createHmac(algo, k).update(v).digest()
  27040. return { k: k, v: v }
  27041. }
  27042. function bits2int (obits, q) {
  27043. var bits = new BN(obits)
  27044. var shift = (obits.length << 3) - q.bitLength()
  27045. if (shift > 0) bits.ishrn(shift)
  27046. return bits
  27047. }
  27048. function bits2octets (bits, q) {
  27049. bits = bits2int(bits, q)
  27050. bits = bits.mod(q)
  27051. var out = Buffer.from(bits.toArray())
  27052. if (out.length < q.byteLength()) {
  27053. var zeros = Buffer.alloc(q.byteLength() - out.length)
  27054. out = Buffer.concat([zeros, out])
  27055. }
  27056. return out
  27057. }
  27058. function makeKey (q, kv, algo) {
  27059. var t
  27060. var k
  27061. do {
  27062. t = Buffer.alloc(0)
  27063. while (t.length * 8 < q.bitLength()) {
  27064. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  27065. t = Buffer.concat([t, kv.v])
  27066. }
  27067. k = bits2int(t, q)
  27068. kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
  27069. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  27070. } while (k.cmp(q) !== -1)
  27071. return k
  27072. }
  27073. function makeR (g, k, p, q) {
  27074. return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
  27075. }
  27076. module.exports = sign
  27077. module.exports.getKey = getKey
  27078. module.exports.makeKey = makeKey
  27079. /***/ }),
  27080. /* 195 */
  27081. /*!**********************************************!*\
  27082. !*** ./node_modules/browserify-rsa/index.js ***!
  27083. \**********************************************/
  27084. /*! no static exports found */
  27085. /***/ (function(module, exports, __webpack_require__) {
  27086. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 185)
  27087. var randomBytes = __webpack_require__(/*! randombytes */ 100)
  27088. function blind (priv) {
  27089. var r = getr(priv)
  27090. var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()
  27091. return { blinder: blinder, unblinder: r.invm(priv.modulus) }
  27092. }
  27093. function getr (priv) {
  27094. var len = priv.modulus.byteLength()
  27095. var r
  27096. do {
  27097. r = new BN(randomBytes(len))
  27098. } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))
  27099. return r
  27100. }
  27101. function crt (msg, priv) {
  27102. var blinds = blind(priv)
  27103. var len = priv.modulus.byteLength()
  27104. var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)
  27105. var c1 = blinded.toRed(BN.mont(priv.prime1))
  27106. var c2 = blinded.toRed(BN.mont(priv.prime2))
  27107. var qinv = priv.coefficient
  27108. var p = priv.prime1
  27109. var q = priv.prime2
  27110. var m1 = c1.redPow(priv.exponent1).fromRed()
  27111. var m2 = c2.redPow(priv.exponent2).fromRed()
  27112. var h = m1.isub(m2).imul(qinv).umod(p).imul(q)
  27113. return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)
  27114. }
  27115. crt.getr = getr
  27116. module.exports = crt
  27117. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 104).Buffer))
  27118. /***/ }),
  27119. /* 196 */
  27120. /*!***********************************************!*\
  27121. !*** ./node_modules/elliptic/lib/elliptic.js ***!
  27122. \***********************************************/
  27123. /*! no static exports found */
  27124. /***/ (function(module, exports, __webpack_require__) {
  27125. "use strict";
  27126. var elliptic = exports;
  27127. elliptic.version = __webpack_require__(/*! ../package.json */ 197).version;
  27128. elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 198);
  27129. elliptic.rand = __webpack_require__(/*! brorand */ 189);
  27130. elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 200);
  27131. elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 205);
  27132. // Protocols
  27133. elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 219);
  27134. elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 223);
  27135. /***/ }),
  27136. /* 197 */
  27137. /*!********************************************!*\
  27138. !*** ./node_modules/elliptic/package.json ***!
  27139. \********************************************/
  27140. /*! exports provided: name, version, description, main, files, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, dependencies, default */
  27141. /***/ (function(module) {
  27142. module.exports = JSON.parse("{\"name\":\"elliptic\",\"version\":\"6.5.4\",\"description\":\"EC cryptography\",\"main\":\"lib/elliptic.js\",\"files\":[\"lib\"],\"scripts\":{\"lint\":\"eslint lib test\",\"lint:fix\":\"npm run lint -- --fix\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"test\":\"npm run lint && npm run unit\",\"version\":\"grunt dist && git add dist/\"},\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:indutny/elliptic\"},\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"author\":\"Fedor Indutny <fedor@indutny.com>\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"homepage\":\"https://github.com/indutny/elliptic\",\"devDependencies\":{\"brfs\":\"^2.0.2\",\"coveralls\":\"^3.1.0\",\"eslint\":\"^7.6.0\",\"grunt\":\"^1.2.1\",\"grunt-browserify\":\"^5.3.0\",\"grunt-cli\":\"^1.3.2\",\"grunt-contrib-connect\":\"^3.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^5.0.0\",\"grunt-mocha-istanbul\":\"^5.0.2\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.5\",\"mocha\":\"^8.0.1\"},\"dependencies\":{\"bn.js\":\"^4.11.9\",\"brorand\":\"^1.1.0\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.1\",\"inherits\":\"^2.0.4\",\"minimalistic-assert\":\"^1.0.1\",\"minimalistic-crypto-utils\":\"^1.0.1\"}}");
  27143. /***/ }),
  27144. /* 198 */
  27145. /*!*****************************************************!*\
  27146. !*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
  27147. \*****************************************************/
  27148. /*! no static exports found */
  27149. /***/ (function(module, exports, __webpack_require__) {
  27150. "use strict";
  27151. var utils = exports;
  27152. var BN = __webpack_require__(/*! bn.js */ 185);
  27153. var minAssert = __webpack_require__(/*! minimalistic-assert */ 159);
  27154. var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 199);
  27155. utils.assert = minAssert;
  27156. utils.toArray = minUtils.toArray;
  27157. utils.zero2 = minUtils.zero2;
  27158. utils.toHex = minUtils.toHex;
  27159. utils.encode = minUtils.encode;
  27160. // Represent num in a w-NAF form
  27161. function getNAF(num, w, bits) {
  27162. var naf = new Array(Math.max(num.bitLength(), bits) + 1);
  27163. naf.fill(0);
  27164. var ws = 1 << (w + 1);
  27165. var k = num.clone();
  27166. for (var i = 0; i < naf.length; i++) {
  27167. var z;
  27168. var mod = k.andln(ws - 1);
  27169. if (k.isOdd()) {
  27170. if (mod > (ws >> 1) - 1)
  27171. z = (ws >> 1) - mod;
  27172. else
  27173. z = mod;
  27174. k.isubn(z);
  27175. } else {
  27176. z = 0;
  27177. }
  27178. naf[i] = z;
  27179. k.iushrn(1);
  27180. }
  27181. return naf;
  27182. }
  27183. utils.getNAF = getNAF;
  27184. // Represent k1, k2 in a Joint Sparse Form
  27185. function getJSF(k1, k2) {
  27186. var jsf = [
  27187. [],
  27188. [],
  27189. ];
  27190. k1 = k1.clone();
  27191. k2 = k2.clone();
  27192. var d1 = 0;
  27193. var d2 = 0;
  27194. var m8;
  27195. while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
  27196. // First phase
  27197. var m14 = (k1.andln(3) + d1) & 3;
  27198. var m24 = (k2.andln(3) + d2) & 3;
  27199. if (m14 === 3)
  27200. m14 = -1;
  27201. if (m24 === 3)
  27202. m24 = -1;
  27203. var u1;
  27204. if ((m14 & 1) === 0) {
  27205. u1 = 0;
  27206. } else {
  27207. m8 = (k1.andln(7) + d1) & 7;
  27208. if ((m8 === 3 || m8 === 5) && m24 === 2)
  27209. u1 = -m14;
  27210. else
  27211. u1 = m14;
  27212. }
  27213. jsf[0].push(u1);
  27214. var u2;
  27215. if ((m24 & 1) === 0) {
  27216. u2 = 0;
  27217. } else {
  27218. m8 = (k2.andln(7) + d2) & 7;
  27219. if ((m8 === 3 || m8 === 5) && m14 === 2)
  27220. u2 = -m24;
  27221. else
  27222. u2 = m24;
  27223. }
  27224. jsf[1].push(u2);
  27225. // Second phase
  27226. if (2 * d1 === u1 + 1)
  27227. d1 = 1 - d1;
  27228. if (2 * d2 === u2 + 1)
  27229. d2 = 1 - d2;
  27230. k1.iushrn(1);
  27231. k2.iushrn(1);
  27232. }
  27233. return jsf;
  27234. }
  27235. utils.getJSF = getJSF;
  27236. function cachedProperty(obj, name, computer) {
  27237. var key = '_' + name;
  27238. obj.prototype[name] = function cachedProperty() {
  27239. return this[key] !== undefined ? this[key] :
  27240. this[key] = computer.call(this);
  27241. };
  27242. }
  27243. utils.cachedProperty = cachedProperty;
  27244. function parseBytes(bytes) {
  27245. return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
  27246. bytes;
  27247. }
  27248. utils.parseBytes = parseBytes;
  27249. function intFromLE(bytes) {
  27250. return new BN(bytes, 'hex', 'le');
  27251. }
  27252. utils.intFromLE = intFromLE;
  27253. /***/ }),
  27254. /* 199 */
  27255. /*!*************************************************************!*\
  27256. !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
  27257. \*************************************************************/
  27258. /*! no static exports found */
  27259. /***/ (function(module, exports, __webpack_require__) {
  27260. "use strict";
  27261. var utils = exports;
  27262. function toArray(msg, enc) {
  27263. if (Array.isArray(msg))
  27264. return msg.slice();
  27265. if (!msg)
  27266. return [];
  27267. var res = [];
  27268. if (typeof msg !== 'string') {
  27269. for (var i = 0; i < msg.length; i++)
  27270. res[i] = msg[i] | 0;
  27271. return res;
  27272. }
  27273. if (enc === 'hex') {
  27274. msg = msg.replace(/[^a-z0-9]+/ig, '');
  27275. if (msg.length % 2 !== 0)
  27276. msg = '0' + msg;
  27277. for (var i = 0; i < msg.length; i += 2)
  27278. res.push(parseInt(msg[i] + msg[i + 1], 16));
  27279. } else {
  27280. for (var i = 0; i < msg.length; i++) {
  27281. var c = msg.charCodeAt(i);
  27282. var hi = c >> 8;
  27283. var lo = c & 0xff;
  27284. if (hi)
  27285. res.push(hi, lo);
  27286. else
  27287. res.push(lo);
  27288. }
  27289. }
  27290. return res;
  27291. }
  27292. utils.toArray = toArray;
  27293. function zero2(word) {
  27294. if (word.length === 1)
  27295. return '0' + word;
  27296. else
  27297. return word;
  27298. }
  27299. utils.zero2 = zero2;
  27300. function toHex(msg) {
  27301. var res = '';
  27302. for (var i = 0; i < msg.length; i++)
  27303. res += zero2(msg[i].toString(16));
  27304. return res;
  27305. }
  27306. utils.toHex = toHex;
  27307. utils.encode = function encode(arr, enc) {
  27308. if (enc === 'hex')
  27309. return toHex(arr);
  27310. else
  27311. return arr;
  27312. };
  27313. /***/ }),
  27314. /* 200 */
  27315. /*!***********************************************************!*\
  27316. !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
  27317. \***********************************************************/
  27318. /*! no static exports found */
  27319. /***/ (function(module, exports, __webpack_require__) {
  27320. "use strict";
  27321. var curve = exports;
  27322. curve.base = __webpack_require__(/*! ./base */ 201);
  27323. curve.short = __webpack_require__(/*! ./short */ 202);
  27324. curve.mont = __webpack_require__(/*! ./mont */ 203);
  27325. curve.edwards = __webpack_require__(/*! ./edwards */ 204);
  27326. /***/ }),
  27327. /* 201 */
  27328. /*!**********************************************************!*\
  27329. !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
  27330. \**********************************************************/
  27331. /*! no static exports found */
  27332. /***/ (function(module, exports, __webpack_require__) {
  27333. "use strict";
  27334. var BN = __webpack_require__(/*! bn.js */ 185);
  27335. var utils = __webpack_require__(/*! ../utils */ 198);
  27336. var getNAF = utils.getNAF;
  27337. var getJSF = utils.getJSF;
  27338. var assert = utils.assert;
  27339. function BaseCurve(type, conf) {
  27340. this.type = type;
  27341. this.p = new BN(conf.p, 16);
  27342. // Use Montgomery, when there is no fast reduction for the prime
  27343. this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
  27344. // Useful for many curves
  27345. this.zero = new BN(0).toRed(this.red);
  27346. this.one = new BN(1).toRed(this.red);
  27347. this.two = new BN(2).toRed(this.red);
  27348. // Curve configuration, optional
  27349. this.n = conf.n && new BN(conf.n, 16);
  27350. this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
  27351. // Temporary arrays
  27352. this._wnafT1 = new Array(4);
  27353. this._wnafT2 = new Array(4);
  27354. this._wnafT3 = new Array(4);
  27355. this._wnafT4 = new Array(4);
  27356. this._bitLength = this.n ? this.n.bitLength() : 0;
  27357. // Generalized Greg Maxwell's trick
  27358. var adjustCount = this.n && this.p.div(this.n);
  27359. if (!adjustCount || adjustCount.cmpn(100) > 0) {
  27360. this.redN = null;
  27361. } else {
  27362. this._maxwellTrick = true;
  27363. this.redN = this.n.toRed(this.red);
  27364. }
  27365. }
  27366. module.exports = BaseCurve;
  27367. BaseCurve.prototype.point = function point() {
  27368. throw new Error('Not implemented');
  27369. };
  27370. BaseCurve.prototype.validate = function validate() {
  27371. throw new Error('Not implemented');
  27372. };
  27373. BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
  27374. assert(p.precomputed);
  27375. var doubles = p._getDoubles();
  27376. var naf = getNAF(k, 1, this._bitLength);
  27377. var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
  27378. I /= 3;
  27379. // Translate into more windowed form
  27380. var repr = [];
  27381. var j;
  27382. var nafW;
  27383. for (j = 0; j < naf.length; j += doubles.step) {
  27384. nafW = 0;
  27385. for (var l = j + doubles.step - 1; l >= j; l--)
  27386. nafW = (nafW << 1) + naf[l];
  27387. repr.push(nafW);
  27388. }
  27389. var a = this.jpoint(null, null, null);
  27390. var b = this.jpoint(null, null, null);
  27391. for (var i = I; i > 0; i--) {
  27392. for (j = 0; j < repr.length; j++) {
  27393. nafW = repr[j];
  27394. if (nafW === i)
  27395. b = b.mixedAdd(doubles.points[j]);
  27396. else if (nafW === -i)
  27397. b = b.mixedAdd(doubles.points[j].neg());
  27398. }
  27399. a = a.add(b);
  27400. }
  27401. return a.toP();
  27402. };
  27403. BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
  27404. var w = 4;
  27405. // Precompute window
  27406. var nafPoints = p._getNAFPoints(w);
  27407. w = nafPoints.wnd;
  27408. var wnd = nafPoints.points;
  27409. // Get NAF form
  27410. var naf = getNAF(k, w, this._bitLength);
  27411. // Add `this`*(N+1) for every w-NAF index
  27412. var acc = this.jpoint(null, null, null);
  27413. for (var i = naf.length - 1; i >= 0; i--) {
  27414. // Count zeroes
  27415. for (var l = 0; i >= 0 && naf[i] === 0; i--)
  27416. l++;
  27417. if (i >= 0)
  27418. l++;
  27419. acc = acc.dblp(l);
  27420. if (i < 0)
  27421. break;
  27422. var z = naf[i];
  27423. assert(z !== 0);
  27424. if (p.type === 'affine') {
  27425. // J +- P
  27426. if (z > 0)
  27427. acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
  27428. else
  27429. acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
  27430. } else {
  27431. // J +- J
  27432. if (z > 0)
  27433. acc = acc.add(wnd[(z - 1) >> 1]);
  27434. else
  27435. acc = acc.add(wnd[(-z - 1) >> 1].neg());
  27436. }
  27437. }
  27438. return p.type === 'affine' ? acc.toP() : acc;
  27439. };
  27440. BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
  27441. points,
  27442. coeffs,
  27443. len,
  27444. jacobianResult) {
  27445. var wndWidth = this._wnafT1;
  27446. var wnd = this._wnafT2;
  27447. var naf = this._wnafT3;
  27448. // Fill all arrays
  27449. var max = 0;
  27450. var i;
  27451. var j;
  27452. var p;
  27453. for (i = 0; i < len; i++) {
  27454. p = points[i];
  27455. var nafPoints = p._getNAFPoints(defW);
  27456. wndWidth[i] = nafPoints.wnd;
  27457. wnd[i] = nafPoints.points;
  27458. }
  27459. // Comb small window NAFs
  27460. for (i = len - 1; i >= 1; i -= 2) {
  27461. var a = i - 1;
  27462. var b = i;
  27463. if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
  27464. naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
  27465. naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
  27466. max = Math.max(naf[a].length, max);
  27467. max = Math.max(naf[b].length, max);
  27468. continue;
  27469. }
  27470. var comb = [
  27471. points[a], /* 1 */
  27472. null, /* 3 */
  27473. null, /* 5 */
  27474. points[b], /* 7 */
  27475. ];
  27476. // Try to avoid Projective points, if possible
  27477. if (points[a].y.cmp(points[b].y) === 0) {
  27478. comb[1] = points[a].add(points[b]);
  27479. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  27480. } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
  27481. comb[1] = points[a].toJ().mixedAdd(points[b]);
  27482. comb[2] = points[a].add(points[b].neg());
  27483. } else {
  27484. comb[1] = points[a].toJ().mixedAdd(points[b]);
  27485. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  27486. }
  27487. var index = [
  27488. -3, /* -1 -1 */
  27489. -1, /* -1 0 */
  27490. -5, /* -1 1 */
  27491. -7, /* 0 -1 */
  27492. 0, /* 0 0 */
  27493. 7, /* 0 1 */
  27494. 5, /* 1 -1 */
  27495. 1, /* 1 0 */
  27496. 3, /* 1 1 */
  27497. ];
  27498. var jsf = getJSF(coeffs[a], coeffs[b]);
  27499. max = Math.max(jsf[0].length, max);
  27500. naf[a] = new Array(max);
  27501. naf[b] = new Array(max);
  27502. for (j = 0; j < max; j++) {
  27503. var ja = jsf[0][j] | 0;
  27504. var jb = jsf[1][j] | 0;
  27505. naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
  27506. naf[b][j] = 0;
  27507. wnd[a] = comb;
  27508. }
  27509. }
  27510. var acc = this.jpoint(null, null, null);
  27511. var tmp = this._wnafT4;
  27512. for (i = max; i >= 0; i--) {
  27513. var k = 0;
  27514. while (i >= 0) {
  27515. var zero = true;
  27516. for (j = 0; j < len; j++) {
  27517. tmp[j] = naf[j][i] | 0;
  27518. if (tmp[j] !== 0)
  27519. zero = false;
  27520. }
  27521. if (!zero)
  27522. break;
  27523. k++;
  27524. i--;
  27525. }
  27526. if (i >= 0)
  27527. k++;
  27528. acc = acc.dblp(k);
  27529. if (i < 0)
  27530. break;
  27531. for (j = 0; j < len; j++) {
  27532. var z = tmp[j];
  27533. p;
  27534. if (z === 0)
  27535. continue;
  27536. else if (z > 0)
  27537. p = wnd[j][(z - 1) >> 1];
  27538. else if (z < 0)
  27539. p = wnd[j][(-z - 1) >> 1].neg();
  27540. if (p.type === 'affine')
  27541. acc = acc.mixedAdd(p);
  27542. else
  27543. acc = acc.add(p);
  27544. }
  27545. }
  27546. // Zeroify references
  27547. for (i = 0; i < len; i++)
  27548. wnd[i] = null;
  27549. if (jacobianResult)
  27550. return acc;
  27551. else
  27552. return acc.toP();
  27553. };
  27554. function BasePoint(curve, type) {
  27555. this.curve = curve;
  27556. this.type = type;
  27557. this.precomputed = null;
  27558. }
  27559. BaseCurve.BasePoint = BasePoint;
  27560. BasePoint.prototype.eq = function eq(/*other*/) {
  27561. throw new Error('Not implemented');
  27562. };
  27563. BasePoint.prototype.validate = function validate() {
  27564. return this.curve.validate(this);
  27565. };
  27566. BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  27567. bytes = utils.toArray(bytes, enc);
  27568. var len = this.p.byteLength();
  27569. // uncompressed, hybrid-odd, hybrid-even
  27570. if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
  27571. bytes.length - 1 === 2 * len) {
  27572. if (bytes[0] === 0x06)
  27573. assert(bytes[bytes.length - 1] % 2 === 0);
  27574. else if (bytes[0] === 0x07)
  27575. assert(bytes[bytes.length - 1] % 2 === 1);
  27576. var res = this.point(bytes.slice(1, 1 + len),
  27577. bytes.slice(1 + len, 1 + 2 * len));
  27578. return res;
  27579. } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
  27580. bytes.length - 1 === len) {
  27581. return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
  27582. }
  27583. throw new Error('Unknown point format');
  27584. };
  27585. BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
  27586. return this.encode(enc, true);
  27587. };
  27588. BasePoint.prototype._encode = function _encode(compact) {
  27589. var len = this.curve.p.byteLength();
  27590. var x = this.getX().toArray('be', len);
  27591. if (compact)
  27592. return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  27593. return [ 0x04 ].concat(x, this.getY().toArray('be', len));
  27594. };
  27595. BasePoint.prototype.encode = function encode(enc, compact) {
  27596. return utils.encode(this._encode(compact), enc);
  27597. };
  27598. BasePoint.prototype.precompute = function precompute(power) {
  27599. if (this.precomputed)
  27600. return this;
  27601. var precomputed = {
  27602. doubles: null,
  27603. naf: null,
  27604. beta: null,
  27605. };
  27606. precomputed.naf = this._getNAFPoints(8);
  27607. precomputed.doubles = this._getDoubles(4, power);
  27608. precomputed.beta = this._getBeta();
  27609. this.precomputed = precomputed;
  27610. return this;
  27611. };
  27612. BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
  27613. if (!this.precomputed)
  27614. return false;
  27615. var doubles = this.precomputed.doubles;
  27616. if (!doubles)
  27617. return false;
  27618. return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
  27619. };
  27620. BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
  27621. if (this.precomputed && this.precomputed.doubles)
  27622. return this.precomputed.doubles;
  27623. var doubles = [ this ];
  27624. var acc = this;
  27625. for (var i = 0; i < power; i += step) {
  27626. for (var j = 0; j < step; j++)
  27627. acc = acc.dbl();
  27628. doubles.push(acc);
  27629. }
  27630. return {
  27631. step: step,
  27632. points: doubles,
  27633. };
  27634. };
  27635. BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
  27636. if (this.precomputed && this.precomputed.naf)
  27637. return this.precomputed.naf;
  27638. var res = [ this ];
  27639. var max = (1 << wnd) - 1;
  27640. var dbl = max === 1 ? null : this.dbl();
  27641. for (var i = 1; i < max; i++)
  27642. res[i] = res[i - 1].add(dbl);
  27643. return {
  27644. wnd: wnd,
  27645. points: res,
  27646. };
  27647. };
  27648. BasePoint.prototype._getBeta = function _getBeta() {
  27649. return null;
  27650. };
  27651. BasePoint.prototype.dblp = function dblp(k) {
  27652. var r = this;
  27653. for (var i = 0; i < k; i++)
  27654. r = r.dbl();
  27655. return r;
  27656. };
  27657. /***/ }),
  27658. /* 202 */
  27659. /*!***********************************************************!*\
  27660. !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
  27661. \***********************************************************/
  27662. /*! no static exports found */
  27663. /***/ (function(module, exports, __webpack_require__) {
  27664. "use strict";
  27665. var utils = __webpack_require__(/*! ../utils */ 198);
  27666. var BN = __webpack_require__(/*! bn.js */ 185);
  27667. var inherits = __webpack_require__(/*! inherits */ 109);
  27668. var Base = __webpack_require__(/*! ./base */ 201);
  27669. var assert = utils.assert;
  27670. function ShortCurve(conf) {
  27671. Base.call(this, 'short', conf);
  27672. this.a = new BN(conf.a, 16).toRed(this.red);
  27673. this.b = new BN(conf.b, 16).toRed(this.red);
  27674. this.tinv = this.two.redInvm();
  27675. this.zeroA = this.a.fromRed().cmpn(0) === 0;
  27676. this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
  27677. // If the curve is endomorphic, precalculate beta and lambda
  27678. this.endo = this._getEndomorphism(conf);
  27679. this._endoWnafT1 = new Array(4);
  27680. this._endoWnafT2 = new Array(4);
  27681. }
  27682. inherits(ShortCurve, Base);
  27683. module.exports = ShortCurve;
  27684. ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
  27685. // No efficient endomorphism
  27686. if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
  27687. return;
  27688. // Compute beta and lambda, that lambda * P = (beta * Px; Py)
  27689. var beta;
  27690. var lambda;
  27691. if (conf.beta) {
  27692. beta = new BN(conf.beta, 16).toRed(this.red);
  27693. } else {
  27694. var betas = this._getEndoRoots(this.p);
  27695. // Choose the smallest beta
  27696. beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
  27697. beta = beta.toRed(this.red);
  27698. }
  27699. if (conf.lambda) {
  27700. lambda = new BN(conf.lambda, 16);
  27701. } else {
  27702. // Choose the lambda that is matching selected beta
  27703. var lambdas = this._getEndoRoots(this.n);
  27704. if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
  27705. lambda = lambdas[0];
  27706. } else {
  27707. lambda = lambdas[1];
  27708. assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
  27709. }
  27710. }
  27711. // Get basis vectors, used for balanced length-two representation
  27712. var basis;
  27713. if (conf.basis) {
  27714. basis = conf.basis.map(function(vec) {
  27715. return {
  27716. a: new BN(vec.a, 16),
  27717. b: new BN(vec.b, 16),
  27718. };
  27719. });
  27720. } else {
  27721. basis = this._getEndoBasis(lambda);
  27722. }
  27723. return {
  27724. beta: beta,
  27725. lambda: lambda,
  27726. basis: basis,
  27727. };
  27728. };
  27729. ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
  27730. // Find roots of for x^2 + x + 1 in F
  27731. // Root = (-1 +- Sqrt(-3)) / 2
  27732. //
  27733. var red = num === this.p ? this.red : BN.mont(num);
  27734. var tinv = new BN(2).toRed(red).redInvm();
  27735. var ntinv = tinv.redNeg();
  27736. var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
  27737. var l1 = ntinv.redAdd(s).fromRed();
  27738. var l2 = ntinv.redSub(s).fromRed();
  27739. return [ l1, l2 ];
  27740. };
  27741. ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
  27742. // aprxSqrt >= sqrt(this.n)
  27743. var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
  27744. // 3.74
  27745. // Run EGCD, until r(L + 1) < aprxSqrt
  27746. var u = lambda;
  27747. var v = this.n.clone();
  27748. var x1 = new BN(1);
  27749. var y1 = new BN(0);
  27750. var x2 = new BN(0);
  27751. var y2 = new BN(1);
  27752. // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
  27753. var a0;
  27754. var b0;
  27755. // First vector
  27756. var a1;
  27757. var b1;
  27758. // Second vector
  27759. var a2;
  27760. var b2;
  27761. var prevR;
  27762. var i = 0;
  27763. var r;
  27764. var x;
  27765. while (u.cmpn(0) !== 0) {
  27766. var q = v.div(u);
  27767. r = v.sub(q.mul(u));
  27768. x = x2.sub(q.mul(x1));
  27769. var y = y2.sub(q.mul(y1));
  27770. if (!a1 && r.cmp(aprxSqrt) < 0) {
  27771. a0 = prevR.neg();
  27772. b0 = x1;
  27773. a1 = r.neg();
  27774. b1 = x;
  27775. } else if (a1 && ++i === 2) {
  27776. break;
  27777. }
  27778. prevR = r;
  27779. v = u;
  27780. u = r;
  27781. x2 = x1;
  27782. x1 = x;
  27783. y2 = y1;
  27784. y1 = y;
  27785. }
  27786. a2 = r.neg();
  27787. b2 = x;
  27788. var len1 = a1.sqr().add(b1.sqr());
  27789. var len2 = a2.sqr().add(b2.sqr());
  27790. if (len2.cmp(len1) >= 0) {
  27791. a2 = a0;
  27792. b2 = b0;
  27793. }
  27794. // Normalize signs
  27795. if (a1.negative) {
  27796. a1 = a1.neg();
  27797. b1 = b1.neg();
  27798. }
  27799. if (a2.negative) {
  27800. a2 = a2.neg();
  27801. b2 = b2.neg();
  27802. }
  27803. return [
  27804. { a: a1, b: b1 },
  27805. { a: a2, b: b2 },
  27806. ];
  27807. };
  27808. ShortCurve.prototype._endoSplit = function _endoSplit(k) {
  27809. var basis = this.endo.basis;
  27810. var v1 = basis[0];
  27811. var v2 = basis[1];
  27812. var c1 = v2.b.mul(k).divRound(this.n);
  27813. var c2 = v1.b.neg().mul(k).divRound(this.n);
  27814. var p1 = c1.mul(v1.a);
  27815. var p2 = c2.mul(v2.a);
  27816. var q1 = c1.mul(v1.b);
  27817. var q2 = c2.mul(v2.b);
  27818. // Calculate answer
  27819. var k1 = k.sub(p1).sub(p2);
  27820. var k2 = q1.add(q2).neg();
  27821. return { k1: k1, k2: k2 };
  27822. };
  27823. ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
  27824. x = new BN(x, 16);
  27825. if (!x.red)
  27826. x = x.toRed(this.red);
  27827. var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
  27828. var y = y2.redSqrt();
  27829. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  27830. throw new Error('invalid point');
  27831. // XXX Is there any way to tell if the number is odd without converting it
  27832. // to non-red form?
  27833. var isOdd = y.fromRed().isOdd();
  27834. if (odd && !isOdd || !odd && isOdd)
  27835. y = y.redNeg();
  27836. return this.point(x, y);
  27837. };
  27838. ShortCurve.prototype.validate = function validate(point) {
  27839. if (point.inf)
  27840. return true;
  27841. var x = point.x;
  27842. var y = point.y;
  27843. var ax = this.a.redMul(x);
  27844. var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
  27845. return y.redSqr().redISub(rhs).cmpn(0) === 0;
  27846. };
  27847. ShortCurve.prototype._endoWnafMulAdd =
  27848. function _endoWnafMulAdd(points, coeffs, jacobianResult) {
  27849. var npoints = this._endoWnafT1;
  27850. var ncoeffs = this._endoWnafT2;
  27851. for (var i = 0; i < points.length; i++) {
  27852. var split = this._endoSplit(coeffs[i]);
  27853. var p = points[i];
  27854. var beta = p._getBeta();
  27855. if (split.k1.negative) {
  27856. split.k1.ineg();
  27857. p = p.neg(true);
  27858. }
  27859. if (split.k2.negative) {
  27860. split.k2.ineg();
  27861. beta = beta.neg(true);
  27862. }
  27863. npoints[i * 2] = p;
  27864. npoints[i * 2 + 1] = beta;
  27865. ncoeffs[i * 2] = split.k1;
  27866. ncoeffs[i * 2 + 1] = split.k2;
  27867. }
  27868. var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
  27869. // Clean-up references to points and coefficients
  27870. for (var j = 0; j < i * 2; j++) {
  27871. npoints[j] = null;
  27872. ncoeffs[j] = null;
  27873. }
  27874. return res;
  27875. };
  27876. function Point(curve, x, y, isRed) {
  27877. Base.BasePoint.call(this, curve, 'affine');
  27878. if (x === null && y === null) {
  27879. this.x = null;
  27880. this.y = null;
  27881. this.inf = true;
  27882. } else {
  27883. this.x = new BN(x, 16);
  27884. this.y = new BN(y, 16);
  27885. // Force redgomery representation when loading from JSON
  27886. if (isRed) {
  27887. this.x.forceRed(this.curve.red);
  27888. this.y.forceRed(this.curve.red);
  27889. }
  27890. if (!this.x.red)
  27891. this.x = this.x.toRed(this.curve.red);
  27892. if (!this.y.red)
  27893. this.y = this.y.toRed(this.curve.red);
  27894. this.inf = false;
  27895. }
  27896. }
  27897. inherits(Point, Base.BasePoint);
  27898. ShortCurve.prototype.point = function point(x, y, isRed) {
  27899. return new Point(this, x, y, isRed);
  27900. };
  27901. ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
  27902. return Point.fromJSON(this, obj, red);
  27903. };
  27904. Point.prototype._getBeta = function _getBeta() {
  27905. if (!this.curve.endo)
  27906. return;
  27907. var pre = this.precomputed;
  27908. if (pre && pre.beta)
  27909. return pre.beta;
  27910. var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
  27911. if (pre) {
  27912. var curve = this.curve;
  27913. var endoMul = function(p) {
  27914. return curve.point(p.x.redMul(curve.endo.beta), p.y);
  27915. };
  27916. pre.beta = beta;
  27917. beta.precomputed = {
  27918. beta: null,
  27919. naf: pre.naf && {
  27920. wnd: pre.naf.wnd,
  27921. points: pre.naf.points.map(endoMul),
  27922. },
  27923. doubles: pre.doubles && {
  27924. step: pre.doubles.step,
  27925. points: pre.doubles.points.map(endoMul),
  27926. },
  27927. };
  27928. }
  27929. return beta;
  27930. };
  27931. Point.prototype.toJSON = function toJSON() {
  27932. if (!this.precomputed)
  27933. return [ this.x, this.y ];
  27934. return [ this.x, this.y, this.precomputed && {
  27935. doubles: this.precomputed.doubles && {
  27936. step: this.precomputed.doubles.step,
  27937. points: this.precomputed.doubles.points.slice(1),
  27938. },
  27939. naf: this.precomputed.naf && {
  27940. wnd: this.precomputed.naf.wnd,
  27941. points: this.precomputed.naf.points.slice(1),
  27942. },
  27943. } ];
  27944. };
  27945. Point.fromJSON = function fromJSON(curve, obj, red) {
  27946. if (typeof obj === 'string')
  27947. obj = JSON.parse(obj);
  27948. var res = curve.point(obj[0], obj[1], red);
  27949. if (!obj[2])
  27950. return res;
  27951. function obj2point(obj) {
  27952. return curve.point(obj[0], obj[1], red);
  27953. }
  27954. var pre = obj[2];
  27955. res.precomputed = {
  27956. beta: null,
  27957. doubles: pre.doubles && {
  27958. step: pre.doubles.step,
  27959. points: [ res ].concat(pre.doubles.points.map(obj2point)),
  27960. },
  27961. naf: pre.naf && {
  27962. wnd: pre.naf.wnd,
  27963. points: [ res ].concat(pre.naf.points.map(obj2point)),
  27964. },
  27965. };
  27966. return res;
  27967. };
  27968. Point.prototype.inspect = function inspect() {
  27969. if (this.isInfinity())
  27970. return '<EC Point Infinity>';
  27971. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  27972. ' y: ' + this.y.fromRed().toString(16, 2) + '>';
  27973. };
  27974. Point.prototype.isInfinity = function isInfinity() {
  27975. return this.inf;
  27976. };
  27977. Point.prototype.add = function add(p) {
  27978. // O + P = P
  27979. if (this.inf)
  27980. return p;
  27981. // P + O = P
  27982. if (p.inf)
  27983. return this;
  27984. // P + P = 2P
  27985. if (this.eq(p))
  27986. return this.dbl();
  27987. // P + (-P) = O
  27988. if (this.neg().eq(p))
  27989. return this.curve.point(null, null);
  27990. // P + Q = O
  27991. if (this.x.cmp(p.x) === 0)
  27992. return this.curve.point(null, null);
  27993. var c = this.y.redSub(p.y);
  27994. if (c.cmpn(0) !== 0)
  27995. c = c.redMul(this.x.redSub(p.x).redInvm());
  27996. var nx = c.redSqr().redISub(this.x).redISub(p.x);
  27997. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  27998. return this.curve.point(nx, ny);
  27999. };
  28000. Point.prototype.dbl = function dbl() {
  28001. if (this.inf)
  28002. return this;
  28003. // 2P = O
  28004. var ys1 = this.y.redAdd(this.y);
  28005. if (ys1.cmpn(0) === 0)
  28006. return this.curve.point(null, null);
  28007. var a = this.curve.a;
  28008. var x2 = this.x.redSqr();
  28009. var dyinv = ys1.redInvm();
  28010. var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
  28011. var nx = c.redSqr().redISub(this.x.redAdd(this.x));
  28012. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  28013. return this.curve.point(nx, ny);
  28014. };
  28015. Point.prototype.getX = function getX() {
  28016. return this.x.fromRed();
  28017. };
  28018. Point.prototype.getY = function getY() {
  28019. return this.y.fromRed();
  28020. };
  28021. Point.prototype.mul = function mul(k) {
  28022. k = new BN(k, 16);
  28023. if (this.isInfinity())
  28024. return this;
  28025. else if (this._hasDoubles(k))
  28026. return this.curve._fixedNafMul(this, k);
  28027. else if (this.curve.endo)
  28028. return this.curve._endoWnafMulAdd([ this ], [ k ]);
  28029. else
  28030. return this.curve._wnafMul(this, k);
  28031. };
  28032. Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
  28033. var points = [ this, p2 ];
  28034. var coeffs = [ k1, k2 ];
  28035. if (this.curve.endo)
  28036. return this.curve._endoWnafMulAdd(points, coeffs);
  28037. else
  28038. return this.curve._wnafMulAdd(1, points, coeffs, 2);
  28039. };
  28040. Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
  28041. var points = [ this, p2 ];
  28042. var coeffs = [ k1, k2 ];
  28043. if (this.curve.endo)
  28044. return this.curve._endoWnafMulAdd(points, coeffs, true);
  28045. else
  28046. return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
  28047. };
  28048. Point.prototype.eq = function eq(p) {
  28049. return this === p ||
  28050. this.inf === p.inf &&
  28051. (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
  28052. };
  28053. Point.prototype.neg = function neg(_precompute) {
  28054. if (this.inf)
  28055. return this;
  28056. var res = this.curve.point(this.x, this.y.redNeg());
  28057. if (_precompute && this.precomputed) {
  28058. var pre = this.precomputed;
  28059. var negate = function(p) {
  28060. return p.neg();
  28061. };
  28062. res.precomputed = {
  28063. naf: pre.naf && {
  28064. wnd: pre.naf.wnd,
  28065. points: pre.naf.points.map(negate),
  28066. },
  28067. doubles: pre.doubles && {
  28068. step: pre.doubles.step,
  28069. points: pre.doubles.points.map(negate),
  28070. },
  28071. };
  28072. }
  28073. return res;
  28074. };
  28075. Point.prototype.toJ = function toJ() {
  28076. if (this.inf)
  28077. return this.curve.jpoint(null, null, null);
  28078. var res = this.curve.jpoint(this.x, this.y, this.curve.one);
  28079. return res;
  28080. };
  28081. function JPoint(curve, x, y, z) {
  28082. Base.BasePoint.call(this, curve, 'jacobian');
  28083. if (x === null && y === null && z === null) {
  28084. this.x = this.curve.one;
  28085. this.y = this.curve.one;
  28086. this.z = new BN(0);
  28087. } else {
  28088. this.x = new BN(x, 16);
  28089. this.y = new BN(y, 16);
  28090. this.z = new BN(z, 16);
  28091. }
  28092. if (!this.x.red)
  28093. this.x = this.x.toRed(this.curve.red);
  28094. if (!this.y.red)
  28095. this.y = this.y.toRed(this.curve.red);
  28096. if (!this.z.red)
  28097. this.z = this.z.toRed(this.curve.red);
  28098. this.zOne = this.z === this.curve.one;
  28099. }
  28100. inherits(JPoint, Base.BasePoint);
  28101. ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
  28102. return new JPoint(this, x, y, z);
  28103. };
  28104. JPoint.prototype.toP = function toP() {
  28105. if (this.isInfinity())
  28106. return this.curve.point(null, null);
  28107. var zinv = this.z.redInvm();
  28108. var zinv2 = zinv.redSqr();
  28109. var ax = this.x.redMul(zinv2);
  28110. var ay = this.y.redMul(zinv2).redMul(zinv);
  28111. return this.curve.point(ax, ay);
  28112. };
  28113. JPoint.prototype.neg = function neg() {
  28114. return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
  28115. };
  28116. JPoint.prototype.add = function add(p) {
  28117. // O + P = P
  28118. if (this.isInfinity())
  28119. return p;
  28120. // P + O = P
  28121. if (p.isInfinity())
  28122. return this;
  28123. // 12M + 4S + 7A
  28124. var pz2 = p.z.redSqr();
  28125. var z2 = this.z.redSqr();
  28126. var u1 = this.x.redMul(pz2);
  28127. var u2 = p.x.redMul(z2);
  28128. var s1 = this.y.redMul(pz2.redMul(p.z));
  28129. var s2 = p.y.redMul(z2.redMul(this.z));
  28130. var h = u1.redSub(u2);
  28131. var r = s1.redSub(s2);
  28132. if (h.cmpn(0) === 0) {
  28133. if (r.cmpn(0) !== 0)
  28134. return this.curve.jpoint(null, null, null);
  28135. else
  28136. return this.dbl();
  28137. }
  28138. var h2 = h.redSqr();
  28139. var h3 = h2.redMul(h);
  28140. var v = u1.redMul(h2);
  28141. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  28142. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  28143. var nz = this.z.redMul(p.z).redMul(h);
  28144. return this.curve.jpoint(nx, ny, nz);
  28145. };
  28146. JPoint.prototype.mixedAdd = function mixedAdd(p) {
  28147. // O + P = P
  28148. if (this.isInfinity())
  28149. return p.toJ();
  28150. // P + O = P
  28151. if (p.isInfinity())
  28152. return this;
  28153. // 8M + 3S + 7A
  28154. var z2 = this.z.redSqr();
  28155. var u1 = this.x;
  28156. var u2 = p.x.redMul(z2);
  28157. var s1 = this.y;
  28158. var s2 = p.y.redMul(z2).redMul(this.z);
  28159. var h = u1.redSub(u2);
  28160. var r = s1.redSub(s2);
  28161. if (h.cmpn(0) === 0) {
  28162. if (r.cmpn(0) !== 0)
  28163. return this.curve.jpoint(null, null, null);
  28164. else
  28165. return this.dbl();
  28166. }
  28167. var h2 = h.redSqr();
  28168. var h3 = h2.redMul(h);
  28169. var v = u1.redMul(h2);
  28170. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  28171. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  28172. var nz = this.z.redMul(h);
  28173. return this.curve.jpoint(nx, ny, nz);
  28174. };
  28175. JPoint.prototype.dblp = function dblp(pow) {
  28176. if (pow === 0)
  28177. return this;
  28178. if (this.isInfinity())
  28179. return this;
  28180. if (!pow)
  28181. return this.dbl();
  28182. var i;
  28183. if (this.curve.zeroA || this.curve.threeA) {
  28184. var r = this;
  28185. for (i = 0; i < pow; i++)
  28186. r = r.dbl();
  28187. return r;
  28188. }
  28189. // 1M + 2S + 1A + N * (4S + 5M + 8A)
  28190. // N = 1 => 6M + 6S + 9A
  28191. var a = this.curve.a;
  28192. var tinv = this.curve.tinv;
  28193. var jx = this.x;
  28194. var jy = this.y;
  28195. var jz = this.z;
  28196. var jz4 = jz.redSqr().redSqr();
  28197. // Reuse results
  28198. var jyd = jy.redAdd(jy);
  28199. for (i = 0; i < pow; i++) {
  28200. var jx2 = jx.redSqr();
  28201. var jyd2 = jyd.redSqr();
  28202. var jyd4 = jyd2.redSqr();
  28203. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  28204. var t1 = jx.redMul(jyd2);
  28205. var nx = c.redSqr().redISub(t1.redAdd(t1));
  28206. var t2 = t1.redISub(nx);
  28207. var dny = c.redMul(t2);
  28208. dny = dny.redIAdd(dny).redISub(jyd4);
  28209. var nz = jyd.redMul(jz);
  28210. if (i + 1 < pow)
  28211. jz4 = jz4.redMul(jyd4);
  28212. jx = nx;
  28213. jz = nz;
  28214. jyd = dny;
  28215. }
  28216. return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
  28217. };
  28218. JPoint.prototype.dbl = function dbl() {
  28219. if (this.isInfinity())
  28220. return this;
  28221. if (this.curve.zeroA)
  28222. return this._zeroDbl();
  28223. else if (this.curve.threeA)
  28224. return this._threeDbl();
  28225. else
  28226. return this._dbl();
  28227. };
  28228. JPoint.prototype._zeroDbl = function _zeroDbl() {
  28229. var nx;
  28230. var ny;
  28231. var nz;
  28232. // Z = 1
  28233. if (this.zOne) {
  28234. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  28235. // #doubling-mdbl-2007-bl
  28236. // 1M + 5S + 14A
  28237. // XX = X1^2
  28238. var xx = this.x.redSqr();
  28239. // YY = Y1^2
  28240. var yy = this.y.redSqr();
  28241. // YYYY = YY^2
  28242. var yyyy = yy.redSqr();
  28243. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  28244. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  28245. s = s.redIAdd(s);
  28246. // M = 3 * XX + a; a = 0
  28247. var m = xx.redAdd(xx).redIAdd(xx);
  28248. // T = M ^ 2 - 2*S
  28249. var t = m.redSqr().redISub(s).redISub(s);
  28250. // 8 * YYYY
  28251. var yyyy8 = yyyy.redIAdd(yyyy);
  28252. yyyy8 = yyyy8.redIAdd(yyyy8);
  28253. yyyy8 = yyyy8.redIAdd(yyyy8);
  28254. // X3 = T
  28255. nx = t;
  28256. // Y3 = M * (S - T) - 8 * YYYY
  28257. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  28258. // Z3 = 2*Y1
  28259. nz = this.y.redAdd(this.y);
  28260. } else {
  28261. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  28262. // #doubling-dbl-2009-l
  28263. // 2M + 5S + 13A
  28264. // A = X1^2
  28265. var a = this.x.redSqr();
  28266. // B = Y1^2
  28267. var b = this.y.redSqr();
  28268. // C = B^2
  28269. var c = b.redSqr();
  28270. // D = 2 * ((X1 + B)^2 - A - C)
  28271. var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
  28272. d = d.redIAdd(d);
  28273. // E = 3 * A
  28274. var e = a.redAdd(a).redIAdd(a);
  28275. // F = E^2
  28276. var f = e.redSqr();
  28277. // 8 * C
  28278. var c8 = c.redIAdd(c);
  28279. c8 = c8.redIAdd(c8);
  28280. c8 = c8.redIAdd(c8);
  28281. // X3 = F - 2 * D
  28282. nx = f.redISub(d).redISub(d);
  28283. // Y3 = E * (D - X3) - 8 * C
  28284. ny = e.redMul(d.redISub(nx)).redISub(c8);
  28285. // Z3 = 2 * Y1 * Z1
  28286. nz = this.y.redMul(this.z);
  28287. nz = nz.redIAdd(nz);
  28288. }
  28289. return this.curve.jpoint(nx, ny, nz);
  28290. };
  28291. JPoint.prototype._threeDbl = function _threeDbl() {
  28292. var nx;
  28293. var ny;
  28294. var nz;
  28295. // Z = 1
  28296. if (this.zOne) {
  28297. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
  28298. // #doubling-mdbl-2007-bl
  28299. // 1M + 5S + 15A
  28300. // XX = X1^2
  28301. var xx = this.x.redSqr();
  28302. // YY = Y1^2
  28303. var yy = this.y.redSqr();
  28304. // YYYY = YY^2
  28305. var yyyy = yy.redSqr();
  28306. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  28307. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  28308. s = s.redIAdd(s);
  28309. // M = 3 * XX + a
  28310. var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
  28311. // T = M^2 - 2 * S
  28312. var t = m.redSqr().redISub(s).redISub(s);
  28313. // X3 = T
  28314. nx = t;
  28315. // Y3 = M * (S - T) - 8 * YYYY
  28316. var yyyy8 = yyyy.redIAdd(yyyy);
  28317. yyyy8 = yyyy8.redIAdd(yyyy8);
  28318. yyyy8 = yyyy8.redIAdd(yyyy8);
  28319. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  28320. // Z3 = 2 * Y1
  28321. nz = this.y.redAdd(this.y);
  28322. } else {
  28323. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
  28324. // 3M + 5S
  28325. // delta = Z1^2
  28326. var delta = this.z.redSqr();
  28327. // gamma = Y1^2
  28328. var gamma = this.y.redSqr();
  28329. // beta = X1 * gamma
  28330. var beta = this.x.redMul(gamma);
  28331. // alpha = 3 * (X1 - delta) * (X1 + delta)
  28332. var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
  28333. alpha = alpha.redAdd(alpha).redIAdd(alpha);
  28334. // X3 = alpha^2 - 8 * beta
  28335. var beta4 = beta.redIAdd(beta);
  28336. beta4 = beta4.redIAdd(beta4);
  28337. var beta8 = beta4.redAdd(beta4);
  28338. nx = alpha.redSqr().redISub(beta8);
  28339. // Z3 = (Y1 + Z1)^2 - gamma - delta
  28340. nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
  28341. // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
  28342. var ggamma8 = gamma.redSqr();
  28343. ggamma8 = ggamma8.redIAdd(ggamma8);
  28344. ggamma8 = ggamma8.redIAdd(ggamma8);
  28345. ggamma8 = ggamma8.redIAdd(ggamma8);
  28346. ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
  28347. }
  28348. return this.curve.jpoint(nx, ny, nz);
  28349. };
  28350. JPoint.prototype._dbl = function _dbl() {
  28351. var a = this.curve.a;
  28352. // 4M + 6S + 10A
  28353. var jx = this.x;
  28354. var jy = this.y;
  28355. var jz = this.z;
  28356. var jz4 = jz.redSqr().redSqr();
  28357. var jx2 = jx.redSqr();
  28358. var jy2 = jy.redSqr();
  28359. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  28360. var jxd4 = jx.redAdd(jx);
  28361. jxd4 = jxd4.redIAdd(jxd4);
  28362. var t1 = jxd4.redMul(jy2);
  28363. var nx = c.redSqr().redISub(t1.redAdd(t1));
  28364. var t2 = t1.redISub(nx);
  28365. var jyd8 = jy2.redSqr();
  28366. jyd8 = jyd8.redIAdd(jyd8);
  28367. jyd8 = jyd8.redIAdd(jyd8);
  28368. jyd8 = jyd8.redIAdd(jyd8);
  28369. var ny = c.redMul(t2).redISub(jyd8);
  28370. var nz = jy.redAdd(jy).redMul(jz);
  28371. return this.curve.jpoint(nx, ny, nz);
  28372. };
  28373. JPoint.prototype.trpl = function trpl() {
  28374. if (!this.curve.zeroA)
  28375. return this.dbl().add(this);
  28376. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
  28377. // 5M + 10S + ...
  28378. // XX = X1^2
  28379. var xx = this.x.redSqr();
  28380. // YY = Y1^2
  28381. var yy = this.y.redSqr();
  28382. // ZZ = Z1^2
  28383. var zz = this.z.redSqr();
  28384. // YYYY = YY^2
  28385. var yyyy = yy.redSqr();
  28386. // M = 3 * XX + a * ZZ2; a = 0
  28387. var m = xx.redAdd(xx).redIAdd(xx);
  28388. // MM = M^2
  28389. var mm = m.redSqr();
  28390. // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
  28391. var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  28392. e = e.redIAdd(e);
  28393. e = e.redAdd(e).redIAdd(e);
  28394. e = e.redISub(mm);
  28395. // EE = E^2
  28396. var ee = e.redSqr();
  28397. // T = 16*YYYY
  28398. var t = yyyy.redIAdd(yyyy);
  28399. t = t.redIAdd(t);
  28400. t = t.redIAdd(t);
  28401. t = t.redIAdd(t);
  28402. // U = (M + E)^2 - MM - EE - T
  28403. var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
  28404. // X3 = 4 * (X1 * EE - 4 * YY * U)
  28405. var yyu4 = yy.redMul(u);
  28406. yyu4 = yyu4.redIAdd(yyu4);
  28407. yyu4 = yyu4.redIAdd(yyu4);
  28408. var nx = this.x.redMul(ee).redISub(yyu4);
  28409. nx = nx.redIAdd(nx);
  28410. nx = nx.redIAdd(nx);
  28411. // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
  28412. var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
  28413. ny = ny.redIAdd(ny);
  28414. ny = ny.redIAdd(ny);
  28415. ny = ny.redIAdd(ny);
  28416. // Z3 = (Z1 + E)^2 - ZZ - EE
  28417. var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
  28418. return this.curve.jpoint(nx, ny, nz);
  28419. };
  28420. JPoint.prototype.mul = function mul(k, kbase) {
  28421. k = new BN(k, kbase);
  28422. return this.curve._wnafMul(this, k);
  28423. };
  28424. JPoint.prototype.eq = function eq(p) {
  28425. if (p.type === 'affine')
  28426. return this.eq(p.toJ());
  28427. if (this === p)
  28428. return true;
  28429. // x1 * z2^2 == x2 * z1^2
  28430. var z2 = this.z.redSqr();
  28431. var pz2 = p.z.redSqr();
  28432. if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
  28433. return false;
  28434. // y1 * z2^3 == y2 * z1^3
  28435. var z3 = z2.redMul(this.z);
  28436. var pz3 = pz2.redMul(p.z);
  28437. return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
  28438. };
  28439. JPoint.prototype.eqXToP = function eqXToP(x) {
  28440. var zs = this.z.redSqr();
  28441. var rx = x.toRed(this.curve.red).redMul(zs);
  28442. if (this.x.cmp(rx) === 0)
  28443. return true;
  28444. var xc = x.clone();
  28445. var t = this.curve.redN.redMul(zs);
  28446. for (;;) {
  28447. xc.iadd(this.curve.n);
  28448. if (xc.cmp(this.curve.p) >= 0)
  28449. return false;
  28450. rx.redIAdd(t);
  28451. if (this.x.cmp(rx) === 0)
  28452. return true;
  28453. }
  28454. };
  28455. JPoint.prototype.inspect = function inspect() {
  28456. if (this.isInfinity())
  28457. return '<EC JPoint Infinity>';
  28458. return '<EC JPoint x: ' + this.x.toString(16, 2) +
  28459. ' y: ' + this.y.toString(16, 2) +
  28460. ' z: ' + this.z.toString(16, 2) + '>';
  28461. };
  28462. JPoint.prototype.isInfinity = function isInfinity() {
  28463. // XXX This code assumes that zero is always zero in red
  28464. return this.z.cmpn(0) === 0;
  28465. };
  28466. /***/ }),
  28467. /* 203 */
  28468. /*!**********************************************************!*\
  28469. !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
  28470. \**********************************************************/
  28471. /*! no static exports found */
  28472. /***/ (function(module, exports, __webpack_require__) {
  28473. "use strict";
  28474. var BN = __webpack_require__(/*! bn.js */ 185);
  28475. var inherits = __webpack_require__(/*! inherits */ 109);
  28476. var Base = __webpack_require__(/*! ./base */ 201);
  28477. var utils = __webpack_require__(/*! ../utils */ 198);
  28478. function MontCurve(conf) {
  28479. Base.call(this, 'mont', conf);
  28480. this.a = new BN(conf.a, 16).toRed(this.red);
  28481. this.b = new BN(conf.b, 16).toRed(this.red);
  28482. this.i4 = new BN(4).toRed(this.red).redInvm();
  28483. this.two = new BN(2).toRed(this.red);
  28484. this.a24 = this.i4.redMul(this.a.redAdd(this.two));
  28485. }
  28486. inherits(MontCurve, Base);
  28487. module.exports = MontCurve;
  28488. MontCurve.prototype.validate = function validate(point) {
  28489. var x = point.normalize().x;
  28490. var x2 = x.redSqr();
  28491. var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
  28492. var y = rhs.redSqrt();
  28493. return y.redSqr().cmp(rhs) === 0;
  28494. };
  28495. function Point(curve, x, z) {
  28496. Base.BasePoint.call(this, curve, 'projective');
  28497. if (x === null && z === null) {
  28498. this.x = this.curve.one;
  28499. this.z = this.curve.zero;
  28500. } else {
  28501. this.x = new BN(x, 16);
  28502. this.z = new BN(z, 16);
  28503. if (!this.x.red)
  28504. this.x = this.x.toRed(this.curve.red);
  28505. if (!this.z.red)
  28506. this.z = this.z.toRed(this.curve.red);
  28507. }
  28508. }
  28509. inherits(Point, Base.BasePoint);
  28510. MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  28511. return this.point(utils.toArray(bytes, enc), 1);
  28512. };
  28513. MontCurve.prototype.point = function point(x, z) {
  28514. return new Point(this, x, z);
  28515. };
  28516. MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  28517. return Point.fromJSON(this, obj);
  28518. };
  28519. Point.prototype.precompute = function precompute() {
  28520. // No-op
  28521. };
  28522. Point.prototype._encode = function _encode() {
  28523. return this.getX().toArray('be', this.curve.p.byteLength());
  28524. };
  28525. Point.fromJSON = function fromJSON(curve, obj) {
  28526. return new Point(curve, obj[0], obj[1] || curve.one);
  28527. };
  28528. Point.prototype.inspect = function inspect() {
  28529. if (this.isInfinity())
  28530. return '<EC Point Infinity>';
  28531. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  28532. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  28533. };
  28534. Point.prototype.isInfinity = function isInfinity() {
  28535. // XXX This code assumes that zero is always zero in red
  28536. return this.z.cmpn(0) === 0;
  28537. };
  28538. Point.prototype.dbl = function dbl() {
  28539. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
  28540. // 2M + 2S + 4A
  28541. // A = X1 + Z1
  28542. var a = this.x.redAdd(this.z);
  28543. // AA = A^2
  28544. var aa = a.redSqr();
  28545. // B = X1 - Z1
  28546. var b = this.x.redSub(this.z);
  28547. // BB = B^2
  28548. var bb = b.redSqr();
  28549. // C = AA - BB
  28550. var c = aa.redSub(bb);
  28551. // X3 = AA * BB
  28552. var nx = aa.redMul(bb);
  28553. // Z3 = C * (BB + A24 * C)
  28554. var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
  28555. return this.curve.point(nx, nz);
  28556. };
  28557. Point.prototype.add = function add() {
  28558. throw new Error('Not supported on Montgomery curve');
  28559. };
  28560. Point.prototype.diffAdd = function diffAdd(p, diff) {
  28561. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
  28562. // 4M + 2S + 6A
  28563. // A = X2 + Z2
  28564. var a = this.x.redAdd(this.z);
  28565. // B = X2 - Z2
  28566. var b = this.x.redSub(this.z);
  28567. // C = X3 + Z3
  28568. var c = p.x.redAdd(p.z);
  28569. // D = X3 - Z3
  28570. var d = p.x.redSub(p.z);
  28571. // DA = D * A
  28572. var da = d.redMul(a);
  28573. // CB = C * B
  28574. var cb = c.redMul(b);
  28575. // X5 = Z1 * (DA + CB)^2
  28576. var nx = diff.z.redMul(da.redAdd(cb).redSqr());
  28577. // Z5 = X1 * (DA - CB)^2
  28578. var nz = diff.x.redMul(da.redISub(cb).redSqr());
  28579. return this.curve.point(nx, nz);
  28580. };
  28581. Point.prototype.mul = function mul(k) {
  28582. var t = k.clone();
  28583. var a = this; // (N / 2) * Q + Q
  28584. var b = this.curve.point(null, null); // (N / 2) * Q
  28585. var c = this; // Q
  28586. for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
  28587. bits.push(t.andln(1));
  28588. for (var i = bits.length - 1; i >= 0; i--) {
  28589. if (bits[i] === 0) {
  28590. // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
  28591. a = a.diffAdd(b, c);
  28592. // N * Q = 2 * ((N / 2) * Q + Q))
  28593. b = b.dbl();
  28594. } else {
  28595. // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
  28596. b = a.diffAdd(b, c);
  28597. // N * Q + Q = 2 * ((N / 2) * Q + Q)
  28598. a = a.dbl();
  28599. }
  28600. }
  28601. return b;
  28602. };
  28603. Point.prototype.mulAdd = function mulAdd() {
  28604. throw new Error('Not supported on Montgomery curve');
  28605. };
  28606. Point.prototype.jumlAdd = function jumlAdd() {
  28607. throw new Error('Not supported on Montgomery curve');
  28608. };
  28609. Point.prototype.eq = function eq(other) {
  28610. return this.getX().cmp(other.getX()) === 0;
  28611. };
  28612. Point.prototype.normalize = function normalize() {
  28613. this.x = this.x.redMul(this.z.redInvm());
  28614. this.z = this.curve.one;
  28615. return this;
  28616. };
  28617. Point.prototype.getX = function getX() {
  28618. // Normalize coordinates
  28619. this.normalize();
  28620. return this.x.fromRed();
  28621. };
  28622. /***/ }),
  28623. /* 204 */
  28624. /*!*************************************************************!*\
  28625. !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
  28626. \*************************************************************/
  28627. /*! no static exports found */
  28628. /***/ (function(module, exports, __webpack_require__) {
  28629. "use strict";
  28630. var utils = __webpack_require__(/*! ../utils */ 198);
  28631. var BN = __webpack_require__(/*! bn.js */ 185);
  28632. var inherits = __webpack_require__(/*! inherits */ 109);
  28633. var Base = __webpack_require__(/*! ./base */ 201);
  28634. var assert = utils.assert;
  28635. function EdwardsCurve(conf) {
  28636. // NOTE: Important as we are creating point in Base.call()
  28637. this.twisted = (conf.a | 0) !== 1;
  28638. this.mOneA = this.twisted && (conf.a | 0) === -1;
  28639. this.extended = this.mOneA;
  28640. Base.call(this, 'edwards', conf);
  28641. this.a = new BN(conf.a, 16).umod(this.red.m);
  28642. this.a = this.a.toRed(this.red);
  28643. this.c = new BN(conf.c, 16).toRed(this.red);
  28644. this.c2 = this.c.redSqr();
  28645. this.d = new BN(conf.d, 16).toRed(this.red);
  28646. this.dd = this.d.redAdd(this.d);
  28647. assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
  28648. this.oneC = (conf.c | 0) === 1;
  28649. }
  28650. inherits(EdwardsCurve, Base);
  28651. module.exports = EdwardsCurve;
  28652. EdwardsCurve.prototype._mulA = function _mulA(num) {
  28653. if (this.mOneA)
  28654. return num.redNeg();
  28655. else
  28656. return this.a.redMul(num);
  28657. };
  28658. EdwardsCurve.prototype._mulC = function _mulC(num) {
  28659. if (this.oneC)
  28660. return num;
  28661. else
  28662. return this.c.redMul(num);
  28663. };
  28664. // Just for compatibility with Short curve
  28665. EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
  28666. return this.point(x, y, z, t);
  28667. };
  28668. EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
  28669. x = new BN(x, 16);
  28670. if (!x.red)
  28671. x = x.toRed(this.red);
  28672. var x2 = x.redSqr();
  28673. var rhs = this.c2.redSub(this.a.redMul(x2));
  28674. var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
  28675. var y2 = rhs.redMul(lhs.redInvm());
  28676. var y = y2.redSqrt();
  28677. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  28678. throw new Error('invalid point');
  28679. var isOdd = y.fromRed().isOdd();
  28680. if (odd && !isOdd || !odd && isOdd)
  28681. y = y.redNeg();
  28682. return this.point(x, y);
  28683. };
  28684. EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
  28685. y = new BN(y, 16);
  28686. if (!y.red)
  28687. y = y.toRed(this.red);
  28688. // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
  28689. var y2 = y.redSqr();
  28690. var lhs = y2.redSub(this.c2);
  28691. var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
  28692. var x2 = lhs.redMul(rhs.redInvm());
  28693. if (x2.cmp(this.zero) === 0) {
  28694. if (odd)
  28695. throw new Error('invalid point');
  28696. else
  28697. return this.point(this.zero, y);
  28698. }
  28699. var x = x2.redSqrt();
  28700. if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
  28701. throw new Error('invalid point');
  28702. if (x.fromRed().isOdd() !== odd)
  28703. x = x.redNeg();
  28704. return this.point(x, y);
  28705. };
  28706. EdwardsCurve.prototype.validate = function validate(point) {
  28707. if (point.isInfinity())
  28708. return true;
  28709. // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
  28710. point.normalize();
  28711. var x2 = point.x.redSqr();
  28712. var y2 = point.y.redSqr();
  28713. var lhs = x2.redMul(this.a).redAdd(y2);
  28714. var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
  28715. return lhs.cmp(rhs) === 0;
  28716. };
  28717. function Point(curve, x, y, z, t) {
  28718. Base.BasePoint.call(this, curve, 'projective');
  28719. if (x === null && y === null && z === null) {
  28720. this.x = this.curve.zero;
  28721. this.y = this.curve.one;
  28722. this.z = this.curve.one;
  28723. this.t = this.curve.zero;
  28724. this.zOne = true;
  28725. } else {
  28726. this.x = new BN(x, 16);
  28727. this.y = new BN(y, 16);
  28728. this.z = z ? new BN(z, 16) : this.curve.one;
  28729. this.t = t && new BN(t, 16);
  28730. if (!this.x.red)
  28731. this.x = this.x.toRed(this.curve.red);
  28732. if (!this.y.red)
  28733. this.y = this.y.toRed(this.curve.red);
  28734. if (!this.z.red)
  28735. this.z = this.z.toRed(this.curve.red);
  28736. if (this.t && !this.t.red)
  28737. this.t = this.t.toRed(this.curve.red);
  28738. this.zOne = this.z === this.curve.one;
  28739. // Use extended coordinates
  28740. if (this.curve.extended && !this.t) {
  28741. this.t = this.x.redMul(this.y);
  28742. if (!this.zOne)
  28743. this.t = this.t.redMul(this.z.redInvm());
  28744. }
  28745. }
  28746. }
  28747. inherits(Point, Base.BasePoint);
  28748. EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  28749. return Point.fromJSON(this, obj);
  28750. };
  28751. EdwardsCurve.prototype.point = function point(x, y, z, t) {
  28752. return new Point(this, x, y, z, t);
  28753. };
  28754. Point.fromJSON = function fromJSON(curve, obj) {
  28755. return new Point(curve, obj[0], obj[1], obj[2]);
  28756. };
  28757. Point.prototype.inspect = function inspect() {
  28758. if (this.isInfinity())
  28759. return '<EC Point Infinity>';
  28760. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  28761. ' y: ' + this.y.fromRed().toString(16, 2) +
  28762. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  28763. };
  28764. Point.prototype.isInfinity = function isInfinity() {
  28765. // XXX This code assumes that zero is always zero in red
  28766. return this.x.cmpn(0) === 0 &&
  28767. (this.y.cmp(this.z) === 0 ||
  28768. (this.zOne && this.y.cmp(this.curve.c) === 0));
  28769. };
  28770. Point.prototype._extDbl = function _extDbl() {
  28771. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  28772. // #doubling-dbl-2008-hwcd
  28773. // 4M + 4S
  28774. // A = X1^2
  28775. var a = this.x.redSqr();
  28776. // B = Y1^2
  28777. var b = this.y.redSqr();
  28778. // C = 2 * Z1^2
  28779. var c = this.z.redSqr();
  28780. c = c.redIAdd(c);
  28781. // D = a * A
  28782. var d = this.curve._mulA(a);
  28783. // E = (X1 + Y1)^2 - A - B
  28784. var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
  28785. // G = D + B
  28786. var g = d.redAdd(b);
  28787. // F = G - C
  28788. var f = g.redSub(c);
  28789. // H = D - B
  28790. var h = d.redSub(b);
  28791. // X3 = E * F
  28792. var nx = e.redMul(f);
  28793. // Y3 = G * H
  28794. var ny = g.redMul(h);
  28795. // T3 = E * H
  28796. var nt = e.redMul(h);
  28797. // Z3 = F * G
  28798. var nz = f.redMul(g);
  28799. return this.curve.point(nx, ny, nz, nt);
  28800. };
  28801. Point.prototype._projDbl = function _projDbl() {
  28802. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  28803. // #doubling-dbl-2008-bbjlp
  28804. // #doubling-dbl-2007-bl
  28805. // and others
  28806. // Generally 3M + 4S or 2M + 4S
  28807. // B = (X1 + Y1)^2
  28808. var b = this.x.redAdd(this.y).redSqr();
  28809. // C = X1^2
  28810. var c = this.x.redSqr();
  28811. // D = Y1^2
  28812. var d = this.y.redSqr();
  28813. var nx;
  28814. var ny;
  28815. var nz;
  28816. var e;
  28817. var h;
  28818. var j;
  28819. if (this.curve.twisted) {
  28820. // E = a * C
  28821. e = this.curve._mulA(c);
  28822. // F = E + D
  28823. var f = e.redAdd(d);
  28824. if (this.zOne) {
  28825. // X3 = (B - C - D) * (F - 2)
  28826. nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
  28827. // Y3 = F * (E - D)
  28828. ny = f.redMul(e.redSub(d));
  28829. // Z3 = F^2 - 2 * F
  28830. nz = f.redSqr().redSub(f).redSub(f);
  28831. } else {
  28832. // H = Z1^2
  28833. h = this.z.redSqr();
  28834. // J = F - 2 * H
  28835. j = f.redSub(h).redISub(h);
  28836. // X3 = (B-C-D)*J
  28837. nx = b.redSub(c).redISub(d).redMul(j);
  28838. // Y3 = F * (E - D)
  28839. ny = f.redMul(e.redSub(d));
  28840. // Z3 = F * J
  28841. nz = f.redMul(j);
  28842. }
  28843. } else {
  28844. // E = C + D
  28845. e = c.redAdd(d);
  28846. // H = (c * Z1)^2
  28847. h = this.curve._mulC(this.z).redSqr();
  28848. // J = E - 2 * H
  28849. j = e.redSub(h).redSub(h);
  28850. // X3 = c * (B - E) * J
  28851. nx = this.curve._mulC(b.redISub(e)).redMul(j);
  28852. // Y3 = c * E * (C - D)
  28853. ny = this.curve._mulC(e).redMul(c.redISub(d));
  28854. // Z3 = E * J
  28855. nz = e.redMul(j);
  28856. }
  28857. return this.curve.point(nx, ny, nz);
  28858. };
  28859. Point.prototype.dbl = function dbl() {
  28860. if (this.isInfinity())
  28861. return this;
  28862. // Double in extended coordinates
  28863. if (this.curve.extended)
  28864. return this._extDbl();
  28865. else
  28866. return this._projDbl();
  28867. };
  28868. Point.prototype._extAdd = function _extAdd(p) {
  28869. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  28870. // #addition-add-2008-hwcd-3
  28871. // 8M
  28872. // A = (Y1 - X1) * (Y2 - X2)
  28873. var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
  28874. // B = (Y1 + X1) * (Y2 + X2)
  28875. var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
  28876. // C = T1 * k * T2
  28877. var c = this.t.redMul(this.curve.dd).redMul(p.t);
  28878. // D = Z1 * 2 * Z2
  28879. var d = this.z.redMul(p.z.redAdd(p.z));
  28880. // E = B - A
  28881. var e = b.redSub(a);
  28882. // F = D - C
  28883. var f = d.redSub(c);
  28884. // G = D + C
  28885. var g = d.redAdd(c);
  28886. // H = B + A
  28887. var h = b.redAdd(a);
  28888. // X3 = E * F
  28889. var nx = e.redMul(f);
  28890. // Y3 = G * H
  28891. var ny = g.redMul(h);
  28892. // T3 = E * H
  28893. var nt = e.redMul(h);
  28894. // Z3 = F * G
  28895. var nz = f.redMul(g);
  28896. return this.curve.point(nx, ny, nz, nt);
  28897. };
  28898. Point.prototype._projAdd = function _projAdd(p) {
  28899. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  28900. // #addition-add-2008-bbjlp
  28901. // #addition-add-2007-bl
  28902. // 10M + 1S
  28903. // A = Z1 * Z2
  28904. var a = this.z.redMul(p.z);
  28905. // B = A^2
  28906. var b = a.redSqr();
  28907. // C = X1 * X2
  28908. var c = this.x.redMul(p.x);
  28909. // D = Y1 * Y2
  28910. var d = this.y.redMul(p.y);
  28911. // E = d * C * D
  28912. var e = this.curve.d.redMul(c).redMul(d);
  28913. // F = B - E
  28914. var f = b.redSub(e);
  28915. // G = B + E
  28916. var g = b.redAdd(e);
  28917. // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
  28918. var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
  28919. var nx = a.redMul(f).redMul(tmp);
  28920. var ny;
  28921. var nz;
  28922. if (this.curve.twisted) {
  28923. // Y3 = A * G * (D - a * C)
  28924. ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
  28925. // Z3 = F * G
  28926. nz = f.redMul(g);
  28927. } else {
  28928. // Y3 = A * G * (D - C)
  28929. ny = a.redMul(g).redMul(d.redSub(c));
  28930. // Z3 = c * F * G
  28931. nz = this.curve._mulC(f).redMul(g);
  28932. }
  28933. return this.curve.point(nx, ny, nz);
  28934. };
  28935. Point.prototype.add = function add(p) {
  28936. if (this.isInfinity())
  28937. return p;
  28938. if (p.isInfinity())
  28939. return this;
  28940. if (this.curve.extended)
  28941. return this._extAdd(p);
  28942. else
  28943. return this._projAdd(p);
  28944. };
  28945. Point.prototype.mul = function mul(k) {
  28946. if (this._hasDoubles(k))
  28947. return this.curve._fixedNafMul(this, k);
  28948. else
  28949. return this.curve._wnafMul(this, k);
  28950. };
  28951. Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
  28952. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
  28953. };
  28954. Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
  28955. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
  28956. };
  28957. Point.prototype.normalize = function normalize() {
  28958. if (this.zOne)
  28959. return this;
  28960. // Normalize coordinates
  28961. var zi = this.z.redInvm();
  28962. this.x = this.x.redMul(zi);
  28963. this.y = this.y.redMul(zi);
  28964. if (this.t)
  28965. this.t = this.t.redMul(zi);
  28966. this.z = this.curve.one;
  28967. this.zOne = true;
  28968. return this;
  28969. };
  28970. Point.prototype.neg = function neg() {
  28971. return this.curve.point(this.x.redNeg(),
  28972. this.y,
  28973. this.z,
  28974. this.t && this.t.redNeg());
  28975. };
  28976. Point.prototype.getX = function getX() {
  28977. this.normalize();
  28978. return this.x.fromRed();
  28979. };
  28980. Point.prototype.getY = function getY() {
  28981. this.normalize();
  28982. return this.y.fromRed();
  28983. };
  28984. Point.prototype.eq = function eq(other) {
  28985. return this === other ||
  28986. this.getX().cmp(other.getX()) === 0 &&
  28987. this.getY().cmp(other.getY()) === 0;
  28988. };
  28989. Point.prototype.eqXToP = function eqXToP(x) {
  28990. var rx = x.toRed(this.curve.red).redMul(this.z);
  28991. if (this.x.cmp(rx) === 0)
  28992. return true;
  28993. var xc = x.clone();
  28994. var t = this.curve.redN.redMul(this.z);
  28995. for (;;) {
  28996. xc.iadd(this.curve.n);
  28997. if (xc.cmp(this.curve.p) >= 0)
  28998. return false;
  28999. rx.redIAdd(t);
  29000. if (this.x.cmp(rx) === 0)
  29001. return true;
  29002. }
  29003. };
  29004. // Compatibility with BaseCurve
  29005. Point.prototype.toP = Point.prototype.normalize;
  29006. Point.prototype.mixedAdd = Point.prototype.add;
  29007. /***/ }),
  29008. /* 205 */
  29009. /*!******************************************************!*\
  29010. !*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
  29011. \******************************************************/
  29012. /*! no static exports found */
  29013. /***/ (function(module, exports, __webpack_require__) {
  29014. "use strict";
  29015. var curves = exports;
  29016. var hash = __webpack_require__(/*! hash.js */ 206);
  29017. var curve = __webpack_require__(/*! ./curve */ 200);
  29018. var utils = __webpack_require__(/*! ./utils */ 198);
  29019. var assert = utils.assert;
  29020. function PresetCurve(options) {
  29021. if (options.type === 'short')
  29022. this.curve = new curve.short(options);
  29023. else if (options.type === 'edwards')
  29024. this.curve = new curve.edwards(options);
  29025. else
  29026. this.curve = new curve.mont(options);
  29027. this.g = this.curve.g;
  29028. this.n = this.curve.n;
  29029. this.hash = options.hash;
  29030. assert(this.g.validate(), 'Invalid curve');
  29031. assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
  29032. }
  29033. curves.PresetCurve = PresetCurve;
  29034. function defineCurve(name, options) {
  29035. Object.defineProperty(curves, name, {
  29036. configurable: true,
  29037. enumerable: true,
  29038. get: function() {
  29039. var curve = new PresetCurve(options);
  29040. Object.defineProperty(curves, name, {
  29041. configurable: true,
  29042. enumerable: true,
  29043. value: curve,
  29044. });
  29045. return curve;
  29046. },
  29047. });
  29048. }
  29049. defineCurve('p192', {
  29050. type: 'short',
  29051. prime: 'p192',
  29052. p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
  29053. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
  29054. b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
  29055. n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
  29056. hash: hash.sha256,
  29057. gRed: false,
  29058. g: [
  29059. '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
  29060. '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',
  29061. ],
  29062. });
  29063. defineCurve('p224', {
  29064. type: 'short',
  29065. prime: 'p224',
  29066. p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
  29067. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
  29068. b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
  29069. n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
  29070. hash: hash.sha256,
  29071. gRed: false,
  29072. g: [
  29073. 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
  29074. 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',
  29075. ],
  29076. });
  29077. defineCurve('p256', {
  29078. type: 'short',
  29079. prime: null,
  29080. p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
  29081. a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
  29082. b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
  29083. n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
  29084. hash: hash.sha256,
  29085. gRed: false,
  29086. g: [
  29087. '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
  29088. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',
  29089. ],
  29090. });
  29091. defineCurve('p384', {
  29092. type: 'short',
  29093. prime: null,
  29094. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29095. 'fffffffe ffffffff 00000000 00000000 ffffffff',
  29096. a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29097. 'fffffffe ffffffff 00000000 00000000 fffffffc',
  29098. b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
  29099. '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
  29100. n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
  29101. 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
  29102. hash: hash.sha384,
  29103. gRed: false,
  29104. g: [
  29105. 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
  29106. '5502f25d bf55296c 3a545e38 72760ab7',
  29107. '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
  29108. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',
  29109. ],
  29110. });
  29111. defineCurve('p521', {
  29112. type: 'short',
  29113. prime: null,
  29114. p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29115. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29116. 'ffffffff ffffffff ffffffff ffffffff ffffffff',
  29117. a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29118. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29119. 'ffffffff ffffffff ffffffff ffffffff fffffffc',
  29120. b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
  29121. '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
  29122. '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
  29123. n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  29124. 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
  29125. 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
  29126. hash: hash.sha512,
  29127. gRed: false,
  29128. g: [
  29129. '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
  29130. '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
  29131. 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
  29132. '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
  29133. '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
  29134. '3fad0761 353c7086 a272c240 88be9476 9fd16650',
  29135. ],
  29136. });
  29137. defineCurve('curve25519', {
  29138. type: 'mont',
  29139. prime: 'p25519',
  29140. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  29141. a: '76d06',
  29142. b: '1',
  29143. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  29144. hash: hash.sha256,
  29145. gRed: false,
  29146. g: [
  29147. '9',
  29148. ],
  29149. });
  29150. defineCurve('ed25519', {
  29151. type: 'edwards',
  29152. prime: 'p25519',
  29153. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  29154. a: '-1',
  29155. c: '1',
  29156. // -121665 * (121666^(-1)) (mod P)
  29157. d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
  29158. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  29159. hash: hash.sha256,
  29160. gRed: false,
  29161. g: [
  29162. '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
  29163. // 4/5
  29164. '6666666666666666666666666666666666666666666666666666666666666658',
  29165. ],
  29166. });
  29167. var pre;
  29168. try {
  29169. pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 218);
  29170. } catch (e) {
  29171. pre = undefined;
  29172. }
  29173. defineCurve('secp256k1', {
  29174. type: 'short',
  29175. prime: 'k256',
  29176. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
  29177. a: '0',
  29178. b: '7',
  29179. n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
  29180. h: '1',
  29181. hash: hash.sha256,
  29182. // Precomputed endomorphism
  29183. beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
  29184. lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
  29185. basis: [
  29186. {
  29187. a: '3086d221a7d46bcde86c90e49284eb15',
  29188. b: '-e4437ed6010e88286f547fa90abfe4c3',
  29189. },
  29190. {
  29191. a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
  29192. b: '3086d221a7d46bcde86c90e49284eb15',
  29193. },
  29194. ],
  29195. gRed: false,
  29196. g: [
  29197. '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  29198. '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
  29199. pre,
  29200. ],
  29201. });
  29202. /***/ }),
  29203. /* 206 */
  29204. /*!******************************************!*\
  29205. !*** ./node_modules/hash.js/lib/hash.js ***!
  29206. \******************************************/
  29207. /*! no static exports found */
  29208. /***/ (function(module, exports, __webpack_require__) {
  29209. var hash = exports;
  29210. hash.utils = __webpack_require__(/*! ./hash/utils */ 207);
  29211. hash.common = __webpack_require__(/*! ./hash/common */ 208);
  29212. hash.sha = __webpack_require__(/*! ./hash/sha */ 209);
  29213. hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 216);
  29214. hash.hmac = __webpack_require__(/*! ./hash/hmac */ 217);
  29215. // Proxy hash functions to the main object
  29216. hash.sha1 = hash.sha.sha1;
  29217. hash.sha256 = hash.sha.sha256;
  29218. hash.sha224 = hash.sha.sha224;
  29219. hash.sha384 = hash.sha.sha384;
  29220. hash.sha512 = hash.sha.sha512;
  29221. hash.ripemd160 = hash.ripemd.ripemd160;
  29222. /***/ }),
  29223. /* 207 */
  29224. /*!************************************************!*\
  29225. !*** ./node_modules/hash.js/lib/hash/utils.js ***!
  29226. \************************************************/
  29227. /*! no static exports found */
  29228. /***/ (function(module, exports, __webpack_require__) {
  29229. "use strict";
  29230. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  29231. var inherits = __webpack_require__(/*! inherits */ 109);
  29232. exports.inherits = inherits;
  29233. function isSurrogatePair(msg, i) {
  29234. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  29235. return false;
  29236. }
  29237. if (i < 0 || i + 1 >= msg.length) {
  29238. return false;
  29239. }
  29240. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  29241. }
  29242. function toArray(msg, enc) {
  29243. if (Array.isArray(msg))
  29244. return msg.slice();
  29245. if (!msg)
  29246. return [];
  29247. var res = [];
  29248. if (typeof msg === 'string') {
  29249. if (!enc) {
  29250. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  29251. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  29252. // Apache License 2.0
  29253. // https://github.com/google/closure-library/blob/master/LICENSE
  29254. var p = 0;
  29255. for (var i = 0; i < msg.length; i++) {
  29256. var c = msg.charCodeAt(i);
  29257. if (c < 128) {
  29258. res[p++] = c;
  29259. } else if (c < 2048) {
  29260. res[p++] = (c >> 6) | 192;
  29261. res[p++] = (c & 63) | 128;
  29262. } else if (isSurrogatePair(msg, i)) {
  29263. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  29264. res[p++] = (c >> 18) | 240;
  29265. res[p++] = ((c >> 12) & 63) | 128;
  29266. res[p++] = ((c >> 6) & 63) | 128;
  29267. res[p++] = (c & 63) | 128;
  29268. } else {
  29269. res[p++] = (c >> 12) | 224;
  29270. res[p++] = ((c >> 6) & 63) | 128;
  29271. res[p++] = (c & 63) | 128;
  29272. }
  29273. }
  29274. } else if (enc === 'hex') {
  29275. msg = msg.replace(/[^a-z0-9]+/ig, '');
  29276. if (msg.length % 2 !== 0)
  29277. msg = '0' + msg;
  29278. for (i = 0; i < msg.length; i += 2)
  29279. res.push(parseInt(msg[i] + msg[i + 1], 16));
  29280. }
  29281. } else {
  29282. for (i = 0; i < msg.length; i++)
  29283. res[i] = msg[i] | 0;
  29284. }
  29285. return res;
  29286. }
  29287. exports.toArray = toArray;
  29288. function toHex(msg) {
  29289. var res = '';
  29290. for (var i = 0; i < msg.length; i++)
  29291. res += zero2(msg[i].toString(16));
  29292. return res;
  29293. }
  29294. exports.toHex = toHex;
  29295. function htonl(w) {
  29296. var res = (w >>> 24) |
  29297. ((w >>> 8) & 0xff00) |
  29298. ((w << 8) & 0xff0000) |
  29299. ((w & 0xff) << 24);
  29300. return res >>> 0;
  29301. }
  29302. exports.htonl = htonl;
  29303. function toHex32(msg, endian) {
  29304. var res = '';
  29305. for (var i = 0; i < msg.length; i++) {
  29306. var w = msg[i];
  29307. if (endian === 'little')
  29308. w = htonl(w);
  29309. res += zero8(w.toString(16));
  29310. }
  29311. return res;
  29312. }
  29313. exports.toHex32 = toHex32;
  29314. function zero2(word) {
  29315. if (word.length === 1)
  29316. return '0' + word;
  29317. else
  29318. return word;
  29319. }
  29320. exports.zero2 = zero2;
  29321. function zero8(word) {
  29322. if (word.length === 7)
  29323. return '0' + word;
  29324. else if (word.length === 6)
  29325. return '00' + word;
  29326. else if (word.length === 5)
  29327. return '000' + word;
  29328. else if (word.length === 4)
  29329. return '0000' + word;
  29330. else if (word.length === 3)
  29331. return '00000' + word;
  29332. else if (word.length === 2)
  29333. return '000000' + word;
  29334. else if (word.length === 1)
  29335. return '0000000' + word;
  29336. else
  29337. return word;
  29338. }
  29339. exports.zero8 = zero8;
  29340. function join32(msg, start, end, endian) {
  29341. var len = end - start;
  29342. assert(len % 4 === 0);
  29343. var res = new Array(len / 4);
  29344. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  29345. var w;
  29346. if (endian === 'big')
  29347. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  29348. else
  29349. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  29350. res[i] = w >>> 0;
  29351. }
  29352. return res;
  29353. }
  29354. exports.join32 = join32;
  29355. function split32(msg, endian) {
  29356. var res = new Array(msg.length * 4);
  29357. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  29358. var m = msg[i];
  29359. if (endian === 'big') {
  29360. res[k] = m >>> 24;
  29361. res[k + 1] = (m >>> 16) & 0xff;
  29362. res[k + 2] = (m >>> 8) & 0xff;
  29363. res[k + 3] = m & 0xff;
  29364. } else {
  29365. res[k + 3] = m >>> 24;
  29366. res[k + 2] = (m >>> 16) & 0xff;
  29367. res[k + 1] = (m >>> 8) & 0xff;
  29368. res[k] = m & 0xff;
  29369. }
  29370. }
  29371. return res;
  29372. }
  29373. exports.split32 = split32;
  29374. function rotr32(w, b) {
  29375. return (w >>> b) | (w << (32 - b));
  29376. }
  29377. exports.rotr32 = rotr32;
  29378. function rotl32(w, b) {
  29379. return (w << b) | (w >>> (32 - b));
  29380. }
  29381. exports.rotl32 = rotl32;
  29382. function sum32(a, b) {
  29383. return (a + b) >>> 0;
  29384. }
  29385. exports.sum32 = sum32;
  29386. function sum32_3(a, b, c) {
  29387. return (a + b + c) >>> 0;
  29388. }
  29389. exports.sum32_3 = sum32_3;
  29390. function sum32_4(a, b, c, d) {
  29391. return (a + b + c + d) >>> 0;
  29392. }
  29393. exports.sum32_4 = sum32_4;
  29394. function sum32_5(a, b, c, d, e) {
  29395. return (a + b + c + d + e) >>> 0;
  29396. }
  29397. exports.sum32_5 = sum32_5;
  29398. function sum64(buf, pos, ah, al) {
  29399. var bh = buf[pos];
  29400. var bl = buf[pos + 1];
  29401. var lo = (al + bl) >>> 0;
  29402. var hi = (lo < al ? 1 : 0) + ah + bh;
  29403. buf[pos] = hi >>> 0;
  29404. buf[pos + 1] = lo;
  29405. }
  29406. exports.sum64 = sum64;
  29407. function sum64_hi(ah, al, bh, bl) {
  29408. var lo = (al + bl) >>> 0;
  29409. var hi = (lo < al ? 1 : 0) + ah + bh;
  29410. return hi >>> 0;
  29411. }
  29412. exports.sum64_hi = sum64_hi;
  29413. function sum64_lo(ah, al, bh, bl) {
  29414. var lo = al + bl;
  29415. return lo >>> 0;
  29416. }
  29417. exports.sum64_lo = sum64_lo;
  29418. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  29419. var carry = 0;
  29420. var lo = al;
  29421. lo = (lo + bl) >>> 0;
  29422. carry += lo < al ? 1 : 0;
  29423. lo = (lo + cl) >>> 0;
  29424. carry += lo < cl ? 1 : 0;
  29425. lo = (lo + dl) >>> 0;
  29426. carry += lo < dl ? 1 : 0;
  29427. var hi = ah + bh + ch + dh + carry;
  29428. return hi >>> 0;
  29429. }
  29430. exports.sum64_4_hi = sum64_4_hi;
  29431. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  29432. var lo = al + bl + cl + dl;
  29433. return lo >>> 0;
  29434. }
  29435. exports.sum64_4_lo = sum64_4_lo;
  29436. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  29437. var carry = 0;
  29438. var lo = al;
  29439. lo = (lo + bl) >>> 0;
  29440. carry += lo < al ? 1 : 0;
  29441. lo = (lo + cl) >>> 0;
  29442. carry += lo < cl ? 1 : 0;
  29443. lo = (lo + dl) >>> 0;
  29444. carry += lo < dl ? 1 : 0;
  29445. lo = (lo + el) >>> 0;
  29446. carry += lo < el ? 1 : 0;
  29447. var hi = ah + bh + ch + dh + eh + carry;
  29448. return hi >>> 0;
  29449. }
  29450. exports.sum64_5_hi = sum64_5_hi;
  29451. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  29452. var lo = al + bl + cl + dl + el;
  29453. return lo >>> 0;
  29454. }
  29455. exports.sum64_5_lo = sum64_5_lo;
  29456. function rotr64_hi(ah, al, num) {
  29457. var r = (al << (32 - num)) | (ah >>> num);
  29458. return r >>> 0;
  29459. }
  29460. exports.rotr64_hi = rotr64_hi;
  29461. function rotr64_lo(ah, al, num) {
  29462. var r = (ah << (32 - num)) | (al >>> num);
  29463. return r >>> 0;
  29464. }
  29465. exports.rotr64_lo = rotr64_lo;
  29466. function shr64_hi(ah, al, num) {
  29467. return ah >>> num;
  29468. }
  29469. exports.shr64_hi = shr64_hi;
  29470. function shr64_lo(ah, al, num) {
  29471. var r = (ah << (32 - num)) | (al >>> num);
  29472. return r >>> 0;
  29473. }
  29474. exports.shr64_lo = shr64_lo;
  29475. /***/ }),
  29476. /* 208 */
  29477. /*!*************************************************!*\
  29478. !*** ./node_modules/hash.js/lib/hash/common.js ***!
  29479. \*************************************************/
  29480. /*! no static exports found */
  29481. /***/ (function(module, exports, __webpack_require__) {
  29482. "use strict";
  29483. var utils = __webpack_require__(/*! ./utils */ 207);
  29484. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  29485. function BlockHash() {
  29486. this.pending = null;
  29487. this.pendingTotal = 0;
  29488. this.blockSize = this.constructor.blockSize;
  29489. this.outSize = this.constructor.outSize;
  29490. this.hmacStrength = this.constructor.hmacStrength;
  29491. this.padLength = this.constructor.padLength / 8;
  29492. this.endian = 'big';
  29493. this._delta8 = this.blockSize / 8;
  29494. this._delta32 = this.blockSize / 32;
  29495. }
  29496. exports.BlockHash = BlockHash;
  29497. BlockHash.prototype.update = function update(msg, enc) {
  29498. // Convert message to array, pad it, and join into 32bit blocks
  29499. msg = utils.toArray(msg, enc);
  29500. if (!this.pending)
  29501. this.pending = msg;
  29502. else
  29503. this.pending = this.pending.concat(msg);
  29504. this.pendingTotal += msg.length;
  29505. // Enough data, try updating
  29506. if (this.pending.length >= this._delta8) {
  29507. msg = this.pending;
  29508. // Process pending data in blocks
  29509. var r = msg.length % this._delta8;
  29510. this.pending = msg.slice(msg.length - r, msg.length);
  29511. if (this.pending.length === 0)
  29512. this.pending = null;
  29513. msg = utils.join32(msg, 0, msg.length - r, this.endian);
  29514. for (var i = 0; i < msg.length; i += this._delta32)
  29515. this._update(msg, i, i + this._delta32);
  29516. }
  29517. return this;
  29518. };
  29519. BlockHash.prototype.digest = function digest(enc) {
  29520. this.update(this._pad());
  29521. assert(this.pending === null);
  29522. return this._digest(enc);
  29523. };
  29524. BlockHash.prototype._pad = function pad() {
  29525. var len = this.pendingTotal;
  29526. var bytes = this._delta8;
  29527. var k = bytes - ((len + this.padLength) % bytes);
  29528. var res = new Array(k + this.padLength);
  29529. res[0] = 0x80;
  29530. for (var i = 1; i < k; i++)
  29531. res[i] = 0;
  29532. // Append length
  29533. len <<= 3;
  29534. if (this.endian === 'big') {
  29535. for (var t = 8; t < this.padLength; t++)
  29536. res[i++] = 0;
  29537. res[i++] = 0;
  29538. res[i++] = 0;
  29539. res[i++] = 0;
  29540. res[i++] = 0;
  29541. res[i++] = (len >>> 24) & 0xff;
  29542. res[i++] = (len >>> 16) & 0xff;
  29543. res[i++] = (len >>> 8) & 0xff;
  29544. res[i++] = len & 0xff;
  29545. } else {
  29546. res[i++] = len & 0xff;
  29547. res[i++] = (len >>> 8) & 0xff;
  29548. res[i++] = (len >>> 16) & 0xff;
  29549. res[i++] = (len >>> 24) & 0xff;
  29550. res[i++] = 0;
  29551. res[i++] = 0;
  29552. res[i++] = 0;
  29553. res[i++] = 0;
  29554. for (t = 8; t < this.padLength; t++)
  29555. res[i++] = 0;
  29556. }
  29557. return res;
  29558. };
  29559. /***/ }),
  29560. /* 209 */
  29561. /*!**********************************************!*\
  29562. !*** ./node_modules/hash.js/lib/hash/sha.js ***!
  29563. \**********************************************/
  29564. /*! no static exports found */
  29565. /***/ (function(module, exports, __webpack_require__) {
  29566. "use strict";
  29567. exports.sha1 = __webpack_require__(/*! ./sha/1 */ 210);
  29568. exports.sha224 = __webpack_require__(/*! ./sha/224 */ 212);
  29569. exports.sha256 = __webpack_require__(/*! ./sha/256 */ 213);
  29570. exports.sha384 = __webpack_require__(/*! ./sha/384 */ 214);
  29571. exports.sha512 = __webpack_require__(/*! ./sha/512 */ 215);
  29572. /***/ }),
  29573. /* 210 */
  29574. /*!************************************************!*\
  29575. !*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
  29576. \************************************************/
  29577. /*! no static exports found */
  29578. /***/ (function(module, exports, __webpack_require__) {
  29579. "use strict";
  29580. var utils = __webpack_require__(/*! ../utils */ 207);
  29581. var common = __webpack_require__(/*! ../common */ 208);
  29582. var shaCommon = __webpack_require__(/*! ./common */ 211);
  29583. var rotl32 = utils.rotl32;
  29584. var sum32 = utils.sum32;
  29585. var sum32_5 = utils.sum32_5;
  29586. var ft_1 = shaCommon.ft_1;
  29587. var BlockHash = common.BlockHash;
  29588. var sha1_K = [
  29589. 0x5A827999, 0x6ED9EBA1,
  29590. 0x8F1BBCDC, 0xCA62C1D6
  29591. ];
  29592. function SHA1() {
  29593. if (!(this instanceof SHA1))
  29594. return new SHA1();
  29595. BlockHash.call(this);
  29596. this.h = [
  29597. 0x67452301, 0xefcdab89, 0x98badcfe,
  29598. 0x10325476, 0xc3d2e1f0 ];
  29599. this.W = new Array(80);
  29600. }
  29601. utils.inherits(SHA1, BlockHash);
  29602. module.exports = SHA1;
  29603. SHA1.blockSize = 512;
  29604. SHA1.outSize = 160;
  29605. SHA1.hmacStrength = 80;
  29606. SHA1.padLength = 64;
  29607. SHA1.prototype._update = function _update(msg, start) {
  29608. var W = this.W;
  29609. for (var i = 0; i < 16; i++)
  29610. W[i] = msg[start + i];
  29611. for(; i < W.length; i++)
  29612. W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
  29613. var a = this.h[0];
  29614. var b = this.h[1];
  29615. var c = this.h[2];
  29616. var d = this.h[3];
  29617. var e = this.h[4];
  29618. for (i = 0; i < W.length; i++) {
  29619. var s = ~~(i / 20);
  29620. var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
  29621. e = d;
  29622. d = c;
  29623. c = rotl32(b, 30);
  29624. b = a;
  29625. a = t;
  29626. }
  29627. this.h[0] = sum32(this.h[0], a);
  29628. this.h[1] = sum32(this.h[1], b);
  29629. this.h[2] = sum32(this.h[2], c);
  29630. this.h[3] = sum32(this.h[3], d);
  29631. this.h[4] = sum32(this.h[4], e);
  29632. };
  29633. SHA1.prototype._digest = function digest(enc) {
  29634. if (enc === 'hex')
  29635. return utils.toHex32(this.h, 'big');
  29636. else
  29637. return utils.split32(this.h, 'big');
  29638. };
  29639. /***/ }),
  29640. /* 211 */
  29641. /*!*****************************************************!*\
  29642. !*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
  29643. \*****************************************************/
  29644. /*! no static exports found */
  29645. /***/ (function(module, exports, __webpack_require__) {
  29646. "use strict";
  29647. var utils = __webpack_require__(/*! ../utils */ 207);
  29648. var rotr32 = utils.rotr32;
  29649. function ft_1(s, x, y, z) {
  29650. if (s === 0)
  29651. return ch32(x, y, z);
  29652. if (s === 1 || s === 3)
  29653. return p32(x, y, z);
  29654. if (s === 2)
  29655. return maj32(x, y, z);
  29656. }
  29657. exports.ft_1 = ft_1;
  29658. function ch32(x, y, z) {
  29659. return (x & y) ^ ((~x) & z);
  29660. }
  29661. exports.ch32 = ch32;
  29662. function maj32(x, y, z) {
  29663. return (x & y) ^ (x & z) ^ (y & z);
  29664. }
  29665. exports.maj32 = maj32;
  29666. function p32(x, y, z) {
  29667. return x ^ y ^ z;
  29668. }
  29669. exports.p32 = p32;
  29670. function s0_256(x) {
  29671. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  29672. }
  29673. exports.s0_256 = s0_256;
  29674. function s1_256(x) {
  29675. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  29676. }
  29677. exports.s1_256 = s1_256;
  29678. function g0_256(x) {
  29679. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  29680. }
  29681. exports.g0_256 = g0_256;
  29682. function g1_256(x) {
  29683. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  29684. }
  29685. exports.g1_256 = g1_256;
  29686. /***/ }),
  29687. /* 212 */
  29688. /*!**************************************************!*\
  29689. !*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
  29690. \**************************************************/
  29691. /*! no static exports found */
  29692. /***/ (function(module, exports, __webpack_require__) {
  29693. "use strict";
  29694. var utils = __webpack_require__(/*! ../utils */ 207);
  29695. var SHA256 = __webpack_require__(/*! ./256 */ 213);
  29696. function SHA224() {
  29697. if (!(this instanceof SHA224))
  29698. return new SHA224();
  29699. SHA256.call(this);
  29700. this.h = [
  29701. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  29702. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
  29703. }
  29704. utils.inherits(SHA224, SHA256);
  29705. module.exports = SHA224;
  29706. SHA224.blockSize = 512;
  29707. SHA224.outSize = 224;
  29708. SHA224.hmacStrength = 192;
  29709. SHA224.padLength = 64;
  29710. SHA224.prototype._digest = function digest(enc) {
  29711. // Just truncate output
  29712. if (enc === 'hex')
  29713. return utils.toHex32(this.h.slice(0, 7), 'big');
  29714. else
  29715. return utils.split32(this.h.slice(0, 7), 'big');
  29716. };
  29717. /***/ }),
  29718. /* 213 */
  29719. /*!**************************************************!*\
  29720. !*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
  29721. \**************************************************/
  29722. /*! no static exports found */
  29723. /***/ (function(module, exports, __webpack_require__) {
  29724. "use strict";
  29725. var utils = __webpack_require__(/*! ../utils */ 207);
  29726. var common = __webpack_require__(/*! ../common */ 208);
  29727. var shaCommon = __webpack_require__(/*! ./common */ 211);
  29728. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  29729. var sum32 = utils.sum32;
  29730. var sum32_4 = utils.sum32_4;
  29731. var sum32_5 = utils.sum32_5;
  29732. var ch32 = shaCommon.ch32;
  29733. var maj32 = shaCommon.maj32;
  29734. var s0_256 = shaCommon.s0_256;
  29735. var s1_256 = shaCommon.s1_256;
  29736. var g0_256 = shaCommon.g0_256;
  29737. var g1_256 = shaCommon.g1_256;
  29738. var BlockHash = common.BlockHash;
  29739. var sha256_K = [
  29740. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  29741. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  29742. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  29743. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  29744. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  29745. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  29746. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  29747. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  29748. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  29749. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  29750. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  29751. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  29752. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  29753. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  29754. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  29755. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  29756. ];
  29757. function SHA256() {
  29758. if (!(this instanceof SHA256))
  29759. return new SHA256();
  29760. BlockHash.call(this);
  29761. this.h = [
  29762. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  29763. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  29764. ];
  29765. this.k = sha256_K;
  29766. this.W = new Array(64);
  29767. }
  29768. utils.inherits(SHA256, BlockHash);
  29769. module.exports = SHA256;
  29770. SHA256.blockSize = 512;
  29771. SHA256.outSize = 256;
  29772. SHA256.hmacStrength = 192;
  29773. SHA256.padLength = 64;
  29774. SHA256.prototype._update = function _update(msg, start) {
  29775. var W = this.W;
  29776. for (var i = 0; i < 16; i++)
  29777. W[i] = msg[start + i];
  29778. for (; i < W.length; i++)
  29779. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  29780. var a = this.h[0];
  29781. var b = this.h[1];
  29782. var c = this.h[2];
  29783. var d = this.h[3];
  29784. var e = this.h[4];
  29785. var f = this.h[5];
  29786. var g = this.h[6];
  29787. var h = this.h[7];
  29788. assert(this.k.length === W.length);
  29789. for (i = 0; i < W.length; i++) {
  29790. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  29791. var T2 = sum32(s0_256(a), maj32(a, b, c));
  29792. h = g;
  29793. g = f;
  29794. f = e;
  29795. e = sum32(d, T1);
  29796. d = c;
  29797. c = b;
  29798. b = a;
  29799. a = sum32(T1, T2);
  29800. }
  29801. this.h[0] = sum32(this.h[0], a);
  29802. this.h[1] = sum32(this.h[1], b);
  29803. this.h[2] = sum32(this.h[2], c);
  29804. this.h[3] = sum32(this.h[3], d);
  29805. this.h[4] = sum32(this.h[4], e);
  29806. this.h[5] = sum32(this.h[5], f);
  29807. this.h[6] = sum32(this.h[6], g);
  29808. this.h[7] = sum32(this.h[7], h);
  29809. };
  29810. SHA256.prototype._digest = function digest(enc) {
  29811. if (enc === 'hex')
  29812. return utils.toHex32(this.h, 'big');
  29813. else
  29814. return utils.split32(this.h, 'big');
  29815. };
  29816. /***/ }),
  29817. /* 214 */
  29818. /*!**************************************************!*\
  29819. !*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
  29820. \**************************************************/
  29821. /*! no static exports found */
  29822. /***/ (function(module, exports, __webpack_require__) {
  29823. "use strict";
  29824. var utils = __webpack_require__(/*! ../utils */ 207);
  29825. var SHA512 = __webpack_require__(/*! ./512 */ 215);
  29826. function SHA384() {
  29827. if (!(this instanceof SHA384))
  29828. return new SHA384();
  29829. SHA512.call(this);
  29830. this.h = [
  29831. 0xcbbb9d5d, 0xc1059ed8,
  29832. 0x629a292a, 0x367cd507,
  29833. 0x9159015a, 0x3070dd17,
  29834. 0x152fecd8, 0xf70e5939,
  29835. 0x67332667, 0xffc00b31,
  29836. 0x8eb44a87, 0x68581511,
  29837. 0xdb0c2e0d, 0x64f98fa7,
  29838. 0x47b5481d, 0xbefa4fa4 ];
  29839. }
  29840. utils.inherits(SHA384, SHA512);
  29841. module.exports = SHA384;
  29842. SHA384.blockSize = 1024;
  29843. SHA384.outSize = 384;
  29844. SHA384.hmacStrength = 192;
  29845. SHA384.padLength = 128;
  29846. SHA384.prototype._digest = function digest(enc) {
  29847. if (enc === 'hex')
  29848. return utils.toHex32(this.h.slice(0, 12), 'big');
  29849. else
  29850. return utils.split32(this.h.slice(0, 12), 'big');
  29851. };
  29852. /***/ }),
  29853. /* 215 */
  29854. /*!**************************************************!*\
  29855. !*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
  29856. \**************************************************/
  29857. /*! no static exports found */
  29858. /***/ (function(module, exports, __webpack_require__) {
  29859. "use strict";
  29860. var utils = __webpack_require__(/*! ../utils */ 207);
  29861. var common = __webpack_require__(/*! ../common */ 208);
  29862. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  29863. var rotr64_hi = utils.rotr64_hi;
  29864. var rotr64_lo = utils.rotr64_lo;
  29865. var shr64_hi = utils.shr64_hi;
  29866. var shr64_lo = utils.shr64_lo;
  29867. var sum64 = utils.sum64;
  29868. var sum64_hi = utils.sum64_hi;
  29869. var sum64_lo = utils.sum64_lo;
  29870. var sum64_4_hi = utils.sum64_4_hi;
  29871. var sum64_4_lo = utils.sum64_4_lo;
  29872. var sum64_5_hi = utils.sum64_5_hi;
  29873. var sum64_5_lo = utils.sum64_5_lo;
  29874. var BlockHash = common.BlockHash;
  29875. var sha512_K = [
  29876. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  29877. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  29878. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  29879. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  29880. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  29881. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  29882. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  29883. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  29884. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  29885. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  29886. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  29887. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  29888. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  29889. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  29890. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  29891. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  29892. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  29893. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  29894. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  29895. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  29896. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  29897. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  29898. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  29899. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  29900. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  29901. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  29902. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  29903. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  29904. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  29905. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  29906. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  29907. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  29908. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  29909. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  29910. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  29911. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  29912. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  29913. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  29914. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  29915. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  29916. ];
  29917. function SHA512() {
  29918. if (!(this instanceof SHA512))
  29919. return new SHA512();
  29920. BlockHash.call(this);
  29921. this.h = [
  29922. 0x6a09e667, 0xf3bcc908,
  29923. 0xbb67ae85, 0x84caa73b,
  29924. 0x3c6ef372, 0xfe94f82b,
  29925. 0xa54ff53a, 0x5f1d36f1,
  29926. 0x510e527f, 0xade682d1,
  29927. 0x9b05688c, 0x2b3e6c1f,
  29928. 0x1f83d9ab, 0xfb41bd6b,
  29929. 0x5be0cd19, 0x137e2179 ];
  29930. this.k = sha512_K;
  29931. this.W = new Array(160);
  29932. }
  29933. utils.inherits(SHA512, BlockHash);
  29934. module.exports = SHA512;
  29935. SHA512.blockSize = 1024;
  29936. SHA512.outSize = 512;
  29937. SHA512.hmacStrength = 192;
  29938. SHA512.padLength = 128;
  29939. SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
  29940. var W = this.W;
  29941. // 32 x 32bit words
  29942. for (var i = 0; i < 32; i++)
  29943. W[i] = msg[start + i];
  29944. for (; i < W.length; i += 2) {
  29945. var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
  29946. var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
  29947. var c1_hi = W[i - 14]; // i - 7
  29948. var c1_lo = W[i - 13];
  29949. var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
  29950. var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
  29951. var c3_hi = W[i - 32]; // i - 16
  29952. var c3_lo = W[i - 31];
  29953. W[i] = sum64_4_hi(
  29954. c0_hi, c0_lo,
  29955. c1_hi, c1_lo,
  29956. c2_hi, c2_lo,
  29957. c3_hi, c3_lo);
  29958. W[i + 1] = sum64_4_lo(
  29959. c0_hi, c0_lo,
  29960. c1_hi, c1_lo,
  29961. c2_hi, c2_lo,
  29962. c3_hi, c3_lo);
  29963. }
  29964. };
  29965. SHA512.prototype._update = function _update(msg, start) {
  29966. this._prepareBlock(msg, start);
  29967. var W = this.W;
  29968. var ah = this.h[0];
  29969. var al = this.h[1];
  29970. var bh = this.h[2];
  29971. var bl = this.h[3];
  29972. var ch = this.h[4];
  29973. var cl = this.h[5];
  29974. var dh = this.h[6];
  29975. var dl = this.h[7];
  29976. var eh = this.h[8];
  29977. var el = this.h[9];
  29978. var fh = this.h[10];
  29979. var fl = this.h[11];
  29980. var gh = this.h[12];
  29981. var gl = this.h[13];
  29982. var hh = this.h[14];
  29983. var hl = this.h[15];
  29984. assert(this.k.length === W.length);
  29985. for (var i = 0; i < W.length; i += 2) {
  29986. var c0_hi = hh;
  29987. var c0_lo = hl;
  29988. var c1_hi = s1_512_hi(eh, el);
  29989. var c1_lo = s1_512_lo(eh, el);
  29990. var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
  29991. var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
  29992. var c3_hi = this.k[i];
  29993. var c3_lo = this.k[i + 1];
  29994. var c4_hi = W[i];
  29995. var c4_lo = W[i + 1];
  29996. var T1_hi = sum64_5_hi(
  29997. c0_hi, c0_lo,
  29998. c1_hi, c1_lo,
  29999. c2_hi, c2_lo,
  30000. c3_hi, c3_lo,
  30001. c4_hi, c4_lo);
  30002. var T1_lo = sum64_5_lo(
  30003. c0_hi, c0_lo,
  30004. c1_hi, c1_lo,
  30005. c2_hi, c2_lo,
  30006. c3_hi, c3_lo,
  30007. c4_hi, c4_lo);
  30008. c0_hi = s0_512_hi(ah, al);
  30009. c0_lo = s0_512_lo(ah, al);
  30010. c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
  30011. c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
  30012. var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
  30013. var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
  30014. hh = gh;
  30015. hl = gl;
  30016. gh = fh;
  30017. gl = fl;
  30018. fh = eh;
  30019. fl = el;
  30020. eh = sum64_hi(dh, dl, T1_hi, T1_lo);
  30021. el = sum64_lo(dl, dl, T1_hi, T1_lo);
  30022. dh = ch;
  30023. dl = cl;
  30024. ch = bh;
  30025. cl = bl;
  30026. bh = ah;
  30027. bl = al;
  30028. ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
  30029. al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
  30030. }
  30031. sum64(this.h, 0, ah, al);
  30032. sum64(this.h, 2, bh, bl);
  30033. sum64(this.h, 4, ch, cl);
  30034. sum64(this.h, 6, dh, dl);
  30035. sum64(this.h, 8, eh, el);
  30036. sum64(this.h, 10, fh, fl);
  30037. sum64(this.h, 12, gh, gl);
  30038. sum64(this.h, 14, hh, hl);
  30039. };
  30040. SHA512.prototype._digest = function digest(enc) {
  30041. if (enc === 'hex')
  30042. return utils.toHex32(this.h, 'big');
  30043. else
  30044. return utils.split32(this.h, 'big');
  30045. };
  30046. function ch64_hi(xh, xl, yh, yl, zh) {
  30047. var r = (xh & yh) ^ ((~xh) & zh);
  30048. if (r < 0)
  30049. r += 0x100000000;
  30050. return r;
  30051. }
  30052. function ch64_lo(xh, xl, yh, yl, zh, zl) {
  30053. var r = (xl & yl) ^ ((~xl) & zl);
  30054. if (r < 0)
  30055. r += 0x100000000;
  30056. return r;
  30057. }
  30058. function maj64_hi(xh, xl, yh, yl, zh) {
  30059. var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
  30060. if (r < 0)
  30061. r += 0x100000000;
  30062. return r;
  30063. }
  30064. function maj64_lo(xh, xl, yh, yl, zh, zl) {
  30065. var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
  30066. if (r < 0)
  30067. r += 0x100000000;
  30068. return r;
  30069. }
  30070. function s0_512_hi(xh, xl) {
  30071. var c0_hi = rotr64_hi(xh, xl, 28);
  30072. var c1_hi = rotr64_hi(xl, xh, 2); // 34
  30073. var c2_hi = rotr64_hi(xl, xh, 7); // 39
  30074. var r = c0_hi ^ c1_hi ^ c2_hi;
  30075. if (r < 0)
  30076. r += 0x100000000;
  30077. return r;
  30078. }
  30079. function s0_512_lo(xh, xl) {
  30080. var c0_lo = rotr64_lo(xh, xl, 28);
  30081. var c1_lo = rotr64_lo(xl, xh, 2); // 34
  30082. var c2_lo = rotr64_lo(xl, xh, 7); // 39
  30083. var r = c0_lo ^ c1_lo ^ c2_lo;
  30084. if (r < 0)
  30085. r += 0x100000000;
  30086. return r;
  30087. }
  30088. function s1_512_hi(xh, xl) {
  30089. var c0_hi = rotr64_hi(xh, xl, 14);
  30090. var c1_hi = rotr64_hi(xh, xl, 18);
  30091. var c2_hi = rotr64_hi(xl, xh, 9); // 41
  30092. var r = c0_hi ^ c1_hi ^ c2_hi;
  30093. if (r < 0)
  30094. r += 0x100000000;
  30095. return r;
  30096. }
  30097. function s1_512_lo(xh, xl) {
  30098. var c0_lo = rotr64_lo(xh, xl, 14);
  30099. var c1_lo = rotr64_lo(xh, xl, 18);
  30100. var c2_lo = rotr64_lo(xl, xh, 9); // 41
  30101. var r = c0_lo ^ c1_lo ^ c2_lo;
  30102. if (r < 0)
  30103. r += 0x100000000;
  30104. return r;
  30105. }
  30106. function g0_512_hi(xh, xl) {
  30107. var c0_hi = rotr64_hi(xh, xl, 1);
  30108. var c1_hi = rotr64_hi(xh, xl, 8);
  30109. var c2_hi = shr64_hi(xh, xl, 7);
  30110. var r = c0_hi ^ c1_hi ^ c2_hi;
  30111. if (r < 0)
  30112. r += 0x100000000;
  30113. return r;
  30114. }
  30115. function g0_512_lo(xh, xl) {
  30116. var c0_lo = rotr64_lo(xh, xl, 1);
  30117. var c1_lo = rotr64_lo(xh, xl, 8);
  30118. var c2_lo = shr64_lo(xh, xl, 7);
  30119. var r = c0_lo ^ c1_lo ^ c2_lo;
  30120. if (r < 0)
  30121. r += 0x100000000;
  30122. return r;
  30123. }
  30124. function g1_512_hi(xh, xl) {
  30125. var c0_hi = rotr64_hi(xh, xl, 19);
  30126. var c1_hi = rotr64_hi(xl, xh, 29); // 61
  30127. var c2_hi = shr64_hi(xh, xl, 6);
  30128. var r = c0_hi ^ c1_hi ^ c2_hi;
  30129. if (r < 0)
  30130. r += 0x100000000;
  30131. return r;
  30132. }
  30133. function g1_512_lo(xh, xl) {
  30134. var c0_lo = rotr64_lo(xh, xl, 19);
  30135. var c1_lo = rotr64_lo(xl, xh, 29); // 61
  30136. var c2_lo = shr64_lo(xh, xl, 6);
  30137. var r = c0_lo ^ c1_lo ^ c2_lo;
  30138. if (r < 0)
  30139. r += 0x100000000;
  30140. return r;
  30141. }
  30142. /***/ }),
  30143. /* 216 */
  30144. /*!*************************************************!*\
  30145. !*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
  30146. \*************************************************/
  30147. /*! no static exports found */
  30148. /***/ (function(module, exports, __webpack_require__) {
  30149. "use strict";
  30150. var utils = __webpack_require__(/*! ./utils */ 207);
  30151. var common = __webpack_require__(/*! ./common */ 208);
  30152. var rotl32 = utils.rotl32;
  30153. var sum32 = utils.sum32;
  30154. var sum32_3 = utils.sum32_3;
  30155. var sum32_4 = utils.sum32_4;
  30156. var BlockHash = common.BlockHash;
  30157. function RIPEMD160() {
  30158. if (!(this instanceof RIPEMD160))
  30159. return new RIPEMD160();
  30160. BlockHash.call(this);
  30161. this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
  30162. this.endian = 'little';
  30163. }
  30164. utils.inherits(RIPEMD160, BlockHash);
  30165. exports.ripemd160 = RIPEMD160;
  30166. RIPEMD160.blockSize = 512;
  30167. RIPEMD160.outSize = 160;
  30168. RIPEMD160.hmacStrength = 192;
  30169. RIPEMD160.padLength = 64;
  30170. RIPEMD160.prototype._update = function update(msg, start) {
  30171. var A = this.h[0];
  30172. var B = this.h[1];
  30173. var C = this.h[2];
  30174. var D = this.h[3];
  30175. var E = this.h[4];
  30176. var Ah = A;
  30177. var Bh = B;
  30178. var Ch = C;
  30179. var Dh = D;
  30180. var Eh = E;
  30181. for (var j = 0; j < 80; j++) {
  30182. var T = sum32(
  30183. rotl32(
  30184. sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
  30185. s[j]),
  30186. E);
  30187. A = E;
  30188. E = D;
  30189. D = rotl32(C, 10);
  30190. C = B;
  30191. B = T;
  30192. T = sum32(
  30193. rotl32(
  30194. sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
  30195. sh[j]),
  30196. Eh);
  30197. Ah = Eh;
  30198. Eh = Dh;
  30199. Dh = rotl32(Ch, 10);
  30200. Ch = Bh;
  30201. Bh = T;
  30202. }
  30203. T = sum32_3(this.h[1], C, Dh);
  30204. this.h[1] = sum32_3(this.h[2], D, Eh);
  30205. this.h[2] = sum32_3(this.h[3], E, Ah);
  30206. this.h[3] = sum32_3(this.h[4], A, Bh);
  30207. this.h[4] = sum32_3(this.h[0], B, Ch);
  30208. this.h[0] = T;
  30209. };
  30210. RIPEMD160.prototype._digest = function digest(enc) {
  30211. if (enc === 'hex')
  30212. return utils.toHex32(this.h, 'little');
  30213. else
  30214. return utils.split32(this.h, 'little');
  30215. };
  30216. function f(j, x, y, z) {
  30217. if (j <= 15)
  30218. return x ^ y ^ z;
  30219. else if (j <= 31)
  30220. return (x & y) | ((~x) & z);
  30221. else if (j <= 47)
  30222. return (x | (~y)) ^ z;
  30223. else if (j <= 63)
  30224. return (x & z) | (y & (~z));
  30225. else
  30226. return x ^ (y | (~z));
  30227. }
  30228. function K(j) {
  30229. if (j <= 15)
  30230. return 0x00000000;
  30231. else if (j <= 31)
  30232. return 0x5a827999;
  30233. else if (j <= 47)
  30234. return 0x6ed9eba1;
  30235. else if (j <= 63)
  30236. return 0x8f1bbcdc;
  30237. else
  30238. return 0xa953fd4e;
  30239. }
  30240. function Kh(j) {
  30241. if (j <= 15)
  30242. return 0x50a28be6;
  30243. else if (j <= 31)
  30244. return 0x5c4dd124;
  30245. else if (j <= 47)
  30246. return 0x6d703ef3;
  30247. else if (j <= 63)
  30248. return 0x7a6d76e9;
  30249. else
  30250. return 0x00000000;
  30251. }
  30252. var r = [
  30253. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  30254. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  30255. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  30256. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  30257. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  30258. ];
  30259. var rh = [
  30260. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  30261. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  30262. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  30263. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  30264. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  30265. ];
  30266. var s = [
  30267. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  30268. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  30269. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  30270. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  30271. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  30272. ];
  30273. var sh = [
  30274. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  30275. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  30276. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  30277. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  30278. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  30279. ];
  30280. /***/ }),
  30281. /* 217 */
  30282. /*!***********************************************!*\
  30283. !*** ./node_modules/hash.js/lib/hash/hmac.js ***!
  30284. \***********************************************/
  30285. /*! no static exports found */
  30286. /***/ (function(module, exports, __webpack_require__) {
  30287. "use strict";
  30288. var utils = __webpack_require__(/*! ./utils */ 207);
  30289. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  30290. function Hmac(hash, key, enc) {
  30291. if (!(this instanceof Hmac))
  30292. return new Hmac(hash, key, enc);
  30293. this.Hash = hash;
  30294. this.blockSize = hash.blockSize / 8;
  30295. this.outSize = hash.outSize / 8;
  30296. this.inner = null;
  30297. this.outer = null;
  30298. this._init(utils.toArray(key, enc));
  30299. }
  30300. module.exports = Hmac;
  30301. Hmac.prototype._init = function init(key) {
  30302. // Shorten key, if needed
  30303. if (key.length > this.blockSize)
  30304. key = new this.Hash().update(key).digest();
  30305. assert(key.length <= this.blockSize);
  30306. // Add padding to key
  30307. for (var i = key.length; i < this.blockSize; i++)
  30308. key.push(0);
  30309. for (i = 0; i < key.length; i++)
  30310. key[i] ^= 0x36;
  30311. this.inner = new this.Hash().update(key);
  30312. // 0x36 ^ 0x5c = 0x6a
  30313. for (i = 0; i < key.length; i++)
  30314. key[i] ^= 0x6a;
  30315. this.outer = new this.Hash().update(key);
  30316. };
  30317. Hmac.prototype.update = function update(msg, enc) {
  30318. this.inner.update(msg, enc);
  30319. return this;
  30320. };
  30321. Hmac.prototype.digest = function digest(enc) {
  30322. this.outer.update(this.inner.digest());
  30323. return this.outer.digest(enc);
  30324. };
  30325. /***/ }),
  30326. /* 218 */
  30327. /*!*********************************************************************!*\
  30328. !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
  30329. \*********************************************************************/
  30330. /*! no static exports found */
  30331. /***/ (function(module, exports) {
  30332. module.exports = {
  30333. doubles: {
  30334. step: 4,
  30335. points: [
  30336. [
  30337. 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
  30338. 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821',
  30339. ],
  30340. [
  30341. '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
  30342. '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf',
  30343. ],
  30344. [
  30345. '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
  30346. 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695',
  30347. ],
  30348. [
  30349. '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
  30350. '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9',
  30351. ],
  30352. [
  30353. '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
  30354. '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36',
  30355. ],
  30356. [
  30357. '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
  30358. '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f',
  30359. ],
  30360. [
  30361. 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
  30362. '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999',
  30363. ],
  30364. [
  30365. '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
  30366. 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09',
  30367. ],
  30368. [
  30369. 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
  30370. '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d',
  30371. ],
  30372. [
  30373. 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
  30374. 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088',
  30375. ],
  30376. [
  30377. 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
  30378. '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d',
  30379. ],
  30380. [
  30381. '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
  30382. '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8',
  30383. ],
  30384. [
  30385. '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
  30386. '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a',
  30387. ],
  30388. [
  30389. '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
  30390. '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453',
  30391. ],
  30392. [
  30393. '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
  30394. '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160',
  30395. ],
  30396. [
  30397. '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
  30398. '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0',
  30399. ],
  30400. [
  30401. '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
  30402. '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6',
  30403. ],
  30404. [
  30405. '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
  30406. '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589',
  30407. ],
  30408. [
  30409. '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
  30410. 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17',
  30411. ],
  30412. [
  30413. 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
  30414. '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda',
  30415. ],
  30416. [
  30417. 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
  30418. '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd',
  30419. ],
  30420. [
  30421. '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
  30422. '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2',
  30423. ],
  30424. [
  30425. '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
  30426. '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6',
  30427. ],
  30428. [
  30429. 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
  30430. '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f',
  30431. ],
  30432. [
  30433. '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
  30434. 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01',
  30435. ],
  30436. [
  30437. 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
  30438. '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3',
  30439. ],
  30440. [
  30441. 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
  30442. 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f',
  30443. ],
  30444. [
  30445. 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
  30446. '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7',
  30447. ],
  30448. [
  30449. 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
  30450. 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78',
  30451. ],
  30452. [
  30453. 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
  30454. '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1',
  30455. ],
  30456. [
  30457. '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
  30458. 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150',
  30459. ],
  30460. [
  30461. '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
  30462. '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82',
  30463. ],
  30464. [
  30465. 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
  30466. '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc',
  30467. ],
  30468. [
  30469. '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
  30470. 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b',
  30471. ],
  30472. [
  30473. 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
  30474. '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51',
  30475. ],
  30476. [
  30477. 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
  30478. '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45',
  30479. ],
  30480. [
  30481. 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
  30482. 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120',
  30483. ],
  30484. [
  30485. '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
  30486. '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84',
  30487. ],
  30488. [
  30489. '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
  30490. '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d',
  30491. ],
  30492. [
  30493. '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
  30494. 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d',
  30495. ],
  30496. [
  30497. '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
  30498. '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8',
  30499. ],
  30500. [
  30501. 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
  30502. '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8',
  30503. ],
  30504. [
  30505. '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
  30506. '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac',
  30507. ],
  30508. [
  30509. '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
  30510. 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f',
  30511. ],
  30512. [
  30513. '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
  30514. '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962',
  30515. ],
  30516. [
  30517. 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
  30518. '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907',
  30519. ],
  30520. [
  30521. '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
  30522. 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec',
  30523. ],
  30524. [
  30525. 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
  30526. 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d',
  30527. ],
  30528. [
  30529. 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
  30530. '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414',
  30531. ],
  30532. [
  30533. '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
  30534. 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd',
  30535. ],
  30536. [
  30537. '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
  30538. 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0',
  30539. ],
  30540. [
  30541. 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
  30542. '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811',
  30543. ],
  30544. [
  30545. 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
  30546. '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1',
  30547. ],
  30548. [
  30549. 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
  30550. '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c',
  30551. ],
  30552. [
  30553. '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
  30554. 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73',
  30555. ],
  30556. [
  30557. '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
  30558. '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd',
  30559. ],
  30560. [
  30561. 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
  30562. 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405',
  30563. ],
  30564. [
  30565. '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
  30566. 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589',
  30567. ],
  30568. [
  30569. '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
  30570. '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e',
  30571. ],
  30572. [
  30573. '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
  30574. '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27',
  30575. ],
  30576. [
  30577. 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
  30578. 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1',
  30579. ],
  30580. [
  30581. '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
  30582. '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482',
  30583. ],
  30584. [
  30585. '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
  30586. '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945',
  30587. ],
  30588. [
  30589. 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
  30590. '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573',
  30591. ],
  30592. [
  30593. 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
  30594. 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82',
  30595. ],
  30596. ],
  30597. },
  30598. naf: {
  30599. wnd: 7,
  30600. points: [
  30601. [
  30602. 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
  30603. '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672',
  30604. ],
  30605. [
  30606. '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
  30607. 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6',
  30608. ],
  30609. [
  30610. '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
  30611. '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da',
  30612. ],
  30613. [
  30614. 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
  30615. 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37',
  30616. ],
  30617. [
  30618. '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
  30619. 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b',
  30620. ],
  30621. [
  30622. 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
  30623. 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81',
  30624. ],
  30625. [
  30626. 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
  30627. '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58',
  30628. ],
  30629. [
  30630. 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
  30631. '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77',
  30632. ],
  30633. [
  30634. '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
  30635. '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a',
  30636. ],
  30637. [
  30638. '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
  30639. '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c',
  30640. ],
  30641. [
  30642. '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
  30643. '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67',
  30644. ],
  30645. [
  30646. '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
  30647. '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402',
  30648. ],
  30649. [
  30650. 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
  30651. 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55',
  30652. ],
  30653. [
  30654. 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
  30655. '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482',
  30656. ],
  30657. [
  30658. '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
  30659. 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82',
  30660. ],
  30661. [
  30662. '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
  30663. 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396',
  30664. ],
  30665. [
  30666. '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
  30667. '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49',
  30668. ],
  30669. [
  30670. '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
  30671. '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf',
  30672. ],
  30673. [
  30674. '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
  30675. '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a',
  30676. ],
  30677. [
  30678. '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
  30679. 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7',
  30680. ],
  30681. [
  30682. 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
  30683. 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933',
  30684. ],
  30685. [
  30686. '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
  30687. '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a',
  30688. ],
  30689. [
  30690. '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
  30691. '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6',
  30692. ],
  30693. [
  30694. 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
  30695. 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37',
  30696. ],
  30697. [
  30698. '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
  30699. '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e',
  30700. ],
  30701. [
  30702. 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
  30703. 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6',
  30704. ],
  30705. [
  30706. 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
  30707. 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476',
  30708. ],
  30709. [
  30710. '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
  30711. '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40',
  30712. ],
  30713. [
  30714. '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
  30715. '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61',
  30716. ],
  30717. [
  30718. '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
  30719. '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683',
  30720. ],
  30721. [
  30722. 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
  30723. '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5',
  30724. ],
  30725. [
  30726. '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
  30727. '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b',
  30728. ],
  30729. [
  30730. 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
  30731. '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417',
  30732. ],
  30733. [
  30734. '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
  30735. 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868',
  30736. ],
  30737. [
  30738. '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
  30739. 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a',
  30740. ],
  30741. [
  30742. 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
  30743. 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6',
  30744. ],
  30745. [
  30746. '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
  30747. '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996',
  30748. ],
  30749. [
  30750. '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
  30751. 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e',
  30752. ],
  30753. [
  30754. 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
  30755. 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d',
  30756. ],
  30757. [
  30758. '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
  30759. '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2',
  30760. ],
  30761. [
  30762. '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
  30763. 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e',
  30764. ],
  30765. [
  30766. '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
  30767. '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437',
  30768. ],
  30769. [
  30770. '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
  30771. 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311',
  30772. ],
  30773. [
  30774. 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
  30775. '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4',
  30776. ],
  30777. [
  30778. '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
  30779. '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575',
  30780. ],
  30781. [
  30782. '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
  30783. 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d',
  30784. ],
  30785. [
  30786. '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
  30787. 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d',
  30788. ],
  30789. [
  30790. 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
  30791. 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629',
  30792. ],
  30793. [
  30794. 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
  30795. 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06',
  30796. ],
  30797. [
  30798. '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
  30799. '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374',
  30800. ],
  30801. [
  30802. '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
  30803. '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee',
  30804. ],
  30805. [
  30806. 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
  30807. '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1',
  30808. ],
  30809. [
  30810. 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
  30811. 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b',
  30812. ],
  30813. [
  30814. '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
  30815. '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661',
  30816. ],
  30817. [
  30818. '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
  30819. '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6',
  30820. ],
  30821. [
  30822. 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
  30823. '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e',
  30824. ],
  30825. [
  30826. '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
  30827. '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d',
  30828. ],
  30829. [
  30830. 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
  30831. 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc',
  30832. ],
  30833. [
  30834. '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
  30835. 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4',
  30836. ],
  30837. [
  30838. '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
  30839. '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c',
  30840. ],
  30841. [
  30842. 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
  30843. '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b',
  30844. ],
  30845. [
  30846. 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
  30847. '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913',
  30848. ],
  30849. [
  30850. '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
  30851. '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154',
  30852. ],
  30853. [
  30854. '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
  30855. '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865',
  30856. ],
  30857. [
  30858. '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
  30859. 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc',
  30860. ],
  30861. [
  30862. '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
  30863. 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224',
  30864. ],
  30865. [
  30866. '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
  30867. '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e',
  30868. ],
  30869. [
  30870. '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
  30871. '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6',
  30872. ],
  30873. [
  30874. '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
  30875. '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511',
  30876. ],
  30877. [
  30878. '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
  30879. 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b',
  30880. ],
  30881. [
  30882. 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
  30883. 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2',
  30884. ],
  30885. [
  30886. '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
  30887. 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c',
  30888. ],
  30889. [
  30890. 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
  30891. '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3',
  30892. ],
  30893. [
  30894. 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
  30895. '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d',
  30896. ],
  30897. [
  30898. 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
  30899. '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700',
  30900. ],
  30901. [
  30902. 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
  30903. '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4',
  30904. ],
  30905. [
  30906. '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
  30907. 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196',
  30908. ],
  30909. [
  30910. '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
  30911. '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4',
  30912. ],
  30913. [
  30914. '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
  30915. 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257',
  30916. ],
  30917. [
  30918. 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
  30919. 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13',
  30920. ],
  30921. [
  30922. 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
  30923. '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096',
  30924. ],
  30925. [
  30926. 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
  30927. 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38',
  30928. ],
  30929. [
  30930. 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
  30931. '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f',
  30932. ],
  30933. [
  30934. '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
  30935. '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448',
  30936. ],
  30937. [
  30938. 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
  30939. '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a',
  30940. ],
  30941. [
  30942. 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
  30943. '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4',
  30944. ],
  30945. [
  30946. '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
  30947. '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437',
  30948. ],
  30949. [
  30950. '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
  30951. 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7',
  30952. ],
  30953. [
  30954. 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
  30955. '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d',
  30956. ],
  30957. [
  30958. 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
  30959. '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a',
  30960. ],
  30961. [
  30962. 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
  30963. '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54',
  30964. ],
  30965. [
  30966. '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
  30967. '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77',
  30968. ],
  30969. [
  30970. 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
  30971. 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517',
  30972. ],
  30973. [
  30974. '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
  30975. 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10',
  30976. ],
  30977. [
  30978. 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
  30979. 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125',
  30980. ],
  30981. [
  30982. 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
  30983. '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e',
  30984. ],
  30985. [
  30986. '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
  30987. 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1',
  30988. ],
  30989. [
  30990. 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
  30991. '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2',
  30992. ],
  30993. [
  30994. 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
  30995. '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423',
  30996. ],
  30997. [
  30998. 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
  30999. '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8',
  31000. ],
  31001. [
  31002. '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
  31003. 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758',
  31004. ],
  31005. [
  31006. '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
  31007. 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375',
  31008. ],
  31009. [
  31010. 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
  31011. '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d',
  31012. ],
  31013. [
  31014. '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
  31015. 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec',
  31016. ],
  31017. [
  31018. '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
  31019. '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0',
  31020. ],
  31021. [
  31022. '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
  31023. 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c',
  31024. ],
  31025. [
  31026. 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
  31027. 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4',
  31028. ],
  31029. [
  31030. '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
  31031. 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f',
  31032. ],
  31033. [
  31034. '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
  31035. '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649',
  31036. ],
  31037. [
  31038. '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
  31039. 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826',
  31040. ],
  31041. [
  31042. '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
  31043. '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5',
  31044. ],
  31045. [
  31046. 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
  31047. 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87',
  31048. ],
  31049. [
  31050. '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
  31051. '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b',
  31052. ],
  31053. [
  31054. 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
  31055. '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc',
  31056. ],
  31057. [
  31058. '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
  31059. '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c',
  31060. ],
  31061. [
  31062. 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
  31063. 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f',
  31064. ],
  31065. [
  31066. 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
  31067. '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a',
  31068. ],
  31069. [
  31070. 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
  31071. 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46',
  31072. ],
  31073. [
  31074. '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
  31075. 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f',
  31076. ],
  31077. [
  31078. '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
  31079. '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03',
  31080. ],
  31081. [
  31082. '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
  31083. 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08',
  31084. ],
  31085. [
  31086. '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
  31087. '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8',
  31088. ],
  31089. [
  31090. '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
  31091. '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373',
  31092. ],
  31093. [
  31094. '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
  31095. 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3',
  31096. ],
  31097. [
  31098. '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
  31099. '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8',
  31100. ],
  31101. [
  31102. '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
  31103. '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1',
  31104. ],
  31105. [
  31106. '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
  31107. '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9',
  31108. ],
  31109. ],
  31110. },
  31111. };
  31112. /***/ }),
  31113. /* 219 */
  31114. /*!********************************************************!*\
  31115. !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
  31116. \********************************************************/
  31117. /*! no static exports found */
  31118. /***/ (function(module, exports, __webpack_require__) {
  31119. "use strict";
  31120. var BN = __webpack_require__(/*! bn.js */ 185);
  31121. var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 220);
  31122. var utils = __webpack_require__(/*! ../utils */ 198);
  31123. var curves = __webpack_require__(/*! ../curves */ 205);
  31124. var rand = __webpack_require__(/*! brorand */ 189);
  31125. var assert = utils.assert;
  31126. var KeyPair = __webpack_require__(/*! ./key */ 221);
  31127. var Signature = __webpack_require__(/*! ./signature */ 222);
  31128. function EC(options) {
  31129. if (!(this instanceof EC))
  31130. return new EC(options);
  31131. // Shortcut `elliptic.ec(curve-name)`
  31132. if (typeof options === 'string') {
  31133. assert(Object.prototype.hasOwnProperty.call(curves, options),
  31134. 'Unknown curve ' + options);
  31135. options = curves[options];
  31136. }
  31137. // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  31138. if (options instanceof curves.PresetCurve)
  31139. options = { curve: options };
  31140. this.curve = options.curve.curve;
  31141. this.n = this.curve.n;
  31142. this.nh = this.n.ushrn(1);
  31143. this.g = this.curve.g;
  31144. // Point on curve
  31145. this.g = options.curve.g;
  31146. this.g.precompute(options.curve.n.bitLength() + 1);
  31147. // Hash for function for DRBG
  31148. this.hash = options.hash || options.curve.hash;
  31149. }
  31150. module.exports = EC;
  31151. EC.prototype.keyPair = function keyPair(options) {
  31152. return new KeyPair(this, options);
  31153. };
  31154. EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
  31155. return KeyPair.fromPrivate(this, priv, enc);
  31156. };
  31157. EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
  31158. return KeyPair.fromPublic(this, pub, enc);
  31159. };
  31160. EC.prototype.genKeyPair = function genKeyPair(options) {
  31161. if (!options)
  31162. options = {};
  31163. // Instantiate Hmac_DRBG
  31164. var drbg = new HmacDRBG({
  31165. hash: this.hash,
  31166. pers: options.pers,
  31167. persEnc: options.persEnc || 'utf8',
  31168. entropy: options.entropy || rand(this.hash.hmacStrength),
  31169. entropyEnc: options.entropy && options.entropyEnc || 'utf8',
  31170. nonce: this.n.toArray(),
  31171. });
  31172. var bytes = this.n.byteLength();
  31173. var ns2 = this.n.sub(new BN(2));
  31174. for (;;) {
  31175. var priv = new BN(drbg.generate(bytes));
  31176. if (priv.cmp(ns2) > 0)
  31177. continue;
  31178. priv.iaddn(1);
  31179. return this.keyFromPrivate(priv);
  31180. }
  31181. };
  31182. EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {
  31183. var delta = msg.byteLength() * 8 - this.n.bitLength();
  31184. if (delta > 0)
  31185. msg = msg.ushrn(delta);
  31186. if (!truncOnly && msg.cmp(this.n) >= 0)
  31187. return msg.sub(this.n);
  31188. else
  31189. return msg;
  31190. };
  31191. EC.prototype.sign = function sign(msg, key, enc, options) {
  31192. if (typeof enc === 'object') {
  31193. options = enc;
  31194. enc = null;
  31195. }
  31196. if (!options)
  31197. options = {};
  31198. key = this.keyFromPrivate(key, enc);
  31199. msg = this._truncateToN(new BN(msg, 16));
  31200. // Zero-extend key to provide enough entropy
  31201. var bytes = this.n.byteLength();
  31202. var bkey = key.getPrivate().toArray('be', bytes);
  31203. // Zero-extend nonce to have the same byte size as N
  31204. var nonce = msg.toArray('be', bytes);
  31205. // Instantiate Hmac_DRBG
  31206. var drbg = new HmacDRBG({
  31207. hash: this.hash,
  31208. entropy: bkey,
  31209. nonce: nonce,
  31210. pers: options.pers,
  31211. persEnc: options.persEnc || 'utf8',
  31212. });
  31213. // Number of bytes to generate
  31214. var ns1 = this.n.sub(new BN(1));
  31215. for (var iter = 0; ; iter++) {
  31216. var k = options.k ?
  31217. options.k(iter) :
  31218. new BN(drbg.generate(this.n.byteLength()));
  31219. k = this._truncateToN(k, true);
  31220. if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
  31221. continue;
  31222. var kp = this.g.mul(k);
  31223. if (kp.isInfinity())
  31224. continue;
  31225. var kpX = kp.getX();
  31226. var r = kpX.umod(this.n);
  31227. if (r.cmpn(0) === 0)
  31228. continue;
  31229. var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
  31230. s = s.umod(this.n);
  31231. if (s.cmpn(0) === 0)
  31232. continue;
  31233. var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
  31234. (kpX.cmp(r) !== 0 ? 2 : 0);
  31235. // Use complement of `s`, if it is > `n / 2`
  31236. if (options.canonical && s.cmp(this.nh) > 0) {
  31237. s = this.n.sub(s);
  31238. recoveryParam ^= 1;
  31239. }
  31240. return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
  31241. }
  31242. };
  31243. EC.prototype.verify = function verify(msg, signature, key, enc) {
  31244. msg = this._truncateToN(new BN(msg, 16));
  31245. key = this.keyFromPublic(key, enc);
  31246. signature = new Signature(signature, 'hex');
  31247. // Perform primitive values validation
  31248. var r = signature.r;
  31249. var s = signature.s;
  31250. if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
  31251. return false;
  31252. if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
  31253. return false;
  31254. // Validate signature
  31255. var sinv = s.invm(this.n);
  31256. var u1 = sinv.mul(msg).umod(this.n);
  31257. var u2 = sinv.mul(r).umod(this.n);
  31258. var p;
  31259. if (!this.curve._maxwellTrick) {
  31260. p = this.g.mulAdd(u1, key.getPublic(), u2);
  31261. if (p.isInfinity())
  31262. return false;
  31263. return p.getX().umod(this.n).cmp(r) === 0;
  31264. }
  31265. // NOTE: Greg Maxwell's trick, inspired by:
  31266. // https://git.io/vad3K
  31267. p = this.g.jmulAdd(u1, key.getPublic(), u2);
  31268. if (p.isInfinity())
  31269. return false;
  31270. // Compare `p.x` of Jacobian point with `r`,
  31271. // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
  31272. // inverse of `p.z^2`
  31273. return p.eqXToP(r);
  31274. };
  31275. EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
  31276. assert((3 & j) === j, 'The recovery param is more than two bits');
  31277. signature = new Signature(signature, enc);
  31278. var n = this.n;
  31279. var e = new BN(msg);
  31280. var r = signature.r;
  31281. var s = signature.s;
  31282. // A set LSB signifies that the y-coordinate is odd
  31283. var isYOdd = j & 1;
  31284. var isSecondKey = j >> 1;
  31285. if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
  31286. throw new Error('Unable to find sencond key candinate');
  31287. // 1.1. Let x = r + jn.
  31288. if (isSecondKey)
  31289. r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
  31290. else
  31291. r = this.curve.pointFromX(r, isYOdd);
  31292. var rInv = signature.r.invm(n);
  31293. var s1 = n.sub(e).mul(rInv).umod(n);
  31294. var s2 = s.mul(rInv).umod(n);
  31295. // 1.6.1 Compute Q = r^-1 (sR - eG)
  31296. // Q = r^-1 (sR + -eG)
  31297. return this.g.mulAdd(s1, r, s2);
  31298. };
  31299. EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
  31300. signature = new Signature(signature, enc);
  31301. if (signature.recoveryParam !== null)
  31302. return signature.recoveryParam;
  31303. for (var i = 0; i < 4; i++) {
  31304. var Qprime;
  31305. try {
  31306. Qprime = this.recoverPubKey(e, signature, i);
  31307. } catch (e) {
  31308. continue;
  31309. }
  31310. if (Qprime.eq(Q))
  31311. return i;
  31312. }
  31313. throw new Error('Unable to find valid recovery factor');
  31314. };
  31315. /***/ }),
  31316. /* 220 */
  31317. /*!*************************************************!*\
  31318. !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
  31319. \*************************************************/
  31320. /*! no static exports found */
  31321. /***/ (function(module, exports, __webpack_require__) {
  31322. "use strict";
  31323. var hash = __webpack_require__(/*! hash.js */ 206);
  31324. var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 199);
  31325. var assert = __webpack_require__(/*! minimalistic-assert */ 159);
  31326. function HmacDRBG(options) {
  31327. if (!(this instanceof HmacDRBG))
  31328. return new HmacDRBG(options);
  31329. this.hash = options.hash;
  31330. this.predResist = !!options.predResist;
  31331. this.outLen = this.hash.outSize;
  31332. this.minEntropy = options.minEntropy || this.hash.hmacStrength;
  31333. this._reseed = null;
  31334. this.reseedInterval = null;
  31335. this.K = null;
  31336. this.V = null;
  31337. var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
  31338. var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
  31339. var pers = utils.toArray(options.pers, options.persEnc || 'hex');
  31340. assert(entropy.length >= (this.minEntropy / 8),
  31341. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  31342. this._init(entropy, nonce, pers);
  31343. }
  31344. module.exports = HmacDRBG;
  31345. HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
  31346. var seed = entropy.concat(nonce).concat(pers);
  31347. this.K = new Array(this.outLen / 8);
  31348. this.V = new Array(this.outLen / 8);
  31349. for (var i = 0; i < this.V.length; i++) {
  31350. this.K[i] = 0x00;
  31351. this.V[i] = 0x01;
  31352. }
  31353. this._update(seed);
  31354. this._reseed = 1;
  31355. this.reseedInterval = 0x1000000000000; // 2^48
  31356. };
  31357. HmacDRBG.prototype._hmac = function hmac() {
  31358. return new hash.hmac(this.hash, this.K);
  31359. };
  31360. HmacDRBG.prototype._update = function update(seed) {
  31361. var kmac = this._hmac()
  31362. .update(this.V)
  31363. .update([ 0x00 ]);
  31364. if (seed)
  31365. kmac = kmac.update(seed);
  31366. this.K = kmac.digest();
  31367. this.V = this._hmac().update(this.V).digest();
  31368. if (!seed)
  31369. return;
  31370. this.K = this._hmac()
  31371. .update(this.V)
  31372. .update([ 0x01 ])
  31373. .update(seed)
  31374. .digest();
  31375. this.V = this._hmac().update(this.V).digest();
  31376. };
  31377. HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
  31378. // Optional entropy enc
  31379. if (typeof entropyEnc !== 'string') {
  31380. addEnc = add;
  31381. add = entropyEnc;
  31382. entropyEnc = null;
  31383. }
  31384. entropy = utils.toArray(entropy, entropyEnc);
  31385. add = utils.toArray(add, addEnc);
  31386. assert(entropy.length >= (this.minEntropy / 8),
  31387. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  31388. this._update(entropy.concat(add || []));
  31389. this._reseed = 1;
  31390. };
  31391. HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
  31392. if (this._reseed > this.reseedInterval)
  31393. throw new Error('Reseed is required');
  31394. // Optional encoding
  31395. if (typeof enc !== 'string') {
  31396. addEnc = add;
  31397. add = enc;
  31398. enc = null;
  31399. }
  31400. // Optional additional data
  31401. if (add) {
  31402. add = utils.toArray(add, addEnc || 'hex');
  31403. this._update(add);
  31404. }
  31405. var temp = [];
  31406. while (temp.length < len) {
  31407. this.V = this._hmac().update(this.V).digest();
  31408. temp = temp.concat(this.V);
  31409. }
  31410. var res = temp.slice(0, len);
  31411. this._update(add);
  31412. this._reseed++;
  31413. return utils.encode(res, enc);
  31414. };
  31415. /***/ }),
  31416. /* 221 */
  31417. /*!******************************************************!*\
  31418. !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
  31419. \******************************************************/
  31420. /*! no static exports found */
  31421. /***/ (function(module, exports, __webpack_require__) {
  31422. "use strict";
  31423. var BN = __webpack_require__(/*! bn.js */ 185);
  31424. var utils = __webpack_require__(/*! ../utils */ 198);
  31425. var assert = utils.assert;
  31426. function KeyPair(ec, options) {
  31427. this.ec = ec;
  31428. this.priv = null;
  31429. this.pub = null;
  31430. // KeyPair(ec, { priv: ..., pub: ... })
  31431. if (options.priv)
  31432. this._importPrivate(options.priv, options.privEnc);
  31433. if (options.pub)
  31434. this._importPublic(options.pub, options.pubEnc);
  31435. }
  31436. module.exports = KeyPair;
  31437. KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
  31438. if (pub instanceof KeyPair)
  31439. return pub;
  31440. return new KeyPair(ec, {
  31441. pub: pub,
  31442. pubEnc: enc,
  31443. });
  31444. };
  31445. KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
  31446. if (priv instanceof KeyPair)
  31447. return priv;
  31448. return new KeyPair(ec, {
  31449. priv: priv,
  31450. privEnc: enc,
  31451. });
  31452. };
  31453. KeyPair.prototype.validate = function validate() {
  31454. var pub = this.getPublic();
  31455. if (pub.isInfinity())
  31456. return { result: false, reason: 'Invalid public key' };
  31457. if (!pub.validate())
  31458. return { result: false, reason: 'Public key is not a point' };
  31459. if (!pub.mul(this.ec.curve.n).isInfinity())
  31460. return { result: false, reason: 'Public key * N != O' };
  31461. return { result: true, reason: null };
  31462. };
  31463. KeyPair.prototype.getPublic = function getPublic(compact, enc) {
  31464. // compact is optional argument
  31465. if (typeof compact === 'string') {
  31466. enc = compact;
  31467. compact = null;
  31468. }
  31469. if (!this.pub)
  31470. this.pub = this.ec.g.mul(this.priv);
  31471. if (!enc)
  31472. return this.pub;
  31473. return this.pub.encode(enc, compact);
  31474. };
  31475. KeyPair.prototype.getPrivate = function getPrivate(enc) {
  31476. if (enc === 'hex')
  31477. return this.priv.toString(16, 2);
  31478. else
  31479. return this.priv;
  31480. };
  31481. KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
  31482. this.priv = new BN(key, enc || 16);
  31483. // Ensure that the priv won't be bigger than n, otherwise we may fail
  31484. // in fixed multiplication method
  31485. this.priv = this.priv.umod(this.ec.curve.n);
  31486. };
  31487. KeyPair.prototype._importPublic = function _importPublic(key, enc) {
  31488. if (key.x || key.y) {
  31489. // Montgomery points only have an `x` coordinate.
  31490. // Weierstrass/Edwards points on the other hand have both `x` and
  31491. // `y` coordinates.
  31492. if (this.ec.curve.type === 'mont') {
  31493. assert(key.x, 'Need x coordinate');
  31494. } else if (this.ec.curve.type === 'short' ||
  31495. this.ec.curve.type === 'edwards') {
  31496. assert(key.x && key.y, 'Need both x and y coordinate');
  31497. }
  31498. this.pub = this.ec.curve.point(key.x, key.y);
  31499. return;
  31500. }
  31501. this.pub = this.ec.curve.decodePoint(key, enc);
  31502. };
  31503. // ECDH
  31504. KeyPair.prototype.derive = function derive(pub) {
  31505. if(!pub.validate()) {
  31506. assert(pub.validate(), 'public point not validated');
  31507. }
  31508. return pub.mul(this.priv).getX();
  31509. };
  31510. // ECDSA
  31511. KeyPair.prototype.sign = function sign(msg, enc, options) {
  31512. return this.ec.sign(msg, this, enc, options);
  31513. };
  31514. KeyPair.prototype.verify = function verify(msg, signature) {
  31515. return this.ec.verify(msg, signature, this);
  31516. };
  31517. KeyPair.prototype.inspect = function inspect() {
  31518. return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
  31519. ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
  31520. };
  31521. /***/ }),
  31522. /* 222 */
  31523. /*!************************************************************!*\
  31524. !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
  31525. \************************************************************/
  31526. /*! no static exports found */
  31527. /***/ (function(module, exports, __webpack_require__) {
  31528. "use strict";
  31529. var BN = __webpack_require__(/*! bn.js */ 185);
  31530. var utils = __webpack_require__(/*! ../utils */ 198);
  31531. var assert = utils.assert;
  31532. function Signature(options, enc) {
  31533. if (options instanceof Signature)
  31534. return options;
  31535. if (this._importDER(options, enc))
  31536. return;
  31537. assert(options.r && options.s, 'Signature without r or s');
  31538. this.r = new BN(options.r, 16);
  31539. this.s = new BN(options.s, 16);
  31540. if (options.recoveryParam === undefined)
  31541. this.recoveryParam = null;
  31542. else
  31543. this.recoveryParam = options.recoveryParam;
  31544. }
  31545. module.exports = Signature;
  31546. function Position() {
  31547. this.place = 0;
  31548. }
  31549. function getLength(buf, p) {
  31550. var initial = buf[p.place++];
  31551. if (!(initial & 0x80)) {
  31552. return initial;
  31553. }
  31554. var octetLen = initial & 0xf;
  31555. // Indefinite length or overflow
  31556. if (octetLen === 0 || octetLen > 4) {
  31557. return false;
  31558. }
  31559. var val = 0;
  31560. for (var i = 0, off = p.place; i < octetLen; i++, off++) {
  31561. val <<= 8;
  31562. val |= buf[off];
  31563. val >>>= 0;
  31564. }
  31565. // Leading zeroes
  31566. if (val <= 0x7f) {
  31567. return false;
  31568. }
  31569. p.place = off;
  31570. return val;
  31571. }
  31572. function rmPadding(buf) {
  31573. var i = 0;
  31574. var len = buf.length - 1;
  31575. while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
  31576. i++;
  31577. }
  31578. if (i === 0) {
  31579. return buf;
  31580. }
  31581. return buf.slice(i);
  31582. }
  31583. Signature.prototype._importDER = function _importDER(data, enc) {
  31584. data = utils.toArray(data, enc);
  31585. var p = new Position();
  31586. if (data[p.place++] !== 0x30) {
  31587. return false;
  31588. }
  31589. var len = getLength(data, p);
  31590. if (len === false) {
  31591. return false;
  31592. }
  31593. if ((len + p.place) !== data.length) {
  31594. return false;
  31595. }
  31596. if (data[p.place++] !== 0x02) {
  31597. return false;
  31598. }
  31599. var rlen = getLength(data, p);
  31600. if (rlen === false) {
  31601. return false;
  31602. }
  31603. var r = data.slice(p.place, rlen + p.place);
  31604. p.place += rlen;
  31605. if (data[p.place++] !== 0x02) {
  31606. return false;
  31607. }
  31608. var slen = getLength(data, p);
  31609. if (slen === false) {
  31610. return false;
  31611. }
  31612. if (data.length !== slen + p.place) {
  31613. return false;
  31614. }
  31615. var s = data.slice(p.place, slen + p.place);
  31616. if (r[0] === 0) {
  31617. if (r[1] & 0x80) {
  31618. r = r.slice(1);
  31619. } else {
  31620. // Leading zeroes
  31621. return false;
  31622. }
  31623. }
  31624. if (s[0] === 0) {
  31625. if (s[1] & 0x80) {
  31626. s = s.slice(1);
  31627. } else {
  31628. // Leading zeroes
  31629. return false;
  31630. }
  31631. }
  31632. this.r = new BN(r);
  31633. this.s = new BN(s);
  31634. this.recoveryParam = null;
  31635. return true;
  31636. };
  31637. function constructLength(arr, len) {
  31638. if (len < 0x80) {
  31639. arr.push(len);
  31640. return;
  31641. }
  31642. var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
  31643. arr.push(octets | 0x80);
  31644. while (--octets) {
  31645. arr.push((len >>> (octets << 3)) & 0xff);
  31646. }
  31647. arr.push(len);
  31648. }
  31649. Signature.prototype.toDER = function toDER(enc) {
  31650. var r = this.r.toArray();
  31651. var s = this.s.toArray();
  31652. // Pad values
  31653. if (r[0] & 0x80)
  31654. r = [ 0 ].concat(r);
  31655. // Pad values
  31656. if (s[0] & 0x80)
  31657. s = [ 0 ].concat(s);
  31658. r = rmPadding(r);
  31659. s = rmPadding(s);
  31660. while (!s[0] && !(s[1] & 0x80)) {
  31661. s = s.slice(1);
  31662. }
  31663. var arr = [ 0x02 ];
  31664. constructLength(arr, r.length);
  31665. arr = arr.concat(r);
  31666. arr.push(0x02);
  31667. constructLength(arr, s.length);
  31668. var backHalf = arr.concat(s);
  31669. var res = [ 0x30 ];
  31670. constructLength(res, backHalf.length);
  31671. res = res.concat(backHalf);
  31672. return utils.encode(res, enc);
  31673. };
  31674. /***/ }),
  31675. /* 223 */
  31676. /*!***********************************************************!*\
  31677. !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
  31678. \***********************************************************/
  31679. /*! no static exports found */
  31680. /***/ (function(module, exports, __webpack_require__) {
  31681. "use strict";
  31682. var hash = __webpack_require__(/*! hash.js */ 206);
  31683. var curves = __webpack_require__(/*! ../curves */ 205);
  31684. var utils = __webpack_require__(/*! ../utils */ 198);
  31685. var assert = utils.assert;
  31686. var parseBytes = utils.parseBytes;
  31687. var KeyPair = __webpack_require__(/*! ./key */ 224);
  31688. var Signature = __webpack_require__(/*! ./signature */ 225);
  31689. function EDDSA(curve) {
  31690. assert(curve === 'ed25519', 'only tested with ed25519 so far');
  31691. if (!(this instanceof EDDSA))
  31692. return new EDDSA(curve);
  31693. curve = curves[curve].curve;
  31694. this.curve = curve;
  31695. this.g = curve.g;
  31696. this.g.precompute(curve.n.bitLength() + 1);
  31697. this.pointClass = curve.point().constructor;
  31698. this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
  31699. this.hash = hash.sha512;
  31700. }
  31701. module.exports = EDDSA;
  31702. /**
  31703. * @param {Array|String} message - message bytes
  31704. * @param {Array|String|KeyPair} secret - secret bytes or a keypair
  31705. * @returns {Signature} - signature
  31706. */
  31707. EDDSA.prototype.sign = function sign(message, secret) {
  31708. message = parseBytes(message);
  31709. var key = this.keyFromSecret(secret);
  31710. var r = this.hashInt(key.messagePrefix(), message);
  31711. var R = this.g.mul(r);
  31712. var Rencoded = this.encodePoint(R);
  31713. var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
  31714. .mul(key.priv());
  31715. var S = r.add(s_).umod(this.curve.n);
  31716. return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
  31717. };
  31718. /**
  31719. * @param {Array} message - message bytes
  31720. * @param {Array|String|Signature} sig - sig bytes
  31721. * @param {Array|String|Point|KeyPair} pub - public key
  31722. * @returns {Boolean} - true if public key matches sig of message
  31723. */
  31724. EDDSA.prototype.verify = function verify(message, sig, pub) {
  31725. message = parseBytes(message);
  31726. sig = this.makeSignature(sig);
  31727. var key = this.keyFromPublic(pub);
  31728. var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
  31729. var SG = this.g.mul(sig.S());
  31730. var RplusAh = sig.R().add(key.pub().mul(h));
  31731. return RplusAh.eq(SG);
  31732. };
  31733. EDDSA.prototype.hashInt = function hashInt() {
  31734. var hash = this.hash();
  31735. for (var i = 0; i < arguments.length; i++)
  31736. hash.update(arguments[i]);
  31737. return utils.intFromLE(hash.digest()).umod(this.curve.n);
  31738. };
  31739. EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
  31740. return KeyPair.fromPublic(this, pub);
  31741. };
  31742. EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
  31743. return KeyPair.fromSecret(this, secret);
  31744. };
  31745. EDDSA.prototype.makeSignature = function makeSignature(sig) {
  31746. if (sig instanceof Signature)
  31747. return sig;
  31748. return new Signature(this, sig);
  31749. };
  31750. /**
  31751. * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
  31752. *
  31753. * EDDSA defines methods for encoding and decoding points and integers. These are
  31754. * helper convenience methods, that pass along to utility functions implied
  31755. * parameters.
  31756. *
  31757. */
  31758. EDDSA.prototype.encodePoint = function encodePoint(point) {
  31759. var enc = point.getY().toArray('le', this.encodingLength);
  31760. enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
  31761. return enc;
  31762. };
  31763. EDDSA.prototype.decodePoint = function decodePoint(bytes) {
  31764. bytes = utils.parseBytes(bytes);
  31765. var lastIx = bytes.length - 1;
  31766. var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
  31767. var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
  31768. var y = utils.intFromLE(normed);
  31769. return this.curve.pointFromY(y, xIsOdd);
  31770. };
  31771. EDDSA.prototype.encodeInt = function encodeInt(num) {
  31772. return num.toArray('le', this.encodingLength);
  31773. };
  31774. EDDSA.prototype.decodeInt = function decodeInt(bytes) {
  31775. return utils.intFromLE(bytes);
  31776. };
  31777. EDDSA.prototype.isPoint = function isPoint(val) {
  31778. return val instanceof this.pointClass;
  31779. };
  31780. /***/ }),
  31781. /* 224 */
  31782. /*!*********************************************************!*\
  31783. !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
  31784. \*********************************************************/
  31785. /*! no static exports found */
  31786. /***/ (function(module, exports, __webpack_require__) {
  31787. "use strict";
  31788. var utils = __webpack_require__(/*! ../utils */ 198);
  31789. var assert = utils.assert;
  31790. var parseBytes = utils.parseBytes;
  31791. var cachedProperty = utils.cachedProperty;
  31792. /**
  31793. * @param {EDDSA} eddsa - instance
  31794. * @param {Object} params - public/private key parameters
  31795. *
  31796. * @param {Array<Byte>} [params.secret] - secret seed bytes
  31797. * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
  31798. * @param {Array<Byte>} [params.pub] - public key point encoded as bytes
  31799. *
  31800. */
  31801. function KeyPair(eddsa, params) {
  31802. this.eddsa = eddsa;
  31803. this._secret = parseBytes(params.secret);
  31804. if (eddsa.isPoint(params.pub))
  31805. this._pub = params.pub;
  31806. else
  31807. this._pubBytes = parseBytes(params.pub);
  31808. }
  31809. KeyPair.fromPublic = function fromPublic(eddsa, pub) {
  31810. if (pub instanceof KeyPair)
  31811. return pub;
  31812. return new KeyPair(eddsa, { pub: pub });
  31813. };
  31814. KeyPair.fromSecret = function fromSecret(eddsa, secret) {
  31815. if (secret instanceof KeyPair)
  31816. return secret;
  31817. return new KeyPair(eddsa, { secret: secret });
  31818. };
  31819. KeyPair.prototype.secret = function secret() {
  31820. return this._secret;
  31821. };
  31822. cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
  31823. return this.eddsa.encodePoint(this.pub());
  31824. });
  31825. cachedProperty(KeyPair, 'pub', function pub() {
  31826. if (this._pubBytes)
  31827. return this.eddsa.decodePoint(this._pubBytes);
  31828. return this.eddsa.g.mul(this.priv());
  31829. });
  31830. cachedProperty(KeyPair, 'privBytes', function privBytes() {
  31831. var eddsa = this.eddsa;
  31832. var hash = this.hash();
  31833. var lastIx = eddsa.encodingLength - 1;
  31834. var a = hash.slice(0, eddsa.encodingLength);
  31835. a[0] &= 248;
  31836. a[lastIx] &= 127;
  31837. a[lastIx] |= 64;
  31838. return a;
  31839. });
  31840. cachedProperty(KeyPair, 'priv', function priv() {
  31841. return this.eddsa.decodeInt(this.privBytes());
  31842. });
  31843. cachedProperty(KeyPair, 'hash', function hash() {
  31844. return this.eddsa.hash().update(this.secret()).digest();
  31845. });
  31846. cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
  31847. return this.hash().slice(this.eddsa.encodingLength);
  31848. });
  31849. KeyPair.prototype.sign = function sign(message) {
  31850. assert(this._secret, 'KeyPair can only verify');
  31851. return this.eddsa.sign(message, this);
  31852. };
  31853. KeyPair.prototype.verify = function verify(message, sig) {
  31854. return this.eddsa.verify(message, sig, this);
  31855. };
  31856. KeyPair.prototype.getSecret = function getSecret(enc) {
  31857. assert(this._secret, 'KeyPair is public only');
  31858. return utils.encode(this.secret(), enc);
  31859. };
  31860. KeyPair.prototype.getPublic = function getPublic(enc) {
  31861. return utils.encode(this.pubBytes(), enc);
  31862. };
  31863. module.exports = KeyPair;
  31864. /***/ }),
  31865. /* 225 */
  31866. /*!***************************************************************!*\
  31867. !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
  31868. \***************************************************************/
  31869. /*! no static exports found */
  31870. /***/ (function(module, exports, __webpack_require__) {
  31871. "use strict";
  31872. var BN = __webpack_require__(/*! bn.js */ 185);
  31873. var utils = __webpack_require__(/*! ../utils */ 198);
  31874. var assert = utils.assert;
  31875. var cachedProperty = utils.cachedProperty;
  31876. var parseBytes = utils.parseBytes;
  31877. /**
  31878. * @param {EDDSA} eddsa - eddsa instance
  31879. * @param {Array<Bytes>|Object} sig -
  31880. * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
  31881. * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
  31882. * @param {Array<Bytes>} [sig.Rencoded] - R point encoded
  31883. * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
  31884. */
  31885. function Signature(eddsa, sig) {
  31886. this.eddsa = eddsa;
  31887. if (typeof sig !== 'object')
  31888. sig = parseBytes(sig);
  31889. if (Array.isArray(sig)) {
  31890. sig = {
  31891. R: sig.slice(0, eddsa.encodingLength),
  31892. S: sig.slice(eddsa.encodingLength),
  31893. };
  31894. }
  31895. assert(sig.R && sig.S, 'Signature without R or S');
  31896. if (eddsa.isPoint(sig.R))
  31897. this._R = sig.R;
  31898. if (sig.S instanceof BN)
  31899. this._S = sig.S;
  31900. this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
  31901. this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
  31902. }
  31903. cachedProperty(Signature, 'S', function S() {
  31904. return this.eddsa.decodeInt(this.Sencoded());
  31905. });
  31906. cachedProperty(Signature, 'R', function R() {
  31907. return this.eddsa.decodePoint(this.Rencoded());
  31908. });
  31909. cachedProperty(Signature, 'Rencoded', function Rencoded() {
  31910. return this.eddsa.encodePoint(this.R());
  31911. });
  31912. cachedProperty(Signature, 'Sencoded', function Sencoded() {
  31913. return this.eddsa.encodeInt(this.S());
  31914. });
  31915. Signature.prototype.toBytes = function toBytes() {
  31916. return this.Rencoded().concat(this.Sencoded());
  31917. };
  31918. Signature.prototype.toHex = function toHex() {
  31919. return utils.encode(this.toBytes(), 'hex').toUpperCase();
  31920. };
  31921. module.exports = Signature;
  31922. /***/ }),
  31923. /* 226 */
  31924. /*!******************************************!*\
  31925. !*** ./node_modules/parse-asn1/index.js ***!
  31926. \******************************************/
  31927. /*! no static exports found */
  31928. /***/ (function(module, exports, __webpack_require__) {
  31929. var asn1 = __webpack_require__(/*! ./asn1 */ 227)
  31930. var aesid = __webpack_require__(/*! ./aesid.json */ 244)
  31931. var fixProc = __webpack_require__(/*! ./fixProc */ 245)
  31932. var ciphers = __webpack_require__(/*! browserify-aes */ 163)
  31933. var compat = __webpack_require__(/*! pbkdf2 */ 148)
  31934. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  31935. module.exports = parseKeys
  31936. function parseKeys (buffer) {
  31937. var password
  31938. if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
  31939. password = buffer.passphrase
  31940. buffer = buffer.key
  31941. }
  31942. if (typeof buffer === 'string') {
  31943. buffer = Buffer.from(buffer)
  31944. }
  31945. var stripped = fixProc(buffer, password)
  31946. var type = stripped.tag
  31947. var data = stripped.data
  31948. var subtype, ndata
  31949. switch (type) {
  31950. case 'CERTIFICATE':
  31951. ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
  31952. // falls through
  31953. case 'PUBLIC KEY':
  31954. if (!ndata) {
  31955. ndata = asn1.PublicKey.decode(data, 'der')
  31956. }
  31957. subtype = ndata.algorithm.algorithm.join('.')
  31958. switch (subtype) {
  31959. case '1.2.840.113549.1.1.1':
  31960. return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
  31961. case '1.2.840.10045.2.1':
  31962. ndata.subjectPrivateKey = ndata.subjectPublicKey
  31963. return {
  31964. type: 'ec',
  31965. data: ndata
  31966. }
  31967. case '1.2.840.10040.4.1':
  31968. ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
  31969. return {
  31970. type: 'dsa',
  31971. data: ndata.algorithm.params
  31972. }
  31973. default: throw new Error('unknown key id ' + subtype)
  31974. }
  31975. // throw new Error('unknown key type ' + type)
  31976. case 'ENCRYPTED PRIVATE KEY':
  31977. data = asn1.EncryptedPrivateKey.decode(data, 'der')
  31978. data = decrypt(data, password)
  31979. // falls through
  31980. case 'PRIVATE KEY':
  31981. ndata = asn1.PrivateKey.decode(data, 'der')
  31982. subtype = ndata.algorithm.algorithm.join('.')
  31983. switch (subtype) {
  31984. case '1.2.840.113549.1.1.1':
  31985. return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
  31986. case '1.2.840.10045.2.1':
  31987. return {
  31988. curve: ndata.algorithm.curve,
  31989. privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
  31990. }
  31991. case '1.2.840.10040.4.1':
  31992. ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
  31993. return {
  31994. type: 'dsa',
  31995. params: ndata.algorithm.params
  31996. }
  31997. default: throw new Error('unknown key id ' + subtype)
  31998. }
  31999. // throw new Error('unknown key type ' + type)
  32000. case 'RSA PUBLIC KEY':
  32001. return asn1.RSAPublicKey.decode(data, 'der')
  32002. case 'RSA PRIVATE KEY':
  32003. return asn1.RSAPrivateKey.decode(data, 'der')
  32004. case 'DSA PRIVATE KEY':
  32005. return {
  32006. type: 'dsa',
  32007. params: asn1.DSAPrivateKey.decode(data, 'der')
  32008. }
  32009. case 'EC PRIVATE KEY':
  32010. data = asn1.ECPrivateKey.decode(data, 'der')
  32011. return {
  32012. curve: data.parameters.value,
  32013. privateKey: data.privateKey
  32014. }
  32015. default: throw new Error('unknown key type ' + type)
  32016. }
  32017. }
  32018. parseKeys.signature = asn1.signature
  32019. function decrypt (data, password) {
  32020. var salt = data.algorithm.decrypt.kde.kdeparams.salt
  32021. var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
  32022. var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
  32023. var iv = data.algorithm.decrypt.cipher.iv
  32024. var cipherText = data.subjectPrivateKey
  32025. var keylen = parseInt(algo.split('-')[1], 10) / 8
  32026. var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
  32027. var cipher = ciphers.createDecipheriv(algo, key, iv)
  32028. var out = []
  32029. out.push(cipher.update(cipherText))
  32030. out.push(cipher.final())
  32031. return Buffer.concat(out)
  32032. }
  32033. /***/ }),
  32034. /* 227 */
  32035. /*!*****************************************!*\
  32036. !*** ./node_modules/parse-asn1/asn1.js ***!
  32037. \*****************************************/
  32038. /*! no static exports found */
  32039. /***/ (function(module, exports, __webpack_require__) {
  32040. "use strict";
  32041. // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
  32042. // Fedor, you are amazing.
  32043. var asn1 = __webpack_require__(/*! asn1.js */ 228)
  32044. exports.certificate = __webpack_require__(/*! ./certificate */ 243)
  32045. var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
  32046. this.seq().obj(
  32047. this.key('version').int(),
  32048. this.key('modulus').int(),
  32049. this.key('publicExponent').int(),
  32050. this.key('privateExponent').int(),
  32051. this.key('prime1').int(),
  32052. this.key('prime2').int(),
  32053. this.key('exponent1').int(),
  32054. this.key('exponent2').int(),
  32055. this.key('coefficient').int()
  32056. )
  32057. })
  32058. exports.RSAPrivateKey = RSAPrivateKey
  32059. var RSAPublicKey = asn1.define('RSAPublicKey', function () {
  32060. this.seq().obj(
  32061. this.key('modulus').int(),
  32062. this.key('publicExponent').int()
  32063. )
  32064. })
  32065. exports.RSAPublicKey = RSAPublicKey
  32066. var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
  32067. this.seq().obj(
  32068. this.key('algorithm').use(AlgorithmIdentifier),
  32069. this.key('subjectPublicKey').bitstr()
  32070. )
  32071. })
  32072. exports.PublicKey = PublicKey
  32073. var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
  32074. this.seq().obj(
  32075. this.key('algorithm').objid(),
  32076. this.key('none').null_().optional(),
  32077. this.key('curve').objid().optional(),
  32078. this.key('params').seq().obj(
  32079. this.key('p').int(),
  32080. this.key('q').int(),
  32081. this.key('g').int()
  32082. ).optional()
  32083. )
  32084. })
  32085. var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
  32086. this.seq().obj(
  32087. this.key('version').int(),
  32088. this.key('algorithm').use(AlgorithmIdentifier),
  32089. this.key('subjectPrivateKey').octstr()
  32090. )
  32091. })
  32092. exports.PrivateKey = PrivateKeyInfo
  32093. var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
  32094. this.seq().obj(
  32095. this.key('algorithm').seq().obj(
  32096. this.key('id').objid(),
  32097. this.key('decrypt').seq().obj(
  32098. this.key('kde').seq().obj(
  32099. this.key('id').objid(),
  32100. this.key('kdeparams').seq().obj(
  32101. this.key('salt').octstr(),
  32102. this.key('iters').int()
  32103. )
  32104. ),
  32105. this.key('cipher').seq().obj(
  32106. this.key('algo').objid(),
  32107. this.key('iv').octstr()
  32108. )
  32109. )
  32110. ),
  32111. this.key('subjectPrivateKey').octstr()
  32112. )
  32113. })
  32114. exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
  32115. var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
  32116. this.seq().obj(
  32117. this.key('version').int(),
  32118. this.key('p').int(),
  32119. this.key('q').int(),
  32120. this.key('g').int(),
  32121. this.key('pub_key').int(),
  32122. this.key('priv_key').int()
  32123. )
  32124. })
  32125. exports.DSAPrivateKey = DSAPrivateKey
  32126. exports.DSAparam = asn1.define('DSAparam', function () {
  32127. this.int()
  32128. })
  32129. var ECPrivateKey = asn1.define('ECPrivateKey', function () {
  32130. this.seq().obj(
  32131. this.key('version').int(),
  32132. this.key('privateKey').octstr(),
  32133. this.key('parameters').optional().explicit(0).use(ECParameters),
  32134. this.key('publicKey').optional().explicit(1).bitstr()
  32135. )
  32136. })
  32137. exports.ECPrivateKey = ECPrivateKey
  32138. var ECParameters = asn1.define('ECParameters', function () {
  32139. this.choice({
  32140. namedCurve: this.objid()
  32141. })
  32142. })
  32143. exports.signature = asn1.define('signature', function () {
  32144. this.seq().obj(
  32145. this.key('r').int(),
  32146. this.key('s').int()
  32147. )
  32148. })
  32149. /***/ }),
  32150. /* 228 */
  32151. /*!******************************************!*\
  32152. !*** ./node_modules/asn1.js/lib/asn1.js ***!
  32153. \******************************************/
  32154. /*! no static exports found */
  32155. /***/ (function(module, exports, __webpack_require__) {
  32156. "use strict";
  32157. const asn1 = exports;
  32158. asn1.bignum = __webpack_require__(/*! bn.js */ 185);
  32159. asn1.define = __webpack_require__(/*! ./asn1/api */ 229).define;
  32160. asn1.base = __webpack_require__(/*! ./asn1/base */ 241);
  32161. asn1.constants = __webpack_require__(/*! ./asn1/constants */ 242);
  32162. asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 238);
  32163. asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 230);
  32164. /***/ }),
  32165. /* 229 */
  32166. /*!**********************************************!*\
  32167. !*** ./node_modules/asn1.js/lib/asn1/api.js ***!
  32168. \**********************************************/
  32169. /*! no static exports found */
  32170. /***/ (function(module, exports, __webpack_require__) {
  32171. "use strict";
  32172. const encoders = __webpack_require__(/*! ./encoders */ 230);
  32173. const decoders = __webpack_require__(/*! ./decoders */ 238);
  32174. const inherits = __webpack_require__(/*! inherits */ 109);
  32175. const api = exports;
  32176. api.define = function define(name, body) {
  32177. return new Entity(name, body);
  32178. };
  32179. function Entity(name, body) {
  32180. this.name = name;
  32181. this.body = body;
  32182. this.decoders = {};
  32183. this.encoders = {};
  32184. }
  32185. Entity.prototype._createNamed = function createNamed(Base) {
  32186. const name = this.name;
  32187. function Generated(entity) {
  32188. this._initNamed(entity, name);
  32189. }
  32190. inherits(Generated, Base);
  32191. Generated.prototype._initNamed = function _initNamed(entity, name) {
  32192. Base.call(this, entity, name);
  32193. };
  32194. return new Generated(this);
  32195. };
  32196. Entity.prototype._getDecoder = function _getDecoder(enc) {
  32197. enc = enc || 'der';
  32198. // Lazily create decoder
  32199. if (!this.decoders.hasOwnProperty(enc))
  32200. this.decoders[enc] = this._createNamed(decoders[enc]);
  32201. return this.decoders[enc];
  32202. };
  32203. Entity.prototype.decode = function decode(data, enc, options) {
  32204. return this._getDecoder(enc).decode(data, options);
  32205. };
  32206. Entity.prototype._getEncoder = function _getEncoder(enc) {
  32207. enc = enc || 'der';
  32208. // Lazily create encoder
  32209. if (!this.encoders.hasOwnProperty(enc))
  32210. this.encoders[enc] = this._createNamed(encoders[enc]);
  32211. return this.encoders[enc];
  32212. };
  32213. Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
  32214. return this._getEncoder(enc).encode(data, reporter);
  32215. };
  32216. /***/ }),
  32217. /* 230 */
  32218. /*!*********************************************************!*\
  32219. !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
  32220. \*********************************************************/
  32221. /*! no static exports found */
  32222. /***/ (function(module, exports, __webpack_require__) {
  32223. "use strict";
  32224. const encoders = exports;
  32225. encoders.der = __webpack_require__(/*! ./der */ 231);
  32226. encoders.pem = __webpack_require__(/*! ./pem */ 237);
  32227. /***/ }),
  32228. /* 231 */
  32229. /*!*******************************************************!*\
  32230. !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
  32231. \*******************************************************/
  32232. /*! no static exports found */
  32233. /***/ (function(module, exports, __webpack_require__) {
  32234. "use strict";
  32235. const inherits = __webpack_require__(/*! inherits */ 109);
  32236. const Buffer = __webpack_require__(/*! safer-buffer */ 232).Buffer;
  32237. const Node = __webpack_require__(/*! ../base/node */ 233);
  32238. // Import DER constants
  32239. const der = __webpack_require__(/*! ../constants/der */ 236);
  32240. function DEREncoder(entity) {
  32241. this.enc = 'der';
  32242. this.name = entity.name;
  32243. this.entity = entity;
  32244. // Construct base tree
  32245. this.tree = new DERNode();
  32246. this.tree._init(entity.body);
  32247. }
  32248. module.exports = DEREncoder;
  32249. DEREncoder.prototype.encode = function encode(data, reporter) {
  32250. return this.tree._encode(data, reporter).join();
  32251. };
  32252. // Tree methods
  32253. function DERNode(parent) {
  32254. Node.call(this, 'der', parent);
  32255. }
  32256. inherits(DERNode, Node);
  32257. DERNode.prototype._encodeComposite = function encodeComposite(tag,
  32258. primitive,
  32259. cls,
  32260. content) {
  32261. const encodedTag = encodeTag(tag, primitive, cls, this.reporter);
  32262. // Short form
  32263. if (content.length < 0x80) {
  32264. const header = Buffer.alloc(2);
  32265. header[0] = encodedTag;
  32266. header[1] = content.length;
  32267. return this._createEncoderBuffer([ header, content ]);
  32268. }
  32269. // Long form
  32270. // Count octets required to store length
  32271. let lenOctets = 1;
  32272. for (let i = content.length; i >= 0x100; i >>= 8)
  32273. lenOctets++;
  32274. const header = Buffer.alloc(1 + 1 + lenOctets);
  32275. header[0] = encodedTag;
  32276. header[1] = 0x80 | lenOctets;
  32277. for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
  32278. header[i] = j & 0xff;
  32279. return this._createEncoderBuffer([ header, content ]);
  32280. };
  32281. DERNode.prototype._encodeStr = function encodeStr(str, tag) {
  32282. if (tag === 'bitstr') {
  32283. return this._createEncoderBuffer([ str.unused | 0, str.data ]);
  32284. } else if (tag === 'bmpstr') {
  32285. const buf = Buffer.alloc(str.length * 2);
  32286. for (let i = 0; i < str.length; i++) {
  32287. buf.writeUInt16BE(str.charCodeAt(i), i * 2);
  32288. }
  32289. return this._createEncoderBuffer(buf);
  32290. } else if (tag === 'numstr') {
  32291. if (!this._isNumstr(str)) {
  32292. return this.reporter.error('Encoding of string type: numstr supports ' +
  32293. 'only digits and space');
  32294. }
  32295. return this._createEncoderBuffer(str);
  32296. } else if (tag === 'printstr') {
  32297. if (!this._isPrintstr(str)) {
  32298. return this.reporter.error('Encoding of string type: printstr supports ' +
  32299. 'only latin upper and lower case letters, ' +
  32300. 'digits, space, apostrophe, left and rigth ' +
  32301. 'parenthesis, plus sign, comma, hyphen, ' +
  32302. 'dot, slash, colon, equal sign, ' +
  32303. 'question mark');
  32304. }
  32305. return this._createEncoderBuffer(str);
  32306. } else if (/str$/.test(tag)) {
  32307. return this._createEncoderBuffer(str);
  32308. } else if (tag === 'objDesc') {
  32309. return this._createEncoderBuffer(str);
  32310. } else {
  32311. return this.reporter.error('Encoding of string type: ' + tag +
  32312. ' unsupported');
  32313. }
  32314. };
  32315. DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
  32316. if (typeof id === 'string') {
  32317. if (!values)
  32318. return this.reporter.error('string objid given, but no values map found');
  32319. if (!values.hasOwnProperty(id))
  32320. return this.reporter.error('objid not found in values map');
  32321. id = values[id].split(/[\s.]+/g);
  32322. for (let i = 0; i < id.length; i++)
  32323. id[i] |= 0;
  32324. } else if (Array.isArray(id)) {
  32325. id = id.slice();
  32326. for (let i = 0; i < id.length; i++)
  32327. id[i] |= 0;
  32328. }
  32329. if (!Array.isArray(id)) {
  32330. return this.reporter.error('objid() should be either array or string, ' +
  32331. 'got: ' + JSON.stringify(id));
  32332. }
  32333. if (!relative) {
  32334. if (id[1] >= 40)
  32335. return this.reporter.error('Second objid identifier OOB');
  32336. id.splice(0, 2, id[0] * 40 + id[1]);
  32337. }
  32338. // Count number of octets
  32339. let size = 0;
  32340. for (let i = 0; i < id.length; i++) {
  32341. let ident = id[i];
  32342. for (size++; ident >= 0x80; ident >>= 7)
  32343. size++;
  32344. }
  32345. const objid = Buffer.alloc(size);
  32346. let offset = objid.length - 1;
  32347. for (let i = id.length - 1; i >= 0; i--) {
  32348. let ident = id[i];
  32349. objid[offset--] = ident & 0x7f;
  32350. while ((ident >>= 7) > 0)
  32351. objid[offset--] = 0x80 | (ident & 0x7f);
  32352. }
  32353. return this._createEncoderBuffer(objid);
  32354. };
  32355. function two(num) {
  32356. if (num < 10)
  32357. return '0' + num;
  32358. else
  32359. return num;
  32360. }
  32361. DERNode.prototype._encodeTime = function encodeTime(time, tag) {
  32362. let str;
  32363. const date = new Date(time);
  32364. if (tag === 'gentime') {
  32365. str = [
  32366. two(date.getUTCFullYear()),
  32367. two(date.getUTCMonth() + 1),
  32368. two(date.getUTCDate()),
  32369. two(date.getUTCHours()),
  32370. two(date.getUTCMinutes()),
  32371. two(date.getUTCSeconds()),
  32372. 'Z'
  32373. ].join('');
  32374. } else if (tag === 'utctime') {
  32375. str = [
  32376. two(date.getUTCFullYear() % 100),
  32377. two(date.getUTCMonth() + 1),
  32378. two(date.getUTCDate()),
  32379. two(date.getUTCHours()),
  32380. two(date.getUTCMinutes()),
  32381. two(date.getUTCSeconds()),
  32382. 'Z'
  32383. ].join('');
  32384. } else {
  32385. this.reporter.error('Encoding ' + tag + ' time is not supported yet');
  32386. }
  32387. return this._encodeStr(str, 'octstr');
  32388. };
  32389. DERNode.prototype._encodeNull = function encodeNull() {
  32390. return this._createEncoderBuffer('');
  32391. };
  32392. DERNode.prototype._encodeInt = function encodeInt(num, values) {
  32393. if (typeof num === 'string') {
  32394. if (!values)
  32395. return this.reporter.error('String int or enum given, but no values map');
  32396. if (!values.hasOwnProperty(num)) {
  32397. return this.reporter.error('Values map doesn\'t contain: ' +
  32398. JSON.stringify(num));
  32399. }
  32400. num = values[num];
  32401. }
  32402. // Bignum, assume big endian
  32403. if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
  32404. const numArray = num.toArray();
  32405. if (!num.sign && numArray[0] & 0x80) {
  32406. numArray.unshift(0);
  32407. }
  32408. num = Buffer.from(numArray);
  32409. }
  32410. if (Buffer.isBuffer(num)) {
  32411. let size = num.length;
  32412. if (num.length === 0)
  32413. size++;
  32414. const out = Buffer.alloc(size);
  32415. num.copy(out);
  32416. if (num.length === 0)
  32417. out[0] = 0;
  32418. return this._createEncoderBuffer(out);
  32419. }
  32420. if (num < 0x80)
  32421. return this._createEncoderBuffer(num);
  32422. if (num < 0x100)
  32423. return this._createEncoderBuffer([0, num]);
  32424. let size = 1;
  32425. for (let i = num; i >= 0x100; i >>= 8)
  32426. size++;
  32427. const out = new Array(size);
  32428. for (let i = out.length - 1; i >= 0; i--) {
  32429. out[i] = num & 0xff;
  32430. num >>= 8;
  32431. }
  32432. if(out[0] & 0x80) {
  32433. out.unshift(0);
  32434. }
  32435. return this._createEncoderBuffer(Buffer.from(out));
  32436. };
  32437. DERNode.prototype._encodeBool = function encodeBool(value) {
  32438. return this._createEncoderBuffer(value ? 0xff : 0);
  32439. };
  32440. DERNode.prototype._use = function use(entity, obj) {
  32441. if (typeof entity === 'function')
  32442. entity = entity(obj);
  32443. return entity._getEncoder('der').tree;
  32444. };
  32445. DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
  32446. const state = this._baseState;
  32447. let i;
  32448. if (state['default'] === null)
  32449. return false;
  32450. const data = dataBuffer.join();
  32451. if (state.defaultBuffer === undefined)
  32452. state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
  32453. if (data.length !== state.defaultBuffer.length)
  32454. return false;
  32455. for (i=0; i < data.length; i++)
  32456. if (data[i] !== state.defaultBuffer[i])
  32457. return false;
  32458. return true;
  32459. };
  32460. // Utility methods
  32461. function encodeTag(tag, primitive, cls, reporter) {
  32462. let res;
  32463. if (tag === 'seqof')
  32464. tag = 'seq';
  32465. else if (tag === 'setof')
  32466. tag = 'set';
  32467. if (der.tagByName.hasOwnProperty(tag))
  32468. res = der.tagByName[tag];
  32469. else if (typeof tag === 'number' && (tag | 0) === tag)
  32470. res = tag;
  32471. else
  32472. return reporter.error('Unknown tag: ' + tag);
  32473. if (res >= 0x1f)
  32474. return reporter.error('Multi-octet tag encoding unsupported');
  32475. if (!primitive)
  32476. res |= 0x20;
  32477. res |= (der.tagClassByName[cls || 'universal'] << 6);
  32478. return res;
  32479. }
  32480. /***/ }),
  32481. /* 232 */
  32482. /*!********************************************!*\
  32483. !*** ./node_modules/safer-buffer/safer.js ***!
  32484. \********************************************/
  32485. /*! no static exports found */
  32486. /***/ (function(module, exports, __webpack_require__) {
  32487. "use strict";
  32488. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable node/no-deprecated-api */
  32489. var buffer = __webpack_require__(/*! buffer */ 104)
  32490. var Buffer = buffer.Buffer
  32491. var safer = {}
  32492. var key
  32493. for (key in buffer) {
  32494. if (!buffer.hasOwnProperty(key)) continue
  32495. if (key === 'SlowBuffer' || key === 'Buffer') continue
  32496. safer[key] = buffer[key]
  32497. }
  32498. var Safer = safer.Buffer = {}
  32499. for (key in Buffer) {
  32500. if (!Buffer.hasOwnProperty(key)) continue
  32501. if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
  32502. Safer[key] = Buffer[key]
  32503. }
  32504. safer.Buffer.prototype = Buffer.prototype
  32505. if (!Safer.from || Safer.from === Uint8Array.from) {
  32506. Safer.from = function (value, encodingOrOffset, length) {
  32507. if (typeof value === 'number') {
  32508. throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
  32509. }
  32510. if (value && typeof value.length === 'undefined') {
  32511. throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
  32512. }
  32513. return Buffer(value, encodingOrOffset, length)
  32514. }
  32515. }
  32516. if (!Safer.alloc) {
  32517. Safer.alloc = function (size, fill, encoding) {
  32518. if (typeof size !== 'number') {
  32519. throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
  32520. }
  32521. if (size < 0 || size >= 2 * (1 << 30)) {
  32522. throw new RangeError('The value "' + size + '" is invalid for option "size"')
  32523. }
  32524. var buf = Buffer(size)
  32525. if (!fill || fill.length === 0) {
  32526. buf.fill(0)
  32527. } else if (typeof encoding === 'string') {
  32528. buf.fill(fill, encoding)
  32529. } else {
  32530. buf.fill(fill)
  32531. }
  32532. return buf
  32533. }
  32534. }
  32535. if (!safer.kStringMaxLength) {
  32536. try {
  32537. safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
  32538. } catch (e) {
  32539. // we can't determine kStringMaxLength in environments where process.binding
  32540. // is unsupported, so let's not set it
  32541. }
  32542. }
  32543. if (!safer.constants) {
  32544. safer.constants = {
  32545. MAX_LENGTH: safer.kMaxLength
  32546. }
  32547. if (safer.kStringMaxLength) {
  32548. safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
  32549. }
  32550. }
  32551. module.exports = safer
  32552. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 101)))
  32553. /***/ }),
  32554. /* 233 */
  32555. /*!****************************************************!*\
  32556. !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
  32557. \****************************************************/
  32558. /*! no static exports found */
  32559. /***/ (function(module, exports, __webpack_require__) {
  32560. "use strict";
  32561. const Reporter = __webpack_require__(/*! ../base/reporter */ 234).Reporter;
  32562. const EncoderBuffer = __webpack_require__(/*! ../base/buffer */ 235).EncoderBuffer;
  32563. const DecoderBuffer = __webpack_require__(/*! ../base/buffer */ 235).DecoderBuffer;
  32564. const assert = __webpack_require__(/*! minimalistic-assert */ 159);
  32565. // Supported tags
  32566. const tags = [
  32567. 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
  32568. 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
  32569. 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
  32570. 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
  32571. ];
  32572. // Public methods list
  32573. const methods = [
  32574. 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
  32575. 'any', 'contains'
  32576. ].concat(tags);
  32577. // Overrided methods list
  32578. const overrided = [
  32579. '_peekTag', '_decodeTag', '_use',
  32580. '_decodeStr', '_decodeObjid', '_decodeTime',
  32581. '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
  32582. '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
  32583. '_encodeNull', '_encodeInt', '_encodeBool'
  32584. ];
  32585. function Node(enc, parent, name) {
  32586. const state = {};
  32587. this._baseState = state;
  32588. state.name = name;
  32589. state.enc = enc;
  32590. state.parent = parent || null;
  32591. state.children = null;
  32592. // State
  32593. state.tag = null;
  32594. state.args = null;
  32595. state.reverseArgs = null;
  32596. state.choice = null;
  32597. state.optional = false;
  32598. state.any = false;
  32599. state.obj = false;
  32600. state.use = null;
  32601. state.useDecoder = null;
  32602. state.key = null;
  32603. state['default'] = null;
  32604. state.explicit = null;
  32605. state.implicit = null;
  32606. state.contains = null;
  32607. // Should create new instance on each method
  32608. if (!state.parent) {
  32609. state.children = [];
  32610. this._wrap();
  32611. }
  32612. }
  32613. module.exports = Node;
  32614. const stateProps = [
  32615. 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
  32616. 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
  32617. 'implicit', 'contains'
  32618. ];
  32619. Node.prototype.clone = function clone() {
  32620. const state = this._baseState;
  32621. const cstate = {};
  32622. stateProps.forEach(function(prop) {
  32623. cstate[prop] = state[prop];
  32624. });
  32625. const res = new this.constructor(cstate.parent);
  32626. res._baseState = cstate;
  32627. return res;
  32628. };
  32629. Node.prototype._wrap = function wrap() {
  32630. const state = this._baseState;
  32631. methods.forEach(function(method) {
  32632. this[method] = function _wrappedMethod() {
  32633. const clone = new this.constructor(this);
  32634. state.children.push(clone);
  32635. return clone[method].apply(clone, arguments);
  32636. };
  32637. }, this);
  32638. };
  32639. Node.prototype._init = function init(body) {
  32640. const state = this._baseState;
  32641. assert(state.parent === null);
  32642. body.call(this);
  32643. // Filter children
  32644. state.children = state.children.filter(function(child) {
  32645. return child._baseState.parent === this;
  32646. }, this);
  32647. assert.equal(state.children.length, 1, 'Root node can have only one child');
  32648. };
  32649. Node.prototype._useArgs = function useArgs(args) {
  32650. const state = this._baseState;
  32651. // Filter children and args
  32652. const children = args.filter(function(arg) {
  32653. return arg instanceof this.constructor;
  32654. }, this);
  32655. args = args.filter(function(arg) {
  32656. return !(arg instanceof this.constructor);
  32657. }, this);
  32658. if (children.length !== 0) {
  32659. assert(state.children === null);
  32660. state.children = children;
  32661. // Replace parent to maintain backward link
  32662. children.forEach(function(child) {
  32663. child._baseState.parent = this;
  32664. }, this);
  32665. }
  32666. if (args.length !== 0) {
  32667. assert(state.args === null);
  32668. state.args = args;
  32669. state.reverseArgs = args.map(function(arg) {
  32670. if (typeof arg !== 'object' || arg.constructor !== Object)
  32671. return arg;
  32672. const res = {};
  32673. Object.keys(arg).forEach(function(key) {
  32674. if (key == (key | 0))
  32675. key |= 0;
  32676. const value = arg[key];
  32677. res[value] = key;
  32678. });
  32679. return res;
  32680. });
  32681. }
  32682. };
  32683. //
  32684. // Overrided methods
  32685. //
  32686. overrided.forEach(function(method) {
  32687. Node.prototype[method] = function _overrided() {
  32688. const state = this._baseState;
  32689. throw new Error(method + ' not implemented for encoding: ' + state.enc);
  32690. };
  32691. });
  32692. //
  32693. // Public methods
  32694. //
  32695. tags.forEach(function(tag) {
  32696. Node.prototype[tag] = function _tagMethod() {
  32697. const state = this._baseState;
  32698. const args = Array.prototype.slice.call(arguments);
  32699. assert(state.tag === null);
  32700. state.tag = tag;
  32701. this._useArgs(args);
  32702. return this;
  32703. };
  32704. });
  32705. Node.prototype.use = function use(item) {
  32706. assert(item);
  32707. const state = this._baseState;
  32708. assert(state.use === null);
  32709. state.use = item;
  32710. return this;
  32711. };
  32712. Node.prototype.optional = function optional() {
  32713. const state = this._baseState;
  32714. state.optional = true;
  32715. return this;
  32716. };
  32717. Node.prototype.def = function def(val) {
  32718. const state = this._baseState;
  32719. assert(state['default'] === null);
  32720. state['default'] = val;
  32721. state.optional = true;
  32722. return this;
  32723. };
  32724. Node.prototype.explicit = function explicit(num) {
  32725. const state = this._baseState;
  32726. assert(state.explicit === null && state.implicit === null);
  32727. state.explicit = num;
  32728. return this;
  32729. };
  32730. Node.prototype.implicit = function implicit(num) {
  32731. const state = this._baseState;
  32732. assert(state.explicit === null && state.implicit === null);
  32733. state.implicit = num;
  32734. return this;
  32735. };
  32736. Node.prototype.obj = function obj() {
  32737. const state = this._baseState;
  32738. const args = Array.prototype.slice.call(arguments);
  32739. state.obj = true;
  32740. if (args.length !== 0)
  32741. this._useArgs(args);
  32742. return this;
  32743. };
  32744. Node.prototype.key = function key(newKey) {
  32745. const state = this._baseState;
  32746. assert(state.key === null);
  32747. state.key = newKey;
  32748. return this;
  32749. };
  32750. Node.prototype.any = function any() {
  32751. const state = this._baseState;
  32752. state.any = true;
  32753. return this;
  32754. };
  32755. Node.prototype.choice = function choice(obj) {
  32756. const state = this._baseState;
  32757. assert(state.choice === null);
  32758. state.choice = obj;
  32759. this._useArgs(Object.keys(obj).map(function(key) {
  32760. return obj[key];
  32761. }));
  32762. return this;
  32763. };
  32764. Node.prototype.contains = function contains(item) {
  32765. const state = this._baseState;
  32766. assert(state.use === null);
  32767. state.contains = item;
  32768. return this;
  32769. };
  32770. //
  32771. // Decoding
  32772. //
  32773. Node.prototype._decode = function decode(input, options) {
  32774. const state = this._baseState;
  32775. // Decode root node
  32776. if (state.parent === null)
  32777. return input.wrapResult(state.children[0]._decode(input, options));
  32778. let result = state['default'];
  32779. let present = true;
  32780. let prevKey = null;
  32781. if (state.key !== null)
  32782. prevKey = input.enterKey(state.key);
  32783. // Check if tag is there
  32784. if (state.optional) {
  32785. let tag = null;
  32786. if (state.explicit !== null)
  32787. tag = state.explicit;
  32788. else if (state.implicit !== null)
  32789. tag = state.implicit;
  32790. else if (state.tag !== null)
  32791. tag = state.tag;
  32792. if (tag === null && !state.any) {
  32793. // Trial and Error
  32794. const save = input.save();
  32795. try {
  32796. if (state.choice === null)
  32797. this._decodeGeneric(state.tag, input, options);
  32798. else
  32799. this._decodeChoice(input, options);
  32800. present = true;
  32801. } catch (e) {
  32802. present = false;
  32803. }
  32804. input.restore(save);
  32805. } else {
  32806. present = this._peekTag(input, tag, state.any);
  32807. if (input.isError(present))
  32808. return present;
  32809. }
  32810. }
  32811. // Push object on stack
  32812. let prevObj;
  32813. if (state.obj && present)
  32814. prevObj = input.enterObject();
  32815. if (present) {
  32816. // Unwrap explicit values
  32817. if (state.explicit !== null) {
  32818. const explicit = this._decodeTag(input, state.explicit);
  32819. if (input.isError(explicit))
  32820. return explicit;
  32821. input = explicit;
  32822. }
  32823. const start = input.offset;
  32824. // Unwrap implicit and normal values
  32825. if (state.use === null && state.choice === null) {
  32826. let save;
  32827. if (state.any)
  32828. save = input.save();
  32829. const body = this._decodeTag(
  32830. input,
  32831. state.implicit !== null ? state.implicit : state.tag,
  32832. state.any
  32833. );
  32834. if (input.isError(body))
  32835. return body;
  32836. if (state.any)
  32837. result = input.raw(save);
  32838. else
  32839. input = body;
  32840. }
  32841. if (options && options.track && state.tag !== null)
  32842. options.track(input.path(), start, input.length, 'tagged');
  32843. if (options && options.track && state.tag !== null)
  32844. options.track(input.path(), input.offset, input.length, 'content');
  32845. // Select proper method for tag
  32846. if (state.any) {
  32847. // no-op
  32848. } else if (state.choice === null) {
  32849. result = this._decodeGeneric(state.tag, input, options);
  32850. } else {
  32851. result = this._decodeChoice(input, options);
  32852. }
  32853. if (input.isError(result))
  32854. return result;
  32855. // Decode children
  32856. if (!state.any && state.choice === null && state.children !== null) {
  32857. state.children.forEach(function decodeChildren(child) {
  32858. // NOTE: We are ignoring errors here, to let parser continue with other
  32859. // parts of encoded data
  32860. child._decode(input, options);
  32861. });
  32862. }
  32863. // Decode contained/encoded by schema, only in bit or octet strings
  32864. if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
  32865. const data = new DecoderBuffer(result);
  32866. result = this._getUse(state.contains, input._reporterState.obj)
  32867. ._decode(data, options);
  32868. }
  32869. }
  32870. // Pop object
  32871. if (state.obj && present)
  32872. result = input.leaveObject(prevObj);
  32873. // Set key
  32874. if (state.key !== null && (result !== null || present === true))
  32875. input.leaveKey(prevKey, state.key, result);
  32876. else if (prevKey !== null)
  32877. input.exitKey(prevKey);
  32878. return result;
  32879. };
  32880. Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
  32881. const state = this._baseState;
  32882. if (tag === 'seq' || tag === 'set')
  32883. return null;
  32884. if (tag === 'seqof' || tag === 'setof')
  32885. return this._decodeList(input, tag, state.args[0], options);
  32886. else if (/str$/.test(tag))
  32887. return this._decodeStr(input, tag, options);
  32888. else if (tag === 'objid' && state.args)
  32889. return this._decodeObjid(input, state.args[0], state.args[1], options);
  32890. else if (tag === 'objid')
  32891. return this._decodeObjid(input, null, null, options);
  32892. else if (tag === 'gentime' || tag === 'utctime')
  32893. return this._decodeTime(input, tag, options);
  32894. else if (tag === 'null_')
  32895. return this._decodeNull(input, options);
  32896. else if (tag === 'bool')
  32897. return this._decodeBool(input, options);
  32898. else if (tag === 'objDesc')
  32899. return this._decodeStr(input, tag, options);
  32900. else if (tag === 'int' || tag === 'enum')
  32901. return this._decodeInt(input, state.args && state.args[0], options);
  32902. if (state.use !== null) {
  32903. return this._getUse(state.use, input._reporterState.obj)
  32904. ._decode(input, options);
  32905. } else {
  32906. return input.error('unknown tag: ' + tag);
  32907. }
  32908. };
  32909. Node.prototype._getUse = function _getUse(entity, obj) {
  32910. const state = this._baseState;
  32911. // Create altered use decoder if implicit is set
  32912. state.useDecoder = this._use(entity, obj);
  32913. assert(state.useDecoder._baseState.parent === null);
  32914. state.useDecoder = state.useDecoder._baseState.children[0];
  32915. if (state.implicit !== state.useDecoder._baseState.implicit) {
  32916. state.useDecoder = state.useDecoder.clone();
  32917. state.useDecoder._baseState.implicit = state.implicit;
  32918. }
  32919. return state.useDecoder;
  32920. };
  32921. Node.prototype._decodeChoice = function decodeChoice(input, options) {
  32922. const state = this._baseState;
  32923. let result = null;
  32924. let match = false;
  32925. Object.keys(state.choice).some(function(key) {
  32926. const save = input.save();
  32927. const node = state.choice[key];
  32928. try {
  32929. const value = node._decode(input, options);
  32930. if (input.isError(value))
  32931. return false;
  32932. result = { type: key, value: value };
  32933. match = true;
  32934. } catch (e) {
  32935. input.restore(save);
  32936. return false;
  32937. }
  32938. return true;
  32939. }, this);
  32940. if (!match)
  32941. return input.error('Choice not matched');
  32942. return result;
  32943. };
  32944. //
  32945. // Encoding
  32946. //
  32947. Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
  32948. return new EncoderBuffer(data, this.reporter);
  32949. };
  32950. Node.prototype._encode = function encode(data, reporter, parent) {
  32951. const state = this._baseState;
  32952. if (state['default'] !== null && state['default'] === data)
  32953. return;
  32954. const result = this._encodeValue(data, reporter, parent);
  32955. if (result === undefined)
  32956. return;
  32957. if (this._skipDefault(result, reporter, parent))
  32958. return;
  32959. return result;
  32960. };
  32961. Node.prototype._encodeValue = function encode(data, reporter, parent) {
  32962. const state = this._baseState;
  32963. // Decode root node
  32964. if (state.parent === null)
  32965. return state.children[0]._encode(data, reporter || new Reporter());
  32966. let result = null;
  32967. // Set reporter to share it with a child class
  32968. this.reporter = reporter;
  32969. // Check if data is there
  32970. if (state.optional && data === undefined) {
  32971. if (state['default'] !== null)
  32972. data = state['default'];
  32973. else
  32974. return;
  32975. }
  32976. // Encode children first
  32977. let content = null;
  32978. let primitive = false;
  32979. if (state.any) {
  32980. // Anything that was given is translated to buffer
  32981. result = this._createEncoderBuffer(data);
  32982. } else if (state.choice) {
  32983. result = this._encodeChoice(data, reporter);
  32984. } else if (state.contains) {
  32985. content = this._getUse(state.contains, parent)._encode(data, reporter);
  32986. primitive = true;
  32987. } else if (state.children) {
  32988. content = state.children.map(function(child) {
  32989. if (child._baseState.tag === 'null_')
  32990. return child._encode(null, reporter, data);
  32991. if (child._baseState.key === null)
  32992. return reporter.error('Child should have a key');
  32993. const prevKey = reporter.enterKey(child._baseState.key);
  32994. if (typeof data !== 'object')
  32995. return reporter.error('Child expected, but input is not object');
  32996. const res = child._encode(data[child._baseState.key], reporter, data);
  32997. reporter.leaveKey(prevKey);
  32998. return res;
  32999. }, this).filter(function(child) {
  33000. return child;
  33001. });
  33002. content = this._createEncoderBuffer(content);
  33003. } else {
  33004. if (state.tag === 'seqof' || state.tag === 'setof') {
  33005. // TODO(indutny): this should be thrown on DSL level
  33006. if (!(state.args && state.args.length === 1))
  33007. return reporter.error('Too many args for : ' + state.tag);
  33008. if (!Array.isArray(data))
  33009. return reporter.error('seqof/setof, but data is not Array');
  33010. const child = this.clone();
  33011. child._baseState.implicit = null;
  33012. content = this._createEncoderBuffer(data.map(function(item) {
  33013. const state = this._baseState;
  33014. return this._getUse(state.args[0], data)._encode(item, reporter);
  33015. }, child));
  33016. } else if (state.use !== null) {
  33017. result = this._getUse(state.use, parent)._encode(data, reporter);
  33018. } else {
  33019. content = this._encodePrimitive(state.tag, data);
  33020. primitive = true;
  33021. }
  33022. }
  33023. // Encode data itself
  33024. if (!state.any && state.choice === null) {
  33025. const tag = state.implicit !== null ? state.implicit : state.tag;
  33026. const cls = state.implicit === null ? 'universal' : 'context';
  33027. if (tag === null) {
  33028. if (state.use === null)
  33029. reporter.error('Tag could be omitted only for .use()');
  33030. } else {
  33031. if (state.use === null)
  33032. result = this._encodeComposite(tag, primitive, cls, content);
  33033. }
  33034. }
  33035. // Wrap in explicit
  33036. if (state.explicit !== null)
  33037. result = this._encodeComposite(state.explicit, false, 'context', result);
  33038. return result;
  33039. };
  33040. Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
  33041. const state = this._baseState;
  33042. const node = state.choice[data.type];
  33043. if (!node) {
  33044. assert(
  33045. false,
  33046. data.type + ' not found in ' +
  33047. JSON.stringify(Object.keys(state.choice)));
  33048. }
  33049. return node._encode(data.value, reporter);
  33050. };
  33051. Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
  33052. const state = this._baseState;
  33053. if (/str$/.test(tag))
  33054. return this._encodeStr(data, tag);
  33055. else if (tag === 'objid' && state.args)
  33056. return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
  33057. else if (tag === 'objid')
  33058. return this._encodeObjid(data, null, null);
  33059. else if (tag === 'gentime' || tag === 'utctime')
  33060. return this._encodeTime(data, tag);
  33061. else if (tag === 'null_')
  33062. return this._encodeNull();
  33063. else if (tag === 'int' || tag === 'enum')
  33064. return this._encodeInt(data, state.args && state.reverseArgs[0]);
  33065. else if (tag === 'bool')
  33066. return this._encodeBool(data);
  33067. else if (tag === 'objDesc')
  33068. return this._encodeStr(data, tag);
  33069. else
  33070. throw new Error('Unsupported tag: ' + tag);
  33071. };
  33072. Node.prototype._isNumstr = function isNumstr(str) {
  33073. return /^[0-9 ]*$/.test(str);
  33074. };
  33075. Node.prototype._isPrintstr = function isPrintstr(str) {
  33076. return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str);
  33077. };
  33078. /***/ }),
  33079. /* 234 */
  33080. /*!********************************************************!*\
  33081. !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
  33082. \********************************************************/
  33083. /*! no static exports found */
  33084. /***/ (function(module, exports, __webpack_require__) {
  33085. "use strict";
  33086. const inherits = __webpack_require__(/*! inherits */ 109);
  33087. function Reporter(options) {
  33088. this._reporterState = {
  33089. obj: null,
  33090. path: [],
  33091. options: options || {},
  33092. errors: []
  33093. };
  33094. }
  33095. exports.Reporter = Reporter;
  33096. Reporter.prototype.isError = function isError(obj) {
  33097. return obj instanceof ReporterError;
  33098. };
  33099. Reporter.prototype.save = function save() {
  33100. const state = this._reporterState;
  33101. return { obj: state.obj, pathLen: state.path.length };
  33102. };
  33103. Reporter.prototype.restore = function restore(data) {
  33104. const state = this._reporterState;
  33105. state.obj = data.obj;
  33106. state.path = state.path.slice(0, data.pathLen);
  33107. };
  33108. Reporter.prototype.enterKey = function enterKey(key) {
  33109. return this._reporterState.path.push(key);
  33110. };
  33111. Reporter.prototype.exitKey = function exitKey(index) {
  33112. const state = this._reporterState;
  33113. state.path = state.path.slice(0, index - 1);
  33114. };
  33115. Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
  33116. const state = this._reporterState;
  33117. this.exitKey(index);
  33118. if (state.obj !== null)
  33119. state.obj[key] = value;
  33120. };
  33121. Reporter.prototype.path = function path() {
  33122. return this._reporterState.path.join('/');
  33123. };
  33124. Reporter.prototype.enterObject = function enterObject() {
  33125. const state = this._reporterState;
  33126. const prev = state.obj;
  33127. state.obj = {};
  33128. return prev;
  33129. };
  33130. Reporter.prototype.leaveObject = function leaveObject(prev) {
  33131. const state = this._reporterState;
  33132. const now = state.obj;
  33133. state.obj = prev;
  33134. return now;
  33135. };
  33136. Reporter.prototype.error = function error(msg) {
  33137. let err;
  33138. const state = this._reporterState;
  33139. const inherited = msg instanceof ReporterError;
  33140. if (inherited) {
  33141. err = msg;
  33142. } else {
  33143. err = new ReporterError(state.path.map(function(elem) {
  33144. return '[' + JSON.stringify(elem) + ']';
  33145. }).join(''), msg.message || msg, msg.stack);
  33146. }
  33147. if (!state.options.partial)
  33148. throw err;
  33149. if (!inherited)
  33150. state.errors.push(err);
  33151. return err;
  33152. };
  33153. Reporter.prototype.wrapResult = function wrapResult(result) {
  33154. const state = this._reporterState;
  33155. if (!state.options.partial)
  33156. return result;
  33157. return {
  33158. result: this.isError(result) ? null : result,
  33159. errors: state.errors
  33160. };
  33161. };
  33162. function ReporterError(path, msg) {
  33163. this.path = path;
  33164. this.rethrow(msg);
  33165. }
  33166. inherits(ReporterError, Error);
  33167. ReporterError.prototype.rethrow = function rethrow(msg) {
  33168. this.message = msg + ' at: ' + (this.path || '(shallow)');
  33169. if (Error.captureStackTrace)
  33170. Error.captureStackTrace(this, ReporterError);
  33171. if (!this.stack) {
  33172. try {
  33173. // IE only adds stack when thrown
  33174. throw new Error(this.message);
  33175. } catch (e) {
  33176. this.stack = e.stack;
  33177. }
  33178. }
  33179. return this;
  33180. };
  33181. /***/ }),
  33182. /* 235 */
  33183. /*!******************************************************!*\
  33184. !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
  33185. \******************************************************/
  33186. /*! no static exports found */
  33187. /***/ (function(module, exports, __webpack_require__) {
  33188. "use strict";
  33189. const inherits = __webpack_require__(/*! inherits */ 109);
  33190. const Reporter = __webpack_require__(/*! ../base/reporter */ 234).Reporter;
  33191. const Buffer = __webpack_require__(/*! safer-buffer */ 232).Buffer;
  33192. function DecoderBuffer(base, options) {
  33193. Reporter.call(this, options);
  33194. if (!Buffer.isBuffer(base)) {
  33195. this.error('Input not Buffer');
  33196. return;
  33197. }
  33198. this.base = base;
  33199. this.offset = 0;
  33200. this.length = base.length;
  33201. }
  33202. inherits(DecoderBuffer, Reporter);
  33203. exports.DecoderBuffer = DecoderBuffer;
  33204. DecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) {
  33205. if (data instanceof DecoderBuffer) {
  33206. return true;
  33207. }
  33208. // Or accept compatible API
  33209. const isCompatible = typeof data === 'object' &&
  33210. Buffer.isBuffer(data.base) &&
  33211. data.constructor.name === 'DecoderBuffer' &&
  33212. typeof data.offset === 'number' &&
  33213. typeof data.length === 'number' &&
  33214. typeof data.save === 'function' &&
  33215. typeof data.restore === 'function' &&
  33216. typeof data.isEmpty === 'function' &&
  33217. typeof data.readUInt8 === 'function' &&
  33218. typeof data.skip === 'function' &&
  33219. typeof data.raw === 'function';
  33220. return isCompatible;
  33221. };
  33222. DecoderBuffer.prototype.save = function save() {
  33223. return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
  33224. };
  33225. DecoderBuffer.prototype.restore = function restore(save) {
  33226. // Return skipped data
  33227. const res = new DecoderBuffer(this.base);
  33228. res.offset = save.offset;
  33229. res.length = this.offset;
  33230. this.offset = save.offset;
  33231. Reporter.prototype.restore.call(this, save.reporter);
  33232. return res;
  33233. };
  33234. DecoderBuffer.prototype.isEmpty = function isEmpty() {
  33235. return this.offset === this.length;
  33236. };
  33237. DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
  33238. if (this.offset + 1 <= this.length)
  33239. return this.base.readUInt8(this.offset++, true);
  33240. else
  33241. return this.error(fail || 'DecoderBuffer overrun');
  33242. };
  33243. DecoderBuffer.prototype.skip = function skip(bytes, fail) {
  33244. if (!(this.offset + bytes <= this.length))
  33245. return this.error(fail || 'DecoderBuffer overrun');
  33246. const res = new DecoderBuffer(this.base);
  33247. // Share reporter state
  33248. res._reporterState = this._reporterState;
  33249. res.offset = this.offset;
  33250. res.length = this.offset + bytes;
  33251. this.offset += bytes;
  33252. return res;
  33253. };
  33254. DecoderBuffer.prototype.raw = function raw(save) {
  33255. return this.base.slice(save ? save.offset : this.offset, this.length);
  33256. };
  33257. function EncoderBuffer(value, reporter) {
  33258. if (Array.isArray(value)) {
  33259. this.length = 0;
  33260. this.value = value.map(function(item) {
  33261. if (!EncoderBuffer.isEncoderBuffer(item))
  33262. item = new EncoderBuffer(item, reporter);
  33263. this.length += item.length;
  33264. return item;
  33265. }, this);
  33266. } else if (typeof value === 'number') {
  33267. if (!(0 <= value && value <= 0xff))
  33268. return reporter.error('non-byte EncoderBuffer value');
  33269. this.value = value;
  33270. this.length = 1;
  33271. } else if (typeof value === 'string') {
  33272. this.value = value;
  33273. this.length = Buffer.byteLength(value);
  33274. } else if (Buffer.isBuffer(value)) {
  33275. this.value = value;
  33276. this.length = value.length;
  33277. } else {
  33278. return reporter.error('Unsupported type: ' + typeof value);
  33279. }
  33280. }
  33281. exports.EncoderBuffer = EncoderBuffer;
  33282. EncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) {
  33283. if (data instanceof EncoderBuffer) {
  33284. return true;
  33285. }
  33286. // Or accept compatible API
  33287. const isCompatible = typeof data === 'object' &&
  33288. data.constructor.name === 'EncoderBuffer' &&
  33289. typeof data.length === 'number' &&
  33290. typeof data.join === 'function';
  33291. return isCompatible;
  33292. };
  33293. EncoderBuffer.prototype.join = function join(out, offset) {
  33294. if (!out)
  33295. out = Buffer.alloc(this.length);
  33296. if (!offset)
  33297. offset = 0;
  33298. if (this.length === 0)
  33299. return out;
  33300. if (Array.isArray(this.value)) {
  33301. this.value.forEach(function(item) {
  33302. item.join(out, offset);
  33303. offset += item.length;
  33304. });
  33305. } else {
  33306. if (typeof this.value === 'number')
  33307. out[offset] = this.value;
  33308. else if (typeof this.value === 'string')
  33309. out.write(this.value, offset);
  33310. else if (Buffer.isBuffer(this.value))
  33311. this.value.copy(out, offset);
  33312. offset += this.length;
  33313. }
  33314. return out;
  33315. };
  33316. /***/ }),
  33317. /* 236 */
  33318. /*!********************************************************!*\
  33319. !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
  33320. \********************************************************/
  33321. /*! no static exports found */
  33322. /***/ (function(module, exports, __webpack_require__) {
  33323. "use strict";
  33324. // Helper
  33325. function reverse(map) {
  33326. const res = {};
  33327. Object.keys(map).forEach(function(key) {
  33328. // Convert key to integer if it is stringified
  33329. if ((key | 0) == key)
  33330. key = key | 0;
  33331. const value = map[key];
  33332. res[value] = key;
  33333. });
  33334. return res;
  33335. }
  33336. exports.tagClass = {
  33337. 0: 'universal',
  33338. 1: 'application',
  33339. 2: 'context',
  33340. 3: 'private'
  33341. };
  33342. exports.tagClassByName = reverse(exports.tagClass);
  33343. exports.tag = {
  33344. 0x00: 'end',
  33345. 0x01: 'bool',
  33346. 0x02: 'int',
  33347. 0x03: 'bitstr',
  33348. 0x04: 'octstr',
  33349. 0x05: 'null_',
  33350. 0x06: 'objid',
  33351. 0x07: 'objDesc',
  33352. 0x08: 'external',
  33353. 0x09: 'real',
  33354. 0x0a: 'enum',
  33355. 0x0b: 'embed',
  33356. 0x0c: 'utf8str',
  33357. 0x0d: 'relativeOid',
  33358. 0x10: 'seq',
  33359. 0x11: 'set',
  33360. 0x12: 'numstr',
  33361. 0x13: 'printstr',
  33362. 0x14: 't61str',
  33363. 0x15: 'videostr',
  33364. 0x16: 'ia5str',
  33365. 0x17: 'utctime',
  33366. 0x18: 'gentime',
  33367. 0x19: 'graphstr',
  33368. 0x1a: 'iso646str',
  33369. 0x1b: 'genstr',
  33370. 0x1c: 'unistr',
  33371. 0x1d: 'charstr',
  33372. 0x1e: 'bmpstr'
  33373. };
  33374. exports.tagByName = reverse(exports.tag);
  33375. /***/ }),
  33376. /* 237 */
  33377. /*!*******************************************************!*\
  33378. !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
  33379. \*******************************************************/
  33380. /*! no static exports found */
  33381. /***/ (function(module, exports, __webpack_require__) {
  33382. "use strict";
  33383. const inherits = __webpack_require__(/*! inherits */ 109);
  33384. const DEREncoder = __webpack_require__(/*! ./der */ 231);
  33385. function PEMEncoder(entity) {
  33386. DEREncoder.call(this, entity);
  33387. this.enc = 'pem';
  33388. }
  33389. inherits(PEMEncoder, DEREncoder);
  33390. module.exports = PEMEncoder;
  33391. PEMEncoder.prototype.encode = function encode(data, options) {
  33392. const buf = DEREncoder.prototype.encode.call(this, data);
  33393. const p = buf.toString('base64');
  33394. const out = [ '-----BEGIN ' + options.label + '-----' ];
  33395. for (let i = 0; i < p.length; i += 64)
  33396. out.push(p.slice(i, i + 64));
  33397. out.push('-----END ' + options.label + '-----');
  33398. return out.join('\n');
  33399. };
  33400. /***/ }),
  33401. /* 238 */
  33402. /*!*********************************************************!*\
  33403. !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
  33404. \*********************************************************/
  33405. /*! no static exports found */
  33406. /***/ (function(module, exports, __webpack_require__) {
  33407. "use strict";
  33408. const decoders = exports;
  33409. decoders.der = __webpack_require__(/*! ./der */ 239);
  33410. decoders.pem = __webpack_require__(/*! ./pem */ 240);
  33411. /***/ }),
  33412. /* 239 */
  33413. /*!*******************************************************!*\
  33414. !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
  33415. \*******************************************************/
  33416. /*! no static exports found */
  33417. /***/ (function(module, exports, __webpack_require__) {
  33418. "use strict";
  33419. const inherits = __webpack_require__(/*! inherits */ 109);
  33420. const bignum = __webpack_require__(/*! bn.js */ 185);
  33421. const DecoderBuffer = __webpack_require__(/*! ../base/buffer */ 235).DecoderBuffer;
  33422. const Node = __webpack_require__(/*! ../base/node */ 233);
  33423. // Import DER constants
  33424. const der = __webpack_require__(/*! ../constants/der */ 236);
  33425. function DERDecoder(entity) {
  33426. this.enc = 'der';
  33427. this.name = entity.name;
  33428. this.entity = entity;
  33429. // Construct base tree
  33430. this.tree = new DERNode();
  33431. this.tree._init(entity.body);
  33432. }
  33433. module.exports = DERDecoder;
  33434. DERDecoder.prototype.decode = function decode(data, options) {
  33435. if (!DecoderBuffer.isDecoderBuffer(data)) {
  33436. data = new DecoderBuffer(data, options);
  33437. }
  33438. return this.tree._decode(data, options);
  33439. };
  33440. // Tree methods
  33441. function DERNode(parent) {
  33442. Node.call(this, 'der', parent);
  33443. }
  33444. inherits(DERNode, Node);
  33445. DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
  33446. if (buffer.isEmpty())
  33447. return false;
  33448. const state = buffer.save();
  33449. const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
  33450. if (buffer.isError(decodedTag))
  33451. return decodedTag;
  33452. buffer.restore(state);
  33453. return decodedTag.tag === tag || decodedTag.tagStr === tag ||
  33454. (decodedTag.tagStr + 'of') === tag || any;
  33455. };
  33456. DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
  33457. const decodedTag = derDecodeTag(buffer,
  33458. 'Failed to decode tag of "' + tag + '"');
  33459. if (buffer.isError(decodedTag))
  33460. return decodedTag;
  33461. let len = derDecodeLen(buffer,
  33462. decodedTag.primitive,
  33463. 'Failed to get length of "' + tag + '"');
  33464. // Failure
  33465. if (buffer.isError(len))
  33466. return len;
  33467. if (!any &&
  33468. decodedTag.tag !== tag &&
  33469. decodedTag.tagStr !== tag &&
  33470. decodedTag.tagStr + 'of' !== tag) {
  33471. return buffer.error('Failed to match tag: "' + tag + '"');
  33472. }
  33473. if (decodedTag.primitive || len !== null)
  33474. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  33475. // Indefinite length... find END tag
  33476. const state = buffer.save();
  33477. const res = this._skipUntilEnd(
  33478. buffer,
  33479. 'Failed to skip indefinite length body: "' + this.tag + '"');
  33480. if (buffer.isError(res))
  33481. return res;
  33482. len = buffer.offset - state.offset;
  33483. buffer.restore(state);
  33484. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  33485. };
  33486. DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
  33487. for (;;) {
  33488. const tag = derDecodeTag(buffer, fail);
  33489. if (buffer.isError(tag))
  33490. return tag;
  33491. const len = derDecodeLen(buffer, tag.primitive, fail);
  33492. if (buffer.isError(len))
  33493. return len;
  33494. let res;
  33495. if (tag.primitive || len !== null)
  33496. res = buffer.skip(len);
  33497. else
  33498. res = this._skipUntilEnd(buffer, fail);
  33499. // Failure
  33500. if (buffer.isError(res))
  33501. return res;
  33502. if (tag.tagStr === 'end')
  33503. break;
  33504. }
  33505. };
  33506. DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
  33507. options) {
  33508. const result = [];
  33509. while (!buffer.isEmpty()) {
  33510. const possibleEnd = this._peekTag(buffer, 'end');
  33511. if (buffer.isError(possibleEnd))
  33512. return possibleEnd;
  33513. const res = decoder.decode(buffer, 'der', options);
  33514. if (buffer.isError(res) && possibleEnd)
  33515. break;
  33516. result.push(res);
  33517. }
  33518. return result;
  33519. };
  33520. DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
  33521. if (tag === 'bitstr') {
  33522. const unused = buffer.readUInt8();
  33523. if (buffer.isError(unused))
  33524. return unused;
  33525. return { unused: unused, data: buffer.raw() };
  33526. } else if (tag === 'bmpstr') {
  33527. const raw = buffer.raw();
  33528. if (raw.length % 2 === 1)
  33529. return buffer.error('Decoding of string type: bmpstr length mismatch');
  33530. let str = '';
  33531. for (let i = 0; i < raw.length / 2; i++) {
  33532. str += String.fromCharCode(raw.readUInt16BE(i * 2));
  33533. }
  33534. return str;
  33535. } else if (tag === 'numstr') {
  33536. const numstr = buffer.raw().toString('ascii');
  33537. if (!this._isNumstr(numstr)) {
  33538. return buffer.error('Decoding of string type: ' +
  33539. 'numstr unsupported characters');
  33540. }
  33541. return numstr;
  33542. } else if (tag === 'octstr') {
  33543. return buffer.raw();
  33544. } else if (tag === 'objDesc') {
  33545. return buffer.raw();
  33546. } else if (tag === 'printstr') {
  33547. const printstr = buffer.raw().toString('ascii');
  33548. if (!this._isPrintstr(printstr)) {
  33549. return buffer.error('Decoding of string type: ' +
  33550. 'printstr unsupported characters');
  33551. }
  33552. return printstr;
  33553. } else if (/str$/.test(tag)) {
  33554. return buffer.raw().toString();
  33555. } else {
  33556. return buffer.error('Decoding of string type: ' + tag + ' unsupported');
  33557. }
  33558. };
  33559. DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
  33560. let result;
  33561. const identifiers = [];
  33562. let ident = 0;
  33563. let subident = 0;
  33564. while (!buffer.isEmpty()) {
  33565. subident = buffer.readUInt8();
  33566. ident <<= 7;
  33567. ident |= subident & 0x7f;
  33568. if ((subident & 0x80) === 0) {
  33569. identifiers.push(ident);
  33570. ident = 0;
  33571. }
  33572. }
  33573. if (subident & 0x80)
  33574. identifiers.push(ident);
  33575. const first = (identifiers[0] / 40) | 0;
  33576. const second = identifiers[0] % 40;
  33577. if (relative)
  33578. result = identifiers;
  33579. else
  33580. result = [first, second].concat(identifiers.slice(1));
  33581. if (values) {
  33582. let tmp = values[result.join(' ')];
  33583. if (tmp === undefined)
  33584. tmp = values[result.join('.')];
  33585. if (tmp !== undefined)
  33586. result = tmp;
  33587. }
  33588. return result;
  33589. };
  33590. DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
  33591. const str = buffer.raw().toString();
  33592. let year;
  33593. let mon;
  33594. let day;
  33595. let hour;
  33596. let min;
  33597. let sec;
  33598. if (tag === 'gentime') {
  33599. year = str.slice(0, 4) | 0;
  33600. mon = str.slice(4, 6) | 0;
  33601. day = str.slice(6, 8) | 0;
  33602. hour = str.slice(8, 10) | 0;
  33603. min = str.slice(10, 12) | 0;
  33604. sec = str.slice(12, 14) | 0;
  33605. } else if (tag === 'utctime') {
  33606. year = str.slice(0, 2) | 0;
  33607. mon = str.slice(2, 4) | 0;
  33608. day = str.slice(4, 6) | 0;
  33609. hour = str.slice(6, 8) | 0;
  33610. min = str.slice(8, 10) | 0;
  33611. sec = str.slice(10, 12) | 0;
  33612. if (year < 70)
  33613. year = 2000 + year;
  33614. else
  33615. year = 1900 + year;
  33616. } else {
  33617. return buffer.error('Decoding ' + tag + ' time is not supported yet');
  33618. }
  33619. return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
  33620. };
  33621. DERNode.prototype._decodeNull = function decodeNull() {
  33622. return null;
  33623. };
  33624. DERNode.prototype._decodeBool = function decodeBool(buffer) {
  33625. const res = buffer.readUInt8();
  33626. if (buffer.isError(res))
  33627. return res;
  33628. else
  33629. return res !== 0;
  33630. };
  33631. DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
  33632. // Bigint, return as it is (assume big endian)
  33633. const raw = buffer.raw();
  33634. let res = new bignum(raw);
  33635. if (values)
  33636. res = values[res.toString(10)] || res;
  33637. return res;
  33638. };
  33639. DERNode.prototype._use = function use(entity, obj) {
  33640. if (typeof entity === 'function')
  33641. entity = entity(obj);
  33642. return entity._getDecoder('der').tree;
  33643. };
  33644. // Utility methods
  33645. function derDecodeTag(buf, fail) {
  33646. let tag = buf.readUInt8(fail);
  33647. if (buf.isError(tag))
  33648. return tag;
  33649. const cls = der.tagClass[tag >> 6];
  33650. const primitive = (tag & 0x20) === 0;
  33651. // Multi-octet tag - load
  33652. if ((tag & 0x1f) === 0x1f) {
  33653. let oct = tag;
  33654. tag = 0;
  33655. while ((oct & 0x80) === 0x80) {
  33656. oct = buf.readUInt8(fail);
  33657. if (buf.isError(oct))
  33658. return oct;
  33659. tag <<= 7;
  33660. tag |= oct & 0x7f;
  33661. }
  33662. } else {
  33663. tag &= 0x1f;
  33664. }
  33665. const tagStr = der.tag[tag];
  33666. return {
  33667. cls: cls,
  33668. primitive: primitive,
  33669. tag: tag,
  33670. tagStr: tagStr
  33671. };
  33672. }
  33673. function derDecodeLen(buf, primitive, fail) {
  33674. let len = buf.readUInt8(fail);
  33675. if (buf.isError(len))
  33676. return len;
  33677. // Indefinite form
  33678. if (!primitive && len === 0x80)
  33679. return null;
  33680. // Definite form
  33681. if ((len & 0x80) === 0) {
  33682. // Short form
  33683. return len;
  33684. }
  33685. // Long form
  33686. const num = len & 0x7f;
  33687. if (num > 4)
  33688. return buf.error('length octect is too long');
  33689. len = 0;
  33690. for (let i = 0; i < num; i++) {
  33691. len <<= 8;
  33692. const j = buf.readUInt8(fail);
  33693. if (buf.isError(j))
  33694. return j;
  33695. len |= j;
  33696. }
  33697. return len;
  33698. }
  33699. /***/ }),
  33700. /* 240 */
  33701. /*!*******************************************************!*\
  33702. !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
  33703. \*******************************************************/
  33704. /*! no static exports found */
  33705. /***/ (function(module, exports, __webpack_require__) {
  33706. "use strict";
  33707. const inherits = __webpack_require__(/*! inherits */ 109);
  33708. const Buffer = __webpack_require__(/*! safer-buffer */ 232).Buffer;
  33709. const DERDecoder = __webpack_require__(/*! ./der */ 239);
  33710. function PEMDecoder(entity) {
  33711. DERDecoder.call(this, entity);
  33712. this.enc = 'pem';
  33713. }
  33714. inherits(PEMDecoder, DERDecoder);
  33715. module.exports = PEMDecoder;
  33716. PEMDecoder.prototype.decode = function decode(data, options) {
  33717. const lines = data.toString().split(/[\r\n]+/g);
  33718. const label = options.label.toUpperCase();
  33719. const re = /^-----(BEGIN|END) ([^-]+)-----$/;
  33720. let start = -1;
  33721. let end = -1;
  33722. for (let i = 0; i < lines.length; i++) {
  33723. const match = lines[i].match(re);
  33724. if (match === null)
  33725. continue;
  33726. if (match[2] !== label)
  33727. continue;
  33728. if (start === -1) {
  33729. if (match[1] !== 'BEGIN')
  33730. break;
  33731. start = i;
  33732. } else {
  33733. if (match[1] !== 'END')
  33734. break;
  33735. end = i;
  33736. break;
  33737. }
  33738. }
  33739. if (start === -1 || end === -1)
  33740. throw new Error('PEM section not found for: ' + label);
  33741. const base64 = lines.slice(start + 1, end).join('');
  33742. // Remove excessive symbols
  33743. base64.replace(/[^a-z0-9+/=]+/gi, '');
  33744. const input = Buffer.from(base64, 'base64');
  33745. return DERDecoder.prototype.decode.call(this, input, options);
  33746. };
  33747. /***/ }),
  33748. /* 241 */
  33749. /*!*****************************************************!*\
  33750. !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
  33751. \*****************************************************/
  33752. /*! no static exports found */
  33753. /***/ (function(module, exports, __webpack_require__) {
  33754. "use strict";
  33755. const base = exports;
  33756. base.Reporter = __webpack_require__(/*! ./reporter */ 234).Reporter;
  33757. base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 235).DecoderBuffer;
  33758. base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 235).EncoderBuffer;
  33759. base.Node = __webpack_require__(/*! ./node */ 233);
  33760. /***/ }),
  33761. /* 242 */
  33762. /*!**********************************************************!*\
  33763. !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
  33764. \**********************************************************/
  33765. /*! no static exports found */
  33766. /***/ (function(module, exports, __webpack_require__) {
  33767. "use strict";
  33768. const constants = exports;
  33769. // Helper
  33770. constants._reverse = function reverse(map) {
  33771. const res = {};
  33772. Object.keys(map).forEach(function(key) {
  33773. // Convert key to integer if it is stringified
  33774. if ((key | 0) == key)
  33775. key = key | 0;
  33776. const value = map[key];
  33777. res[value] = key;
  33778. });
  33779. return res;
  33780. };
  33781. constants.der = __webpack_require__(/*! ./der */ 236);
  33782. /***/ }),
  33783. /* 243 */
  33784. /*!************************************************!*\
  33785. !*** ./node_modules/parse-asn1/certificate.js ***!
  33786. \************************************************/
  33787. /*! no static exports found */
  33788. /***/ (function(module, exports, __webpack_require__) {
  33789. "use strict";
  33790. // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
  33791. // thanks to @Rantanen
  33792. var asn = __webpack_require__(/*! asn1.js */ 228)
  33793. var Time = asn.define('Time', function () {
  33794. this.choice({
  33795. utcTime: this.utctime(),
  33796. generalTime: this.gentime()
  33797. })
  33798. })
  33799. var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
  33800. this.seq().obj(
  33801. this.key('type').objid(),
  33802. this.key('value').any()
  33803. )
  33804. })
  33805. var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
  33806. this.seq().obj(
  33807. this.key('algorithm').objid(),
  33808. this.key('parameters').optional(),
  33809. this.key('curve').objid().optional()
  33810. )
  33811. })
  33812. var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
  33813. this.seq().obj(
  33814. this.key('algorithm').use(AlgorithmIdentifier),
  33815. this.key('subjectPublicKey').bitstr()
  33816. )
  33817. })
  33818. var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
  33819. this.setof(AttributeTypeValue)
  33820. })
  33821. var RDNSequence = asn.define('RDNSequence', function () {
  33822. this.seqof(RelativeDistinguishedName)
  33823. })
  33824. var Name = asn.define('Name', function () {
  33825. this.choice({
  33826. rdnSequence: this.use(RDNSequence)
  33827. })
  33828. })
  33829. var Validity = asn.define('Validity', function () {
  33830. this.seq().obj(
  33831. this.key('notBefore').use(Time),
  33832. this.key('notAfter').use(Time)
  33833. )
  33834. })
  33835. var Extension = asn.define('Extension', function () {
  33836. this.seq().obj(
  33837. this.key('extnID').objid(),
  33838. this.key('critical').bool().def(false),
  33839. this.key('extnValue').octstr()
  33840. )
  33841. })
  33842. var TBSCertificate = asn.define('TBSCertificate', function () {
  33843. this.seq().obj(
  33844. this.key('version').explicit(0).int().optional(),
  33845. this.key('serialNumber').int(),
  33846. this.key('signature').use(AlgorithmIdentifier),
  33847. this.key('issuer').use(Name),
  33848. this.key('validity').use(Validity),
  33849. this.key('subject').use(Name),
  33850. this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
  33851. this.key('issuerUniqueID').implicit(1).bitstr().optional(),
  33852. this.key('subjectUniqueID').implicit(2).bitstr().optional(),
  33853. this.key('extensions').explicit(3).seqof(Extension).optional()
  33854. )
  33855. })
  33856. var X509Certificate = asn.define('X509Certificate', function () {
  33857. this.seq().obj(
  33858. this.key('tbsCertificate').use(TBSCertificate),
  33859. this.key('signatureAlgorithm').use(AlgorithmIdentifier),
  33860. this.key('signatureValue').bitstr()
  33861. )
  33862. })
  33863. module.exports = X509Certificate
  33864. /***/ }),
  33865. /* 244 */
  33866. /*!********************************************!*\
  33867. !*** ./node_modules/parse-asn1/aesid.json ***!
  33868. \********************************************/
  33869. /*! 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 */
  33870. /***/ (function(module) {
  33871. 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\"}");
  33872. /***/ }),
  33873. /* 245 */
  33874. /*!********************************************!*\
  33875. !*** ./node_modules/parse-asn1/fixProc.js ***!
  33876. \********************************************/
  33877. /*! no static exports found */
  33878. /***/ (function(module, exports, __webpack_require__) {
  33879. // adapted from https://github.com/apatil/pemstrip
  33880. 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
  33881. var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
  33882. var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m
  33883. var evp = __webpack_require__(/*! evp_bytestokey */ 180)
  33884. var ciphers = __webpack_require__(/*! browserify-aes */ 163)
  33885. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  33886. module.exports = function (okey, password) {
  33887. var key = okey.toString()
  33888. var match = key.match(findProc)
  33889. var decrypted
  33890. if (!match) {
  33891. var match2 = key.match(fullRegex)
  33892. decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ''), 'base64')
  33893. } else {
  33894. var suite = 'aes' + match[1]
  33895. var iv = Buffer.from(match[2], 'hex')
  33896. var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
  33897. var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
  33898. var out = []
  33899. var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
  33900. out.push(cipher.update(cipherText))
  33901. out.push(cipher.final())
  33902. decrypted = Buffer.concat(out)
  33903. }
  33904. var tag = key.match(startRegex)[1]
  33905. return {
  33906. tag: tag,
  33907. data: decrypted
  33908. }
  33909. }
  33910. /***/ }),
  33911. /* 246 */
  33912. /*!**********************************************************!*\
  33913. !*** ./node_modules/browserify-sign/browser/curves.json ***!
  33914. \**********************************************************/
  33915. /*! 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 */
  33916. /***/ (function(module) {
  33917. 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\"}");
  33918. /***/ }),
  33919. /* 247 */
  33920. /*!********************************************************!*\
  33921. !*** ./node_modules/browserify-sign/browser/verify.js ***!
  33922. \********************************************************/
  33923. /*! no static exports found */
  33924. /***/ (function(module, exports, __webpack_require__) {
  33925. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  33926. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  33927. var BN = __webpack_require__(/*! bn.js */ 185)
  33928. var EC = __webpack_require__(/*! elliptic */ 196).ec
  33929. var parseKeys = __webpack_require__(/*! parse-asn1 */ 226)
  33930. var curves = __webpack_require__(/*! ./curves.json */ 246)
  33931. function verify (sig, hash, key, signType, tag) {
  33932. var pub = parseKeys(key)
  33933. if (pub.type === 'ec') {
  33934. // rsa keys can be interpreted as ecdsa ones in openssl
  33935. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  33936. return ecVerify(sig, hash, pub)
  33937. } else if (pub.type === 'dsa') {
  33938. if (signType !== 'dsa') throw new Error('wrong public key type')
  33939. return dsaVerify(sig, hash, pub)
  33940. } else {
  33941. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  33942. }
  33943. hash = Buffer.concat([tag, hash])
  33944. var len = pub.modulus.byteLength()
  33945. var pad = [1]
  33946. var padNum = 0
  33947. while (hash.length + pad.length + 2 < len) {
  33948. pad.push(0xff)
  33949. padNum++
  33950. }
  33951. pad.push(0x00)
  33952. var i = -1
  33953. while (++i < hash.length) {
  33954. pad.push(hash[i])
  33955. }
  33956. pad = Buffer.from(pad)
  33957. var red = BN.mont(pub.modulus)
  33958. sig = new BN(sig).toRed(red)
  33959. sig = sig.redPow(new BN(pub.publicExponent))
  33960. sig = Buffer.from(sig.fromRed().toArray())
  33961. var out = padNum < 8 ? 1 : 0
  33962. len = Math.min(sig.length, pad.length)
  33963. if (sig.length !== pad.length) out = 1
  33964. i = -1
  33965. while (++i < len) out |= sig[i] ^ pad[i]
  33966. return out === 0
  33967. }
  33968. function ecVerify (sig, hash, pub) {
  33969. var curveId = curves[pub.data.algorithm.curve.join('.')]
  33970. if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
  33971. var curve = new EC(curveId)
  33972. var pubkey = pub.data.subjectPrivateKey.data
  33973. return curve.verify(hash, sig, pubkey)
  33974. }
  33975. function dsaVerify (sig, hash, pub) {
  33976. var p = pub.data.p
  33977. var q = pub.data.q
  33978. var g = pub.data.g
  33979. var y = pub.data.pub_key
  33980. var unpacked = parseKeys.signature.decode(sig, 'der')
  33981. var s = unpacked.s
  33982. var r = unpacked.r
  33983. checkValue(s, q)
  33984. checkValue(r, q)
  33985. var montp = BN.mont(p)
  33986. var w = s.invm(q)
  33987. var v = g.toRed(montp)
  33988. .redPow(new BN(hash).mul(w).mod(q))
  33989. .fromRed()
  33990. .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
  33991. .mod(p)
  33992. .mod(q)
  33993. return v.cmp(r) === 0
  33994. }
  33995. function checkValue (b, q) {
  33996. if (b.cmpn(0) <= 0) throw new Error('invalid sig')
  33997. if (b.cmp(q) >= q) throw new Error('invalid sig')
  33998. }
  33999. module.exports = verify
  34000. /***/ }),
  34001. /* 248 */
  34002. /*!*********************************************!*\
  34003. !*** ./node_modules/create-ecdh/browser.js ***!
  34004. \*********************************************/
  34005. /*! no static exports found */
  34006. /***/ (function(module, exports, __webpack_require__) {
  34007. /* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 196)
  34008. var BN = __webpack_require__(/*! bn.js */ 185)
  34009. module.exports = function createECDH (curve) {
  34010. return new ECDH(curve)
  34011. }
  34012. var aliases = {
  34013. secp256k1: {
  34014. name: 'secp256k1',
  34015. byteLength: 32
  34016. },
  34017. secp224r1: {
  34018. name: 'p224',
  34019. byteLength: 28
  34020. },
  34021. prime256v1: {
  34022. name: 'p256',
  34023. byteLength: 32
  34024. },
  34025. prime192v1: {
  34026. name: 'p192',
  34027. byteLength: 24
  34028. },
  34029. ed25519: {
  34030. name: 'ed25519',
  34031. byteLength: 32
  34032. },
  34033. secp384r1: {
  34034. name: 'p384',
  34035. byteLength: 48
  34036. },
  34037. secp521r1: {
  34038. name: 'p521',
  34039. byteLength: 66
  34040. }
  34041. }
  34042. aliases.p224 = aliases.secp224r1
  34043. aliases.p256 = aliases.secp256r1 = aliases.prime256v1
  34044. aliases.p192 = aliases.secp192r1 = aliases.prime192v1
  34045. aliases.p384 = aliases.secp384r1
  34046. aliases.p521 = aliases.secp521r1
  34047. function ECDH (curve) {
  34048. this.curveType = aliases[curve]
  34049. if (!this.curveType) {
  34050. this.curveType = {
  34051. name: curve
  34052. }
  34053. }
  34054. this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
  34055. this.keys = void 0
  34056. }
  34057. ECDH.prototype.generateKeys = function (enc, format) {
  34058. this.keys = this.curve.genKeyPair()
  34059. return this.getPublicKey(enc, format)
  34060. }
  34061. ECDH.prototype.computeSecret = function (other, inenc, enc) {
  34062. inenc = inenc || 'utf8'
  34063. if (!Buffer.isBuffer(other)) {
  34064. other = new Buffer(other, inenc)
  34065. }
  34066. var otherPub = this.curve.keyFromPublic(other).getPublic()
  34067. var out = otherPub.mul(this.keys.getPrivate()).getX()
  34068. return formatReturnValue(out, enc, this.curveType.byteLength)
  34069. }
  34070. ECDH.prototype.getPublicKey = function (enc, format) {
  34071. var key = this.keys.getPublic(format === 'compressed', true)
  34072. if (format === 'hybrid') {
  34073. if (key[key.length - 1] % 2) {
  34074. key[0] = 7
  34075. } else {
  34076. key[0] = 6
  34077. }
  34078. }
  34079. return formatReturnValue(key, enc)
  34080. }
  34081. ECDH.prototype.getPrivateKey = function (enc) {
  34082. return formatReturnValue(this.keys.getPrivate(), enc)
  34083. }
  34084. ECDH.prototype.setPublicKey = function (pub, enc) {
  34085. enc = enc || 'utf8'
  34086. if (!Buffer.isBuffer(pub)) {
  34087. pub = new Buffer(pub, enc)
  34088. }
  34089. this.keys._importPublic(pub)
  34090. return this
  34091. }
  34092. ECDH.prototype.setPrivateKey = function (priv, enc) {
  34093. enc = enc || 'utf8'
  34094. if (!Buffer.isBuffer(priv)) {
  34095. priv = new Buffer(priv, enc)
  34096. }
  34097. var _priv = new BN(priv)
  34098. _priv = _priv.toString(16)
  34099. this.keys = this.curve.genKeyPair()
  34100. this.keys._importPrivate(_priv)
  34101. return this
  34102. }
  34103. function formatReturnValue (bn, enc, len) {
  34104. if (!Array.isArray(bn)) {
  34105. bn = bn.toArray()
  34106. }
  34107. var buf = new Buffer(bn)
  34108. if (len && buf.length < len) {
  34109. var zeros = new Buffer(len - buf.length)
  34110. zeros.fill(0)
  34111. buf = Buffer.concat([zeros, buf])
  34112. }
  34113. if (!enc) {
  34114. return buf
  34115. } else {
  34116. return buf.toString(enc)
  34117. }
  34118. }
  34119. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 104).Buffer))
  34120. /***/ }),
  34121. /* 249 */
  34122. /*!************************************************!*\
  34123. !*** ./node_modules/public-encrypt/browser.js ***!
  34124. \************************************************/
  34125. /*! no static exports found */
  34126. /***/ (function(module, exports, __webpack_require__) {
  34127. exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 250)
  34128. exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 254)
  34129. exports.privateEncrypt = function privateEncrypt (key, buf) {
  34130. return exports.publicEncrypt(key, buf, true)
  34131. }
  34132. exports.publicDecrypt = function publicDecrypt (key, buf) {
  34133. return exports.privateDecrypt(key, buf, true)
  34134. }
  34135. /***/ }),
  34136. /* 250 */
  34137. /*!******************************************************!*\
  34138. !*** ./node_modules/public-encrypt/publicEncrypt.js ***!
  34139. \******************************************************/
  34140. /*! no static exports found */
  34141. /***/ (function(module, exports, __webpack_require__) {
  34142. var parseKeys = __webpack_require__(/*! parse-asn1 */ 226)
  34143. var randomBytes = __webpack_require__(/*! randombytes */ 100)
  34144. var createHash = __webpack_require__(/*! create-hash */ 108)
  34145. var mgf = __webpack_require__(/*! ./mgf */ 251)
  34146. var xor = __webpack_require__(/*! ./xor */ 252)
  34147. var BN = __webpack_require__(/*! bn.js */ 185)
  34148. var withPublic = __webpack_require__(/*! ./withPublic */ 253)
  34149. var crt = __webpack_require__(/*! browserify-rsa */ 195)
  34150. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  34151. module.exports = function publicEncrypt (publicKey, msg, reverse) {
  34152. var padding
  34153. if (publicKey.padding) {
  34154. padding = publicKey.padding
  34155. } else if (reverse) {
  34156. padding = 1
  34157. } else {
  34158. padding = 4
  34159. }
  34160. var key = parseKeys(publicKey)
  34161. var paddedMsg
  34162. if (padding === 4) {
  34163. paddedMsg = oaep(key, msg)
  34164. } else if (padding === 1) {
  34165. paddedMsg = pkcs1(key, msg, reverse)
  34166. } else if (padding === 3) {
  34167. paddedMsg = new BN(msg)
  34168. if (paddedMsg.cmp(key.modulus) >= 0) {
  34169. throw new Error('data too long for modulus')
  34170. }
  34171. } else {
  34172. throw new Error('unknown padding')
  34173. }
  34174. if (reverse) {
  34175. return crt(paddedMsg, key)
  34176. } else {
  34177. return withPublic(paddedMsg, key)
  34178. }
  34179. }
  34180. function oaep (key, msg) {
  34181. var k = key.modulus.byteLength()
  34182. var mLen = msg.length
  34183. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  34184. var hLen = iHash.length
  34185. var hLen2 = 2 * hLen
  34186. if (mLen > k - hLen2 - 2) {
  34187. throw new Error('message too long')
  34188. }
  34189. var ps = Buffer.alloc(k - mLen - hLen2 - 2)
  34190. var dblen = k - hLen - 1
  34191. var seed = randomBytes(hLen)
  34192. var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
  34193. var maskedSeed = xor(seed, mgf(maskedDb, hLen))
  34194. return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
  34195. }
  34196. function pkcs1 (key, msg, reverse) {
  34197. var mLen = msg.length
  34198. var k = key.modulus.byteLength()
  34199. if (mLen > k - 11) {
  34200. throw new Error('message too long')
  34201. }
  34202. var ps
  34203. if (reverse) {
  34204. ps = Buffer.alloc(k - mLen - 3, 0xff)
  34205. } else {
  34206. ps = nonZero(k - mLen - 3)
  34207. }
  34208. return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
  34209. }
  34210. function nonZero (len) {
  34211. var out = Buffer.allocUnsafe(len)
  34212. var i = 0
  34213. var cache = randomBytes(len * 2)
  34214. var cur = 0
  34215. var num
  34216. while (i < len) {
  34217. if (cur === cache.length) {
  34218. cache = randomBytes(len * 2)
  34219. cur = 0
  34220. }
  34221. num = cache[cur++]
  34222. if (num) {
  34223. out[i++] = num
  34224. }
  34225. }
  34226. return out
  34227. }
  34228. /***/ }),
  34229. /* 251 */
  34230. /*!********************************************!*\
  34231. !*** ./node_modules/public-encrypt/mgf.js ***!
  34232. \********************************************/
  34233. /*! no static exports found */
  34234. /***/ (function(module, exports, __webpack_require__) {
  34235. var createHash = __webpack_require__(/*! create-hash */ 108)
  34236. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  34237. module.exports = function (seed, len) {
  34238. var t = Buffer.alloc(0)
  34239. var i = 0
  34240. var c
  34241. while (t.length < len) {
  34242. c = i2ops(i++)
  34243. t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
  34244. }
  34245. return t.slice(0, len)
  34246. }
  34247. function i2ops (c) {
  34248. var out = Buffer.allocUnsafe(4)
  34249. out.writeUInt32BE(c, 0)
  34250. return out
  34251. }
  34252. /***/ }),
  34253. /* 252 */
  34254. /*!********************************************!*\
  34255. !*** ./node_modules/public-encrypt/xor.js ***!
  34256. \********************************************/
  34257. /*! no static exports found */
  34258. /***/ (function(module, exports) {
  34259. module.exports = function xor (a, b) {
  34260. var len = a.length
  34261. var i = -1
  34262. while (++i < len) {
  34263. a[i] ^= b[i]
  34264. }
  34265. return a
  34266. }
  34267. /***/ }),
  34268. /* 253 */
  34269. /*!***************************************************!*\
  34270. !*** ./node_modules/public-encrypt/withPublic.js ***!
  34271. \***************************************************/
  34272. /*! no static exports found */
  34273. /***/ (function(module, exports, __webpack_require__) {
  34274. var BN = __webpack_require__(/*! bn.js */ 185)
  34275. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  34276. function withPublic (paddedMsg, key) {
  34277. return Buffer.from(paddedMsg
  34278. .toRed(BN.mont(key.modulus))
  34279. .redPow(new BN(key.publicExponent))
  34280. .fromRed()
  34281. .toArray())
  34282. }
  34283. module.exports = withPublic
  34284. /***/ }),
  34285. /* 254 */
  34286. /*!*******************************************************!*\
  34287. !*** ./node_modules/public-encrypt/privateDecrypt.js ***!
  34288. \*******************************************************/
  34289. /*! no static exports found */
  34290. /***/ (function(module, exports, __webpack_require__) {
  34291. var parseKeys = __webpack_require__(/*! parse-asn1 */ 226)
  34292. var mgf = __webpack_require__(/*! ./mgf */ 251)
  34293. var xor = __webpack_require__(/*! ./xor */ 252)
  34294. var BN = __webpack_require__(/*! bn.js */ 185)
  34295. var crt = __webpack_require__(/*! browserify-rsa */ 195)
  34296. var createHash = __webpack_require__(/*! create-hash */ 108)
  34297. var withPublic = __webpack_require__(/*! ./withPublic */ 253)
  34298. var Buffer = __webpack_require__(/*! safe-buffer */ 103).Buffer
  34299. module.exports = function privateDecrypt (privateKey, enc, reverse) {
  34300. var padding
  34301. if (privateKey.padding) {
  34302. padding = privateKey.padding
  34303. } else if (reverse) {
  34304. padding = 1
  34305. } else {
  34306. padding = 4
  34307. }
  34308. var key = parseKeys(privateKey)
  34309. var k = key.modulus.byteLength()
  34310. if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
  34311. throw new Error('decryption error')
  34312. }
  34313. var msg
  34314. if (reverse) {
  34315. msg = withPublic(new BN(enc), key)
  34316. } else {
  34317. msg = crt(enc, key)
  34318. }
  34319. var zBuffer = Buffer.alloc(k - msg.length)
  34320. msg = Buffer.concat([zBuffer, msg], k)
  34321. if (padding === 4) {
  34322. return oaep(key, msg)
  34323. } else if (padding === 1) {
  34324. return pkcs1(key, msg, reverse)
  34325. } else if (padding === 3) {
  34326. return msg
  34327. } else {
  34328. throw new Error('unknown padding')
  34329. }
  34330. }
  34331. function oaep (key, msg) {
  34332. var k = key.modulus.byteLength()
  34333. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  34334. var hLen = iHash.length
  34335. if (msg[0] !== 0) {
  34336. throw new Error('decryption error')
  34337. }
  34338. var maskedSeed = msg.slice(1, hLen + 1)
  34339. var maskedDb = msg.slice(hLen + 1)
  34340. var seed = xor(maskedSeed, mgf(maskedDb, hLen))
  34341. var db = xor(maskedDb, mgf(seed, k - hLen - 1))
  34342. if (compare(iHash, db.slice(0, hLen))) {
  34343. throw new Error('decryption error')
  34344. }
  34345. var i = hLen
  34346. while (db[i] === 0) {
  34347. i++
  34348. }
  34349. if (db[i++] !== 1) {
  34350. throw new Error('decryption error')
  34351. }
  34352. return db.slice(i)
  34353. }
  34354. function pkcs1 (key, msg, reverse) {
  34355. var p1 = msg.slice(0, 2)
  34356. var i = 2
  34357. var status = 0
  34358. while (msg[i++] !== 0) {
  34359. if (i >= msg.length) {
  34360. status++
  34361. break
  34362. }
  34363. }
  34364. var ps = msg.slice(2, i - 1)
  34365. if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
  34366. status++
  34367. }
  34368. if (ps.length < 8) {
  34369. status++
  34370. }
  34371. if (status) {
  34372. throw new Error('decryption error')
  34373. }
  34374. return msg.slice(i)
  34375. }
  34376. function compare (a, b) {
  34377. a = Buffer.from(a)
  34378. b = Buffer.from(b)
  34379. var dif = 0
  34380. var len = a.length
  34381. if (a.length !== b.length) {
  34382. dif++
  34383. len = Math.min(a.length, b.length)
  34384. }
  34385. var i = -1
  34386. while (++i < len) {
  34387. dif += (a[i] ^ b[i])
  34388. }
  34389. return dif
  34390. }
  34391. /***/ }),
  34392. /* 255 */
  34393. /*!********************************************!*\
  34394. !*** ./node_modules/randomfill/browser.js ***!
  34395. \********************************************/
  34396. /*! no static exports found */
  34397. /***/ (function(module, exports, __webpack_require__) {
  34398. "use strict";
  34399. /* WEBPACK VAR INJECTION */(function(global, process) {
  34400. function oldBrowser () {
  34401. throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
  34402. }
  34403. var safeBuffer = __webpack_require__(/*! safe-buffer */ 103)
  34404. var randombytes = __webpack_require__(/*! randombytes */ 100)
  34405. var Buffer = safeBuffer.Buffer
  34406. var kBufferMaxLength = safeBuffer.kMaxLength
  34407. var crypto = global.crypto || global.msCrypto
  34408. var kMaxUint32 = Math.pow(2, 32) - 1
  34409. function assertOffset (offset, length) {
  34410. if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
  34411. throw new TypeError('offset must be a number')
  34412. }
  34413. if (offset > kMaxUint32 || offset < 0) {
  34414. throw new TypeError('offset must be a uint32')
  34415. }
  34416. if (offset > kBufferMaxLength || offset > length) {
  34417. throw new RangeError('offset out of range')
  34418. }
  34419. }
  34420. function assertSize (size, offset, length) {
  34421. if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
  34422. throw new TypeError('size must be a number')
  34423. }
  34424. if (size > kMaxUint32 || size < 0) {
  34425. throw new TypeError('size must be a uint32')
  34426. }
  34427. if (size + offset > length || size > kBufferMaxLength) {
  34428. throw new RangeError('buffer too small')
  34429. }
  34430. }
  34431. if ((crypto && crypto.getRandomValues) || !process.browser) {
  34432. exports.randomFill = randomFill
  34433. exports.randomFillSync = randomFillSync
  34434. } else {
  34435. exports.randomFill = oldBrowser
  34436. exports.randomFillSync = oldBrowser
  34437. }
  34438. function randomFill (buf, offset, size, cb) {
  34439. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  34440. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  34441. }
  34442. if (typeof offset === 'function') {
  34443. cb = offset
  34444. offset = 0
  34445. size = buf.length
  34446. } else if (typeof size === 'function') {
  34447. cb = size
  34448. size = buf.length - offset
  34449. } else if (typeof cb !== 'function') {
  34450. throw new TypeError('"cb" argument must be a function')
  34451. }
  34452. assertOffset(offset, buf.length)
  34453. assertSize(size, offset, buf.length)
  34454. return actualFill(buf, offset, size, cb)
  34455. }
  34456. function actualFill (buf, offset, size, cb) {
  34457. if (process.browser) {
  34458. var ourBuf = buf.buffer
  34459. var uint = new Uint8Array(ourBuf, offset, size)
  34460. crypto.getRandomValues(uint)
  34461. if (cb) {
  34462. process.nextTick(function () {
  34463. cb(null, buf)
  34464. })
  34465. return
  34466. }
  34467. return buf
  34468. }
  34469. if (cb) {
  34470. randombytes(size, function (err, bytes) {
  34471. if (err) {
  34472. return cb(err)
  34473. }
  34474. bytes.copy(buf, offset)
  34475. cb(null, buf)
  34476. })
  34477. return
  34478. }
  34479. var bytes = randombytes(size)
  34480. bytes.copy(buf, offset)
  34481. return buf
  34482. }
  34483. function randomFillSync (buf, offset, size) {
  34484. if (typeof offset === 'undefined') {
  34485. offset = 0
  34486. }
  34487. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  34488. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  34489. }
  34490. assertOffset(offset, buf.length)
  34491. if (size === undefined) size = buf.length - offset
  34492. assertSize(size, offset, buf.length)
  34493. return actualFill(buf, offset, size)
  34494. }
  34495. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 101)))
  34496. /***/ }),
  34497. /* 256 */,
  34498. /* 257 */,
  34499. /* 258 */,
  34500. /* 259 */,
  34501. /* 260 */,
  34502. /* 261 */,
  34503. /* 262 */,
  34504. /* 263 */,
  34505. /* 264 */,
  34506. /* 265 */,
  34507. /* 266 */,
  34508. /* 267 */,
  34509. /* 268 */,
  34510. /* 269 */,
  34511. /* 270 */,
  34512. /* 271 */,
  34513. /* 272 */,
  34514. /* 273 */,
  34515. /* 274 */,
  34516. /* 275 */,
  34517. /* 276 */,
  34518. /* 277 */,
  34519. /* 278 */,
  34520. /* 279 */,
  34521. /* 280 */,
  34522. /* 281 */,
  34523. /* 282 */,
  34524. /* 283 */,
  34525. /* 284 */,
  34526. /* 285 */,
  34527. /* 286 */,
  34528. /* 287 */,
  34529. /* 288 */,
  34530. /* 289 */,
  34531. /* 290 */,
  34532. /* 291 */,
  34533. /* 292 */,
  34534. /* 293 */,
  34535. /* 294 */,
  34536. /* 295 */,
  34537. /* 296 */,
  34538. /* 297 */,
  34539. /* 298 */
  34540. /*!************************************************************************************************************************!*\
  34541. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  34542. \************************************************************************************************************************/
  34543. /*! no static exports found */
  34544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34545. "use strict";
  34546. __webpack_require__.r(__webpack_exports__);
  34547. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./z-paging-main.js?vue&type=script&lang=js& */ 299);
  34548. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  34549. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  34550. /* harmony default export */ __webpack_exports__["default"] = (_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  34551. /***/ }),
  34552. /* 299 */
  34553. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  34554. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  34555. \***************************************************************************************************************************************************************************************************************************************************************************************************************/
  34556. /*! no static exports found */
  34557. /***/ (function(module, exports, __webpack_require__) {
  34558. "use strict";
  34559. /* WEBPACK VAR INJECTION */(function(uni) {
  34560. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  34561. Object.defineProperty(exports, "__esModule", {
  34562. value: true
  34563. });
  34564. exports.default = void 0;
  34565. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  34566. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  34567. var _zPagingStatic = _interopRequireDefault(__webpack_require__(/*! ./z-paging-static */ 300));
  34568. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! ./z-paging-constant */ 301));
  34569. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! ./z-paging-utils */ 302));
  34570. var _dataHandle = _interopRequireDefault(__webpack_require__(/*! ./modules/data-handle */ 308));
  34571. var _i18n = _interopRequireDefault(__webpack_require__(/*! ./modules/i18n */ 310));
  34572. var _nvue = _interopRequireDefault(__webpack_require__(/*! ./modules/nvue */ 311));
  34573. var _empty = _interopRequireDefault(__webpack_require__(/*! ./modules/empty */ 312));
  34574. var _refresher = _interopRequireDefault(__webpack_require__(/*! ./modules/refresher */ 313));
  34575. var _loadMore = _interopRequireDefault(__webpack_require__(/*! ./modules/load-more */ 314));
  34576. var _scroller = _interopRequireDefault(__webpack_require__(/*! ./modules/scroller */ 315));
  34577. var _backToTop = _interopRequireDefault(__webpack_require__(/*! ./modules/back-to-top */ 316));
  34578. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! ./z-paging-enum */ 309));
  34579. // [z-paging]核心js
  34580. var zPagingRefresh = function zPagingRefresh() {
  34581. __webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-refresh */ "uni_modules/z-paging/components/z-paging/components/z-paging-refresh").then((function () {
  34582. return resolve(__webpack_require__(/*! ../components/z-paging-refresh */ 398));
  34583. }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
  34584. };
  34585. var zPagingLoadMore = function zPagingLoadMore() {
  34586. __webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-load-more */ "uni_modules/z-paging/components/z-paging/components/z-paging-load-more").then((function () {
  34587. return resolve(__webpack_require__(/*! ../components/z-paging-load-more */ 405));
  34588. }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
  34589. };
  34590. var zPagingEmptyView = function zPagingEmptyView() {
  34591. __webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view */ "uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view").then((function () {
  34592. return resolve(__webpack_require__(/*! ../../z-paging-empty-view/z-paging-empty-view */ 391));
  34593. }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
  34594. };
  34595. var systemInfo = uni.getSystemInfoSync();
  34596. var _default2 = {
  34597. name: "z-paging",
  34598. components: {
  34599. zPagingRefresh: zPagingRefresh,
  34600. zPagingLoadMore: zPagingLoadMore,
  34601. zPagingEmptyView: zPagingEmptyView
  34602. },
  34603. mixins: [_dataHandle.default, _i18n.default, _nvue.default, _empty.default, _refresher.default, _loadMore.default, _scroller.default, _backToTop.default],
  34604. data: function data() {
  34605. return {
  34606. //--------------静态资源---------------
  34607. base64Arrow: _zPagingStatic.default.base64Arrow,
  34608. base64Flower: _zPagingStatic.default.base64Flower,
  34609. base64BackToTop: _zPagingStatic.default.base64BackToTop,
  34610. //-------------全局数据相关--------------
  34611. //当前加载类型
  34612. loadingType: _zPagingEnum.default.LoadingType.Refresher,
  34613. requestTimeStamp: 0,
  34614. chatRecordLoadingMoreText: '',
  34615. wxsPropType: '',
  34616. renderPropScrollTop: -1,
  34617. renderPropUsePageScroll: -1,
  34618. checkScrolledToBottomTimeOut: null,
  34619. systemInfo: null,
  34620. cssSafeAreaInsetBottom: -1,
  34621. cacheTopHeight: 0,
  34622. //--------------状态&判断---------------
  34623. insideOfPaging: -1,
  34624. loading: false,
  34625. loadingForNow: false,
  34626. isLoadFailed: false,
  34627. isIos: systemInfo.platform === 'ios',
  34628. disabledBounce: false,
  34629. fromCompleteEmit: false,
  34630. disabledCompleteEmit: false,
  34631. //---------------wxs相关---------------
  34632. wxsIsScrollTopInTopRange: true,
  34633. wxsScrollTop: 0,
  34634. wxsPageScrollTop: 0,
  34635. wxsOnPullingDown: false
  34636. };
  34637. },
  34638. props: {
  34639. //调用complete后延迟处理的时间,单位为毫秒,默认0毫秒,优先级高于minDelay
  34640. delay: {
  34641. type: [Number, String],
  34642. default: _zPagingUtils.default.gc('delay', 0)
  34643. },
  34644. //触发@query后最小延迟处理的时间,单位为毫秒,默认0毫秒,优先级低于delay(假设设置为300毫秒,若分页请求时间小于300毫秒,则在调用complete后延迟[300毫秒-请求时长];若请求时长大于300毫秒,则不延迟),当show-refresher-when-reload为true或reload(true)时,其最小值为400
  34645. minDelay: {
  34646. type: [Number, String],
  34647. default: _zPagingUtils.default.gc('minDelay', 0)
  34648. },
  34649. //设置z-paging的style,部分平台(如微信小程序)无法直接修改组件的style,可使用此属性代替
  34650. pagingStyle: {
  34651. type: Object,
  34652. default: function _default() {
  34653. return _zPagingUtils.default.gc('pagingStyle', {});
  34654. }
  34655. },
  34656. //z-paging的高度,优先级低于pagingStyle中设置的height;传字符串,如100px、100rpx、100%
  34657. height: {
  34658. type: String,
  34659. default: _zPagingUtils.default.gc('height', '')
  34660. },
  34661. //z-paging的宽度,优先级低于pagingStyle中设置的width;传字符串,如100px、100rpx、100%
  34662. width: {
  34663. type: String,
  34664. default: _zPagingUtils.default.gc('width', '')
  34665. },
  34666. //z-paging的背景色,优先级低于pagingStyle中设置的background。传字符串,如"#ffffff"
  34667. bgColor: {
  34668. type: String,
  34669. default: _zPagingUtils.default.gc('bgColor', '')
  34670. },
  34671. //设置z-paging的容器(插槽的父view)的style
  34672. pagingContentStyle: {
  34673. type: Object,
  34674. default: function _default() {
  34675. return _zPagingUtils.default.gc('pagingContentStyle', {});
  34676. }
  34677. },
  34678. //z-paging是否自动高度,若自动高度则会自动铺满屏幕
  34679. autoHeight: {
  34680. type: Boolean,
  34681. default: _zPagingUtils.default.gc('autoHeight', false)
  34682. },
  34683. //z-paging是否自动高度时,附加的高度,注意添加单位px或rpx,若需要减少高度,则传负数
  34684. autoHeightAddition: {
  34685. type: [Number, String],
  34686. default: _zPagingUtils.default.gc('autoHeightAddition', '0px')
  34687. },
  34688. //loading(下拉刷新、上拉加载更多)的主题样式,支持black,white,默认black
  34689. defaultThemeStyle: {
  34690. type: String,
  34691. default: function _default() {
  34692. return _zPagingUtils.default.gc('defaultThemeStyle', 'black');
  34693. }
  34694. },
  34695. //是否使用虚拟列表,默认为否
  34696. useVirtualList: {
  34697. type: Boolean,
  34698. default: _zPagingUtils.default.gc('useVirtualList', false)
  34699. },
  34700. //z-paging是否使用fixed布局,若使用fixed布局,则z-paging的父view无需固定高度,z-paging高度默认为100%,默认为是(当使用内置scroll-view滚动时有效)
  34701. fixed: {
  34702. type: Boolean,
  34703. default: _zPagingUtils.default.gc('fixed', true)
  34704. },
  34705. //是否开启底部安全区域适配
  34706. safeAreaInsetBottom: {
  34707. type: Boolean,
  34708. default: _zPagingUtils.default.gc('safeAreaInsetBottom', false)
  34709. },
  34710. //第一次加载后自动隐藏loading slot,默认为是
  34711. autoHideLoadingAfterFirstLoaded: {
  34712. type: Boolean,
  34713. default: _zPagingUtils.default.gc('autoHideLoadingAfterFirstLoaded', true)
  34714. },
  34715. //loading slot是否铺满屏幕并固定,默认为否
  34716. loadingFullFixed: {
  34717. type: Boolean,
  34718. default: _zPagingUtils.default.gc('loadingFullFixed', false)
  34719. },
  34720. //slot="top"的view的z-index,默认为99,仅使用页面滚动时有效
  34721. topZIndex: {
  34722. type: Number,
  34723. default: _zPagingUtils.default.gc('topZIndex', 99)
  34724. },
  34725. //z-paging内容容器父view的z-index,默认为1
  34726. superContentZIndex: {
  34727. type: Number,
  34728. default: _zPagingUtils.default.gc('superContentZIndex', 1)
  34729. },
  34730. //z-paging内容容器部分的z-index,默认为10
  34731. contentZIndex: {
  34732. type: Number,
  34733. default: _zPagingUtils.default.gc('contentZIndex', 10)
  34734. },
  34735. //使用页面滚动时,是否在不满屏时自动填充满屏幕,默认为是
  34736. autoFullHeight: {
  34737. type: Boolean,
  34738. default: _zPagingUtils.default.gc('autoFullHeight', true)
  34739. },
  34740. //是否将错误信息打印至控制台,默认为是
  34741. showConsoleError: {
  34742. type: Boolean,
  34743. default: _zPagingUtils.default.gc('showConsoleError', true)
  34744. }
  34745. },
  34746. mounted: function mounted() {
  34747. var _this = this;
  34748. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  34749. this.renderJsIgnore;
  34750. if (!this.refresherOnly && this.mountedAutoCallReload && this.auto) {
  34751. this.$nextTick(function () {
  34752. _this._preReload();
  34753. });
  34754. }
  34755. var delay = 0;
  34756. delay = 100;
  34757. this.$nextTick(function () {
  34758. _this.systemInfo = uni.getSystemInfoSync();
  34759. if (!_this.usePageScroll && _this.autoHeight) {
  34760. _this._setAutoHeight();
  34761. }
  34762. _this.loaded = true;
  34763. });
  34764. this.updatePageScrollTopHeight();
  34765. this.updatePageScrollBottomHeight();
  34766. if (this.finalRefresherEnabled && this.useCustomRefresher) {
  34767. this.$nextTick(function () {
  34768. _this.isTouchmoving = true;
  34769. });
  34770. }
  34771. this._onEmit();
  34772. this.$nextTick(function () {
  34773. setTimeout(function () {
  34774. _this._getCssSafeAreaInsetBottom();
  34775. }, delay);
  34776. });
  34777. },
  34778. destroyed: function destroyed() {
  34779. this._offEmit();
  34780. },
  34781. watch: {
  34782. loadingStatus: function loadingStatus(newVal, oldVal) {
  34783. var _this2 = this;
  34784. this.$emit('loadingStatusChange', newVal);
  34785. this.$nextTick(function () {
  34786. _this2.loadingStatusAfterRender = newVal;
  34787. });
  34788. },
  34789. loading: function loading(newVal) {
  34790. if (newVal) {
  34791. this.loadingForNow = newVal;
  34792. }
  34793. },
  34794. defaultThemeStyle: {
  34795. handler: function handler(newVal) {
  34796. if (newVal.length) {
  34797. this.finalRefresherDefaultStyle = newVal;
  34798. }
  34799. },
  34800. immediate: true
  34801. },
  34802. autoHeight: function autoHeight(newVal, oldVal) {
  34803. if (this.loaded && !this.usePageScroll) {
  34804. this._setAutoHeight(newVal);
  34805. }
  34806. },
  34807. autoHeightAddition: function autoHeightAddition(newVal, oldVal) {
  34808. if (this.loaded && !this.usePageScroll && this.autoHeight) {
  34809. this._setAutoHeight(newVal);
  34810. }
  34811. }
  34812. },
  34813. computed: {
  34814. zScopedSlots: function zScopedSlots() {
  34815. return this.$scopedSlots;
  34816. },
  34817. finalPagingStyle: function finalPagingStyle() {
  34818. var pagingStyle = this.pagingStyle;
  34819. if (!this.systemInfo) return pagingStyle;
  34820. var windowTop = this.systemInfo.windowTop;
  34821. var windowBottom = this.systemInfo.windowBottom;
  34822. if (!this.usePageScroll && this.fixed) {
  34823. if (windowTop && !pagingStyle.top) {
  34824. pagingStyle.top = windowTop + 'px';
  34825. }
  34826. if (!pagingStyle.bottom) {
  34827. var bottom = windowBottom ? windowBottom : 0;
  34828. if (this.safeAreaInsetBottom) {
  34829. bottom += this.safeAreaBottom;
  34830. }
  34831. if (bottom > 0) {
  34832. pagingStyle.bottom = bottom + 'px';
  34833. }
  34834. }
  34835. }
  34836. if (this.bgColor.length && !pagingStyle['background']) {
  34837. pagingStyle['background'] = this.bgColor;
  34838. }
  34839. if (this.height.length && !pagingStyle['height']) {
  34840. pagingStyle['height'] = this.height;
  34841. }
  34842. if (this.width.length && !pagingStyle['width']) {
  34843. pagingStyle['width'] = this.width;
  34844. }
  34845. return pagingStyle;
  34846. },
  34847. finalLowerThreshold: function finalLowerThreshold() {
  34848. return _zPagingUtils.default.convertTextToPx(this.lowerThreshold);
  34849. },
  34850. finalPagingContentStyle: function finalPagingContentStyle() {
  34851. if (this.contentZIndex != 1) {
  34852. this.pagingContentStyle['z-index'] = this.contentZIndex;
  34853. this.pagingContentStyle['position'] = 'relative';
  34854. }
  34855. return this.pagingContentStyle;
  34856. },
  34857. showLoading: function showLoading() {
  34858. if (this.firstPageLoaded || !this.loading || !this.loadingForNow) return false;
  34859. if (this.autoHideLoadingAfterFirstLoaded) {
  34860. return this.fromEmptyViewReload ? true : !this.pagingLoaded;
  34861. } else {
  34862. return this.loadingType === _zPagingEnum.default.LoadingType.Refresher;
  34863. }
  34864. },
  34865. safeAreaBottom: function safeAreaBottom() {
  34866. if (!this.systemInfo) return 0;
  34867. var safeAreaBottom = 0;
  34868. safeAreaBottom = this.cssSafeAreaInsetBottom === -1 ? 0 : this.cssSafeAreaInsetBottom;
  34869. return safeAreaBottom;
  34870. },
  34871. renderJsIgnore: function renderJsIgnore() {
  34872. var _this3 = this;
  34873. if (this.usePageScroll && this.useChatRecordMode || !this.refresherEnabled || !this.useCustomRefresher) {
  34874. this.$nextTick(function () {
  34875. _this3.renderPropScrollTop = 10;
  34876. });
  34877. }
  34878. return 0;
  34879. },
  34880. windowHeight: function windowHeight() {
  34881. return !this.systemInfo ? 0 : this.systemInfo.windowHeight || 0;
  34882. },
  34883. windowTop: function windowTop() {
  34884. return !this.systemInfo ? 0 : this.systemInfo.windowTop || 0;
  34885. },
  34886. windowBottom: function windowBottom() {
  34887. if (!this.systemInfo) return 0;
  34888. var windowBottom = this.systemInfo.windowBottom || 0;
  34889. if (this.safeAreaInsetBottom) {
  34890. windowBottom += this.safeAreaBottom;
  34891. }
  34892. return windowBottom;
  34893. }
  34894. },
  34895. methods: {
  34896. //当前版本号
  34897. getVersion: function getVersion() {
  34898. return "z-paging v".concat(zConstant.version);
  34899. },
  34900. //设置nvue List的specialEffects
  34901. setSpecialEffects: function setSpecialEffects(args) {
  34902. this.setListSpecialEffects(args);
  34903. },
  34904. //与setSpecialEffects等效,兼容旧版本
  34905. setListSpecialEffects: function setListSpecialEffects(args) {
  34906. this.nFixFreezing = args !== {};
  34907. if (this.isIos) {
  34908. this.privateRefresherEnabled = 0;
  34909. }
  34910. if (!this.usePageScroll) {
  34911. this.$refs['n-list'].setSpecialEffects(args);
  34912. }
  34913. },
  34914. //处理开始加载更多状态
  34915. _startLoading: function _startLoading() {
  34916. var isReload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  34917. if (this.showLoadingMoreWhenReload && !this.isUserPullDown || !isReload) {
  34918. this.loadingStatus = _zPagingEnum.default.More.Loading;
  34919. }
  34920. this.loading = true;
  34921. },
  34922. //检测scrollView是否要铺满屏幕
  34923. _doCheckScrollViewShouldFullHeight: function _doCheckScrollViewShouldFullHeight(totalData) {
  34924. var _this4 = this;
  34925. if (this.autoFullHeight && this.usePageScroll && this.isTotalChangeFromAddData) {
  34926. this.$nextTick(function () {
  34927. _this4._checkScrollViewShouldFullHeight(function (scrollViewNode, pagingContainerNode) {
  34928. _this4._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, scrollViewNode, pagingContainerNode);
  34929. });
  34930. });
  34931. } else {
  34932. this._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData);
  34933. }
  34934. },
  34935. //检测z-paging是否要全屏覆盖(当使用页面滚动并且不满全屏时,默认z-paging需要铺满全屏,避免数据过少时内部的empty-view无法正确展示)
  34936. _checkScrollViewShouldFullHeight: function _checkScrollViewShouldFullHeight(callback) {
  34937. var _this5 = this;
  34938. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  34939. var scrollViewNode, pagingContainerNode, scrollViewHeight, scrollViewTop;
  34940. return _regenerator.default.wrap(function _callee$(_context) {
  34941. while (1) {
  34942. switch (_context.prev = _context.next) {
  34943. case 0:
  34944. _context.prev = 0;
  34945. _context.next = 3;
  34946. return _this5._getNodeClientRect('.zp-scroll-view');
  34947. case 3:
  34948. scrollViewNode = _context.sent;
  34949. _context.next = 6;
  34950. return _this5._getNodeClientRect('.zp-paging-container-content');
  34951. case 6:
  34952. pagingContainerNode = _context.sent;
  34953. if (!(!scrollViewNode || !pagingContainerNode)) {
  34954. _context.next = 9;
  34955. break;
  34956. }
  34957. return _context.abrupt("return");
  34958. case 9:
  34959. scrollViewHeight = pagingContainerNode[0].height;
  34960. scrollViewTop = scrollViewNode[0].top;
  34961. if (_this5.isAddedData && scrollViewHeight + scrollViewTop <= _this5.windowHeight) {
  34962. _this5._setAutoHeight(true, scrollViewNode);
  34963. callback(scrollViewNode, pagingContainerNode);
  34964. } else {
  34965. _this5._setAutoHeight(false);
  34966. callback(null, null);
  34967. }
  34968. _context.next = 17;
  34969. break;
  34970. case 14:
  34971. _context.prev = 14;
  34972. _context.t0 = _context["catch"](0);
  34973. callback(null, null);
  34974. case 17:
  34975. case "end":
  34976. return _context.stop();
  34977. }
  34978. }
  34979. }, _callee, null, [[0, 14]]);
  34980. }))();
  34981. },
  34982. //设置z-paging高度
  34983. _setAutoHeight: function _setAutoHeight() {
  34984. var _arguments = arguments,
  34985. _this6 = this;
  34986. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  34987. var shouldFullHeight, scrollViewNode, heightKey, finalScrollViewNode, finalScrollBottomNode, scrollViewTop, scrollViewHeight, additionHeight;
  34988. return _regenerator.default.wrap(function _callee2$(_context2) {
  34989. while (1) {
  34990. switch (_context2.prev = _context2.next) {
  34991. case 0:
  34992. shouldFullHeight = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;
  34993. scrollViewNode = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : null;
  34994. heightKey = 'height';
  34995. if (_this6.usePageScroll) {
  34996. heightKey = 'min-height';
  34997. }
  34998. _context2.prev = 4;
  34999. if (!shouldFullHeight) {
  35000. _context2.next = 20;
  35001. break;
  35002. }
  35003. if (!scrollViewNode) {
  35004. _context2.next = 10;
  35005. break;
  35006. }
  35007. _context2.t0 = scrollViewNode;
  35008. _context2.next = 13;
  35009. break;
  35010. case 10:
  35011. _context2.next = 12;
  35012. return _this6._getNodeClientRect('.scroll-view');
  35013. case 12:
  35014. _context2.t0 = _context2.sent;
  35015. case 13:
  35016. finalScrollViewNode = _context2.t0;
  35017. _context2.next = 16;
  35018. return _this6._getNodeClientRect('.zp-page-scroll-bottom');
  35019. case 16:
  35020. finalScrollBottomNode = _context2.sent;
  35021. if (finalScrollViewNode) {
  35022. scrollViewTop = finalScrollViewNode[0].top;
  35023. scrollViewHeight = _this6.windowHeight - scrollViewTop;
  35024. if (finalScrollBottomNode) {
  35025. scrollViewHeight -= finalScrollBottomNode[0].height;
  35026. }
  35027. additionHeight = _zPagingUtils.default.convertTextToPx(_this6.autoHeightAddition);
  35028. _this6.$set(_this6.scrollViewStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  35029. _this6.$set(_this6.scrollViewInStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  35030. }
  35031. _context2.next = 22;
  35032. break;
  35033. case 20:
  35034. _this6.$delete(_this6.scrollViewStyle, heightKey);
  35035. _this6.$delete(_this6.scrollViewInStyle, heightKey);
  35036. case 22:
  35037. _context2.next = 26;
  35038. break;
  35039. case 24:
  35040. _context2.prev = 24;
  35041. _context2.t1 = _context2["catch"](4);
  35042. case 26:
  35043. case "end":
  35044. return _context2.stop();
  35045. }
  35046. }
  35047. }, _callee2, null, [[4, 24]]);
  35048. }))();
  35049. },
  35050. //通过获取css设置的底部安全区域占位view高度设置bottom距离
  35051. _getCssSafeAreaInsetBottom: function _getCssSafeAreaInsetBottom() {
  35052. var _this7 = this;
  35053. this._getNodeClientRect('.zp-safe-area-inset-bottom').then(function (res) {
  35054. if (res) {
  35055. _this7.cssSafeAreaInsetBottom = res[0].height;
  35056. if (_this7.safeAreaInsetBottom) {
  35057. _this7.updatePageScrollBottomHeight();
  35058. }
  35059. }
  35060. });
  35061. },
  35062. //触发更新是否超出页面状态
  35063. _updateInsideOfPaging: function _updateInsideOfPaging() {
  35064. var _this8 = this;
  35065. if (this.insideMore && this.insideOfPaging === true) {
  35066. setTimeout(function () {
  35067. _this8.doLoadMore();
  35068. }, 200);
  35069. }
  35070. },
  35071. //获取节点尺寸
  35072. _getNodeClientRect: function _getNodeClientRect(select) {
  35073. var inThis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35074. var scrollOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35075. var res = inThis ? uni.createSelectorQuery().in(this) : uni.createSelectorQuery();
  35076. if (scrollOffset) {
  35077. res.select(select).scrollOffset();
  35078. } else {
  35079. res.select(select).boundingClientRect();
  35080. }
  35081. return new Promise(function (resolve, reject) {
  35082. res.exec(function (data) {
  35083. resolve(data && data != '' && data != undefined && data.length ? data : false);
  35084. });
  35085. });
  35086. },
  35087. //清除timeout
  35088. _cleanTimeout: function _cleanTimeout(timeout) {
  35089. if (timeout) {
  35090. clearTimeout(timeout);
  35091. timeout = null;
  35092. }
  35093. return timeout;
  35094. },
  35095. //添加全局emit监听
  35096. _onEmit: function _onEmit() {
  35097. var _this9 = this;
  35098. uni.$on(_zPagingConstant.default.i18nUpdateKey, function () {
  35099. _this9.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  35100. });
  35101. uni.$on(_zPagingConstant.default.errorUpdateKey, function () {
  35102. if (_this9.loading) {
  35103. _this9.complete(false);
  35104. }
  35105. });
  35106. uni.$on(_zPagingConstant.default.completeUpdateKey, function (data) {
  35107. setTimeout(function () {
  35108. if (_this9.loading) {
  35109. if (!_this9.disabledCompleteEmit) {
  35110. var type = data.type || 'normal';
  35111. var list = data.list || data;
  35112. var rule = data.rule;
  35113. _this9.fromCompleteEmit = true;
  35114. switch (type) {
  35115. case 'normal':
  35116. _this9.complete(list);
  35117. break;
  35118. case 'total':
  35119. _this9.completeByTotal(list, rule);
  35120. break;
  35121. case 'nomore':
  35122. _this9.completeByNoMore(list, rule);
  35123. break;
  35124. case 'key':
  35125. _this9.completeByKey(list, rule);
  35126. break;
  35127. default:
  35128. break;
  35129. }
  35130. } else {
  35131. _this9.disabledCompleteEmit = false;
  35132. }
  35133. }
  35134. }, 1);
  35135. });
  35136. },
  35137. //销毁全局emit监听
  35138. _offEmit: function _offEmit() {
  35139. uni.$off(_zPagingConstant.default.i18nUpdateKey);
  35140. uni.$off(_zPagingConstant.default.errorUpdateKey);
  35141. uni.$off(_zPagingConstant.default.completeUpdateKey);
  35142. }
  35143. }
  35144. };
  35145. exports.default = _default2;
  35146. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  35147. /***/ }),
  35148. /* 300 */
  35149. /*!*************************************************************************************************!*\
  35150. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-static.js ***!
  35151. \*************************************************************************************************/
  35152. /*! no static exports found */
  35153. /***/ (function(module, exports, __webpack_require__) {
  35154. "use strict";
  35155. Object.defineProperty(exports, "__esModule", {
  35156. value: true
  35157. });
  35158. exports.default = void 0;
  35159. // [z-paging]公用的静态图片资源
  35160. var base64Arrow = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAD1BMVEVHcExRUVFMTExRUVFRUVE9CdWsAAAABHRSTlMAjjrY9ZnUjwAAAQFJREFUWMPt2MsNgzAMgGEEE1B1gKJmAIRYoCH7z9RCXrabh33iYktcIv35EEg5ZBh07pvxJU6MFSPOSRnjnBUjUsaciRUjMsb4xIoRCWNiYsUInzE5sWKEyxiYWDbyefqHx1zIeiYTk7mQYziTYecxHvEJjwmIT3hMQELCYSISEg4TkZj0mYTEpM8kJCU9JiMp6TEZyUmbAUhO2gxAQNJiIAKSFgMRmNQZhMCkziAEJTUGIyipMRjBSZkhCE7KDEFIUmTeGCHJxWz0zXaE0GTCG8ZFtEaS347r/1fe11YyHYVfubxayfjoHmc0YYwmmmiiiSaaaKLJ7ckyz5ve+dw3Xw2emdwm9xSbAAAAAElFTkSuQmCC';
  35161. var base64ArrowWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVHcEz///////////////////+IGTx/AAAABnRSTlMA/dAkXZOhASU/AAABYElEQVRYw+2YwXLCIBCGsdAHWGbyAKZ4zxi9O017rxLf/1UaWFAgA1m8dcpedNSPf/l/Vh0Ya/Wn6hN0JcGvoCqRM4C8VBFiDwBqqNuJKV0rAnCgy3AUqZE57x0iqTL8Br4U3WBf/YWaIlTKfAcELU/h9w72CSVPa3C3OCDvhpHbRp/s2vq4fHhCeiCl2A3m4Qd71DQR257mFBlMcTlbFnFWzNtHxewYEfSiaLS4el8d8nyhmKJd1CF4eOS0keLMAuSxubLBIeIGQW8YHCFFo7EH9+YDcQt9FMZEswTheaNxTHwHT8SZorJjMrEVwo4Zo0U8HSEyZvJMOg4RjnmmRr8nDYeIz3OMkbfE/QhBo+U9RnZJxjGCRh/WKmHEMWLNkfPKsGh/CWJk1JjG0kcuJggTt34VDP8aWAFhp4nybVb5+9qQhjSkIQ1pSEMa8k+Q5U9rV3dF8MpFBK+/7miVq1/HZ2qmo9D+pAAAAABJRU5ErkJggg==';
  35162. var base64Flower = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAKlBMVEVHcEzDw8Ovr6+pqamUlJTCwsKenp61tbWxsbGysrLNzc2bm5u5ubmjo6MpovhuAAAACnRSTlMA/P79/sHDhiZS0DxZowAABBBJREFUWMPtl89rE0EUx7ctTXatB3MI1SWnDbUKPUgXqh4ED8Uf7KUVSm3ooVSpSii0Fn/gD4j4o+APiEoVmos9FO2celiqZVgwgaKHPQiCCkv+F99kM7Ozm5kxq1dfD91k9pPve9/3ZjbRNHHok/mKli4eIPNgSuRObuN9SqSEzM20iGnm0yIbqCuV7NSSSIV7uyPM6JMBYdeTOanh/QihJYZsUCSby+VkMj2AvOt0rAeQAwqE3lfKMZVlQCZk1QOCKkkVPadITCfIRNKxfoJI5+0OIFtJx14CMSg1mRSDko7VAfksRQzEbGYqxOJcVTWMCH2I1/IACNW0PWU2M8cmAVHtnH5mM1VRWtwKZjOd5JbF6s1IbaYqaotjNlPHgDAnlAizubTR6ovMYn052g/U5qcmOpi0WL8xTS/3IfSet5m8MEr5ajjF5le6dq/OJpobrdY0t3i9QgefWrxW9/1BLhk0E9m8FeUMhhXal499iD0eQRfDF+ts/tttORRerfp+oV7f4xJj82iUYm1Yzod+ZQEAlS/8mMBwKebVmCVp1f0JLS6zKd17+iwRKTARVg2SHtz3iEbBH+Q+U28zW2Jiza8Tjb1YFoYZMsJyjDqp3M9XBQdSdPLFdxEpvOB37JrHcmR/y9+LgoTlCFGZEa2sc6d4PGlweEa2JSVPoVm+IfGG3ZL037iV9oH+P+Jxc4HGVflNq1M0pivao/EopO4b/ojVCP9GjmiXOeS0DOn1o/iiccT4ORnyvBGF3yUywkQajW4Ti0SGuiy/wVSg/L8w+X/8Q+hvUx8Xd90z4oV5a1i88MbFWHz0WZZ1UrTwBGPX3Rat9AFiXRMRjoMdIdJLEOt2h7jrYOzgOamKZSWSNspOS0X8SAqRYmxRL7sg4eLzYmNehcxh3uoyud/BH2Udux4ywxFTc1xC7Mgf4vMhc5S+kSH3Y7yj+qpwIWSoPTVCOOPVthGx9FbGqrwFw6wSFxJr+17zeKcztt3u+2roAEVgUjDd+AHGuxHy2rZHaa8JMkTHEeyi85ANPO9j9BVuBRD2FY5LDMo/Sz/2hReqGIs/KiFin+CsPsYO/yvM3jL2vE8EbX7/Bf8ejtr2GLN65bioAdgLd8Bis/mD5GmP2qeqyo2ZwQEOtAjRIDH7mBKpUcMoApbZJ5UIxkEwxyMZyMxW/uKFvHCFR3SSmerHyDNQ2dF4JG6zIMpBgLfjSF9x1D6smFcYnGApjmSLICO3ecCDWrQ48geba9DI3STy2i7ax6WIB62fSyIZIiO3GFQqSURp8wCo7GhJBGwuSovJBNjb7kT6FPVnIa9qJ2Ko+l9mefGIdinaMp0yC1URYiwsdfNE45EuA5Cx9EhalfvN5s+UyItm81vaB3p4joniN+SCP7Qc1hblAAAAAElFTkSuQmCC';
  35163. var base64FlowerWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEX///9HcEz///////////////84chYNAAAABnRSTlP/AGzCOYZj5g1nAAACfklEQVRYw+2YTVPDIBCGtza9Jw25a0bvcax30o73OOr//yvma2F3YWlpPTijXNpAHrK8LLALVPFium2vNIFSbwGKTGQA2GUiHcD29yDNy3sMIdUBQl7r2H8mOEVqAHgPkYZUS6Qc2zYhQqtjyDZEximCZwWZLIBeIgYShs2NzxKpSUehYpMJhURGb+O+w5BpMCAREKPnCDHbIY20SzhM5yxziAXpOiBXydrekT9i5XDEq4NIIHHgyU5mRGqviII4mREJJA4QJzMiILwlRJzpKxJKvCBm8OsBBbLux0tsPl4RKYm5aPu6jw1U4mGxEUR9g8M1PcqBEp/WJliNgYOXueBzS4jZSIcgY5lCtevgDSgyzE+rAfuOTQMq0yzvoGH18qju27Mayzs4fPyMziCx81NJa5RNfW7vPYK9KOfDiVkBxFHG8hAj9txuoBuSWORsFfkpBf7xKFLSeaOefEojh5jz22DJEqMP8fUyaKdQx+RnG+yXMpe8Aars8ueR1pVH/bW3FyyvPRw90upLDHwpgBDtg4aUBNkxRLXMAi03IhcZtr1m+FeI/O/JNyDmmL1djLOauSlNflBpW18RQ2bPqXI22MXXEk75KRHTnkPkYbESbdKP2ZFk0r5sIwffAjy1lx+vx7NLjB6/E7Jfv5ERKhzpN0w8IDE8IGFDv5dhz10s7GFiXRZcUeLCEG5P5nDq9k4PFDcoMpE3GY4OuxuCXhmuyNB6k0RsLIAvqp9NE5r8ZCSS8gxnUp7ODdYhZTqxuiJ9uyJJtPmpqJ7wVj+XVieS903iViHziqAhchLEJAyb7jWU647EpUofQ0ziUuXXXhDddtlllSwjgSQu7r4BRWhQqfDPMVwAAAAASUVORK5CYII=';
  35164. var base64Success = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVRUVFHcExTU1NRUVFRUVFRUVFOSlSUAAAABnRSTlP/AI6+VySB3ZENAAACcElEQVRYw+2YyYKCMAyGI8hdpdxdZu7gcpdZ7jL6/s8yYheSNi0aPdqbwOffpGmaFOYPD3gj4bisN7vddv17N/JVgxn5x12IWgIaWTuO/IE3PseQbwjGPo2cgRmHFLJwdm/X643zwiqOKPPJ1nj3sjEP2iiifZWj5bhopSyGaEO2HX5fbQJzwJ+W7x/jw5ZFjsEU0PMph9xE8i5EqprKALW95eJQURkgzw98uJ/JvwGecR7bIjWWsUgVrrIfFZ2HlLy3sKETD1mmRLRMRhGVssRa0xJkdn3SpJBymBkM8+pSSDXMDNyDaToVHd2fgpNt0sjwiUZO19+jGQ+gQEg9Oq+bufmAVGihomNmjQG7UG3020vrlm7lkFnKFGU3kZ0KGAdmKe821pipQ+qEKcrZeTL2g5FsUks4cStjEZWwXg0b0n4GxmEpkWwIs5VBynjgK7xZaz1/0D7OxkVuLpsY5BQNFyLS84VBjjbg0iL2r2EQHBOxBhikuUOkdxODVF1cxHoWtPPsiyXO455Iv34hssCO8EV4ZIYTjS8SR4qYSHRiTiYQ4ZFbHi0iIhhBTi6dTCgSWRcnw4h4yGTuyTAiOGBIWGoZTgSHJQl+LcOJ4OCnW6yX2bMnJ9pidCOXtkTkTrIGpYuOynAiOF14SamMiOCk5Ke+mq8BcOrrvym8d0zKIQnWT+M1WwOQNO4fFiWb18hhERxJPx2fblbPHHyC41VyiAtKBUFBIih7JMWVoIQTFIr3lKPN80WvoLSWFPC653ioTZA0I0FrQ7qU6asaK0H7JmkSJa2ooOGVtNUsc3j9FYHkIkJy3SG6VHnfXKXGP9t4N9Q4Ye98AAAAAElFTkSuQmCC';
  35165. var base64SuccessWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAiVYk6KvDHLfaegAAAo1JREFUWMPtWEtzmzAQNhCTq910ytXpiyvxTNOr60zrayepx9d02gnX4sTm7xcEiJX2gdnkGJ1A4tOnfWqXyeR1vMRYzrcPD9v5h5MBl3/Ldvx4cxIg/FWC8X0xjLjalM54uhhCfCrRuJURX0pi3EmIqZV7O59vrRZmguStHL9b7S7ftfLwOtiZDw7AHMtmquAQ12b5Wwbnordm8g9zLLO49qc/m2n6aKnhwPOGZ08hAiNHhheiHae1lOUPGZpQkPKa3q0mOUjaRzSRaGUjpy/mmWSwySSpllcEteBKAT52KEnSbblA51pJEPxBQoiH1FP4E3s5+FJv07h6/ylD6ui7B+9fq/ehrFB98ghec9EoVtyjK8pqCHLmCBOwMWSCeWFNN4MbPAk55NhsvoFHSSVR0k5TCTTEzlUGcqV/nVp7n9oIVkmtaqbAEqEgfdgHJPwsEAyZ9r4VAZXFjpEwyaw3+H2v42KYxKhs1XvY/gSSGv+IHyUSuHXCeZhLAgVI3EjgSGo1Fb3xO0tGGU9S2/KAIbtjxpJASG73qox6w5LUq0cEOa+iIONIWIilQSQ0pPa2jgaRQAgQP7c0mITRWGxpMAmEQFN2NAQJNCV0mI6GIIEO47hlQ0ORQLd0nL+hoUjg1m6I1TRr8uYEAriBHLcVFQ5UEMiBe3XkTBEG04WXlGKGxPnMS305XQPA1Ocn2JiuAZwE66fxnKwBnDTuXxZTMq85lwW6kt5ndLqZPefiU1yvmktcUSooChJF2aMprhQlnKJQ5FxRKkcVRa+itNYU8Io2oVkY14w0NMWYlqft91Bj9VHq+ca3b43BxjWJmla0sfKohlfTVpPN+93L/yLQ/IjQ/O5Q/VR5HdL4D7mlxmjwVdELAAAAAElFTkSuQmCC';
  35166. var base64Empty = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURdvc3EdwTMLBwcjIyLSzs/Hx8ff39////19dXXz7IJEAAAAFdFJOU/4A6J9QDyyutAAAB5VJREFUeNrtnM1z4jYYxhUHkR4hdu9eU7Z75Ct7jgPbs9ZZmSuTrUWPmXTA186e+LMrf0uWLMtf2WkHXQgzln88et5XeiVMwPQdGrhCrpAr5Aq5Qv4TkJ07OGQFMLp1B4VYCz+kDblDQhJGeH4eEDLBYdLOHwaDWNBPIeHLYJAJ3meQ83IoCMTHDBKOBoKYGOeM8G0gyD0LObnDQB5ZSCtTNCBfsM9AboaBPLCQcDAIM1zht/dQEkMsd1DjI4hpw2YzMtBJeBbydWpCTJs3YDKGX62YgfGoVwi9KwtZJAzcYHHRm7sYCKD390nQSIoO5JGZIEOYxNoZ4+deISYLyeL5hLHbJ2QK98W0kudMgJe9Qh73odhO+KZHyNYGvgQS9gmJKhUigwSj3iBPUhXxePWmxBqHw0Mej9WQ3qILVjLC177yxNxXQ/7uK+Mn1aNVLsGsBTaWrSAPobYl0aUHt2fIs2Rgz7c9QYL0pSTkSzILLFtAJMH1cidN998T9E0/Sg73/pEEwrgkYRh86wlC949gJsR6EobBcz8hHOVgKYi2m6kZtodIkjEQvF3QjbGpmplB4/lRgJhxgRS2N15iijAvPmByDtCxfQhPJ8J4CR82rgCCBILarScw6X0OcMUyYrFVmbxErl0ZacFIoloOLdJAO42qY+NMDss2kKS8xmiZxcCpFKXWvpRGbQqJp5ixyRfJMmR6x0Fk+z29kmgWDYI5ziFbdug/84HxvduhWhLOJ2StPDQrMJPSjNANklh8QhB7dBO0yTGRwn1fkOk8rbQjiB8Ymww+JuiuN0icmSccK4naLMWYa/euL0+m23GyM8kgAc6sYeL4z04Qa4WjGepcKIliO8EUGSk7d9OGWOsoK31OSdy8TQZ59Y/hWbaV1IVs5/Ed6UzGK4nANAJiyGhRsZPUg2yzLe9hLyiJIyCaDU7udC2uy9pnkKvidlBUEltzFAqxRhBrBZm7HfZnjEQI3boqTsJq15PUDEaKZLgiJYc8OZtCtnM/4G93OFYooXpvdy0guwWWNQkEHl/j7Jw1XRmtlS9HYJkSPjk1IUnyyRqUKQn45NSDlP1mcg9i6En1ZU2IADnEtHF1Q+JwIcS/d5YakPuDUamEShGUHHikAz9oQCaE0CsrpYjDBVkEHQYdyK+EkKPhVErxqh1xbJ/oQf4gEeVsOIEc41WJNAwcd9GBfCZJezXsJhAvH+ImEEIOzlwXgpw5wQ0gH3MIOcsiQAahZuSD69/UQyxcQEggiQARQseVFO/ASAMCgM9gjkHZmhLENzi1AOhA7ullkMWUrfHKfpMiDBHtDIx6yCS6jseEnDUe7zcT6DGCtnrIY3olZw1hrPHkfucIAJa1EDu/lsVEyVmGGA67coKijeogFnMxlEaAV5ghRdDm1kDuuatZTJBGgJdOthIzsvZbDWRRuh6ScgR4EQLgagQvRQIxxQ4sxqcR4GE+c4CkjZQQW9YF89Y4OFAjOCki5KmiDxsBL3PlSJWlAFVogaoIePlYi2ClCJAHRa/cmre5eqTii4uvisqQJxqnip6pNd68DhEvyEs5xIyHBNdh4thCKhU++10kD7Gy1Up1A/o56FKuRJQWSFCuf8dpbisxhqHSKlSSgvG7VTaFKO5TzYD5VMPUxEB2YJNiqq3xYJ0KrroH8mq7xpoXqEZgfgNRUQsDtTVvUOk3sLUKbqrBr7YGvkCkQNC/9SA+vTYtvERrxiKEmcogk4ZqCLUd59MIEiFYHlIoxelCaJWDMmtOPIa80XVLbkb6hzaEwwTcPEmV4AIRlBGNIEmuJBFwLAZoHClJ36J8h+wxihpCqJosAnJrSKwEcQOFAFeWN4RQMYc0Ao4Jhg5gpASzyWcDvjpuDIlTkrGGJEro1rHIjHKR3wJCAj+z5oyi11gJBkXy9QFJIiAu78d+pgSjuWhGN0gUAZAcEncSJf4LRrZ8I94WEmcNCJJqBWYjVbE9bg2JxiyrViBWty6QvO56D8jPVWLA4ZX8dfkxvJJPl8t8aCX+pU/Iz1SCf7lc4OBK0OWfQaKLP0TKjj96VvIp+/BDZjwNKF2ItV2vN7sWStAl87oWkm3dZ+k3lEMoYXe8cT1eq2TOePJDD8KfQdxu6iEPxanUZa4HmZRq3dunGsj3BzFq6yD3wnZNX4n2emI2hXyXQpi6RRZdfSgxHNuxVZBFdyVeBPDmCsiksxKUiDAUEKuzkvRUEs0V08pjVyU2/yqFmF2VZGYop3peitdUiQd1pnrL7qTE01tPzE6eaEKm23dQwh2jNlbiay+/245zl94abw45CzNPyqYQ2++kxHGV1crWzg4A2yvR+BY7wziwnRLN7+O36aA54+ZKGjxZYK3txJpxQyUNn5GwtquII4+ACiWtnvawduu1A3SVtH5uhTvAVSpBG7fDYz6RQ+M6JWjmKm6g+RvTla9UMtspu+s+37VbVCupNqPx43CsNawSb1PbtcmDfQWmUILW7rRXSPHtSq5k5ur0a/hb7DQCUiW3G71ejX/wvV1kSoyNbp8Wvyqn1lCIKvl6gNDkNBYzt0GHdr+Pt9xGl1//ncAVcoVcIVfIFXKFXCFXyP8I8i8SyTW4yTz2lwAAAABJRU5ErkJggg==';
  35167. var base64Error = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAJFBMVEVHcEzo6Oibm5ukpKSbm5uampqbm5ubm5u5ubnn5+fm5ub6+vpGpDPdAAAAC3RSTlMA/v4hb+u20dq8aQhnHL4AAATwSURBVHja7ZvNb+JGGMbdjjdVe3NPodzeMhj1ZMUGujkh28B9wKR7iwwBqafWSbPqsbm0uTWtVlrTS9v0Et9yqLQS/1zHNiTZMMB4bO92d+dRUITt8c/PvPPx2h4URUpKSkpKSkpK6m3K6lFN73Q+S/+es3W3fzabTh2Dl0FAXEM+BgrgeXxRsdILTDU9n7J0vz/+EsCYC9KEiSFc06pf5zouqAkjkGWo0OG5Fq6j2IwZ6I4/4DhyTxc20oUjAj5PRTTrwvGAZ9p+ADzlD4RDctCoLhb7JUP87xeLxS3BZUIQ+YNCFi8wRwc4GIqGRK/GkM+5ILV8kFflOmkkkH/LddJ4c05eSSfSyTvrZPEmnCw+UCeuk84QvTSnUF0uCL68fBle/swF+RL1QZ/EpU6gHtOsAM64pnjPwxgTLsjoBM58ODNaAXYBT5QeGdr0KwcEA8He0TkPBLCjUDNHpG4qlg8eTCzXht1FVd1MxTPHj5LTtUiSrKK+7iDf8wBGxk4If3arLv/HF4Tox0A2nlFIGp+CIA+LzSamgbp4TNvZjECtDAjyMcB5HybLO6NxsRA1vmFCNjguNXDGWygbRPXh/B+zn9zPWK5RCkT18QxA57YgAqE+HGS6/tAoD4JO0ts+M2tbyQJpc95a5oI0xXNhCZGQ/x8E0VSCkUZY6Z6CIE/qdO5eL+yPlW6tMMgefPs3o7Bdt8iguJj4DThlZSY/rJ0yB+RraLDK2jAQCHyr4zIhT9mQ7vowygMZjpgQG+CYUV2E1EWqixyzICr8eFFnBB5ba1Y4IIfeKQvysW7ssZrwQLEFmvCBM2U6oRkdI5Wgm1QnO8RUTDlASoiESIiESMh7BDHKhlhu/LbSNUuEqL3lu1p945vO3BArADiaum7vBGDUKQfSIjBykooyrRPQnTIglHFfSagHeqd4iErwa9duEebpckGQjx/VT4v5fC0XhJHAd1mPRvJAVMZiAeQzTpgHYrPKqkGnUEiX+dCoNS4UgniHMTnUS4iESIiE7IS0x+mnVAidglDwVcmQJpy2WQ8VC4UgogfbA1RE4Nuw3UghEBV2rKl7V5ygAJPSY9KGQbP01mVjA5Fa2f1kQN2U3k+M9POWB8gnJUNMZJioWTMzKwOklyxgDrCXVcMMEF90tXM9C2TiCqmfCdIRi/jeewNpyerKok9WkGuzfCdYC+fXRsmBxxpVGG2zY0ZBbieJKvPrDQce3lxppBhIjGFWGkVoxUEoZt0Mukn2XBQH0bTHZpaMIp2sU/6qasU70W6/eHjM09VmYSc6C6Jpvz+orKvVxot8kL3HkMr9IZ9qeZ2o6RrO9mOI9ufdIR9peZ2gNIW31yC/MpyI9ngUDNIsezPks3vIsWDGdYA7cZa9pbqUVeCr/neiaR3U3R4BfXPg75vwb8I/b7HjxChobDZCO+Ny4wuxxaVxPPowcoNnrzPmzGFlX3RJHz2FafbhJ41n8PLx2DCM7KkwQgpqka1DVzKdJNHfJwBe9l/n0eSZFsIPjVSY8xZKZpSXnogwled98wAx3xRcdBNq1f1fhFVdIcL5tvaDolC7XaqaWStEtLOJHkbhlSauMLrma4yHEa03AVUoIUs/M2NQFkchBZiGUPeKonAnqhLOo4hrKf0WTyZ1FcU0Ki0hVrSr+Mucnvya7jYUKSkpKSkpKSmpD0f/AXq+Umj5XnXDAAAAAElFTkSuQmCC';
  35168. var base64BackToTop = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAElBMVEVRUVH+/v5HcEyZmZlRUVFRUVGm1ByOAAAABnRSTlPMzADMTZAJBBGsAAAEnElEQVR42t2cS27jMAyGf7/2U+QCQeDsbeQCgZDujaC5/1UmkzaJn+JDFGcw3LdfflKibJkkDnxrL7dbg7sNt6+L4O8OYBM+B0ys+QrGkHZG+OEEQ8g6go8Bx1GIGMdpNOQyIG6XdMgnSPtKhLQDGEZFBgYMkhKFtGBb0EIEjDgFRowoBVaMGAWpMedEfxMiZtwpUsgZCqtlkCNUdpVAWigtCCCDFtLwIWeoreZCWiRYYEKGFEjDg+yRZCUH0iLRAgNyToXUNCRZyMqWhGnUN2IPm3wSlwJ7IUspyCBkIQUZhCykIIeQuRTkEDKXAuM9srrtYbrZN7Y98giZSoFd+t1OxmMITG0dcrSFXFchZ1tIvQZpYWxhBbK3hpQrkMEa0iwh5t4a+QvZvDXyF7J5a+Qv5PPW21/I5623v5DPW29/IaO3Xv5Clrw1y1/Ikrdm+Qs5svw83yNnSJ5BQb4F/F7EIEJSnThGBAXxkFQfLOviQUE8JAUPsosHBfGQfDAtHhREQ1JxIV00KIgmrnRI84S0yAd5BAXxxJUck0f6Qnwr9qmr6xF5xLMjcwn/iudIEAdWnyjkEXlQKZiRVzoqRyLbgeUKKR8Q4alY7cSnoxzSf2ggsqehKr6YVpcXpOd7H93f60cKhOd7Re2LteUF4eLqiVS1mr0ge4io6C2+soaFkJ7MuuuQs1yITEp9hwwKISIpzR2iESKSIoT0rLNwuVHQqoSIpAQJpGce60vIUSdEIuUqgPTsJ5QFZK8UIpBS8iG94GFrDjlrhfCl8CG96Llxmle4kEr6vKWBPIVo9kqDQSRk9/3cWoikcCFPAd33v4dIChPyEvLzBA6RlEYWke4JEUnhKXkLeUEKxRHJFfKCQHGucIW8IdZSRkLeEGMpYyEjiK2UsZARxFTKRMgYYillImQMMZQyFTKB2EmZCplAuFLIHT8TMoWwpQwiIVMIUwqpZP5bp5CCvCTiQKr5f5lCQN+tPCBn2ZvVDFJwIDUP0m1BYAfZYRNSsCB7BqTbhoARePIxtZ9tgwWkoJcwCalmv3MBAemtO4R6dah2HaKQqj8Zvp9sQDjvJ21+SPCBHPJDDk6QITekEV7gqCC19CpKAym9IMfckKv4olMBCeIrWwVEfvkshzQekO9r9P1/ALk+IG1eSPCDiCJfyG+FyU+A6ZCa/piZDinpz7LpkCv5gdkAEshP5emQhv7onw6pGeULyZCSUYiRDAmMkpJkCKs4JhFSq8p8hJBSVbAkhARV6ZUQoisik0FqXTmcDHLVFfbJIEFXoiiCNMpiSxGkVJaNiiBBWQArgTTaUl4JpNQWJUsgQVteXQg+AKkLxQWFGKW+5J2+eVp4S168X3CF1CltCKdTJ8lb84YK2bUBO+wZW0Pqv9nk4tKu49N45NJC5dMM5tLW5tOg59Jq6NM06dL+abFXwr/RkuvTXJwae1abtE/Dt0/ruksTvs84AZ/BCC4jHnyGVfiM3VBQFANEXEah+Ax18RlP4zNox2dkkM/wI58xTn8yDCXGYCDV3W5RGSajtXyGhG1jbpbjzpwGt/0MJft8jqC7iUbQ/QZaxdnKqcIftwAAAABJRU5ErkJggg==';
  35169. var _default = {
  35170. base64Arrow: base64Arrow,
  35171. base64ArrowWhite: base64ArrowWhite,
  35172. base64Flower: base64Flower,
  35173. base64FlowerWhite: base64FlowerWhite,
  35174. base64Success: base64Success,
  35175. base64SuccessWhite: base64SuccessWhite,
  35176. base64Empty: base64Empty,
  35177. base64Error: base64Error,
  35178. base64BackToTop: base64BackToTop
  35179. };
  35180. exports.default = _default;
  35181. /***/ }),
  35182. /* 301 */
  35183. /*!***************************************************************************************************!*\
  35184. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js ***!
  35185. \***************************************************************************************************/
  35186. /*! no static exports found */
  35187. /***/ (function(module, exports, __webpack_require__) {
  35188. "use strict";
  35189. Object.defineProperty(exports, "__esModule", {
  35190. value: true
  35191. });
  35192. exports.default = void 0;
  35193. // [z-paging]常量
  35194. var version = '2.2.1';
  35195. var delayTime = 100;
  35196. var i18nUpdateKey = 'z-paging-i18n-update';
  35197. var errorUpdateKey = 'z-paging-error-emit';
  35198. var completeUpdateKey = 'z-paging-complete-emit';
  35199. var _default = {
  35200. version: version,
  35201. delayTime: delayTime,
  35202. i18nUpdateKey: i18nUpdateKey,
  35203. errorUpdateKey: errorUpdateKey,
  35204. completeUpdateKey: completeUpdateKey
  35205. };
  35206. exports.default = _default;
  35207. /***/ }),
  35208. /* 302 */
  35209. /*!************************************************************************************************!*\
  35210. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-utils.js ***!
  35211. \************************************************************************************************/
  35212. /*! no static exports found */
  35213. /***/ (function(module, exports, __webpack_require__) {
  35214. "use strict";
  35215. /* WEBPACK VAR INJECTION */(function(uni) {
  35216. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  35217. Object.defineProperty(exports, "__esModule", {
  35218. value: true
  35219. });
  35220. exports.default = void 0;
  35221. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! ./z-paging-i18n */ 303));
  35222. var _zPagingConfig = _interopRequireDefault(__webpack_require__(/*! ./z-paging-config */ 304));
  35223. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index */ 305));
  35224. // [z-paging]工具类
  35225. var storageKey = 'Z-PAGING-REFRESHER-TIME-STORAGE-KEY';
  35226. var config = null;
  35227. /*
  35228. 当z-paging未使用uni_modules管理时,控制台会有警告:WARNING: Module not found: Error: Can't resolve '@/uni_modules/z-paging'...
  35229. 此时注释下方try中的代码即可
  35230. */
  35231. try {
  35232. var contextKeys = __webpack_require__(306).keys();
  35233. if (contextKeys.length) {
  35234. var suffix = '.js';
  35235. config = __webpack_require__(307)("./z-paging-config" + suffix);
  35236. }
  35237. } catch (e) {}
  35238. //获取默认配置信息
  35239. function gc(key, defaultValue) {
  35240. if (!config) {
  35241. if (_index.default && Object.keys(_index.default).length) {
  35242. config = _index.default;
  35243. } else {
  35244. var temConfig = _zPagingConfig.default.getConfig();
  35245. if (_zPagingConfig.default && temConfig) {
  35246. config = temConfig;
  35247. }
  35248. }
  35249. }
  35250. if (!config) {
  35251. return defaultValue;
  35252. }
  35253. var value = config[_toKebab(key)];
  35254. if (value === undefined) {
  35255. value = config[key];
  35256. } else {
  35257. return value;
  35258. }
  35259. return defaultValue;
  35260. }
  35261. //判断两个数组是否相等
  35262. function arrayIsEqual(arr1, arr2) {
  35263. if (arr1 === arr2) return true;
  35264. if (arr1.length !== arr2.length) return false;
  35265. for (var i = 0; i < arr1.length; i++) {
  35266. if (arr1[i] !== arr2[i]) return false;
  35267. }
  35268. return true;
  35269. }
  35270. //获取最终的touch位置
  35271. function getTouch(e) {
  35272. var touch = null;
  35273. if (e.touches && e.touches.length) {
  35274. touch = e.touches[0];
  35275. } else if (e.changedTouches && e.changedTouches.length) {
  35276. touch = e.changedTouches[0];
  35277. } else if (e.datail && e.datail != {}) {
  35278. touch = e.datail;
  35279. } else {
  35280. return {
  35281. touchX: 0,
  35282. touchY: 0
  35283. };
  35284. }
  35285. return {
  35286. touchX: touch.clientX,
  35287. touchY: touch.clientY
  35288. };
  35289. }
  35290. //判断当前手势是否在z-paging内触发
  35291. function getTouchFromZPaging(target) {
  35292. if (target && target.tagName && target.tagName !== 'BODY' && target.tagName !== 'UNI-PAGE-BODY') {
  35293. var classList = target.classList;
  35294. if (classList && classList.contains('zp-paging-touch-view')) {
  35295. return true;
  35296. } else {
  35297. return getTouchFromZPaging(target.parentNode);
  35298. }
  35299. } else {
  35300. return false;
  35301. }
  35302. }
  35303. //获取z-paging所在的parent
  35304. function getParent(parent) {
  35305. if (!parent) return null;
  35306. if (parent.$refs.paging) return parent;
  35307. return getParent(parent.$parent);
  35308. }
  35309. //打印错误信息
  35310. function consoleErr(err) {
  35311. console.error("[z-paging]".concat(err));
  35312. }
  35313. //打印警告信息
  35314. function consoleWarn(warn) {
  35315. console.warn("[z-paging]".concat(warn));
  35316. }
  35317. //设置下拉刷新时间
  35318. function setRefesrherTime(time, key) {
  35319. try {
  35320. var datas = getRefesrherTime();
  35321. if (!datas) {
  35322. datas = {};
  35323. }
  35324. datas[key] = time;
  35325. uni.setStorageSync(storageKey, datas);
  35326. } catch (e) {}
  35327. }
  35328. //获取下拉刷新时间
  35329. function getRefesrherTime() {
  35330. try {
  35331. var datas = uni.getStorageSync(storageKey);
  35332. return datas;
  35333. } catch (e) {
  35334. return null;
  35335. }
  35336. }
  35337. //通过下拉刷新标识key获取下拉刷新时间
  35338. function getRefesrherTimeByKey(key) {
  35339. var datas = getRefesrherTime();
  35340. if (datas) {
  35341. var data = datas[key];
  35342. if (data) return data;
  35343. }
  35344. return null;
  35345. }
  35346. //通过下拉刷新标识key获取下拉刷新时间(格式化之后)
  35347. function getRefesrherFormatTimeByKey(key) {
  35348. var time = getRefesrherTimeByKey(key);
  35349. var timeText = _zPagingI18n.default.t['refresherUpdateTimeNoneText'][_zPagingI18n.default.getLanguage()];
  35350. if (time) {
  35351. timeText = _timeFormat(time);
  35352. }
  35353. return "".concat(_zPagingI18n.default.t['refresherUpdateTimeText'][_zPagingI18n.default.getLanguage()]).concat(timeText);
  35354. }
  35355. //将文本的px或者rpx转为px的值
  35356. function convertTextToPx(text) {
  35357. var dataType = Object.prototype.toString.call(text);
  35358. if (dataType === '[object Number]') {
  35359. return text;
  35360. }
  35361. var isRpx = false;
  35362. if (text.indexOf('rpx') !== -1 || text.indexOf('upx') !== -1) {
  35363. text = text.replace('rpx', '').replace('upx', '');
  35364. isRpx = true;
  35365. } else if (text.indexOf('px') !== -1) {
  35366. text = text.replace('px', '');
  35367. }
  35368. if (!isNaN(text)) {
  35369. if (isRpx) return Number(uni.upx2px(text));
  35370. return Number(text);
  35371. }
  35372. return 0;
  35373. }
  35374. //获取当前时间
  35375. function getTime() {
  35376. return new Date().getTime();
  35377. }
  35378. //------------------ 私有方法 ------------------------
  35379. function _timeFormat(time) {
  35380. var date = new Date(time);
  35381. var currentDate = new Date();
  35382. var dateDay = new Date(time).setHours(0, 0, 0, 0);
  35383. var currentDateDay = new Date().setHours(0, 0, 0, 0);
  35384. var disTime = dateDay - currentDateDay;
  35385. var dayStr = '';
  35386. var timeStr = _dateTimeFormat(date);
  35387. if (disTime === 0) {
  35388. dayStr = _zPagingI18n.default.t['refresherUpdateTimeTodayText'][_zPagingI18n.default.getLanguage()];
  35389. } else if (disTime === -86400000) {
  35390. dayStr = _zPagingI18n.default.t['refresherUpdateTimeYesterdayText'][_zPagingI18n.default.getLanguage()];
  35391. } else {
  35392. dayStr = _dateDayFormat(date, date.getFullYear() !== currentDate.getFullYear());
  35393. }
  35394. return "".concat(dayStr, " ").concat(timeStr);
  35395. }
  35396. function _dateDayFormat(date) {
  35397. var showYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35398. var year = date.getFullYear();
  35399. var month = date.getMonth() + 1;
  35400. var day = date.getDate();
  35401. if (showYear) {
  35402. return "".concat(year, "-").concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  35403. } else {
  35404. return "".concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  35405. }
  35406. }
  35407. function _dateTimeFormat(date) {
  35408. var hour = date.getHours();
  35409. var minute = date.getMinutes();
  35410. return "".concat(_fullZeroToTwo(hour), ":").concat(_fullZeroToTwo(minute));
  35411. }
  35412. function _fullZeroToTwo(str) {
  35413. str = str.toString();
  35414. if (str.length === 1) return '0' + str;
  35415. return str;
  35416. }
  35417. //驼峰转短横线
  35418. function _toKebab(value) {
  35419. return value.replace(/([A-Z])/g, "-$1").toLowerCase();
  35420. }
  35421. var _default = {
  35422. gc: gc,
  35423. setRefesrherTime: setRefesrherTime,
  35424. getRefesrherFormatTimeByKey: getRefesrherFormatTimeByKey,
  35425. arrayIsEqual: arrayIsEqual,
  35426. getTouch: getTouch,
  35427. getTouchFromZPaging: getTouchFromZPaging,
  35428. getParent: getParent,
  35429. convertTextToPx: convertTextToPx,
  35430. getTime: getTime,
  35431. consoleErr: consoleErr,
  35432. consoleWarn: consoleWarn
  35433. };
  35434. exports.default = _default;
  35435. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  35436. /***/ }),
  35437. /* 303 */
  35438. /*!***********************************************************************************************!*\
  35439. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-i18n.js ***!
  35440. \***********************************************************************************************/
  35441. /*! no static exports found */
  35442. /***/ (function(module, exports, __webpack_require__) {
  35443. "use strict";
  35444. /* WEBPACK VAR INJECTION */(function(uni) {
  35445. Object.defineProperty(exports, "__esModule", {
  35446. value: true
  35447. });
  35448. exports.default = void 0;
  35449. // z-paging国际化(支持中文、中文繁体和英文)
  35450. var i18nUpdateKey = 'z-paging-i18n-update';
  35451. var t = {
  35452. refresherDefaultText: {
  35453. 'en': 'Pull down to refresh',
  35454. 'zh-cn': '继续下拉刷新',
  35455. 'zh-hant-cn': '繼續下拉重繪'
  35456. },
  35457. refresherPullingText: {
  35458. 'en': 'Release to refresh',
  35459. 'zh-cn': '松开立即刷新',
  35460. 'zh-hant-cn': '鬆開立即重繪'
  35461. },
  35462. refresherRefreshingText: {
  35463. 'en': 'Refreshing...',
  35464. 'zh-cn': '正在刷新...',
  35465. 'zh-hant-cn': '正在重繪...'
  35466. },
  35467. refresherCompleteText: {
  35468. 'en': 'Refresh succeeded',
  35469. 'zh-cn': '刷新成功',
  35470. 'zh-hant-cn': '重繪成功'
  35471. },
  35472. loadingMoreDefaultText: {
  35473. 'en': 'Click to load more',
  35474. 'zh-cn': '点击加载更多',
  35475. 'zh-hant-cn': '點擊加載更多'
  35476. },
  35477. loadingMoreLoadingText: {
  35478. 'en': 'Loading...',
  35479. 'zh-cn': '正在加载...',
  35480. 'zh-hant-cn': '正在加載...'
  35481. },
  35482. loadingMoreNoMoreText: {
  35483. 'en': 'No more data',
  35484. 'zh-cn': '没有更多了',
  35485. 'zh-hant-cn': '沒有更多了'
  35486. },
  35487. loadingMoreFailText: {
  35488. 'en': 'Load failed,click to reload',
  35489. 'zh-cn': '加载失败,点击重新加载',
  35490. 'zh-hant-cn': '加載失敗,點擊重新加載'
  35491. },
  35492. emptyViewText: {
  35493. 'en': 'No data',
  35494. 'zh-cn': '没有数据哦~',
  35495. 'zh-hant-cn': '沒有數據哦~'
  35496. },
  35497. emptyViewReloadText: {
  35498. 'en': 'Reload',
  35499. 'zh-cn': '重新加载',
  35500. 'zh-hant-cn': '重新加載'
  35501. },
  35502. emptyViewErrorText: {
  35503. 'en': 'Sorry,load failed',
  35504. 'zh-cn': '很抱歉,加载失败',
  35505. 'zh-hant-cn': '很抱歉,加載失敗'
  35506. },
  35507. refresherUpdateTimeText: {
  35508. 'en': 'Last update: ',
  35509. 'zh-cn': '最后更新:',
  35510. 'zh-hant-cn': '最後更新:'
  35511. },
  35512. refresherUpdateTimeNoneText: {
  35513. 'en': 'None',
  35514. 'zh-cn': '无',
  35515. 'zh-hant-cn': '無'
  35516. },
  35517. refresherUpdateTimeTodayText: {
  35518. 'en': 'Today',
  35519. 'zh-cn': '今天',
  35520. 'zh-hant-cn': '今天'
  35521. },
  35522. refresherUpdateTimeYesterdayText: {
  35523. 'en': 'Yesterday',
  35524. 'zh-cn': '昨天',
  35525. 'zh-hant-cn': '昨天'
  35526. }
  35527. };
  35528. // 获取当前语言,格式为:zh-cn、zh-hant-cn、en。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  35529. function getLanguage() {
  35530. var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  35531. return _getPrivateLanguage(false, followSystemLanguage);
  35532. }
  35533. // 获取当前语言,格式为:简体中文、繁體中文、English。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  35534. function getLanguageName() {
  35535. var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  35536. var language = getLanguage(followSystemLanguage);
  35537. var languageNameMap = {
  35538. 'zh-cn': '简体中文',
  35539. 'zh-hant-cn': '繁體中文',
  35540. 'en': 'English'
  35541. };
  35542. return languageNameMap[language];
  35543. }
  35544. //设置当前语言,格式为:zh-cn、zh-hant-cn、en
  35545. function setLanguage(myLanguage) {
  35546. uni.setStorageSync(i18nUpdateKey, myLanguage);
  35547. uni.$emit(i18nUpdateKey, myLanguage);
  35548. }
  35549. // 插件内部使用,请勿直接调用
  35550. function _getPrivateLanguage(myLanguage) {
  35551. var followSystemLanguage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35552. var systemLanguage = '';
  35553. if (followSystemLanguage) {
  35554. systemLanguage = uni.getSystemInfoSync().language;
  35555. }
  35556. var language = myLanguage || uni.getStorageSync(i18nUpdateKey) || systemLanguage;
  35557. language = language.toLowerCase();
  35558. var reg = new RegExp('_', '');
  35559. language = language.replace(reg, '-');
  35560. if (language.indexOf('zh') !== -1) {
  35561. if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) {
  35562. return 'zh-cn';
  35563. }
  35564. return 'zh-hant-cn';
  35565. }
  35566. if (language.indexOf('en') !== -1) {
  35567. return 'en';
  35568. }
  35569. return 'zh-cn';
  35570. }
  35571. var _default = {
  35572. t: t,
  35573. getLanguage: getLanguage,
  35574. getLanguageName: getLanguageName,
  35575. setLanguage: setLanguage,
  35576. _getPrivateLanguage: _getPrivateLanguage
  35577. };
  35578. exports.default = _default;
  35579. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  35580. /***/ }),
  35581. /* 304 */
  35582. /*!*************************************************************************************************!*\
  35583. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-config.js ***!
  35584. \*************************************************************************************************/
  35585. /*! no static exports found */
  35586. /***/ (function(module, exports, __webpack_require__) {
  35587. "use strict";
  35588. /* WEBPACK VAR INJECTION */(function(uni) {
  35589. Object.defineProperty(exports, "__esModule", {
  35590. value: true
  35591. });
  35592. exports.default = void 0;
  35593. // [z-paging]处理main.js中的配置信息工具
  35594. var config = null;
  35595. var getedStorage = false;
  35596. var storageKey = 'Z-PAGING-CONFIG-STORAGE-KEY';
  35597. function setConfig(value) {
  35598. try {
  35599. uni.setStorageSync(storageKey, value);
  35600. } catch (e) {}
  35601. }
  35602. function getConfig() {
  35603. try {
  35604. if (getedStorage) return config;
  35605. config = uni.getStorageSync(storageKey);
  35606. getedStorage = true;
  35607. } catch (e) {
  35608. return null;
  35609. }
  35610. }
  35611. var _default = {
  35612. setConfig: setConfig,
  35613. getConfig: getConfig
  35614. };
  35615. exports.default = _default;
  35616. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  35617. /***/ }),
  35618. /* 305 */
  35619. /*!*******************************************************************************************!*\
  35620. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/config/index.js ***!
  35621. \*******************************************************************************************/
  35622. /*! no static exports found */
  35623. /***/ (function(module, exports, __webpack_require__) {
  35624. "use strict";
  35625. Object.defineProperty(exports, "__esModule", {
  35626. value: true
  35627. });
  35628. exports.default = void 0;
  35629. // z-paging全局配置文件,注意避免更新时此文件被覆盖,若被覆盖,可在此文件中右键->点击本地历史记录,找回覆盖前的配置
  35630. var _default = {};
  35631. exports.default = _default;
  35632. /***/ }),
  35633. /* 306 */
  35634. /*!*******************************************************************************************!*\
  35635. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync nonrecursive \z-paging-config$ ***!
  35636. \*******************************************************************************************/
  35637. /*! no static exports found */
  35638. /***/ (function(module, exports) {
  35639. function webpackEmptyContext(req) {
  35640. var e = new Error("Cannot find module '" + req + "'");
  35641. e.code = 'MODULE_NOT_FOUND';
  35642. throw e;
  35643. }
  35644. webpackEmptyContext.keys = function() { return []; };
  35645. webpackEmptyContext.resolve = webpackEmptyContext;
  35646. module.exports = webpackEmptyContext;
  35647. webpackEmptyContext.id = 306;
  35648. /***/ }),
  35649. /* 307 */
  35650. /*!**************************************************************************************!*\
  35651. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync ^\.\/z\-paging\-config.*$ ***!
  35652. \**************************************************************************************/
  35653. /*! no static exports found */
  35654. /***/ (function(module, exports) {
  35655. function webpackEmptyContext(req) {
  35656. var e = new Error("Cannot find module '" + req + "'");
  35657. e.code = 'MODULE_NOT_FOUND';
  35658. throw e;
  35659. }
  35660. webpackEmptyContext.keys = function() { return []; };
  35661. webpackEmptyContext.resolve = webpackEmptyContext;
  35662. module.exports = webpackEmptyContext;
  35663. webpackEmptyContext.id = 307;
  35664. /***/ }),
  35665. /* 308 */
  35666. /*!*****************************************************************************************************!*\
  35667. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/data-handle.js ***!
  35668. \*****************************************************************************************************/
  35669. /*! no static exports found */
  35670. /***/ (function(module, exports, __webpack_require__) {
  35671. "use strict";
  35672. /* WEBPACK VAR INJECTION */(function(uni) {
  35673. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  35674. Object.defineProperty(exports, "__esModule", {
  35675. value: true
  35676. });
  35677. exports.default = void 0;
  35678. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  35679. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  35680. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 301));
  35681. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 309));
  35682. // [z-paging]数据处理模块
  35683. var ZPData = {
  35684. props: {
  35685. //自定义初始的pageNo,默认为1
  35686. defaultPageNo: {
  35687. type: [Number, String],
  35688. default: _zPagingUtils.default.gc('defaultPageNo', 1),
  35689. observer: function observer(newVal, oldVal) {
  35690. this.pageNo = newVal;
  35691. }
  35692. },
  35693. //自定义pageSize,默认为10
  35694. defaultPageSize: {
  35695. type: [Number, String],
  35696. default: _zPagingUtils.default.gc('defaultPageSize', 10)
  35697. },
  35698. //为保证数据一致,设置当前tab切换时的标识key,并在complete中传递相同key,若二者不一致,则complete将不会生效
  35699. dataKey: {
  35700. type: [Number, String, Object],
  35701. default: function _default() {
  35702. return _zPagingUtils.default.gc('dataKey', null);
  35703. }
  35704. },
  35705. //自动注入的list名,可自动修改父view(包含ref="paging")中对应name的list值
  35706. autowireListName: {
  35707. type: String,
  35708. default: function _default() {
  35709. return _zPagingUtils.default.gc('autowireListName', '');
  35710. }
  35711. },
  35712. //自动注入的query名,可自动调用父view(包含ref="paging")中的query方法
  35713. autowireQueryName: {
  35714. type: String,
  35715. default: function _default() {
  35716. return _zPagingUtils.default.gc('autowireQueryName', '');
  35717. }
  35718. },
  35719. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是。请使用简便写法:auto
  35720. mountedAutoCallReload: {
  35721. type: Boolean,
  35722. default: _zPagingUtils.default.gc('mountedAutoCallReload', true)
  35723. },
  35724. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是
  35725. auto: {
  35726. type: Boolean,
  35727. default: _zPagingUtils.default.gc('auto', true)
  35728. },
  35729. //用户下拉刷新时是否触发reload方法,默认为是
  35730. reloadWhenRefresh: {
  35731. type: Boolean,
  35732. default: _zPagingUtils.default.gc('reloadWhenRefresh', true)
  35733. },
  35734. //reload时自动滚动到顶部,默认为是
  35735. autoScrollToTopWhenReload: {
  35736. type: Boolean,
  35737. default: _zPagingUtils.default.gc('autoScrollToTopWhenReload', true)
  35738. },
  35739. //reload时立即自动清空原list,默认为是,若立即自动清空,则在reload之后、请求回调之前页面是空白的
  35740. autoCleanListWhenReload: {
  35741. type: Boolean,
  35742. default: _zPagingUtils.default.gc('autoCleanListWhenReload', true)
  35743. },
  35744. //列表刷新时自动显示下拉刷新view,默认为否
  35745. showRefresherWhenReload: {
  35746. type: Boolean,
  35747. default: _zPagingUtils.default.gc('showRefresherWhenReload', false)
  35748. },
  35749. //列表刷新时自动显示加载更多view,且为加载中状态,默认为否
  35750. showLoadingMoreWhenReload: {
  35751. type: Boolean,
  35752. default: _zPagingUtils.default.gc('showLoadingMoreWhenReload', false)
  35753. },
  35754. //本地分页时上拉加载更多延迟时间,单位为毫秒,默认200毫秒
  35755. localPagingLoadingTime: {
  35756. type: [Number, String],
  35757. default: _zPagingUtils.default.gc('localPagingLoadingTime', 200)
  35758. },
  35759. //当分页未满一屏时,是否自动加载更多,默认为否(nvue无效)
  35760. insideMore: {
  35761. type: Boolean,
  35762. default: _zPagingUtils.default.gc('insideMore', false)
  35763. },
  35764. //使用聊天记录模式,默认为否
  35765. useChatRecordMode: {
  35766. type: Boolean,
  35767. default: _zPagingUtils.default.gc('useChatRecordMode', false)
  35768. },
  35769. //自动拼接complete中传过来的数组(使用聊天记录模式时无效)
  35770. concat: {
  35771. type: Boolean,
  35772. default: _zPagingUtils.default.gc('concat', true)
  35773. },
  35774. //父组件v-model所绑定的list的值
  35775. value: {
  35776. type: Array,
  35777. default: function _default() {
  35778. return [];
  35779. }
  35780. }
  35781. },
  35782. data: function data() {
  35783. return {
  35784. currentData: [],
  35785. totalData: [],
  35786. realTotalData: [],
  35787. totalLocalPagingList: [],
  35788. pageNo: 1,
  35789. isLocalPaging: false,
  35790. isAddedData: false,
  35791. isTotalChangeFromAddData: false,
  35792. privateConcat: true,
  35793. myParentQuery: -1,
  35794. firstPageLoaded: false,
  35795. pagingLoaded: false,
  35796. loaded: false,
  35797. isUserReload: true,
  35798. fromEmptyViewReload: false
  35799. };
  35800. },
  35801. computed: {
  35802. pageSize: function pageSize() {
  35803. return this.defaultPageSize;
  35804. },
  35805. finalConcat: function finalConcat() {
  35806. return this.concat && this.privateConcat;
  35807. },
  35808. isFirstPage: function isFirstPage() {
  35809. return this.pageNo === this.defaultPageNo;
  35810. }
  35811. },
  35812. watch: {
  35813. totalData: function totalData(newVal, oldVal) {
  35814. this._totalDataChange(newVal, oldVal);
  35815. },
  35816. currentData: function currentData(newVal, oldVal) {
  35817. this._currentDataChange(newVal, oldVal);
  35818. },
  35819. useChatRecordMode: function useChatRecordMode(newVal, oldVal) {
  35820. if (newVal) {
  35821. this.nLoadingMoreFixedHeight = false;
  35822. }
  35823. }
  35824. },
  35825. methods: {
  35826. //请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否成功(默认是是)
  35827. complete: function complete(data) {
  35828. var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35829. this.customNoMore = -1;
  35830. this.addData(data, success);
  35831. },
  35832. //简写,与complete完全相同
  35833. end: function end(data) {
  35834. var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35835. this.complete(data, success);
  35836. },
  35837. //【保证数据一致】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为dataKey,需与:data-key绑定的一致,第三个参数为是否成功(默认为是)
  35838. completeByKey: function completeByKey(data) {
  35839. var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  35840. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35841. if (dataKey !== null && this.dataKey !== null && dataKey !== this.dataKey) {
  35842. if (this.isFirstPage) {
  35843. this.endRefresh();
  35844. }
  35845. return;
  35846. }
  35847. this.customNoMore = -1;
  35848. this.addData(data, success);
  35849. },
  35850. //简写,与completeByKey完全相同
  35851. endByKey: function endByKey(data) {
  35852. var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  35853. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35854. this.completeByKey(data, dataKey, success);
  35855. },
  35856. //【通过totalCount判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为totalCount(列表总数),第三个参数为是否成功(默认为是)
  35857. completeByTotalCount: function completeByTotalCount(data, totalCount) {
  35858. var _this = this;
  35859. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35860. if (totalCount == 'undefined') {
  35861. this.customNoMore = -1;
  35862. } else {
  35863. var dataTypeRes = this._checkDataType(data, success, false);
  35864. data = dataTypeRes.data;
  35865. success = dataTypeRes.success;
  35866. if (totalCount >= 0 && success) {
  35867. this.$nextTick(function () {
  35868. var nomore = true;
  35869. var realTotalDataCount = _this.realTotalData.length;
  35870. if (_this.pageNo == _this.defaultPageNo) {
  35871. realTotalDataCount = 0;
  35872. }
  35873. var exceedCount = realTotalDataCount + data.length - totalCount;
  35874. if (exceedCount >= 0) {
  35875. nomore = false;
  35876. exceedCount = _this.defaultPageSize - exceedCount;
  35877. if (exceedCount > 0 && exceedCount < data.length) {
  35878. data = data.splice(0, exceedCount);
  35879. }
  35880. }
  35881. _this.completeByNoMore(data, nomore, success);
  35882. });
  35883. return;
  35884. }
  35885. }
  35886. this.addData(data, success);
  35887. },
  35888. //简写,与completeByTotalCount完全相同
  35889. completeByTotal: function completeByTotal(data, totalCount) {
  35890. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35891. this.completeByTotalCount(data, totalCount, success);
  35892. },
  35893. //简写,与completeByTotalCount完全相同
  35894. endByTotalCount: function endByTotalCount(data, totalCount) {
  35895. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35896. this.completeByTotalCount(data, totalCount, success);
  35897. },
  35898. //简写,与completeByTotalCount完全相同
  35899. endByTotal: function endByTotal(data, totalCount) {
  35900. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35901. this.completeByTotalCount(data, totalCount, success);
  35902. },
  35903. //【自行判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否有更多数据,第三个参数为是否成功(默认是是)
  35904. completeByNoMore: function completeByNoMore(data, nomore) {
  35905. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35906. if (nomore != 'undefined') {
  35907. this.customNoMore = nomore == true ? 1 : 0;
  35908. }
  35909. this.addData(data, success);
  35910. },
  35911. //简写,与completeByNoMore完全相同
  35912. endByNoMore: function endByNoMore(data, nomore) {
  35913. var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35914. this.completeByNoMore(data, nomore, success);
  35915. },
  35916. //与上方complete方法功能一致,新版本中设置服务端回调数组请使用complete方法
  35917. addData: function addData(data) {
  35918. var _this2 = this;
  35919. var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35920. if (!this.fromCompleteEmit) {
  35921. this.disabledCompleteEmit = true;
  35922. this.fromCompleteEmit = false;
  35923. }
  35924. var currentTimeStamp = _zPagingUtils.default.getTime();
  35925. var addDataDalay = 0;
  35926. var disTime = currentTimeStamp - this.requestTimeStamp;
  35927. var minDelay = this.minDelay;
  35928. if (this.isFirstPage && this.finalShowRefresherWhenReload) {
  35929. minDelay = Math.max(400, minDelay);
  35930. }
  35931. if (this.requestTimeStamp > 0 && disTime < minDelay) {
  35932. addDataDalay = minDelay - disTime;
  35933. }
  35934. this.$nextTick(function () {
  35935. var delay = _this2.delay > 0 ? _this2.delay : addDataDalay;
  35936. setTimeout(function () {
  35937. _this2._addData(data, success, false);
  35938. }, delay);
  35939. });
  35940. },
  35941. //从顶部添加数据,不会影响分页的pageNo和pageSize
  35942. addDataFromTop: function addDataFromTop(data) {
  35943. var _this3 = this;
  35944. var toTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35945. var toTopWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35946. var dataType = Object.prototype.toString.call(data);
  35947. if (dataType !== '[object Array]') {
  35948. data = [data];
  35949. }
  35950. this.totalData = [].concat((0, _toConsumableArray2.default)(data), (0, _toConsumableArray2.default)(this.totalData));
  35951. if (toTop) {
  35952. setTimeout(function () {
  35953. _this3._scrollToTop(toTopWithAnimate);
  35954. }, _zPagingConstant.default.delayTime);
  35955. }
  35956. },
  35957. //重新设置列表数据,调用此方法不会影响pageNo和pageSize,也不会触发请求。适用场景:当需要删除列表中某一项时,将删除对应项后的数组通过此方法传递给z-paging。(当出现类似的需要修改列表数组的场景时,请使用此方法,请勿直接修改page中:list.sync绑定的数组)
  35958. resetTotalData: function resetTotalData(data) {
  35959. if (data == undefined) {
  35960. if (this.showConsoleError) {
  35961. _zPagingUtils.default.consoleErr('方法resetTotalData参数缺失!');
  35962. }
  35963. return;
  35964. }
  35965. this.isTotalChangeFromAddData = true;
  35966. var dataType = Object.prototype.toString.call(data);
  35967. if (dataType !== '[object Array]') {
  35968. data = [data];
  35969. }
  35970. this.totalData = data;
  35971. },
  35972. //添加聊天记录
  35973. addChatRecordData: function addChatRecordData(data) {
  35974. var _this4 = this;
  35975. var toBottom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35976. var toBottomWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  35977. var dataType = Object.prototype.toString.call(data);
  35978. if (dataType !== '[object Array]') {
  35979. data = [data];
  35980. }
  35981. if (!this.useChatRecordMode) return;
  35982. this.isTotalChangeFromAddData = true;
  35983. this.totalData = [].concat((0, _toConsumableArray2.default)(this.totalData), (0, _toConsumableArray2.default)(data));
  35984. if (toBottom) {
  35985. setTimeout(function () {
  35986. _this4._scrollToBottom(toBottomWithAnimate);
  35987. }, _zPagingConstant.default.delayTime);
  35988. }
  35989. },
  35990. //设置本地分页数据,请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging作分页处理(若调用了此方法,则上拉加载更多时内部会自动分页,不会触发@query所绑定的事件)
  35991. setLocalPaging: function setLocalPaging(data) {
  35992. var _this5 = this;
  35993. var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  35994. this.isLocalPaging = true;
  35995. this.$nextTick(function () {
  35996. _this5._addData(data, success, true);
  35997. });
  35998. },
  35999. //重新加载分页数据,pageNo会恢复为默认值,相当于下拉刷新的效果(animate为true时会展示下拉刷新动画,默认为false)
  36000. reload: function reload() {
  36001. var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;
  36002. if (animate) {
  36003. this.privateShowRefresherWhenReload = animate;
  36004. this.isUserPullDown = true;
  36005. }
  36006. this._preReload(animate, false);
  36007. },
  36008. //刷新列表数据,pageNo和pageSize不会重置,列表数据会重新从服务端获取。必须保证@query绑定的方法中的pageNo和pageSize和传给服务端的一致
  36009. refresh: function refresh() {
  36010. if (!this.realTotalData.length) {
  36011. this.reload();
  36012. return;
  36013. }
  36014. var disPageNo = this.pageNo - this.defaultPageNo + 1;
  36015. if (disPageNo >= 1) {
  36016. this.loading = true;
  36017. this.privateConcat = false;
  36018. var totalPageSize = disPageNo * this.pageSize;
  36019. this._emitQuery(this.defaultPageNo, totalPageSize, _zPagingEnum.default.QueryFrom.Refresh);
  36020. this._callMyParentQuery(this.defaultPageNo, totalPageSize);
  36021. }
  36022. },
  36023. //清空分页数据
  36024. clean: function clean() {
  36025. this._reload(true);
  36026. this._addData([], true, false);
  36027. },
  36028. //清空分页数据
  36029. clear: function clear() {
  36030. this.clean();
  36031. },
  36032. //手动触发滚动到顶部加载更多,聊天记录模式时有效
  36033. doChatRecordLoadMore: function doChatRecordLoadMore() {
  36034. this.useChatRecordMode && this._onLoadingMore('click');
  36035. },
  36036. //reload之前的一些处理
  36037. _preReload: function _preReload() {
  36038. var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;
  36039. var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  36040. this.isUserReload = true;
  36041. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  36042. if (animate) {
  36043. this.privateShowRefresherWhenReload = animate;
  36044. if (this.useCustomRefresher) {
  36045. this._doRefresherRefreshAnimate();
  36046. } else {
  36047. this.refresherTriggered = true;
  36048. }
  36049. } else {
  36050. this._refresherEnd(false, false, false, false);
  36051. }
  36052. this._reload(false, isFromMounted);
  36053. },
  36054. //重新加载分页数据
  36055. _reload: function _reload() {
  36056. var _this6 = this;
  36057. var isClean = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  36058. var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  36059. var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  36060. this.isAddedData = false;
  36061. this.cacheScrollNodeHeight = -1;
  36062. this.insideOfPaging = -1;
  36063. this.pageNo = this.defaultPageNo;
  36064. this._cleanRefresherEndTimeout();
  36065. !this.privateShowRefresherWhenReload && !isClean && this._startLoading(true);
  36066. this.firstPageLoaded = true;
  36067. this.isTotalChangeFromAddData = false;
  36068. this.totalData = [];
  36069. if (!isClean) {
  36070. this._emitQuery(this.pageNo, this.defaultPageSize, isUserPullDown ? _zPagingEnum.default.QueryFrom.UserPullDown : _zPagingEnum.default.QueryFrom.Reload);
  36071. var delay = 0;
  36072. setTimeout(function () {
  36073. _this6._callMyParentQuery();
  36074. }, delay);
  36075. if (!isFromMounted && this.autoScrollToTopWhenReload) {
  36076. var checkedNRefresherLoading = true;
  36077. if (checkedNRefresherLoading) {
  36078. this._scrollToTop(false);
  36079. }
  36080. }
  36081. if (!this.usePageScroll && this.useChatRecordMode) {
  36082. if (this.showConsoleError) {
  36083. _zPagingUtils.default.consoleWarn('使用聊天记录模式时,建议使用页面滚动,可将usePageScroll设置为true以启用页面滚动!!');
  36084. }
  36085. }
  36086. }
  36087. this.$nextTick(function () {});
  36088. },
  36089. //处理服务端返回的数组
  36090. _addData: function _addData(data, success, isLocal) {
  36091. var _this7 = this;
  36092. this.isAddedData = true;
  36093. this.fromEmptyViewReload = false;
  36094. this.isTotalChangeFromAddData = true;
  36095. this.refresherTriggered = false;
  36096. !this.useCustomRefresher && uni.stopPullDownRefresh();
  36097. var tempIsUserPullDown = this.isUserPullDown;
  36098. if (this.showRefresherUpdateTime && this.isFirstPage) {
  36099. _zPagingUtils.default.setRefesrherTime(_zPagingUtils.default.getTime(), this.refresherUpdateTimeKey);
  36100. this.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  36101. this.$refs.refresh && this.$refs.refresh.updateTime();
  36102. }
  36103. if (tempIsUserPullDown && this.isFirstPage) {
  36104. this.isUserPullDown = false;
  36105. }
  36106. var dataTypeRes = this._checkDataType(data, success, isLocal);
  36107. data = dataTypeRes.data;
  36108. success = dataTypeRes.success;
  36109. var delayTime = _zPagingConstant.default.delayTime;
  36110. var shouldEndLoadingDelay = true;
  36111. this.loadingForNow = false;
  36112. setTimeout(function () {
  36113. _this7.pagingLoaded = true;
  36114. _this7.$nextTick(function () {
  36115. _this7._refresherEnd(shouldEndLoadingDelay, true, tempIsUserPullDown);
  36116. });
  36117. }, delayTime);
  36118. if (this.isFirstPage) {
  36119. this.isLoadFailed = !success;
  36120. }
  36121. if (success) {
  36122. if (!(this.privateConcat === false && this.loadingStatus === _zPagingEnum.default.More.NoMore)) {
  36123. this.loadingStatus = _zPagingEnum.default.More.Default;
  36124. }
  36125. if (isLocal) {
  36126. this.totalLocalPagingList = data;
  36127. this._localPagingQueryList(this.defaultPageNo, this.defaultPageSize, 0, function (res) {
  36128. _this7.complete(res);
  36129. });
  36130. } else {
  36131. var dataChangeDelayTime = 0;
  36132. setTimeout(function () {
  36133. _this7._currentDataChange(data, _this7.currentData);
  36134. }, dataChangeDelayTime);
  36135. }
  36136. } else {
  36137. this._currentDataChange(data, this.currentData);
  36138. this.loadingStatus = _zPagingEnum.default.More.Fail;
  36139. if (this.loadingType === _zPagingEnum.default.LoadingType.LoadingMore) {
  36140. this.pageNo--;
  36141. }
  36142. }
  36143. },
  36144. //所有数据改变时调用
  36145. _totalDataChange: function _totalDataChange(newVal, oldVal) {
  36146. var _this8 = this;
  36147. var eventThrow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  36148. if ((!this.isUserReload || !this.autoCleanListWhenReload) && this.firstPageLoaded && !newVal.length && oldVal.length) {
  36149. return;
  36150. }
  36151. this._doCheckScrollViewShouldFullHeight(newVal);
  36152. if (!this.realTotalData.length && !newVal.length) {
  36153. eventThrow = false;
  36154. }
  36155. this.realTotalData = newVal;
  36156. if (eventThrow) {
  36157. this.$emit('input', newVal);
  36158. this.$emit('update:list', newVal);
  36159. this.$emit('listChange', newVal);
  36160. this._callMyParentList(newVal);
  36161. }
  36162. this.firstPageLoaded = false;
  36163. this.isTotalChangeFromAddData = false;
  36164. this.$nextTick(function () {
  36165. setTimeout(function () {
  36166. _this8._getNodeClientRect('.zp-paging-container-content').then(function (res) {
  36167. if (res) {
  36168. _this8.$emit('contentHeightChanged', res[0].height);
  36169. }
  36170. });
  36171. }, _this8.isIos ? 100 : 300);
  36172. });
  36173. },
  36174. //当前数据改变时调用
  36175. _currentDataChange: function _currentDataChange(newVal, oldVal) {
  36176. var _this9 = this;
  36177. newVal = (0, _toConsumableArray2.default)(newVal);
  36178. this.useChatRecordMode && newVal.reverse();
  36179. if (this.isFirstPage && this.finalConcat) {
  36180. this.totalData = [];
  36181. }
  36182. if (this.customNoMore !== -1) {
  36183. if (this.customNoMore === 0 || !newVal.length) {
  36184. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  36185. }
  36186. } else {
  36187. if (!newVal.length || newVal.length && newVal.length < this.defaultPageSize) {
  36188. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  36189. }
  36190. }
  36191. if (!this.totalData.length) {
  36192. if (this.finalConcat) {
  36193. this.totalData = newVal;
  36194. }
  36195. if (this.useChatRecordMode) {
  36196. this.$nextTick(function () {
  36197. _this9._scrollToBottom(false);
  36198. });
  36199. }
  36200. } else {
  36201. if (this.useChatRecordMode) {
  36202. var idIndex = newVal.length;
  36203. var idIndexStr = "z-paging-".concat(idIndex);
  36204. this.totalData = [].concat((0, _toConsumableArray2.default)(newVal), (0, _toConsumableArray2.default)(this.totalData));
  36205. if (this.pageNo !== this.defaultPageNo) {
  36206. this.privateScrollWithAnimation = 0;
  36207. var delayTime = 200;
  36208. this.$emit('update:chatIndex', idIndex);
  36209. setTimeout(function () {
  36210. _this9._scrollIntoView(idIndexStr, 30 + _this9.cacheTopHeight, false, function () {
  36211. _this9.$emit('update:chatIndex', 0);
  36212. });
  36213. }, this.usePageScroll ? 0 : delayTime);
  36214. } else {
  36215. this.$nextTick(function () {
  36216. _this9._scrollToBottom(false);
  36217. });
  36218. }
  36219. } else {
  36220. if (this.finalConcat) {
  36221. this.totalData = [].concat((0, _toConsumableArray2.default)(this.totalData), (0, _toConsumableArray2.default)(newVal));
  36222. if (!this.isIos && !this.refresherOnly && !this.usePageScroll && newVal.length) {
  36223. this.loadingMoreTimeStamp = _zPagingUtils.default.getTime();
  36224. var currentScrollTop = this.oldScrollTop;
  36225. this.scrollToY(currentScrollTop);
  36226. }
  36227. } else {
  36228. this.totalData = (0, _toConsumableArray2.default)(newVal);
  36229. }
  36230. }
  36231. }
  36232. this.privateConcat = true;
  36233. },
  36234. //本地分页请求
  36235. _localPagingQueryList: function _localPagingQueryList(pageNo, pageSize, localPagingLoadingTime, callback) {
  36236. pageNo = parseInt(pageNo);
  36237. pageSize = parseInt(pageSize);
  36238. if (pageNo < 0 || pageSize <= 0) {
  36239. callQueryResult(callback, []);
  36240. return;
  36241. }
  36242. pageNo = Math.max(1, pageNo);
  36243. var totalPagingList = (0, _toConsumableArray2.default)(this.totalLocalPagingList);
  36244. var pageNoIndex = (pageNo - 1) * pageSize;
  36245. if (pageNoIndex + pageSize <= totalPagingList.length) {
  36246. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, pageSize), localPagingLoadingTime);
  36247. } else if (pageNoIndex < totalPagingList.length) {
  36248. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, totalPagingList.length - pageNoIndex), localPagingLoadingTime);
  36249. } else {
  36250. this._localPagingQueryResult(callback, [], localPagingLoadingTime);
  36251. }
  36252. },
  36253. //本地分页请求回调
  36254. _localPagingQueryResult: function _localPagingQueryResult(callback, arg, localPagingLoadingTime) {
  36255. setTimeout(function () {
  36256. callback(arg);
  36257. }, localPagingLoadingTime);
  36258. },
  36259. //修改父view的list
  36260. _callMyParentList: function _callMyParentList(newVal) {
  36261. if (this.autowireListName.length) {
  36262. var myParent = _zPagingUtils.default.getParent(this.$parent);
  36263. if (myParent && myParent[this.autowireListName]) {
  36264. myParent[this.autowireListName] = newVal;
  36265. }
  36266. }
  36267. },
  36268. //调用父view的query
  36269. _callMyParentQuery: function _callMyParentQuery() {
  36270. var customPageNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  36271. var customPageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  36272. if (this.autowireQueryName) {
  36273. if (this.myParentQuery === -1) {
  36274. var myParent = _zPagingUtils.default.getParent(this.$parent);
  36275. if (myParent && myParent[this.autowireQueryName]) {
  36276. this.myParentQuery = myParent[this.autowireQueryName];
  36277. }
  36278. }
  36279. if (this.myParentQuery !== -1) {
  36280. if (customPageSize > 0) {
  36281. this.myParentQuery(customPageNo, customPageSize);
  36282. } else {
  36283. this.myParentQuery(this.pageNo, this.defaultPageSize);
  36284. }
  36285. }
  36286. }
  36287. },
  36288. //发射query事件
  36289. _emitQuery: function _emitQuery(pageNo, pageSize, from) {
  36290. this.requestTimeStamp = _zPagingUtils.default.getTime();
  36291. this.$emit('query', pageNo, pageSize, from);
  36292. },
  36293. //检查complete data的类型
  36294. _checkDataType: function _checkDataType(data, success, isLocal) {
  36295. var dataType = Object.prototype.toString.call(data);
  36296. if (dataType === '[object Boolean]') {
  36297. success = data;
  36298. data = [];
  36299. } else if (dataType !== '[object Array]') {
  36300. data = [];
  36301. var methodStr = isLocal ? 'setLocalPaging' : 'complete';
  36302. if (dataType !== '[object Undefined]') {
  36303. if (this.showConsoleError) {
  36304. _zPagingUtils.default.consoleErr("".concat(methodStr, "\u53C2\u6570\u7C7B\u578B\u4E0D\u6B63\u786E\uFF0C\u7B2C\u4E00\u4E2A\u53C2\u6570\u7C7B\u578B\u5FC5\u987B\u4E3AArray!"));
  36305. }
  36306. }
  36307. }
  36308. return {
  36309. data: data,
  36310. success: success
  36311. };
  36312. }
  36313. }
  36314. };
  36315. var _default2 = ZPData;
  36316. exports.default = _default2;
  36317. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  36318. /***/ }),
  36319. /* 309 */
  36320. /*!***********************************************************************************************!*\
  36321. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-enum.js ***!
  36322. \***********************************************************************************************/
  36323. /*! no static exports found */
  36324. /***/ (function(module, exports, __webpack_require__) {
  36325. "use strict";
  36326. Object.defineProperty(exports, "__esModule", {
  36327. value: true
  36328. });
  36329. exports.default = void 0;
  36330. // [z-paging]枚举
  36331. var Enum = {
  36332. //当前加载类型 0.下拉刷新 1.上拉加载更多
  36333. LoadingType: {
  36334. Refresher: 0,
  36335. LoadingMore: 1
  36336. },
  36337. //下拉刷新状态 0.默认状态 1.松手立即刷新 2.刷新中 3.刷新结束
  36338. Refresher: {
  36339. Default: 0,
  36340. ReleaseToRefresh: 1,
  36341. Loading: 2,
  36342. Complete: 3
  36343. },
  36344. //底部加载更多状态 0.默认状态 1.加载中 2.没有更多数据 3.加载失败
  36345. More: {
  36346. Default: 0,
  36347. Loading: 1,
  36348. NoMore: 2,
  36349. Fail: 3
  36350. },
  36351. //@query触发来源 0.用户主动下拉刷新 1.通过reload触发 2.通过refresh触发 3.通过滚动到底部加载更多或点击底部加载更多触发
  36352. QueryFrom: {
  36353. UserPullDown: 0,
  36354. Reload: 1,
  36355. Refresh: 2,
  36356. LoadingMore: 3
  36357. }
  36358. };
  36359. var _default = Enum;
  36360. exports.default = _default;
  36361. /***/ }),
  36362. /* 310 */
  36363. /*!**********************************************************************************************!*\
  36364. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/i18n.js ***!
  36365. \**********************************************************************************************/
  36366. /*! no static exports found */
  36367. /***/ (function(module, exports, __webpack_require__) {
  36368. "use strict";
  36369. /* WEBPACK VAR INJECTION */(function(uni) {
  36370. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  36371. Object.defineProperty(exports, "__esModule", {
  36372. value: true
  36373. });
  36374. exports.default = void 0;
  36375. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  36376. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 301));
  36377. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! .././z-paging-i18n */ 303));
  36378. // [z-paging]i18n模块
  36379. var systemInfo = uni.getSystemInfoSync();
  36380. var ZPI18n = {
  36381. props: {
  36382. //i18n国际化设置语言,支持简体中文(zh-cn)、繁体中文(zh-hant-cn)和英文(en)
  36383. language: {
  36384. type: String,
  36385. default: _zPagingUtils.default.gc('language', '')
  36386. },
  36387. //i18n国际化默认是否跟随系统语言,默认为是
  36388. followSystemLanguage: {
  36389. type: Boolean,
  36390. default: _zPagingUtils.default.gc('followSystemLanguage', true)
  36391. }
  36392. },
  36393. data: function data() {
  36394. return {
  36395. tempLanguageUpdateKey: 0
  36396. };
  36397. },
  36398. computed: {
  36399. tempLanguage: function tempLanguage() {
  36400. var systemLanguage = false;
  36401. var temp = this.tempLanguageUpdateKey;
  36402. if (this.followSystemLanguage) {
  36403. systemLanguage = systemInfo.language;
  36404. }
  36405. return uni.getStorageSync(_zPagingConstant.default.i18nUpdateKey) || systemLanguage || 'zh-cn';
  36406. },
  36407. finalTempLanguage: function finalTempLanguage() {
  36408. return this.language.length ? this.language : this.tempLanguage;
  36409. },
  36410. finalLanguage: function finalLanguage() {
  36411. var language = this.finalTempLanguage.toLowerCase();
  36412. return _zPagingI18n.default._getPrivateLanguage(language, this.followSystemLanguage);
  36413. },
  36414. finalRefresherDefaultText: function finalRefresherDefaultText() {
  36415. return this._getI18nText('refresherDefaultText', this.refresherDefaultText);
  36416. },
  36417. finalRefresherPullingText: function finalRefresherPullingText() {
  36418. return this._getI18nText('refresherPullingText', this.refresherPullingText);
  36419. },
  36420. finalRefresherRefreshingText: function finalRefresherRefreshingText() {
  36421. return this._getI18nText('refresherRefreshingText', this.refresherRefreshingText);
  36422. },
  36423. finalRefresherCompleteText: function finalRefresherCompleteText() {
  36424. return this._getI18nText('refresherCompleteText', this.refresherCompleteText);
  36425. },
  36426. finalLoadingMoreDefaultText: function finalLoadingMoreDefaultText() {
  36427. return this._getI18nText('loadingMoreDefaultText', this.loadingMoreDefaultText);
  36428. },
  36429. finalLoadingMoreLoadingText: function finalLoadingMoreLoadingText() {
  36430. return this._getI18nText('loadingMoreLoadingText', this.loadingMoreLoadingText);
  36431. },
  36432. finalLoadingMoreNoMoreText: function finalLoadingMoreNoMoreText() {
  36433. return this._getI18nText('loadingMoreNoMoreText', this.loadingMoreNoMoreText);
  36434. },
  36435. finalLoadingMoreFailText: function finalLoadingMoreFailText() {
  36436. return this._getI18nText('loadingMoreFailText', this.loadingMoreFailText);
  36437. },
  36438. finalEmptyViewText: function finalEmptyViewText() {
  36439. return this.isLoadFailed ? this.finalEmptyViewErrorText : this._getI18nText('emptyViewText', this.emptyViewText);
  36440. },
  36441. finalEmptyViewReloadText: function finalEmptyViewReloadText() {
  36442. return this._getI18nText('emptyViewReloadText', this.emptyViewReloadText);
  36443. },
  36444. finalEmptyViewErrorText: function finalEmptyViewErrorText() {
  36445. return this._getI18nText('emptyViewErrorText', this.emptyViewErrorText);
  36446. }
  36447. },
  36448. methods: {
  36449. //设置i18n国际化语言
  36450. setI18n: function setI18n(language) {
  36451. _zPagingI18n.default.setLanguage(language);
  36452. },
  36453. //获取当前z-paging的语言
  36454. getLanguage: function getLanguage() {
  36455. return this.finalLanguage;
  36456. },
  36457. //获取国际化转换后的文本
  36458. _getI18nText: function _getI18nText(key, value) {
  36459. var dataType = Object.prototype.toString.call(value);
  36460. if (dataType === '[object Object]') {
  36461. var nextValue = value[this.finalLanguage];
  36462. if (nextValue) return nextValue;
  36463. } else if (dataType === '[object String]') {
  36464. return value;
  36465. }
  36466. return _zPagingI18n.default.t[key][this.finalLanguage];
  36467. }
  36468. }
  36469. };
  36470. var _default = ZPI18n;
  36471. exports.default = _default;
  36472. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  36473. /***/ }),
  36474. /* 311 */
  36475. /*!**********************************************************************************************!*\
  36476. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/nvue.js ***!
  36477. \**********************************************************************************************/
  36478. /*! no static exports found */
  36479. /***/ (function(module, exports, __webpack_require__) {
  36480. "use strict";
  36481. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  36482. Object.defineProperty(exports, "__esModule", {
  36483. value: true
  36484. });
  36485. exports.default = void 0;
  36486. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  36487. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 309));
  36488. // [z-paging]nvue独有部分模块
  36489. var ZPNvue = {
  36490. props: {
  36491. //nvue中修改列表类型,可选值有list、waterfall和scroller,默认为list
  36492. nvueListIs: {
  36493. type: String,
  36494. default: _zPagingUtils.default.gc('nvueListIs', 'list')
  36495. },
  36496. //nvue waterfall配置,仅在nvue中且nvueListIs=waterfall时有效,配置参数详情参见:https://uniapp.dcloud.io/component/waterfall
  36497. nvueWaterfallConfig: {
  36498. type: Object,
  36499. default: function _default() {
  36500. return _zPagingUtils.default.gc('nvueWaterfallConfig', {});
  36501. }
  36502. },
  36503. //nvue 控制是否回弹效果,iOS不支持动态修改
  36504. nvueBounce: {
  36505. type: Boolean,
  36506. default: _zPagingUtils.default.gc('nvueBounce', true)
  36507. },
  36508. //nvue中通过代码滚动到顶部/底部时,是否加快动画效果(无滚动动画时无效),默认为否
  36509. nvueFastScroll: {
  36510. type: Boolean,
  36511. default: _zPagingUtils.default.gc('nvueFastScroll', false)
  36512. },
  36513. //nvue中list的id
  36514. nvueListId: {
  36515. type: String,
  36516. default: _zPagingUtils.default.gc('nvueListId', '')
  36517. },
  36518. //nvue中refresh组件的样式
  36519. nvueRefresherStyle: {
  36520. type: Object,
  36521. default: function _default() {
  36522. return _zPagingUtils.default.gc('nvueRefresherStyle', {});
  36523. }
  36524. },
  36525. //是否隐藏nvue列表底部的tagView,此view用于标识滚动到底部位置,若隐藏则滚动到底部功能将失效,在nvue中实现吸顶+swiper功能时需将最外层z-paging的此属性设置为true。默认为否
  36526. hideNvueBottomTag: {
  36527. type: Boolean,
  36528. default: _zPagingUtils.default.gc('hideNvueBottomTag', false)
  36529. }
  36530. },
  36531. data: function data() {
  36532. return {
  36533. nRefresherLoading: false,
  36534. nListIsDragging: false,
  36535. nShowBottom: true,
  36536. nFixFreezing: false,
  36537. nShowRefresherReveal: false,
  36538. nIsFirstPageAndNoMore: false,
  36539. nFirstPageAndNoMoreChecked: false,
  36540. nLoadingMoreFixedHeight: false,
  36541. nShowRefresherRevealHeight: 0
  36542. };
  36543. },
  36544. watch: {
  36545. nIsFirstPageAndNoMore: {
  36546. handler: function handler(newVal) {
  36547. var cellStyle = !this.useChatRecordMode || newVal ? {} : {
  36548. transform: 'rotate(180deg)'
  36549. };
  36550. this.$emit('update:cellStyle', cellStyle);
  36551. },
  36552. immediate: true
  36553. }
  36554. },
  36555. computed: {},
  36556. methods: {}
  36557. };
  36558. var _default2 = ZPNvue;
  36559. exports.default = _default2;
  36560. /***/ }),
  36561. /* 312 */
  36562. /*!***********************************************************************************************!*\
  36563. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/empty.js ***!
  36564. \***********************************************************************************************/
  36565. /*! no static exports found */
  36566. /***/ (function(module, exports, __webpack_require__) {
  36567. "use strict";
  36568. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  36569. Object.defineProperty(exports, "__esModule", {
  36570. value: true
  36571. });
  36572. exports.default = void 0;
  36573. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  36574. // [z-paging]空数据图view模块
  36575. var ZPEmptyView = {
  36576. props: {
  36577. //是否强制隐藏空数据图,默认为否
  36578. hideEmptyView: {
  36579. type: Boolean,
  36580. default: _zPagingUtils.default.gc('hideEmptyView', false)
  36581. },
  36582. //空数据图描述文字,默认为“没有数据哦~”
  36583. emptyViewText: {
  36584. type: [String, Object],
  36585. default: _zPagingUtils.default.gc('emptyViewText', null)
  36586. },
  36587. //是否显示空数据图重新加载按钮(无数据时),默认为否
  36588. showEmptyViewReload: {
  36589. type: Boolean,
  36590. default: _zPagingUtils.default.gc('showEmptyViewReload', false)
  36591. },
  36592. //加载失败时是否显示空数据图重新加载按钮,默认为是
  36593. showEmptyViewReloadWhenError: {
  36594. type: Boolean,
  36595. default: _zPagingUtils.default.gc('showEmptyViewReloadWhenError', true)
  36596. },
  36597. //空数据图点击重新加载文字,默认为“重新加载”
  36598. emptyViewReloadText: {
  36599. type: [String, Object],
  36600. default: _zPagingUtils.default.gc('emptyViewReloadText', null)
  36601. },
  36602. //空数据图图片,默认使用z-paging内置的图片
  36603. emptyViewImg: {
  36604. type: String,
  36605. default: _zPagingUtils.default.gc('emptyViewImg', '')
  36606. },
  36607. //空数据图“加载失败”描述文字,默认为“很抱歉,加载失败”
  36608. emptyViewErrorText: {
  36609. type: [String, Object],
  36610. default: _zPagingUtils.default.gc('emptyViewErrorText', null)
  36611. },
  36612. //空数据图“加载失败”图片,默认使用z-paging内置的图片
  36613. emptyViewErrorImg: {
  36614. type: String,
  36615. default: _zPagingUtils.default.gc('emptyViewErrorImg', '')
  36616. },
  36617. //空数据图样式
  36618. emptyViewStyle: {
  36619. type: Object,
  36620. default: function _default() {
  36621. return _zPagingUtils.default.gc('emptyViewStyle', {});
  36622. }
  36623. },
  36624. //空数据图容器样式
  36625. emptyViewSuperStyle: {
  36626. type: Object,
  36627. default: function _default() {
  36628. return _zPagingUtils.default.gc('emptyViewSuperStyle', {});
  36629. }
  36630. },
  36631. //空数据图img样式
  36632. emptyViewImgStyle: {
  36633. type: Object,
  36634. default: function _default() {
  36635. return _zPagingUtils.default.gc('emptyViewImgStyle', {});
  36636. }
  36637. },
  36638. //空数据图描述文字样式
  36639. emptyViewTitleStyle: {
  36640. type: Object,
  36641. default: function _default() {
  36642. return _zPagingUtils.default.gc('emptyViewTitleStyle', {});
  36643. }
  36644. },
  36645. //空数据图重新加载按钮样式
  36646. emptyViewReloadStyle: {
  36647. type: Object,
  36648. default: function _default() {
  36649. return _zPagingUtils.default.gc('emptyViewReloadStyle', {});
  36650. }
  36651. },
  36652. //空数据图片是否铺满z-paging,默认为是。若设置为否,则为填充满z-paging的剩余部分
  36653. emptyViewFixed: {
  36654. type: Boolean,
  36655. default: function _default() {
  36656. return _zPagingUtils.default.gc('emptyViewFixed', false);
  36657. }
  36658. },
  36659. //空数据图片是否垂直居中,默认为是。emptyViewFixed为false时有效
  36660. emptyViewCenter: {
  36661. type: Boolean,
  36662. default: function _default() {
  36663. return _zPagingUtils.default.gc('emptyViewCenter', true);
  36664. }
  36665. },
  36666. //加载中时是否自动隐藏空数据图,默认为是
  36667. autoHideEmptyViewWhenLoading: {
  36668. type: Boolean,
  36669. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenLoading', true)
  36670. },
  36671. //用户下拉列表触发下拉刷新加载中时是否自动隐藏空数据图,默认为是
  36672. autoHideEmptyViewWhenPull: {
  36673. type: Boolean,
  36674. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenPull', true)
  36675. },
  36676. //空数据view的z-index,默认为9
  36677. emptyViewZIndex: {
  36678. type: Number,
  36679. default: _zPagingUtils.default.gc('emptyViewZIndex', 9)
  36680. }
  36681. },
  36682. computed: {
  36683. finalEmptyViewImg: function finalEmptyViewImg() {
  36684. return this.isLoadFailed ? this.emptyViewErrorImg : this.emptyViewImg;
  36685. },
  36686. finalShowEmptyViewReload: function finalShowEmptyViewReload() {
  36687. return this.isLoadFailed ? this.showEmptyViewReloadWhenError : this.showEmptyViewReload;
  36688. },
  36689. showEmpty: function showEmpty() {
  36690. if (this.refresherOnly || this.hideEmptyView || this.totalData.length) return false;
  36691. if (this.autoHideEmptyViewWhenLoading) {
  36692. if (this.isAddedData && !this.firstPageLoaded && !this.loading) return true;
  36693. } else {
  36694. return true;
  36695. }
  36696. if (!this.autoHideEmptyViewWhenPull && !this.isUserReload) return true;
  36697. return false;
  36698. }
  36699. },
  36700. methods: {
  36701. //点击了空数据view重新加载按钮
  36702. _emptyViewReload: function _emptyViewReload() {
  36703. var _this = this;
  36704. var callbacked = false;
  36705. this.$emit('emptyViewReload', function (reload) {
  36706. if (reload === undefined || reload === true) {
  36707. _this.fromEmptyViewReload = true;
  36708. _this.reload();
  36709. }
  36710. callbacked = true;
  36711. });
  36712. this.$nextTick(function () {
  36713. if (!callbacked) {
  36714. _this.fromEmptyViewReload = true;
  36715. _this.reload();
  36716. }
  36717. });
  36718. }
  36719. }
  36720. };
  36721. var _default2 = ZPEmptyView;
  36722. exports.default = _default2;
  36723. /***/ }),
  36724. /* 313 */
  36725. /*!***************************************************************************************************!*\
  36726. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/refresher.js ***!
  36727. \***************************************************************************************************/
  36728. /*! no static exports found */
  36729. /***/ (function(module, exports, __webpack_require__) {
  36730. "use strict";
  36731. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  36732. Object.defineProperty(exports, "__esModule", {
  36733. value: true
  36734. });
  36735. exports.default = void 0;
  36736. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  36737. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 301));
  36738. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 309));
  36739. // [z-paging]下拉刷新view模块
  36740. var ZPRefresher = {
  36741. props: {
  36742. //下拉刷新的主题样式,支持black,white,默认black
  36743. refresherThemeStyle: {
  36744. type: String,
  36745. default: function _default() {
  36746. return _zPagingUtils.default.gc('refresherThemeStyle', '');
  36747. }
  36748. },
  36749. //自定义下拉刷新中左侧图标的样式
  36750. refresherImgStyle: {
  36751. type: Object,
  36752. default: function _default() {
  36753. return _zPagingUtils.default.gc('refresherImgStyle', {});
  36754. }
  36755. },
  36756. //自定义下拉刷新中右侧状态描述文字的样式
  36757. refresherTitleStyle: {
  36758. type: Object,
  36759. default: function _default() {
  36760. return _zPagingUtils.default.gc('refresherTitleStyle', {});
  36761. }
  36762. },
  36763. //自定义下拉刷新中右侧最后更新时间文字的样式(show-refresher-update-time为true时有效)
  36764. refresherUpdateTimeStyle: {
  36765. type: Object,
  36766. default: function _default() {
  36767. return _zPagingUtils.default.gc('refresherUpdateTimeStyle', {});
  36768. }
  36769. },
  36770. //在微信小程序和QQ小程序中,是否实时监听下拉刷新中进度,默认为否
  36771. watchRefresherTouchmove: {
  36772. type: Boolean,
  36773. default: _zPagingUtils.default.gc('watchRefresherTouchmove', false)
  36774. },
  36775. //底部加载更多的主题样式,支持black,white,默认black
  36776. loadingMoreThemeStyle: {
  36777. type: String,
  36778. default: function _default() {
  36779. return _zPagingUtils.default.gc('loadingMoreThemeStyle', '');
  36780. }
  36781. },
  36782. //是否只使用下拉刷新,设置为true后将关闭mounted自动请求数据、关闭滚动到底部加载更多,强制隐藏空数据图。默认为否
  36783. refresherOnly: {
  36784. type: Boolean,
  36785. default: _zPagingUtils.default.gc('refresherOnly', false)
  36786. },
  36787. //自定义下拉刷新结束以后延迟回弹的时间,单位为毫秒,默认为0
  36788. refresherCompleteDelay: {
  36789. type: [Number, String],
  36790. default: _zPagingUtils.default.gc('refresherCompleteDelay', 0)
  36791. },
  36792. //自定义下拉刷新结束回弹动画时间,单位为毫秒,默认为300毫秒(refresherEndBounceEnabled为false时,refresherCompleteDuration为设定值的1/3),nvue无效
  36793. refresherCompleteDuration: {
  36794. type: [Number, String],
  36795. default: _zPagingUtils.default.gc('refresherCompleteDuration', 300)
  36796. },
  36797. //自定义下拉刷新结束状态下是否允许列表滚动,默认为否
  36798. refresherCompleteScrollable: {
  36799. type: Boolean,
  36800. default: _zPagingUtils.default.gc('refresherCompleteScrollable', false)
  36801. },
  36802. //是否使用自定义的下拉刷新,默认为是,即使用z-paging的下拉刷新。设置为false即代表使用uni scroll-view自带的下拉刷新,h5、App、微信小程序以外的平台不支持uni scroll-view自带的下拉刷新
  36803. useCustomRefresher: {
  36804. type: Boolean,
  36805. default: _zPagingUtils.default.gc('useCustomRefresher', true)
  36806. },
  36807. //自定义下拉刷新下拉帧率,默认为40,过高可能会出现抖动问题
  36808. refresherFps: {
  36809. type: [Number, String],
  36810. default: _zPagingUtils.default.gc('refresherFps', 40)
  36811. },
  36812. //自定义下拉刷新允许触发的最大下拉角度,默认为40度,当下拉角度小于设定值时,自定义下拉刷新动画不会被触发
  36813. refresherMaxAngle: {
  36814. type: [Number, String],
  36815. default: _zPagingUtils.default.gc('refresherMaxAngle', 40)
  36816. },
  36817. //自定义下拉刷新的角度由未达到最大角度变到达到最大角度时,是否继续下拉刷新手势,默认为否
  36818. refresherAngleEnableChangeContinued: {
  36819. type: Boolean,
  36820. default: _zPagingUtils.default.gc('refresherAngleEnableChangeContinued', false)
  36821. },
  36822. //自定义下拉刷新默认状态下的文字
  36823. refresherDefaultText: {
  36824. type: [String, Object],
  36825. default: _zPagingUtils.default.gc('refresherDefaultText', null)
  36826. },
  36827. //自定义下拉刷新松手立即刷新状态下的文字
  36828. refresherPullingText: {
  36829. type: [String, Object],
  36830. default: _zPagingUtils.default.gc('refresherPullingText', null)
  36831. },
  36832. //自定义下拉刷新刷新中状态下的文字
  36833. refresherRefreshingText: {
  36834. type: [String, Object],
  36835. default: _zPagingUtils.default.gc('refresherRefreshingText', null)
  36836. },
  36837. //自定义下拉刷新刷新结束状态下的文字
  36838. refresherCompleteText: {
  36839. type: [String, Object],
  36840. default: _zPagingUtils.default.gc('refresherCompleteText', null)
  36841. },
  36842. //是否开启自定义下拉刷新刷新结束回弹效果,默认为是
  36843. refresherEndBounceEnabled: {
  36844. type: Boolean,
  36845. default: _zPagingUtils.default.gc('refresherEndBounceEnabled', true)
  36846. },
  36847. //是否开启自定义下拉刷新,默认为是
  36848. refresherEnabled: {
  36849. type: Boolean,
  36850. default: _zPagingUtils.default.gc('refresherEnabled', true)
  36851. },
  36852. //设置自定义下拉刷新阈值,默认为80rpx
  36853. refresherThreshold: {
  36854. type: [Number, String],
  36855. default: _zPagingUtils.default.gc('refresherThreshold', '80rpx')
  36856. },
  36857. //设置系统下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式,默认为black
  36858. refresherDefaultStyle: {
  36859. type: String,
  36860. default: _zPagingUtils.default.gc('refresherDefaultStyle', 'black')
  36861. },
  36862. //设置自定义下拉刷新区域背景
  36863. refresherBackground: {
  36864. type: String,
  36865. default: _zPagingUtils.default.gc('refresherBackground', 'transparent')
  36866. },
  36867. //设置固定的自定义下拉刷新区域背景
  36868. refresherFixedBackground: {
  36869. type: String,
  36870. default: _zPagingUtils.default.gc('refresherFixedBackground', 'transparent')
  36871. },
  36872. //设置固定的自定义下拉刷新区域高度,默认为0
  36873. refresherFixedBacHeight: {
  36874. type: [Number, String],
  36875. default: _zPagingUtils.default.gc('refresherFixedBacHeight', 0)
  36876. },
  36877. //设置自定义下拉刷新下拉超出阈值后继续下拉位移衰减的比例,范围0-1,值越大代表衰减越多。默认为0.7(nvue无效)
  36878. refresherOutRate: {
  36879. type: Number,
  36880. default: _zPagingUtils.default.gc('refresherOutRate', 0.7)
  36881. },
  36882. //是否显示最后更新时间,默认为否
  36883. showRefresherUpdateTime: {
  36884. type: Boolean,
  36885. default: _zPagingUtils.default.gc('showRefresherUpdateTime', false)
  36886. },
  36887. //如果需要区别不同页面的最后更新时间,请为不同页面的z-paging的`refresher-update-time-key`设置不同的字符串
  36888. refresherUpdateTimeKey: {
  36889. type: String,
  36890. default: _zPagingUtils.default.gc('refresherUpdateTimeKey', 'default')
  36891. }
  36892. },
  36893. data: function data() {
  36894. return {
  36895. //下拉刷新状态
  36896. refresherStatus: _zPagingEnum.default.Refresher.Default,
  36897. refresherTouchstartY: 0,
  36898. lastRefresherTouchmove: null,
  36899. refresherReachMaxAngle: true,
  36900. refresherTransform: 'translateY(0px)',
  36901. refresherTransition: '',
  36902. finalRefresherDefaultStyle: 'black',
  36903. refresherRevealStackCount: 0,
  36904. refresherCompleteTimeout: null,
  36905. refresherCompleteSubTimeout: null,
  36906. refresherEndTimeout: null,
  36907. refresherTriggered: false,
  36908. isTouchmoving: false,
  36909. isTouchEnded: false,
  36910. isUserPullDown: false,
  36911. privateRefresherEnabled: -1,
  36912. privateShowRefresherWhenReload: false,
  36913. customRefresherHeight: -1,
  36914. showCustomRefresher: false,
  36915. doRefreshAnimateAfter: false,
  36916. isRefresherInComplete: false,
  36917. pullDownTimeStamp: 0,
  36918. moveDis: 0,
  36919. oldMoveDis: 0
  36920. };
  36921. },
  36922. watch: {
  36923. refresherDefaultStyle: {
  36924. handler: function handler(newVal) {
  36925. if (newVal.length) {
  36926. this.finalRefresherDefaultStyle = newVal;
  36927. }
  36928. },
  36929. immediate: true
  36930. },
  36931. refresherStatus: function refresherStatus(newVal, oldVal) {
  36932. if (newVal === _zPagingEnum.default.Refresher.Loading) {
  36933. this._cleanRefresherEndTimeout();
  36934. }
  36935. this.$emit('refresherStatusChange', newVal);
  36936. this.$emit('update:refresherStatus', newVal);
  36937. },
  36938. moveDis: function moveDis(newVal, oldVal) {
  36939. this.oldMoveDis = oldVal;
  36940. }
  36941. },
  36942. computed: {
  36943. pullDownDisTimeStamp: function pullDownDisTimeStamp() {
  36944. return 1000 / this.refresherFps;
  36945. },
  36946. finalRefresherEnabled: function finalRefresherEnabled() {
  36947. if (this.useChatRecordMode) return false;
  36948. if (this.privateRefresherEnabled === -1) return this.refresherEnabled;
  36949. return this.privateRefresherEnabled === 1;
  36950. },
  36951. finalRefresherThreshold: function finalRefresherThreshold() {
  36952. var refresherThreshold = this.refresherThreshold;
  36953. var idDefault = false;
  36954. if (refresherThreshold === '80rpx') {
  36955. idDefault = true;
  36956. if (this.showRefresherUpdateTime) {
  36957. refresherThreshold = '120rpx';
  36958. }
  36959. }
  36960. if (idDefault && this.customRefresherHeight > 0) {
  36961. return this.customRefresherHeight;
  36962. }
  36963. return _zPagingUtils.default.convertTextToPx(refresherThreshold);
  36964. },
  36965. finalRefresherFixedBacHeight: function finalRefresherFixedBacHeight() {
  36966. return _zPagingUtils.default.convertTextToPx(this.refresherFixedBacHeight);
  36967. },
  36968. finalRefresherThemeStyle: function finalRefresherThemeStyle() {
  36969. return this.refresherThemeStyle.length ? this.refresherThemeStyle : this.defaultThemeStyle;
  36970. },
  36971. finalRefresherOutRate: function finalRefresherOutRate() {
  36972. var rate = this.refresherOutRate;
  36973. rate = Math.max(0, rate);
  36974. rate = Math.min(1, rate);
  36975. return rate;
  36976. },
  36977. finalRefresherTransform: function finalRefresherTransform() {
  36978. if (this.refresherTransform === 'translateY(0px)') return 'none';
  36979. return this.refresherTransform;
  36980. },
  36981. finalShowRefresherWhenReload: function finalShowRefresherWhenReload() {
  36982. return this.showRefresherWhenReload || this.privateShowRefresherWhenReload;
  36983. },
  36984. finalRefresherTriggered: function finalRefresherTriggered() {
  36985. if (!(this.finalRefresherEnabled && !this.useCustomRefresher)) return false;
  36986. return this.refresherTriggered;
  36987. },
  36988. showRefresher: function showRefresher() {
  36989. var _this = this;
  36990. var showRefresher = this.finalRefresherEnabled && this.useCustomRefresher && this.isTouchmoving;
  36991. if (this.customRefresherHeight === -1 && showRefresher) {
  36992. setTimeout(function () {
  36993. _this.$nextTick(function () {
  36994. _this._updateCustomRefresherHeight();
  36995. });
  36996. }, 100);
  36997. }
  36998. return showRefresher;
  36999. },
  37000. hasTouchmove: function hasTouchmove() {
  37001. return this.watchRefresherTouchmove;
  37002. return true;
  37003. return this.watchRefresherTouchmove;
  37004. }
  37005. },
  37006. methods: {
  37007. //终止下拉刷新状态
  37008. endRefresh: function endRefresh() {
  37009. this._refresherEnd();
  37010. },
  37011. handleRefresherStatusChanged: function handleRefresherStatusChanged(func) {
  37012. this.refresherStatusChangedFunc = func;
  37013. },
  37014. //自定义下拉刷新被触发
  37015. _onRefresh: function _onRefresh() {
  37016. var fromScrollView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  37017. var isUserPullDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  37018. if (fromScrollView && !(this.finalRefresherEnabled && !this.useCustomRefresher)) return;
  37019. this.$emit('onRefresh');
  37020. this.$emit('Refresh');
  37021. if (this.loading || this.isRefresherInComplete) return;
  37022. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  37023. if (this.nShowRefresherReveal) return;
  37024. this.isUserPullDown = isUserPullDown;
  37025. this.isUserReload = !isUserPullDown;
  37026. this._startLoading(true);
  37027. this.refresherTriggered = true;
  37028. if (this.reloadWhenRefresh && isUserPullDown) {
  37029. if (this.useChatRecordMode) {
  37030. this._onLoadingMore('click');
  37031. } else {
  37032. this._reload(false, false, isUserPullDown);
  37033. }
  37034. }
  37035. },
  37036. //自定义下拉刷新被复位
  37037. _onRestore: function _onRestore() {
  37038. this.refresherTriggered = 'restore';
  37039. this.$emit('onRestore');
  37040. this.$emit('Restore');
  37041. },
  37042. //进一步处理拖拽开始结果
  37043. _handleRefresherTouchstart: function _handleRefresherTouchstart(touch) {
  37044. if (!this.loading && this.isTouchEnded) {
  37045. this.isTouchmoving = false;
  37046. }
  37047. this.isTouchEnded = false;
  37048. this.refresherTransition = '';
  37049. this.refresherTouchstartY = touch.touchY;
  37050. this.$emit('refresherTouchstart', this.refresherTouchstartY);
  37051. this.lastRefresherTouchmove = touch;
  37052. this._cleanRefresherCompleteTimeout();
  37053. this._cleanRefresherEndTimeout();
  37054. },
  37055. //进一步处理拖拽中结果
  37056. _handleRefresherTouchmove: function _handleRefresherTouchmove(moveDis, touch) {
  37057. this.refresherReachMaxAngle = true;
  37058. this.isTouchmoving = true;
  37059. //this.refresherTransition = '';
  37060. this.isTouchEnded = false;
  37061. this.refresherStatus = moveDis >= this.finalRefresherThreshold ? _zPagingEnum.default.Refresher.ReleaseToRefresh : this.refresherStatus = _zPagingEnum.default.Refresher.Default;
  37062. this.moveDis = moveDis;
  37063. },
  37064. //进一步处理拖拽结束结果
  37065. _handleRefresherTouchend: function _handleRefresherTouchend(moveDis) {
  37066. var _this2 = this;
  37067. this.refresherReachMaxAngle = true;
  37068. if (moveDis < 0 && this.usePageScroll && this.loadingMoreEnabled && this.useCustomRefresher && this.pageScrollTop === -1) {
  37069. if (this.showConsoleError) {
  37070. _zPagingUtils.default.consoleErr('usePageScroll为true并且自定义下拉刷新时必须引入mixin或在page滚动时通过调用z-paging组件的updatePageScrollTop方法设置当前的scrollTop');
  37071. }
  37072. }
  37073. this.isTouchEnded = true;
  37074. if (moveDis >= this.finalRefresherThreshold && this.refresherStatus === _zPagingEnum.default.Refresher.ReleaseToRefresh) {
  37075. this.moveDis = this.finalRefresherThreshold;
  37076. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  37077. this._doRefresherLoad();
  37078. } else {
  37079. this._refresherEnd();
  37080. setTimeout(function () {
  37081. _this2.isTouchmoving = false;
  37082. }, _zPagingConstant.default.delayTime);
  37083. }
  37084. this.scrollEnable = true;
  37085. // this.refresherTransition = 'transform .1s linear';
  37086. this.$emit('refresherTouchend', moveDis);
  37087. },
  37088. //处理scroll-view bounce是否生效
  37089. _handleScrollViewDisableBounce: function _handleScrollViewDisableBounce(e) {
  37090. if (!this.usePageScroll && !this.scrollToTopBounceEnabled) {
  37091. this.refresherTransition = '';
  37092. this.scrollEnable = e.bounce;
  37093. }
  37094. },
  37095. //wxs正在下拉状态改变处理
  37096. _handleWxsPullingDownStatusChange: function _handleWxsPullingDownStatusChange(onPullingDown) {
  37097. this.wxsOnPullingDown = onPullingDown;
  37098. if (onPullingDown && !this.useChatRecordMode) {
  37099. this.renderPropScrollTop = 0;
  37100. }
  37101. },
  37102. //wxs正在下拉处理
  37103. _handleWxsPullingDown: function _handleWxsPullingDown(e) {
  37104. this._emitTouchmove({
  37105. pullingDistance: e.moveDis,
  37106. dy: e.diffDis
  37107. });
  37108. },
  37109. //wxs通知更新其props
  37110. _handlePropUpdate: function _handlePropUpdate(e) {
  37111. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  37112. },
  37113. //下拉刷新结束
  37114. _refresherEnd: function _refresherEnd() {
  37115. var _this3 = this;
  37116. var shouldEndLoadingDelay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  37117. var fromAddData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  37118. var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  37119. var setLoading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  37120. if (this.loadingType === _zPagingEnum.default.LoadingType.Refresher) {
  37121. var refresherCompleteDelay = 0;
  37122. if (fromAddData && (isUserPullDown || this.showRefresherWhenReload)) {
  37123. refresherCompleteDelay = this.refresherCompleteDuration > 700 ? 1 : this.refresherCompleteDelay;
  37124. }
  37125. var refresherStatus = refresherCompleteDelay > 0 ? _zPagingEnum.default.Refresher.Complete : _zPagingEnum.default.Refresher.Default;
  37126. if (this.finalShowRefresherWhenReload) {
  37127. var stackCount = this.refresherRevealStackCount;
  37128. this.refresherRevealStackCount--;
  37129. if (stackCount > 1) return;
  37130. }
  37131. this._cleanRefresherEndTimeout();
  37132. this.refresherEndTimeout = setTimeout(function () {
  37133. _this3.refresherStatus = refresherStatus;
  37134. }, refresherStatus === _zPagingEnum.default.Refresher.Default ? this.refresherCompleteDuration : 0);
  37135. if (refresherCompleteDelay > 0) {
  37136. this.isRefresherInComplete = true;
  37137. }
  37138. this._cleanRefresherCompleteTimeout();
  37139. this.refresherCompleteTimeout = setTimeout(function () {
  37140. var animateDuration = 1;
  37141. var animateType = _this3.refresherEndBounceEnabled && fromAddData ? 'cubic-bezier(0.19,1.64,0.42,0.72)' : 'linear';
  37142. if (fromAddData) {
  37143. animateDuration = _this3.refresherEndBounceEnabled ? _this3.refresherCompleteDuration / 1000 : _this3.refresherCompleteDuration / 3000;
  37144. }
  37145. _this3.refresherTransition = "transform ".concat(fromAddData ? animateDuration : 0.1, "s ").concat(animateType);
  37146. _this3.wxsPropType = _this3.refresherTransition + 'end' + _zPagingUtils.default.getTime();
  37147. _this3.moveDis = 0;
  37148. if (refresherStatus === _zPagingEnum.default.Refresher.Complete) {
  37149. if (_this3.refresherCompleteSubTimeout) {
  37150. clearTimeout(_this3.refresherCompleteSubTimeout);
  37151. _this3.refresherCompleteSubTimeout = null;
  37152. }
  37153. _this3.refresherCompleteSubTimeout = setTimeout(function () {
  37154. _this3.$nextTick(function () {
  37155. _this3.refresherStatus = _zPagingEnum.default.Refresher.Default;
  37156. _this3.isRefresherInComplete = false;
  37157. });
  37158. }, animateDuration * 800);
  37159. }
  37160. }, refresherCompleteDelay);
  37161. }
  37162. if (setLoading) {
  37163. setTimeout(function () {
  37164. _this3.loading = false;
  37165. }, shouldEndLoadingDelay ? _zPagingConstant.default.delayTime : 0);
  37166. isUserPullDown && this._onRestore();
  37167. }
  37168. },
  37169. //模拟用户手动触发下拉刷新
  37170. _doRefresherRefreshAnimate: function _doRefresherRefreshAnimate() {
  37171. this._cleanRefresherCompleteTimeout();
  37172. var doRefreshAnimateAfter = !this.doRefreshAnimateAfter && this.finalShowRefresherWhenReload && this.customRefresherHeight === -1 && this.refresherThreshold === '80rpx';
  37173. if (doRefreshAnimateAfter) {
  37174. this.doRefreshAnimateAfter = true;
  37175. return;
  37176. }
  37177. this.refresherRevealStackCount++;
  37178. this.wxsPropType = 'begin' + _zPagingUtils.default.getTime();
  37179. this.moveDis = this.finalRefresherThreshold;
  37180. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  37181. this.isTouchmoving = true;
  37182. this._doRefresherLoad(false);
  37183. },
  37184. //触发下拉刷新
  37185. _doRefresherLoad: function _doRefresherLoad() {
  37186. var isUserPullDown = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  37187. this._onRefresh(false, isUserPullDown);
  37188. this.loading = true;
  37189. },
  37190. //获取处理后的moveDis
  37191. _getFinalRefresherMoveDis: function _getFinalRefresherMoveDis(moveDis) {
  37192. moveDis = moveDis * 0.85;
  37193. if (moveDis >= this.finalRefresherThreshold) {
  37194. moveDis = this.finalRefresherThreshold + (moveDis - this.finalRefresherThreshold) * (1 - this.finalRefresherOutRate);
  37195. }
  37196. return moveDis;
  37197. },
  37198. //更新自定义下拉刷新view高度
  37199. _updateCustomRefresherHeight: function _updateCustomRefresherHeight() {
  37200. var _this4 = this;
  37201. this._getNodeClientRect('.zp-custom-refresher-slot-view').then(function (res) {
  37202. if (res) {
  37203. _this4.customRefresherHeight = res[0].height;
  37204. if (_this4.customRefresherHeight > 0) {
  37205. _this4.showCustomRefresher = true;
  37206. }
  37207. } else {
  37208. _this4.customRefresherHeight = 0;
  37209. }
  37210. if (_this4.doRefreshAnimateAfter) {
  37211. _this4.doRefreshAnimateAfter = false;
  37212. _this4._doRefresherRefreshAnimate();
  37213. }
  37214. });
  37215. },
  37216. //发射pullingDown事件
  37217. _emitTouchmove: function _emitTouchmove(e) {
  37218. e.viewHeight = this.finalRefresherThreshold;
  37219. e.rate = e.pullingDistance / e.viewHeight;
  37220. if (this.hasTouchmove) {
  37221. this.$emit('refresherTouchmove', e);
  37222. }
  37223. },
  37224. //清除refresherCompleteTimeout
  37225. _cleanRefresherCompleteTimeout: function _cleanRefresherCompleteTimeout() {
  37226. this.refresherCompleteTimeout = this._cleanTimeout(this.refresherCompleteTimeout);
  37227. },
  37228. //清除refresherEndTimeout
  37229. _cleanRefresherEndTimeout: function _cleanRefresherEndTimeout() {
  37230. this.refresherEndTimeout = this._cleanTimeout(this.refresherEndTimeout);
  37231. }
  37232. }
  37233. };
  37234. var _default2 = ZPRefresher;
  37235. exports.default = _default2;
  37236. /***/ }),
  37237. /* 314 */
  37238. /*!***************************************************************************************************!*\
  37239. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/load-more.js ***!
  37240. \***************************************************************************************************/
  37241. /*! no static exports found */
  37242. /***/ (function(module, exports, __webpack_require__) {
  37243. "use strict";
  37244. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  37245. Object.defineProperty(exports, "__esModule", {
  37246. value: true
  37247. });
  37248. exports.default = void 0;
  37249. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  37250. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  37251. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  37252. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 309));
  37253. // [z-paging]滚动到底部加载更多模块
  37254. var ZPLoadMore = {
  37255. props: {
  37256. //自定义底部加载更多样式
  37257. loadingMoreCustomStyle: {
  37258. type: Object,
  37259. default: function _default() {
  37260. return _zPagingUtils.default.gc('loadingMoreCustomStyle', {});
  37261. }
  37262. },
  37263. //自定义底部加载更多文字样式
  37264. loadingMoreTitleCustomStyle: {
  37265. type: Object,
  37266. default: function _default() {
  37267. return _zPagingUtils.default.gc('loadingMoreTitleCustomStyle', {});
  37268. }
  37269. },
  37270. //自定义底部加载更多加载中动画样式
  37271. loadingMoreLoadingIconCustomStyle: {
  37272. type: Object,
  37273. default: function _default() {
  37274. return _zPagingUtils.default.gc('loadingMoreLoadingIconCustomStyle', {});
  37275. }
  37276. },
  37277. //自定义底部加载更多加载中动画图标类型,可选flower或circle,默认为flower
  37278. loadingMoreLoadingIconType: {
  37279. type: String,
  37280. default: _zPagingUtils.default.gc('loadingMoreLoadingIconType', 'flower')
  37281. },
  37282. //自定义底部加载更多加载中动画图标图片
  37283. loadingMoreLoadingIconCustomImage: {
  37284. type: String,
  37285. default: _zPagingUtils.default.gc('loadingMoreLoadingIconCustomImage', '')
  37286. },
  37287. //底部加载更多加载中view是否展示旋转动画,默认为是
  37288. loadingMoreLoadingAnimated: {
  37289. type: Boolean,
  37290. default: _zPagingUtils.default.gc('loadingMoreLoadingAnimated', true)
  37291. },
  37292. //是否启用加载更多数据(含滑动到底部加载更多数据和点击加载更多数据),默认为是
  37293. loadingMoreEnabled: {
  37294. type: Boolean,
  37295. default: _zPagingUtils.default.gc('loadingMoreEnabled', true)
  37296. },
  37297. //是否启用滑动到底部加载更多数据,默认为是
  37298. toBottomLoadingMoreEnabled: {
  37299. type: Boolean,
  37300. default: _zPagingUtils.default.gc('toBottomLoadingMoreEnabled', true)
  37301. },
  37302. //滑动到底部状态为默认状态时,以加载中的状态展示,默认为否。若设置为是,可避免滚动到底部看到默认状态然后立刻变为加载中状态的问题,但分页数量未超过一屏时,不会显示【点击加载更多】
  37303. loadingMoreDefaultAsLoading: {
  37304. type: [Boolean],
  37305. default: _zPagingUtils.default.gc('loadingMoreDefaultAsLoading', false)
  37306. },
  37307. //滑动到底部"默认"文字,默认为【点击加载更多】
  37308. loadingMoreDefaultText: {
  37309. type: [String, Object],
  37310. default: _zPagingUtils.default.gc('loadingMoreDefaultText', null)
  37311. },
  37312. //滑动到底部"加载中"文字,默认为【正在加载...】
  37313. loadingMoreLoadingText: {
  37314. type: [String, Object],
  37315. default: _zPagingUtils.default.gc('loadingMoreLoadingText', null)
  37316. },
  37317. //滑动到底部"没有更多"文字,默认为【没有更多了】
  37318. loadingMoreNoMoreText: {
  37319. type: [String, Object],
  37320. default: _zPagingUtils.default.gc('loadingMoreNoMoreText', null)
  37321. },
  37322. //滑动到底部"加载失败"文字,默认为【加载失败,点击重新加载】
  37323. loadingMoreFailText: {
  37324. type: [String, Object],
  37325. default: _zPagingUtils.default.gc('loadingMoreFailText', null)
  37326. },
  37327. //当没有更多数据且分页内容未超出z-paging时是否隐藏没有更多数据的view,默认为否
  37328. hideLoadingMoreWhenNoMoreAndInsideOfPaging: {
  37329. type: Boolean,
  37330. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreAndInsideOfPaging', false)
  37331. },
  37332. //当没有更多数据且分页数组长度少于这个值时,隐藏没有更多数据的view,默认为0,代表不限制。
  37333. hideLoadingMoreWhenNoMoreByLimit: {
  37334. type: Number,
  37335. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreByLimit', 0)
  37336. },
  37337. //是否显示默认的加载更多text,默认为是
  37338. showDefaultLoadingMoreText: {
  37339. type: Boolean,
  37340. default: _zPagingUtils.default.gc('showDefaultLoadingMoreText', true)
  37341. },
  37342. //是否显示没有更多数据的view
  37343. showLoadingMoreNoMoreView: {
  37344. type: Boolean,
  37345. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreView', true)
  37346. },
  37347. //是否显示没有更多数据的分割线,默认为是
  37348. showLoadingMoreNoMoreLine: {
  37349. type: Boolean,
  37350. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreLine', true)
  37351. },
  37352. //自定义底部没有更多数据的分割线样式
  37353. loadingMoreNoMoreLineCustomStyle: {
  37354. type: Object,
  37355. default: function _default() {
  37356. return _zPagingUtils.default.gc('loadingMoreNoMoreLineCustomStyle', {});
  37357. }
  37358. },
  37359. //距底部/右边多远时(单位px),触发 scrolltolower 事件,默认为100rpx
  37360. lowerThreshold: {
  37361. type: [Number, String],
  37362. default: _zPagingUtils.default.gc('lowerThreshold', '100rpx')
  37363. }
  37364. },
  37365. data: function data() {
  37366. return {
  37367. //底部加载更多状态
  37368. loadingStatus: _zPagingEnum.default.More.Default,
  37369. loadingStatusAfterRender: _zPagingEnum.default.More.Default,
  37370. loadingMoreTimeStamp: 0,
  37371. loadingMoreDefaultSlot: null,
  37372. showLoadingMore: false,
  37373. customNoMore: -1
  37374. };
  37375. },
  37376. computed: {
  37377. zPagingLoadMoreConfig: function zPagingLoadMoreConfig() {
  37378. return {
  37379. status: this.loadingStatusAfterRender,
  37380. defaultAsLoading: this.loadingMoreDefaultAsLoading,
  37381. defaultThemeStyle: this.finalLoadingMoreThemeStyle,
  37382. customStyle: this.loadingMoreCustomStyle,
  37383. titleCustomStyle: this.loadingMoreTitleCustomStyle,
  37384. iconCustomStyle: this.loadingMoreLoadingIconCustomStyle,
  37385. loadingIconType: this.loadingMoreLoadingIconType,
  37386. loadingIconCustomImage: this.loadingMoreLoadingIconCustomImage,
  37387. loadingAnimated: this.loadingMoreLoadingAnimated,
  37388. showNoMoreLine: this.showLoadingMoreNoMoreLine,
  37389. noMoreLineCustomStyle: this.loadingMoreNoMoreLineCustomStyle,
  37390. defaultText: this.finalLoadingMoreDefaultText,
  37391. loadingText: this.finalLoadingMoreLoadingText,
  37392. noMoreText: this.finalLoadingMoreNoMoreText,
  37393. failText: this.finalLoadingMoreFailText
  37394. };
  37395. },
  37396. finalLoadingMoreThemeStyle: function finalLoadingMoreThemeStyle() {
  37397. return this.loadingMoreThemeStyle.length ? this.loadingMoreThemeStyle : this.defaultThemeStyle;
  37398. }
  37399. },
  37400. methods: {
  37401. //手动触发上拉加载更多(非必须,可依据具体需求使用)
  37402. doLoadMore: function doLoadMore() {
  37403. this._onLoadingMore('toBottom');
  37404. },
  37405. //通过@scroll事件检测是否滚动到了底部
  37406. _checkScrolledToBottom: function _checkScrolledToBottom(scrollDiff) {
  37407. var _this = this;
  37408. var checked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  37409. if (this.checkScrolledToBottomTimeOut) {
  37410. clearTimeout(this.checkScrolledToBottomTimeOut);
  37411. this.checkScrolledToBottomTimeOut = null;
  37412. }
  37413. if (this.cacheScrollNodeHeight === -1) {
  37414. this._getNodeClientRect('.zp-scroll-view').then(function (res) {
  37415. if (res) {
  37416. var pageScrollNodeHeight = res[0].height;
  37417. _this.cacheScrollNodeHeight = pageScrollNodeHeight;
  37418. if (scrollDiff - pageScrollNodeHeight <= _this.finalLowerThreshold) {
  37419. _this._onLoadingMore('toBottom');
  37420. }
  37421. }
  37422. });
  37423. } else {
  37424. if (scrollDiff - this.cacheScrollNodeHeight <= this.finalLowerThreshold) {
  37425. this._onLoadingMore('toBottom');
  37426. } else if (scrollDiff - this.cacheScrollNodeHeight <= 500 && !checked) {
  37427. this.checkScrolledToBottomTimeOut = setTimeout(function () {
  37428. _this._getNodeClientRect('.zp-scroll-view', true, true).then(function (res) {
  37429. _this.oldScrollTop = res[0].scrollTop;
  37430. var newScrollDiff = res[0].scrollHeight - _this.oldScrollTop;
  37431. _this._checkScrolledToBottom(newScrollDiff, true);
  37432. });
  37433. }, 150);
  37434. }
  37435. }
  37436. },
  37437. //触发加载更多时调用,from:0-滑动到底部触发;1-点击加载更多触发
  37438. _onLoadingMore: function _onLoadingMore() {
  37439. var _this2 = this;
  37440. var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'click';
  37441. if (from === 'toBottom') {
  37442. if (!this.scrollToBottomBounceEnabled) {
  37443. if (this.scrollEnable) {
  37444. this.scrollEnable = false;
  37445. this.$nextTick(function () {
  37446. _this2.scrollEnable = true;
  37447. });
  37448. }
  37449. }
  37450. }
  37451. this.$emit('scrolltolower', from);
  37452. if (from === 'toBottom' && (!this.toBottomLoadingMoreEnabled || this.useChatRecordMode)) return;
  37453. if (this.refresherOnly || !this.loadingMoreEnabled || !(this.loadingStatus === _zPagingEnum.default.More.Default || this.loadingStatus === _zPagingEnum.default.More.Fail) || this.loading) return;
  37454. if (!this.isIos && !this.refresherOnly && !this.usePageScroll) {
  37455. var currentTimestamp = _zPagingUtils.default.getTime();
  37456. if (this.loadingMoreTimeStamp > 0 && currentTimestamp - this.loadingMoreTimeStamp < 100) {
  37457. this.loadingMoreTimeStamp = 0;
  37458. return;
  37459. }
  37460. }
  37461. this._doLoadingMore();
  37462. },
  37463. //处理开始加载更多
  37464. _doLoadingMore: function _doLoadingMore() {
  37465. var _this3 = this;
  37466. if (this.pageNo >= this.defaultPageNo && this.loadingStatus !== _zPagingEnum.default.More.NoMore) {
  37467. this.pageNo++;
  37468. this._startLoading(false);
  37469. if (this.isLocalPaging) {
  37470. this._localPagingQueryList(this.pageNo, this.defaultPageSize, this.localPagingLoadingTime, function (res) {
  37471. _this3.addData(res);
  37472. });
  37473. } else {
  37474. this._emitQuery(this.pageNo, this.defaultPageSize, _zPagingEnum.default.QueryFrom.LoadingMore);
  37475. this._callMyParentQuery();
  37476. }
  37477. this.loadingType = _zPagingEnum.default.LoadingType.LoadingMore;
  37478. }
  37479. },
  37480. //(预处理)判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  37481. _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode) {
  37482. var _this4 = this;
  37483. if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreByLimit > 0 && newVal.length) {
  37484. this.showLoadingMore = newVal.length > this.hideLoadingMoreWhenNoMoreByLimit;
  37485. } else if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreAndInsideOfPaging && newVal.length || this.insideMore && this.insideOfPaging !== false && newVal.length) {
  37486. this.$nextTick(function () {
  37487. _this4._checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode);
  37488. });
  37489. if (this.insideMore && this.insideOfPaging !== false && newVal.length) {
  37490. this.showLoadingMore = newVal.length;
  37491. }
  37492. } else {
  37493. this.showLoadingMore = newVal.length;
  37494. }
  37495. },
  37496. //判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  37497. _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, oldScrollViewNode, oldPagingContainerNode) {
  37498. var _this5 = this;
  37499. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  37500. var scrollViewNode, scrollViewTotalH, pagingContainerH, scrollViewH, pagingContainerNode;
  37501. return _regenerator.default.wrap(function _callee$(_context) {
  37502. while (1) {
  37503. switch (_context.prev = _context.next) {
  37504. case 0:
  37505. _context.prev = 0;
  37506. _context.t0 = oldScrollViewNode;
  37507. if (_context.t0) {
  37508. _context.next = 6;
  37509. break;
  37510. }
  37511. _context.next = 5;
  37512. return _this5._getNodeClientRect('.zp-scroll-view');
  37513. case 5:
  37514. _context.t0 = _context.sent;
  37515. case 6:
  37516. scrollViewNode = _context.t0;
  37517. if (!_this5.usePageScroll) {
  37518. _context.next = 11;
  37519. break;
  37520. }
  37521. if (scrollViewNode) {
  37522. scrollViewTotalH = scrollViewNode[0].top + scrollViewNode[0].height;
  37523. _this5.insideOfPaging = scrollViewTotalH < _this5.windowHeight;
  37524. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  37525. _this5.showLoadingMore = !_this5.insideOfPaging;
  37526. }
  37527. _this5._updateInsideOfPaging();
  37528. }
  37529. _context.next = 24;
  37530. break;
  37531. case 11:
  37532. pagingContainerH = 0;
  37533. scrollViewH = 0;
  37534. _context.t1 = oldPagingContainerNode;
  37535. if (_context.t1) {
  37536. _context.next = 18;
  37537. break;
  37538. }
  37539. _context.next = 17;
  37540. return _this5._getNodeClientRect('.zp-paging-container-content');
  37541. case 17:
  37542. _context.t1 = _context.sent;
  37543. case 18:
  37544. pagingContainerNode = _context.t1;
  37545. if (pagingContainerNode) {
  37546. pagingContainerH = pagingContainerNode[0].height;
  37547. }
  37548. if (scrollViewNode) {
  37549. scrollViewH = scrollViewNode[0].height;
  37550. }
  37551. _this5.insideOfPaging = pagingContainerH < scrollViewH;
  37552. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  37553. _this5.showLoadingMore = !_this5.insideOfPaging;
  37554. }
  37555. _this5._updateInsideOfPaging();
  37556. case 24:
  37557. _context.next = 31;
  37558. break;
  37559. case 26:
  37560. _context.prev = 26;
  37561. _context.t2 = _context["catch"](0);
  37562. _this5.insideOfPaging = !totalData.length;
  37563. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  37564. _this5.showLoadingMore = !_this5.insideOfPaging;
  37565. }
  37566. _this5._updateInsideOfPaging();
  37567. case 31:
  37568. case "end":
  37569. return _context.stop();
  37570. }
  37571. }
  37572. }, _callee, null, [[0, 26]]);
  37573. }))();
  37574. },
  37575. //是否要展示上拉加载更多view
  37576. _showLoadingMore: function _showLoadingMore(type) {
  37577. if (!(this.loadingStatus === _zPagingEnum.default.More.Default ? this.nShowBottom : true)) return false;
  37578. if ((!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) && !this.showLoadingMore || !this.loadingMoreEnabled && (!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) || this.refresherOnly) return false;
  37579. if (this.useChatRecordMode && type !== 'Loading') return false;
  37580. if (!this.$slots) return false;
  37581. if (type === 'Custom') {
  37582. return this.showDefaultLoadingMoreText && !(this.loadingStatus === _zPagingEnum.default.More.NoMore && !this.showLoadingMoreNoMoreView);
  37583. }
  37584. var res = this.loadingStatus === _zPagingEnum.default.More[type] && this.$slots["loadingMore".concat(type)] && (type === 'NoMore' ? this.showLoadingMoreNoMoreView : true);
  37585. if (res) {}
  37586. return res;
  37587. }
  37588. }
  37589. };
  37590. var _default2 = ZPLoadMore;
  37591. exports.default = _default2;
  37592. /***/ }),
  37593. /* 315 */
  37594. /*!**************************************************************************************************!*\
  37595. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/scroller.js ***!
  37596. \**************************************************************************************************/
  37597. /*! no static exports found */
  37598. /***/ (function(module, exports, __webpack_require__) {
  37599. "use strict";
  37600. /* WEBPACK VAR INJECTION */(function(uni) {
  37601. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  37602. Object.defineProperty(exports, "__esModule", {
  37603. value: true
  37604. });
  37605. exports.default = void 0;
  37606. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  37607. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  37608. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  37609. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 309));
  37610. // [z-paging]scroll相关模块
  37611. var ZPScroller = {
  37612. props: {
  37613. //使用页面滚动,默认为否,当设置为是时则使用页面的滚动而非此组件内部的scroll-view的滚动,使用页面滚动时z-paging无需设置确定的高度且对于长列表展示性能更高,但配置会略微繁琐
  37614. usePageScroll: {
  37615. type: Boolean,
  37616. default: _zPagingUtils.default.gc('usePageScroll', false)
  37617. },
  37618. //是否可以滚动,使用内置scroll-view和nvue时有效,默认为是
  37619. scrollable: {
  37620. type: Boolean,
  37621. default: _zPagingUtils.default.gc('scrollable', true)
  37622. },
  37623. //控制是否出现滚动条,默认为是
  37624. showScrollbar: {
  37625. type: Boolean,
  37626. default: _zPagingUtils.default.gc('showScrollbar', true)
  37627. },
  37628. //是否允许横向滚动,默认为否
  37629. scrollX: {
  37630. type: Boolean,
  37631. default: _zPagingUtils.default.gc('scrollX', false)
  37632. },
  37633. //iOS设备上滚动到顶部时是否允许回弹效果,默认为否。关闭回弹效果后可使滚动到顶部与下拉刷新更连贯,但是有吸顶view时滚动到顶部时可能出现抖动。
  37634. scrollToTopBounceEnabled: {
  37635. type: Boolean,
  37636. default: _zPagingUtils.default.gc('scrollToTopBounceEnabled', false)
  37637. },
  37638. //iOS设备上滚动到底部时是否允许回弹效果,默认为是。
  37639. scrollToBottomBounceEnabled: {
  37640. type: Boolean,
  37641. default: _zPagingUtils.default.gc('scrollToBottomBounceEnabled', true)
  37642. },
  37643. //在设置滚动条位置时使用动画过渡,默认为否
  37644. scrollWithAnimation: {
  37645. type: Boolean,
  37646. default: _zPagingUtils.default.gc('scrollWithAnimation', false)
  37647. },
  37648. //值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
  37649. scrollIntoView: {
  37650. type: String,
  37651. default: _zPagingUtils.default.gc('scrollIntoView', '')
  37652. }
  37653. },
  37654. data: function data() {
  37655. return {
  37656. scrollTop: 0,
  37657. oldScrollTop: 0,
  37658. scrollViewStyle: {},
  37659. scrollViewInStyle: {},
  37660. pageScrollTop: -1,
  37661. scrollEnable: true,
  37662. privateScrollWithAnimation: -1,
  37663. cacheScrollNodeHeight: -1
  37664. };
  37665. },
  37666. watch: {
  37667. oldScrollTop: function oldScrollTop(newVal, oldVal) {
  37668. !this.usePageScroll && this._scrollTopChange(newVal, oldVal, false);
  37669. },
  37670. pageScrollTop: function pageScrollTop(newVal, oldVal) {
  37671. this.usePageScroll && this._scrollTopChange(newVal, oldVal, true);
  37672. },
  37673. usePageScroll: {
  37674. handler: function handler(newVal) {
  37675. var _this = this;
  37676. this.$nextTick(function () {
  37677. _this.renderPropUsePageScroll = newVal;
  37678. });
  37679. if (this.loaded && this.autoHeight) {
  37680. this._setAutoHeight(!newVal);
  37681. }
  37682. },
  37683. immediate: true
  37684. },
  37685. finalScrollTop: function finalScrollTop(newVal, oldVal) {
  37686. if (!this.useChatRecordMode) {
  37687. this.renderPropScrollTop = newVal < 6 ? 0 : 10;
  37688. }
  37689. }
  37690. },
  37691. computed: {
  37692. finalScrollWithAnimation: function finalScrollWithAnimation() {
  37693. if (this.privateScrollWithAnimation !== -1) {
  37694. var scrollWithAnimation = this.privateScrollWithAnimation === 1;
  37695. this.privateScrollWithAnimation = -1;
  37696. return scrollWithAnimation;
  37697. }
  37698. return this.scrollWithAnimation;
  37699. },
  37700. finalScrollViewStyle: function finalScrollViewStyle() {
  37701. if (this.superContentZIndex != 1) {
  37702. this.scrollViewStyle['z-index'] = this.superContentZIndex;
  37703. this.scrollViewStyle['position'] = 'relative';
  37704. }
  37705. return this.scrollViewStyle;
  37706. },
  37707. finalScrollTop: function finalScrollTop() {
  37708. return this.usePageScroll ? this.pageScrollTop : this.oldScrollTop;
  37709. }
  37710. },
  37711. methods: {
  37712. //滚动到顶部,animate为是否展示滚动动画,默认为是
  37713. scrollToTop: function scrollToTop(animate) {
  37714. var _this2 = this;
  37715. var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  37716. this.$nextTick(function () {
  37717. _this2._scrollToTop(animate, false);
  37718. });
  37719. },
  37720. //滚动到底部,animate为是否展示滚动动画,默认为是
  37721. scrollToBottom: function scrollToBottom(animate) {
  37722. var _this3 = this;
  37723. var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  37724. this.$nextTick(function () {
  37725. _this3._scrollToBottom(animate);
  37726. });
  37727. },
  37728. //滚动到指定view(vue中有效)。sel为需要滚动的view的id值,不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  37729. scrollIntoViewById: function scrollIntoViewById(sel, offset, animate) {
  37730. this._scrollIntoView(sel, offset, animate);
  37731. },
  37732. //滚动到指定view(vue中有效)。nodeTop为需要滚动的view的top值(通过uni.createSelectorQuery()获取);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  37733. scrollIntoViewByNodeTop: function scrollIntoViewByNodeTop(nodeTop, offset, animate) {
  37734. var _this4 = this;
  37735. this.scrollTop = this.oldScrollTop;
  37736. this.$nextTick(function () {
  37737. _this4._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  37738. });
  37739. },
  37740. //滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  37741. scrollToY: function scrollToY(y, offset, animate) {
  37742. var _this5 = this;
  37743. this.scrollTop = this.oldScrollTop;
  37744. this.$nextTick(function () {
  37745. _this5._scrollToY(y, offset, animate);
  37746. });
  37747. },
  37748. //滚动到指定view(nvue中有效)。index为需要滚动的view的index(第几个);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  37749. scrollIntoViewByIndex: function scrollIntoViewByIndex(index, offset, animate) {
  37750. this._scrollIntoView(index, offset, animate);
  37751. },
  37752. //滚动到指定view(nvue中有效)。view为需要滚动的view(通过`this.$refs.xxx`获取),不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  37753. scrollIntoViewByView: function scrollIntoViewByView(view, offset, animate) {
  37754. this._scrollIntoView(view, offset, animate);
  37755. },
  37756. //当使用页面滚动并且自定义下拉刷新时,请在页面的onPageScroll中调用此方法,告知z-paging当前的pageScrollTop,否则会导致在任意位置都可以下拉刷新
  37757. updatePageScrollTop: function updatePageScrollTop(value) {
  37758. if (value == undefined) {
  37759. _zPagingUtils.default.consoleErr('updatePageScrollTop方法缺少参数,请将页面onPageScroll事件中的scrollTop传递给此方法');
  37760. return;
  37761. }
  37762. this.pageScrollTop = value;
  37763. },
  37764. //当使用页面滚动并且设置了slot="top"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="top"的view高度动态改变时,在其高度需要更新时调用此方法
  37765. updatePageScrollTopHeight: function updatePageScrollTopHeight() {
  37766. this._updatePageScrollTopOrBottomHeight('top');
  37767. },
  37768. //当使用页面滚动并且设置了slot="bottom"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="bottom"的view高度动态改变时,在其高度需要更新时调用此方法
  37769. updatePageScrollBottomHeight: function updatePageScrollBottomHeight() {
  37770. this._updatePageScrollTopOrBottomHeight('bottom');
  37771. },
  37772. //更新z-paging内置scroll-view的scrollTop
  37773. updateScrollViewScrollTop: function updateScrollViewScrollTop(scrollTop) {
  37774. var _this6 = this;
  37775. var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  37776. this.privateScrollWithAnimation = animate ? 1 : 0;
  37777. this.scrollTop = this.oldScrollTop;
  37778. this.$nextTick(function () {
  37779. _this6.scrollTop = scrollTop;
  37780. _this6.oldScrollTop = _this6.scrollTop;
  37781. });
  37782. },
  37783. //当滚动到顶部时
  37784. _scrollToUpper: function _scrollToUpper() {
  37785. var _this7 = this;
  37786. this.$emit('scrolltoupper');
  37787. this.$emit('scrollTopChange', 0);
  37788. this.$nextTick(function () {
  37789. _this7.oldScrollTop = 0;
  37790. });
  37791. if (!this.useChatRecordMode) return;
  37792. if (this.loadingStatus === _zPagingEnum.default.More.NoMore) return;
  37793. this._onLoadingMore('click');
  37794. },
  37795. //滚动到顶部
  37796. _scrollToTop: function _scrollToTop() {
  37797. var _this8 = this;
  37798. var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  37799. var isPrivate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  37800. if (this.usePageScroll) {
  37801. this.$nextTick(function () {
  37802. uni.pageScrollTo({
  37803. scrollTop: 0,
  37804. duration: animate ? 100 : 0
  37805. });
  37806. });
  37807. return;
  37808. }
  37809. this.privateScrollWithAnimation = animate ? 1 : 0;
  37810. this.scrollTop = this.oldScrollTop;
  37811. this.$nextTick(function () {
  37812. _this8.scrollTop = 0;
  37813. _this8.oldScrollTop = _this8.scrollTop;
  37814. });
  37815. },
  37816. //滚动到底部
  37817. _scrollToBottom: function _scrollToBottom() {
  37818. var _arguments = arguments,
  37819. _this9 = this;
  37820. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  37821. var animate, pagingContainerH, scrollViewH, pagingContainerNode, scrollViewNode;
  37822. return _regenerator.default.wrap(function _callee$(_context) {
  37823. while (1) {
  37824. switch (_context.prev = _context.next) {
  37825. case 0:
  37826. animate = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;
  37827. if (!_this9.usePageScroll) {
  37828. _context.next = 4;
  37829. break;
  37830. }
  37831. _this9.$nextTick(function () {
  37832. uni.pageScrollTo({
  37833. scrollTop: Number.MAX_VALUE,
  37834. duration: animate ? 100 : 0
  37835. });
  37836. });
  37837. return _context.abrupt("return");
  37838. case 4:
  37839. _context.prev = 4;
  37840. _this9.privateScrollWithAnimation = animate ? 1 : 0;
  37841. pagingContainerH = 0;
  37842. scrollViewH = 0;
  37843. _context.next = 10;
  37844. return _this9._getNodeClientRect('.zp-paging-container');
  37845. case 10:
  37846. pagingContainerNode = _context.sent;
  37847. _context.next = 13;
  37848. return _this9._getNodeClientRect('.zp-scroll-view');
  37849. case 13:
  37850. scrollViewNode = _context.sent;
  37851. if (pagingContainerNode) {
  37852. pagingContainerH = pagingContainerNode[0].height;
  37853. }
  37854. if (scrollViewNode) {
  37855. scrollViewH = scrollViewNode[0].height;
  37856. }
  37857. if (pagingContainerH > scrollViewH) {
  37858. _this9.scrollTop = _this9.oldScrollTop;
  37859. _this9.$nextTick(function () {
  37860. _this9.scrollTop = pagingContainerH - scrollViewH;
  37861. _this9.oldScrollTop = _this9.scrollTop;
  37862. });
  37863. }
  37864. _context.next = 21;
  37865. break;
  37866. case 19:
  37867. _context.prev = 19;
  37868. _context.t0 = _context["catch"](4);
  37869. case 21:
  37870. case "end":
  37871. return _context.stop();
  37872. }
  37873. }
  37874. }, _callee, null, [[4, 19]]);
  37875. }))();
  37876. },
  37877. //滚动到指定view
  37878. _scrollIntoView: function _scrollIntoView(sel) {
  37879. var _this10 = this;
  37880. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  37881. var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  37882. var finishCallback = arguments.length > 3 ? arguments[3] : undefined;
  37883. try {
  37884. this.scrollTop = this.oldScrollTop;
  37885. this.$nextTick(function () {
  37886. if (sel.indexOf('#') != -1) {
  37887. sel = sel.replace('#', '');
  37888. }
  37889. _this10._getNodeClientRect('#' + sel, false).then(function (node) {
  37890. if (node) {
  37891. var nodeTop = node[0].top;
  37892. _this10._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  37893. if (finishCallback) {
  37894. finishCallback();
  37895. }
  37896. }
  37897. });
  37898. });
  37899. } catch (e) {}
  37900. },
  37901. //通过nodeTop滚动到指定view
  37902. _scrollIntoViewByNodeTop: function _scrollIntoViewByNodeTop(nodeTop) {
  37903. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  37904. var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  37905. this._scrollToY(nodeTop, offset, animate, true);
  37906. },
  37907. //滚动到指定位置
  37908. _scrollToY: function _scrollToY(y) {
  37909. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  37910. var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  37911. var addScrollTop = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  37912. this.privateScrollWithAnimation = animate ? 1 : 0;
  37913. if (this.usePageScroll) {
  37914. uni.pageScrollTo({
  37915. scrollTop: y - offset,
  37916. duration: animate ? 100 : 0
  37917. });
  37918. } else {
  37919. if (addScrollTop) {
  37920. y += this.oldScrollTop;
  37921. }
  37922. this.scrollTop = y - offset;
  37923. this.oldScrollTop = this.scrollTop;
  37924. }
  37925. },
  37926. //scroll-view滚动中
  37927. _scroll: function _scroll(e) {
  37928. this.$emit('scroll', e);
  37929. this.oldScrollTop = e.detail.scrollTop;
  37930. var scrollDiff = e.detail.scrollHeight - this.oldScrollTop;
  37931. !this.isIos && this._checkScrolledToBottom(scrollDiff);
  37932. },
  37933. //scrollTop改变时触发
  37934. _scrollTopChange: function _scrollTopChange(newVal, oldVal, isPageScrollTop) {
  37935. this.$emit('scrollTopChange', newVal);
  37936. this.$emit('update:scrollTop', newVal);
  37937. this._checkShouldShowBackToTop(newVal, oldVal);
  37938. var scrollTop = this.isIos ? newVal > 5 ? 6 : 0 : newVal;
  37939. if (isPageScrollTop) {
  37940. this.wxsPageScrollTop = scrollTop;
  37941. } else {
  37942. this.wxsScrollTop = scrollTop;
  37943. }
  37944. },
  37945. //更新使用页面滚动时slot="top"或"bottom"插入view的高度
  37946. _updatePageScrollTopOrBottomHeight: function _updatePageScrollTopOrBottomHeight(type) {
  37947. var _this11 = this;
  37948. if (!this.usePageScroll) return;
  37949. this._doCheckScrollViewShouldFullHeight(this.realTotalData);
  37950. var node = ".zp-page-scroll-".concat(type);
  37951. var marginText = "margin".concat(type.slice(0, 1).toUpperCase() + type.slice(1));
  37952. var safeAreaInsetBottomAdd = this.safeAreaInsetBottom;
  37953. this.$nextTick(function () {
  37954. var delayTime = 0;
  37955. setTimeout(function () {
  37956. _this11._getNodeClientRect(node).then(function (res) {
  37957. if (res) {
  37958. var pageScrollNodeHeight = res[0].height;
  37959. if (type === 'bottom') {
  37960. if (safeAreaInsetBottomAdd) {
  37961. pageScrollNodeHeight += _this11.safeAreaBottom;
  37962. }
  37963. } else {
  37964. _this11.cacheTopHeight = pageScrollNodeHeight;
  37965. }
  37966. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(pageScrollNodeHeight, "px"));
  37967. } else if (safeAreaInsetBottomAdd) {
  37968. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(_this11.safeAreaBottom, "px"));
  37969. }
  37970. });
  37971. }, delayTime);
  37972. });
  37973. }
  37974. }
  37975. };
  37976. var _default = ZPScroller;
  37977. exports.default = _default;
  37978. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  37979. /***/ }),
  37980. /* 316 */
  37981. /*!*****************************************************************************************************!*\
  37982. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/back-to-top.js ***!
  37983. \*****************************************************************************************************/
  37984. /*! no static exports found */
  37985. /***/ (function(module, exports, __webpack_require__) {
  37986. "use strict";
  37987. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  37988. Object.defineProperty(exports, "__esModule", {
  37989. value: true
  37990. });
  37991. exports.default = void 0;
  37992. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 302));
  37993. // [z-paging]点击返回顶部view模块
  37994. var ZPBackToTop = {
  37995. props: {
  37996. //自动显示点击返回顶部按钮,默认为否
  37997. autoShowBackToTop: {
  37998. type: Boolean,
  37999. default: _zPagingUtils.default.gc('autoShowBackToTop', false)
  38000. },
  38001. //点击返回顶部按钮显示/隐藏的阈值(滚动距离),单位为px,默认为400rpx
  38002. backToTopThreshold: {
  38003. type: [Number, String],
  38004. default: _zPagingUtils.default.gc('backToTopThreshold', '400rpx')
  38005. },
  38006. //点击返回顶部按钮的自定义图片地址,默认使用z-paging内置的图片
  38007. backToTopImg: {
  38008. type: String,
  38009. default: _zPagingUtils.default.gc('backToTopImg', '')
  38010. },
  38011. //点击返回顶部按钮返回到顶部时是否展示过渡动画,默认为是
  38012. backToTopWithAnimate: {
  38013. type: Boolean,
  38014. default: _zPagingUtils.default.gc('backToTopWithAnimate', true)
  38015. },
  38016. //点击返回顶部按钮与底部的距离,注意添加单位px或rpx,默认为160rpx
  38017. backToTopBottom: {
  38018. type: [Number, String],
  38019. default: _zPagingUtils.default.gc('backToTopBottom', '160rpx')
  38020. },
  38021. //点击返回顶部按钮的自定义样式
  38022. backToTopStyle: {
  38023. type: Object,
  38024. default: function _default() {
  38025. return _zPagingUtils.default.gc('backToTopStyle', {});
  38026. }
  38027. },
  38028. //iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向,默认为是
  38029. enableBackToTop: {
  38030. type: Boolean,
  38031. default: _zPagingUtils.default.gc('enableBackToTop', true)
  38032. }
  38033. },
  38034. data: function data() {
  38035. return {
  38036. backToTopClass: 'zp-back-to-top zp-back-to-top-hide',
  38037. lastBackToTopShowTime: 0,
  38038. showBackToTopClass: false
  38039. };
  38040. },
  38041. computed: {
  38042. finalEnableBackToTop: function finalEnableBackToTop() {
  38043. return this.usePageScroll ? false : this.enableBackToTop;
  38044. },
  38045. finalBackToTopThreshold: function finalBackToTopThreshold() {
  38046. return _zPagingUtils.default.convertTextToPx(this.backToTopThreshold);
  38047. },
  38048. finalBackToTopStyle: function finalBackToTopStyle() {
  38049. var tempBackToTopStyle = this.backToTopStyle;
  38050. if (!tempBackToTopStyle.bottom) {
  38051. tempBackToTopStyle.bottom = this.windowBottom + _zPagingUtils.default.convertTextToPx(this.backToTopBottom) + 'px';
  38052. }
  38053. if (!tempBackToTopStyle.position) {
  38054. tempBackToTopStyle.position = this.usePageScroll ? 'fixed' : 'absolute';
  38055. }
  38056. return tempBackToTopStyle;
  38057. }
  38058. },
  38059. methods: {
  38060. //点击返回顶部
  38061. _backToTopClick: function _backToTopClick() {
  38062. !this.backToTopWithAnimate && this._checkShouldShowBackToTop(1, 0);
  38063. this.scrollToTop(this.backToTopWithAnimate);
  38064. },
  38065. //判断是否要显示返回顶部按钮
  38066. _checkShouldShowBackToTop: function _checkShouldShowBackToTop(newVal, oldVal) {
  38067. var _this = this;
  38068. if (!this.autoShowBackToTop) {
  38069. this.showBackToTopClass = false;
  38070. return;
  38071. }
  38072. if (newVal !== oldVal) {
  38073. if (newVal > this.finalBackToTopThreshold) {
  38074. if (!this.showBackToTopClass) {
  38075. this.showBackToTopClass = true;
  38076. this.lastBackToTopShowTime = new Date().getTime();
  38077. setTimeout(function () {
  38078. _this.backToTopClass = 'zp-back-to-top zp-back-to-top-show';
  38079. }, 300);
  38080. }
  38081. } else {
  38082. if (this.showBackToTopClass) {
  38083. var currentTime = new Date().getTime();
  38084. var dalayTime = 300;
  38085. if (currentTime - this.lastBackToTopShowTime < 500) {
  38086. dalayTime = 0;
  38087. }
  38088. this.backToTopClass = 'zp-back-to-top zp-back-to-top-hide';
  38089. setTimeout(function () {
  38090. _this.showBackToTopClass = false;
  38091. }, dalayTime);
  38092. }
  38093. }
  38094. }
  38095. }
  38096. }
  38097. };
  38098. var _default2 = ZPBackToTop;
  38099. exports.default = _default2;
  38100. /***/ }),
  38101. /* 317 */,
  38102. /* 318 */,
  38103. /* 319 */,
  38104. /* 320 */,
  38105. /* 321 */,
  38106. /* 322 */,
  38107. /* 323 */,
  38108. /* 324 */,
  38109. /* 325 */,
  38110. /* 326 */,
  38111. /* 327 */,
  38112. /* 328 */,
  38113. /* 329 */,
  38114. /* 330 */,
  38115. /* 331 */,
  38116. /* 332 */,
  38117. /* 333 */,
  38118. /* 334 */,
  38119. /* 335 */,
  38120. /* 336 */,
  38121. /* 337 */,
  38122. /* 338 */,
  38123. /* 339 */,
  38124. /* 340 */,
  38125. /* 341 */,
  38126. /* 342 */,
  38127. /* 343 */,
  38128. /* 344 */,
  38129. /* 345 */,
  38130. /* 346 */,
  38131. /* 347 */
  38132. /*!*****************************************************************************************!*\
  38133. !*** D:/code/work/broke_news_wx/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  38134. \*****************************************************************************************/
  38135. /*! no static exports found */
  38136. /***/ (function(module, exports, __webpack_require__) {
  38137. "use strict";
  38138. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  38139. Object.defineProperty(exports, "__esModule", {
  38140. value: true
  38141. });
  38142. exports.default = void 0;
  38143. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 44));
  38144. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 348));
  38145. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 349));
  38146. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 351));
  38147. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 46));
  38148. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  38149. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  38150. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  38151. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  38152. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38153. var pattern = {
  38154. email: /^\S+?@\S+?\.\S+?$/,
  38155. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  38156. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  38157. };
  38158. var FORMAT_MAPPING = {
  38159. "int": 'integer',
  38160. "bool": 'boolean',
  38161. "double": 'number',
  38162. "long": 'number',
  38163. "password": 'string'
  38164. // "fileurls": 'array'
  38165. };
  38166. function formatMessage(args) {
  38167. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  38168. var defaultMessage = ['label'];
  38169. defaultMessage.forEach(function (item) {
  38170. if (args[item] === undefined) {
  38171. args[item] = '';
  38172. }
  38173. });
  38174. var str = resources;
  38175. for (var key in args) {
  38176. var reg = new RegExp('{' + key + '}');
  38177. str = str.replace(reg, args[key]);
  38178. }
  38179. return str;
  38180. }
  38181. function isEmptyValue(value, type) {
  38182. if (value === undefined || value === null) {
  38183. return true;
  38184. }
  38185. if (typeof value === 'string' && !value) {
  38186. return true;
  38187. }
  38188. if (Array.isArray(value) && !value.length) {
  38189. return true;
  38190. }
  38191. if (type === 'object' && !Object.keys(value).length) {
  38192. return true;
  38193. }
  38194. return false;
  38195. }
  38196. var types = {
  38197. integer: function integer(value) {
  38198. return types.number(value) && parseInt(value, 10) === value;
  38199. },
  38200. string: function string(value) {
  38201. return typeof value === 'string';
  38202. },
  38203. number: function number(value) {
  38204. if (isNaN(value)) {
  38205. return false;
  38206. }
  38207. return typeof value === 'number';
  38208. },
  38209. "boolean": function boolean(value) {
  38210. return typeof value === 'boolean';
  38211. },
  38212. "float": function float(value) {
  38213. return types.number(value) && !types.integer(value);
  38214. },
  38215. array: function array(value) {
  38216. return Array.isArray(value);
  38217. },
  38218. object: function object(value) {
  38219. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  38220. },
  38221. date: function date(value) {
  38222. return value instanceof Date;
  38223. },
  38224. timestamp: function timestamp(value) {
  38225. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  38226. return false;
  38227. }
  38228. return true;
  38229. },
  38230. file: function file(value) {
  38231. return typeof value.url === 'string';
  38232. },
  38233. email: function email(value) {
  38234. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  38235. },
  38236. url: function url(value) {
  38237. return typeof value === 'string' && !!value.match(pattern.url);
  38238. },
  38239. pattern: function pattern(reg, value) {
  38240. try {
  38241. return new RegExp(reg).test(value);
  38242. } catch (e) {
  38243. return false;
  38244. }
  38245. },
  38246. method: function method(value) {
  38247. return typeof value === 'function';
  38248. },
  38249. idcard: function idcard(value) {
  38250. return typeof value === 'string' && !!value.match(pattern.idcard);
  38251. },
  38252. 'url-https': function urlHttps(value) {
  38253. return this.url(value) && value.startsWith('https://');
  38254. },
  38255. 'url-scheme': function urlScheme(value) {
  38256. return value.startsWith('://');
  38257. },
  38258. 'url-web': function urlWeb(value) {
  38259. return false;
  38260. }
  38261. };
  38262. var RuleValidator = /*#__PURE__*/function () {
  38263. function RuleValidator(message) {
  38264. (0, _classCallCheck2.default)(this, RuleValidator);
  38265. this._message = message;
  38266. }
  38267. (0, _createClass2.default)(RuleValidator, [{
  38268. key: "validateRule",
  38269. value: function () {
  38270. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  38271. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  38272. return _regenerator.default.wrap(function _callee$(_context) {
  38273. while (1) {
  38274. switch (_context.prev = _context.next) {
  38275. case 0:
  38276. result = null;
  38277. rules = fieldValue.rules;
  38278. hasRequired = rules.findIndex(function (item) {
  38279. return item.required;
  38280. });
  38281. if (!(hasRequired < 0)) {
  38282. _context.next = 8;
  38283. break;
  38284. }
  38285. if (!(value === null || value === undefined)) {
  38286. _context.next = 6;
  38287. break;
  38288. }
  38289. return _context.abrupt("return", result);
  38290. case 6:
  38291. if (!(typeof value === 'string' && !value.length)) {
  38292. _context.next = 8;
  38293. break;
  38294. }
  38295. return _context.abrupt("return", result);
  38296. case 8:
  38297. message = this._message;
  38298. if (!(rules === undefined)) {
  38299. _context.next = 11;
  38300. break;
  38301. }
  38302. return _context.abrupt("return", message['default']);
  38303. case 11:
  38304. i = 0;
  38305. case 12:
  38306. if (!(i < rules.length)) {
  38307. _context.next = 35;
  38308. break;
  38309. }
  38310. rule = rules[i];
  38311. vt = this._getValidateType(rule);
  38312. Object.assign(rule, {
  38313. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  38314. });
  38315. if (!RuleValidatorHelper[vt]) {
  38316. _context.next = 20;
  38317. break;
  38318. }
  38319. result = RuleValidatorHelper[vt](rule, value, message);
  38320. if (!(result != null)) {
  38321. _context.next = 20;
  38322. break;
  38323. }
  38324. return _context.abrupt("break", 35);
  38325. case 20:
  38326. if (!rule.validateExpr) {
  38327. _context.next = 26;
  38328. break;
  38329. }
  38330. now = Date.now();
  38331. resultExpr = rule.validateExpr(value, allData, now);
  38332. if (!(resultExpr === false)) {
  38333. _context.next = 26;
  38334. break;
  38335. }
  38336. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  38337. return _context.abrupt("break", 35);
  38338. case 26:
  38339. if (!rule.validateFunction) {
  38340. _context.next = 32;
  38341. break;
  38342. }
  38343. _context.next = 29;
  38344. return this.validateFunction(rule, value, data, allData, vt);
  38345. case 29:
  38346. result = _context.sent;
  38347. if (!(result !== null)) {
  38348. _context.next = 32;
  38349. break;
  38350. }
  38351. return _context.abrupt("break", 35);
  38352. case 32:
  38353. i++;
  38354. _context.next = 12;
  38355. break;
  38356. case 35:
  38357. if (result !== null) {
  38358. result = message.TAG + result;
  38359. }
  38360. return _context.abrupt("return", result);
  38361. case 37:
  38362. case "end":
  38363. return _context.stop();
  38364. }
  38365. }
  38366. }, _callee, this);
  38367. }));
  38368. function validateRule(_x, _x2, _x3, _x4, _x5) {
  38369. return _validateRule.apply(this, arguments);
  38370. }
  38371. return validateRule;
  38372. }()
  38373. }, {
  38374. key: "validateFunction",
  38375. value: function () {
  38376. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  38377. var result, callbackMessage, res;
  38378. return _regenerator.default.wrap(function _callee2$(_context2) {
  38379. while (1) {
  38380. switch (_context2.prev = _context2.next) {
  38381. case 0:
  38382. result = null;
  38383. _context2.prev = 1;
  38384. callbackMessage = null;
  38385. _context2.next = 5;
  38386. return rule.validateFunction(rule, value, allData || data, function (message) {
  38387. callbackMessage = message;
  38388. });
  38389. case 5:
  38390. res = _context2.sent;
  38391. if (callbackMessage || typeof res === 'string' && res || res === false) {
  38392. result = this._getMessage(rule, callbackMessage || res, vt);
  38393. }
  38394. _context2.next = 12;
  38395. break;
  38396. case 9:
  38397. _context2.prev = 9;
  38398. _context2.t0 = _context2["catch"](1);
  38399. result = this._getMessage(rule, _context2.t0.message, vt);
  38400. case 12:
  38401. return _context2.abrupt("return", result);
  38402. case 13:
  38403. case "end":
  38404. return _context2.stop();
  38405. }
  38406. }
  38407. }, _callee2, this, [[1, 9]]);
  38408. }));
  38409. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  38410. return _validateFunction.apply(this, arguments);
  38411. }
  38412. return validateFunction;
  38413. }()
  38414. }, {
  38415. key: "_getMessage",
  38416. value: function _getMessage(rule, message, vt) {
  38417. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  38418. }
  38419. }, {
  38420. key: "_getValidateType",
  38421. value: function _getValidateType(rule) {
  38422. var result = '';
  38423. if (rule.required) {
  38424. result = 'required';
  38425. } else if (rule.format) {
  38426. result = 'format';
  38427. } else if (rule.arrayType) {
  38428. result = 'arrayTypeFormat';
  38429. } else if (rule.range) {
  38430. result = 'range';
  38431. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  38432. result = 'rangeNumber';
  38433. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  38434. result = 'rangeLength';
  38435. } else if (rule.pattern) {
  38436. result = 'pattern';
  38437. } else if (rule.validateFunction) {
  38438. result = 'validateFunction';
  38439. }
  38440. return result;
  38441. }
  38442. }]);
  38443. return RuleValidator;
  38444. }();
  38445. var RuleValidatorHelper = {
  38446. required: function required(rule, value, message) {
  38447. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  38448. return formatMessage(rule, rule.errorMessage || message.required);
  38449. }
  38450. return null;
  38451. },
  38452. range: function range(rule, value, message) {
  38453. var range = rule.range,
  38454. errorMessage = rule.errorMessage;
  38455. var list = new Array(range.length);
  38456. for (var i = 0; i < range.length; i++) {
  38457. var item = range[i];
  38458. if (types.object(item) && item.value !== undefined) {
  38459. list[i] = item.value;
  38460. } else {
  38461. list[i] = item;
  38462. }
  38463. }
  38464. var result = false;
  38465. if (Array.isArray(value)) {
  38466. result = new Set(value.concat(list)).size === list.length;
  38467. } else {
  38468. if (list.indexOf(value) > -1) {
  38469. result = true;
  38470. }
  38471. }
  38472. if (!result) {
  38473. return formatMessage(rule, errorMessage || message['enum']);
  38474. }
  38475. return null;
  38476. },
  38477. rangeNumber: function rangeNumber(rule, value, message) {
  38478. if (!types.number(value)) {
  38479. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  38480. }
  38481. var minimum = rule.minimum,
  38482. maximum = rule.maximum,
  38483. exclusiveMinimum = rule.exclusiveMinimum,
  38484. exclusiveMaximum = rule.exclusiveMaximum;
  38485. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  38486. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  38487. if (minimum !== undefined && min) {
  38488. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  38489. } else if (maximum !== undefined && max) {
  38490. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  38491. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  38492. return formatMessage(rule, rule.errorMessage || message['number'].range);
  38493. }
  38494. return null;
  38495. },
  38496. rangeLength: function rangeLength(rule, value, message) {
  38497. if (!types.string(value) && !types.array(value)) {
  38498. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  38499. }
  38500. var min = rule.minLength;
  38501. var max = rule.maxLength;
  38502. var val = value.length;
  38503. if (min !== undefined && val < min) {
  38504. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  38505. } else if (max !== undefined && val > max) {
  38506. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  38507. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  38508. return formatMessage(rule, rule.errorMessage || message['length'].range);
  38509. }
  38510. return null;
  38511. },
  38512. pattern: function pattern(rule, value, message) {
  38513. if (!types['pattern'](rule.pattern, value)) {
  38514. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  38515. }
  38516. return null;
  38517. },
  38518. format: function format(rule, value, message) {
  38519. var customTypes = Object.keys(types);
  38520. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  38521. if (customTypes.indexOf(format) > -1) {
  38522. if (!types[format](value)) {
  38523. return formatMessage(rule, rule.errorMessage || message.typeError);
  38524. }
  38525. }
  38526. return null;
  38527. },
  38528. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  38529. if (!Array.isArray(value)) {
  38530. return formatMessage(rule, rule.errorMessage || message.typeError);
  38531. }
  38532. for (var i = 0; i < value.length; i++) {
  38533. var element = value[i];
  38534. var formatResult = this.format(rule, element, message);
  38535. if (formatResult !== null) {
  38536. return formatResult;
  38537. }
  38538. }
  38539. return null;
  38540. }
  38541. };
  38542. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  38543. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  38544. var _super = _createSuper(SchemaValidator);
  38545. function SchemaValidator(schema, options) {
  38546. var _this;
  38547. (0, _classCallCheck2.default)(this, SchemaValidator);
  38548. _this = _super.call(this, SchemaValidator.message);
  38549. _this._schema = schema;
  38550. _this._options = options || null;
  38551. return _this;
  38552. }
  38553. (0, _createClass2.default)(SchemaValidator, [{
  38554. key: "updateSchema",
  38555. value: function updateSchema(schema) {
  38556. this._schema = schema;
  38557. }
  38558. }, {
  38559. key: "validate",
  38560. value: function () {
  38561. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  38562. var result;
  38563. return _regenerator.default.wrap(function _callee3$(_context3) {
  38564. while (1) {
  38565. switch (_context3.prev = _context3.next) {
  38566. case 0:
  38567. result = this._checkFieldInSchema(data);
  38568. if (result) {
  38569. _context3.next = 5;
  38570. break;
  38571. }
  38572. _context3.next = 4;
  38573. return this.invokeValidate(data, false, allData);
  38574. case 4:
  38575. result = _context3.sent;
  38576. case 5:
  38577. return _context3.abrupt("return", result.length ? result[0] : null);
  38578. case 6:
  38579. case "end":
  38580. return _context3.stop();
  38581. }
  38582. }
  38583. }, _callee3, this);
  38584. }));
  38585. function validate(_x11, _x12) {
  38586. return _validate.apply(this, arguments);
  38587. }
  38588. return validate;
  38589. }()
  38590. }, {
  38591. key: "validateAll",
  38592. value: function () {
  38593. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  38594. var result;
  38595. return _regenerator.default.wrap(function _callee4$(_context4) {
  38596. while (1) {
  38597. switch (_context4.prev = _context4.next) {
  38598. case 0:
  38599. result = this._checkFieldInSchema(data);
  38600. if (result) {
  38601. _context4.next = 5;
  38602. break;
  38603. }
  38604. _context4.next = 4;
  38605. return this.invokeValidate(data, true, allData);
  38606. case 4:
  38607. result = _context4.sent;
  38608. case 5:
  38609. return _context4.abrupt("return", result);
  38610. case 6:
  38611. case "end":
  38612. return _context4.stop();
  38613. }
  38614. }
  38615. }, _callee4, this);
  38616. }));
  38617. function validateAll(_x13, _x14) {
  38618. return _validateAll.apply(this, arguments);
  38619. }
  38620. return validateAll;
  38621. }()
  38622. }, {
  38623. key: "validateUpdate",
  38624. value: function () {
  38625. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  38626. var result;
  38627. return _regenerator.default.wrap(function _callee5$(_context5) {
  38628. while (1) {
  38629. switch (_context5.prev = _context5.next) {
  38630. case 0:
  38631. result = this._checkFieldInSchema(data);
  38632. if (result) {
  38633. _context5.next = 5;
  38634. break;
  38635. }
  38636. _context5.next = 4;
  38637. return this.invokeValidateUpdate(data, false, allData);
  38638. case 4:
  38639. result = _context5.sent;
  38640. case 5:
  38641. return _context5.abrupt("return", result.length ? result[0] : null);
  38642. case 6:
  38643. case "end":
  38644. return _context5.stop();
  38645. }
  38646. }
  38647. }, _callee5, this);
  38648. }));
  38649. function validateUpdate(_x15, _x16) {
  38650. return _validateUpdate.apply(this, arguments);
  38651. }
  38652. return validateUpdate;
  38653. }()
  38654. }, {
  38655. key: "invokeValidate",
  38656. value: function () {
  38657. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  38658. var result, schema, key, value, errorMessage;
  38659. return _regenerator.default.wrap(function _callee6$(_context6) {
  38660. while (1) {
  38661. switch (_context6.prev = _context6.next) {
  38662. case 0:
  38663. result = [];
  38664. schema = this._schema;
  38665. _context6.t0 = _regenerator.default.keys(schema);
  38666. case 3:
  38667. if ((_context6.t1 = _context6.t0()).done) {
  38668. _context6.next = 15;
  38669. break;
  38670. }
  38671. key = _context6.t1.value;
  38672. value = schema[key];
  38673. _context6.next = 8;
  38674. return this.validateRule(key, value, data[key], data, allData);
  38675. case 8:
  38676. errorMessage = _context6.sent;
  38677. if (!(errorMessage != null)) {
  38678. _context6.next = 13;
  38679. break;
  38680. }
  38681. result.push({
  38682. key: key,
  38683. errorMessage: errorMessage
  38684. });
  38685. if (all) {
  38686. _context6.next = 13;
  38687. break;
  38688. }
  38689. return _context6.abrupt("break", 15);
  38690. case 13:
  38691. _context6.next = 3;
  38692. break;
  38693. case 15:
  38694. return _context6.abrupt("return", result);
  38695. case 16:
  38696. case "end":
  38697. return _context6.stop();
  38698. }
  38699. }
  38700. }, _callee6, this);
  38701. }));
  38702. function invokeValidate(_x17, _x18, _x19) {
  38703. return _invokeValidate.apply(this, arguments);
  38704. }
  38705. return invokeValidate;
  38706. }()
  38707. }, {
  38708. key: "invokeValidateUpdate",
  38709. value: function () {
  38710. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  38711. var result, key, errorMessage;
  38712. return _regenerator.default.wrap(function _callee7$(_context7) {
  38713. while (1) {
  38714. switch (_context7.prev = _context7.next) {
  38715. case 0:
  38716. result = [];
  38717. _context7.t0 = _regenerator.default.keys(data);
  38718. case 2:
  38719. if ((_context7.t1 = _context7.t0()).done) {
  38720. _context7.next = 13;
  38721. break;
  38722. }
  38723. key = _context7.t1.value;
  38724. _context7.next = 6;
  38725. return this.validateRule(key, this._schema[key], data[key], data, allData);
  38726. case 6:
  38727. errorMessage = _context7.sent;
  38728. if (!(errorMessage != null)) {
  38729. _context7.next = 11;
  38730. break;
  38731. }
  38732. result.push({
  38733. key: key,
  38734. errorMessage: errorMessage
  38735. });
  38736. if (all) {
  38737. _context7.next = 11;
  38738. break;
  38739. }
  38740. return _context7.abrupt("break", 13);
  38741. case 11:
  38742. _context7.next = 2;
  38743. break;
  38744. case 13:
  38745. return _context7.abrupt("return", result);
  38746. case 14:
  38747. case "end":
  38748. return _context7.stop();
  38749. }
  38750. }
  38751. }, _callee7, this);
  38752. }));
  38753. function invokeValidateUpdate(_x20, _x21, _x22) {
  38754. return _invokeValidateUpdate.apply(this, arguments);
  38755. }
  38756. return invokeValidateUpdate;
  38757. }()
  38758. }, {
  38759. key: "_checkFieldInSchema",
  38760. value: function _checkFieldInSchema(data) {
  38761. var keys = Object.keys(data);
  38762. var keys2 = Object.keys(this._schema);
  38763. if (new Set(keys.concat(keys2)).size === keys2.length) {
  38764. return '';
  38765. }
  38766. var noExistFields = keys.filter(function (key) {
  38767. return keys2.indexOf(key) < 0;
  38768. });
  38769. var errorMessage = formatMessage({
  38770. field: JSON.stringify(noExistFields)
  38771. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  38772. return [{
  38773. key: 'invalid',
  38774. errorMessage: errorMessage
  38775. }];
  38776. }
  38777. }]);
  38778. return SchemaValidator;
  38779. }(RuleValidator);
  38780. function Message() {
  38781. return {
  38782. TAG: "",
  38783. default: '验证错误',
  38784. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  38785. validateFunction: '验证无效',
  38786. required: '{label}必填',
  38787. 'enum': '{label}超出范围',
  38788. timestamp: '{label}格式无效',
  38789. whitespace: '{label}不能为空',
  38790. typeError: '{label}类型无效',
  38791. date: {
  38792. format: '{label}日期{value}格式无效',
  38793. parse: '{label}日期无法解析,{value}无效',
  38794. invalid: '{label}日期{value}无效'
  38795. },
  38796. length: {
  38797. minLength: '{label}长度不能少于{minLength}',
  38798. maxLength: '{label}长度不能超过{maxLength}',
  38799. range: '{label}必须介于{minLength}和{maxLength}之间'
  38800. },
  38801. number: {
  38802. minimum: '{label}不能小于{minimum}',
  38803. maximum: '{label}不能大于{maximum}',
  38804. exclusiveMinimum: '{label}不能小于等于{minimum}',
  38805. exclusiveMaximum: '{label}不能大于等于{maximum}',
  38806. range: '{label}必须介于{minimum}and{maximum}之间'
  38807. },
  38808. pattern: {
  38809. mismatch: '{label}格式不匹配'
  38810. }
  38811. };
  38812. }
  38813. SchemaValidator.message = new Message();
  38814. var _default = SchemaValidator;
  38815. exports.default = _default;
  38816. /***/ }),
  38817. /* 348 */
  38818. /*!*********************************************************!*\
  38819. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  38820. \*********************************************************/
  38821. /*! no static exports found */
  38822. /***/ (function(module, exports, __webpack_require__) {
  38823. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  38824. function _inherits(subClass, superClass) {
  38825. if (typeof superClass !== "function" && superClass !== null) {
  38826. throw new TypeError("Super expression must either be null or a function");
  38827. }
  38828. subClass.prototype = Object.create(superClass && superClass.prototype, {
  38829. constructor: {
  38830. value: subClass,
  38831. writable: true,
  38832. configurable: true
  38833. }
  38834. });
  38835. Object.defineProperty(subClass, "prototype", {
  38836. writable: false
  38837. });
  38838. if (superClass) setPrototypeOf(subClass, superClass);
  38839. }
  38840. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  38841. /***/ }),
  38842. /* 349 */
  38843. /*!**************************************************************************!*\
  38844. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  38845. \**************************************************************************/
  38846. /*! no static exports found */
  38847. /***/ (function(module, exports, __webpack_require__) {
  38848. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  38849. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 350);
  38850. function _possibleConstructorReturn(self, call) {
  38851. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  38852. return call;
  38853. } else if (call !== void 0) {
  38854. throw new TypeError("Derived constructors may only return object or undefined");
  38855. }
  38856. return assertThisInitialized(self);
  38857. }
  38858. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  38859. /***/ }),
  38860. /* 350 */
  38861. /*!**********************************************************************!*\
  38862. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  38863. \**********************************************************************/
  38864. /*! no static exports found */
  38865. /***/ (function(module, exports) {
  38866. function _assertThisInitialized(self) {
  38867. if (self === void 0) {
  38868. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  38869. }
  38870. return self;
  38871. }
  38872. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  38873. /***/ }),
  38874. /* 351 */
  38875. /*!***************************************************************!*\
  38876. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  38877. \***************************************************************/
  38878. /*! no static exports found */
  38879. /***/ (function(module, exports) {
  38880. function _getPrototypeOf(o) {
  38881. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  38882. return o.__proto__ || Object.getPrototypeOf(o);
  38883. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  38884. return _getPrototypeOf(o);
  38885. }
  38886. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  38887. /***/ }),
  38888. /* 352 */,
  38889. /* 353 */,
  38890. /* 354 */,
  38891. /* 355 */,
  38892. /* 356 */,
  38893. /* 357 */,
  38894. /* 358 */,
  38895. /* 359 */,
  38896. /* 360 */,
  38897. /* 361 */,
  38898. /* 362 */,
  38899. /* 363 */,
  38900. /* 364 */,
  38901. /* 365 */,
  38902. /* 366 */,
  38903. /* 367 */,
  38904. /* 368 */,
  38905. /* 369 */,
  38906. /* 370 */,
  38907. /* 371 */,
  38908. /* 372 */,
  38909. /* 373 */
  38910. /*!***************************************************!*\
  38911. !*** D:/code/work/broke_news_wx/utils/bmap-wx.js ***!
  38912. \***************************************************/
  38913. /*! no static exports found */
  38914. /***/ (function(module, exports, __webpack_require__) {
  38915. /* WEBPACK VAR INJECTION */(function(wx) {var _classCallCheck = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23);
  38916. var _createClass = __webpack_require__(/*! @babel/runtime/helpers/createClass */ 24);
  38917. /**
  38918. * @file 微信小程序JSAPI
  38919. * @author 崔健 cuijian03@baidu.com 2017.01.10
  38920. * @update 邓淑芳 623996689@qq.com 2019.07.03
  38921. */
  38922. /**
  38923. * 百度地图微信小程序API类
  38924. *
  38925. * @class
  38926. */
  38927. var BMapWX = /*#__PURE__*/function () {
  38928. "use strict";
  38929. /**
  38930. * 百度地图微信小程序API类
  38931. *
  38932. * @constructor
  38933. */
  38934. function BMapWX(param) {
  38935. _classCallCheck(this, BMapWX);
  38936. this.ak = param["ak"];
  38937. }
  38938. /**
  38939. * 使用微信接口进行定位
  38940. *
  38941. * @param {string} type 坐标类型
  38942. * @param {Function} success 成功执行
  38943. * @param {Function} fail 失败执行
  38944. * @param {Function} complete 完成后执行
  38945. */
  38946. _createClass(BMapWX, [{
  38947. key: "getWXLocation",
  38948. value: function getWXLocation(type, success, fail, complete) {
  38949. type = type || 'gcj02', success = success || function () {};
  38950. fail = fail || function () {};
  38951. complete = complete || function () {};
  38952. // wx.getLocation({
  38953. // type: type,
  38954. // success: success,
  38955. // fail: fail,
  38956. // complete: complete
  38957. // });
  38958. wx.getFuzzyLocation({
  38959. type: type,
  38960. success: success,
  38961. fail: fail,
  38962. complete: complete
  38963. });
  38964. }
  38965. /**
  38966. * POI周边检索
  38967. *
  38968. * @param {Object} param 检索配置
  38969. * 参数对象结构可以参考
  38970. * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
  38971. */
  38972. }, {
  38973. key: "search",
  38974. value: function search(param) {
  38975. var that = this;
  38976. param = param || {};
  38977. var searchparam = {
  38978. query: param["query"] || '生活服务$美食&酒店',
  38979. scope: param["scope"] || 1,
  38980. filter: param["filter"] || '',
  38981. coord_type: param["coord_type"] || 2,
  38982. page_size: param["page_size"] || 10,
  38983. page_num: param["page_num"] || 0,
  38984. output: param["output"] || 'json',
  38985. ak: that.ak,
  38986. sn: param["sn"] || '',
  38987. timestamp: param["timestamp"] || '',
  38988. radius: param["radius"] || 2000,
  38989. ret_coordtype: 'gcj02ll'
  38990. };
  38991. var otherparam = {
  38992. iconPath: param["iconPath"],
  38993. iconTapPath: param["iconTapPath"],
  38994. width: param["width"],
  38995. height: param["height"],
  38996. alpha: param["alpha"] || 1,
  38997. success: param["success"] || function () {},
  38998. fail: param["fail"] || function () {}
  38999. };
  39000. var type = 'gcj02';
  39001. var locationsuccess = function locationsuccess(result) {
  39002. searchparam["location"] = result["latitude"] + ',' + result["longitude"];
  39003. wx.request({
  39004. url: 'https://api.map.baidu.com/place/v2/search',
  39005. data: searchparam,
  39006. header: {
  39007. "content-type": "application/json"
  39008. },
  39009. method: 'GET',
  39010. success: function success(data) {
  39011. var res = data["data"];
  39012. if (res["status"] === 0) {
  39013. var poiArr = res["results"];
  39014. // outputRes 包含两个对象,
  39015. // originalData为百度接口返回的原始数据
  39016. // wxMarkerData为小程序规范的marker格式
  39017. var outputRes = {};
  39018. outputRes["originalData"] = res;
  39019. outputRes["wxMarkerData"] = [];
  39020. for (var i = 0; i < poiArr.length; i++) {
  39021. outputRes["wxMarkerData"][i] = {
  39022. id: i,
  39023. latitude: poiArr[i]["location"]["lat"],
  39024. longitude: poiArr[i]["location"]["lng"],
  39025. title: poiArr[i]["name"],
  39026. iconPath: otherparam["iconPath"],
  39027. iconTapPath: otherparam["iconTapPath"],
  39028. address: poiArr[i]["address"],
  39029. telephone: poiArr[i]["telephone"],
  39030. alpha: otherparam["alpha"],
  39031. width: otherparam["width"],
  39032. height: otherparam["height"]
  39033. };
  39034. }
  39035. otherparam.success(outputRes);
  39036. } else {
  39037. otherparam.fail({
  39038. errMsg: res["message"],
  39039. statusCode: res["status"]
  39040. });
  39041. }
  39042. },
  39043. fail: function fail(data) {
  39044. otherparam.fail(data);
  39045. }
  39046. });
  39047. };
  39048. var locationfail = function locationfail(result) {
  39049. otherparam.fail(result);
  39050. };
  39051. var locationcomplete = function locationcomplete(result) {};
  39052. if (!param["location"]) {
  39053. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  39054. } else {
  39055. var longitude = param.location.split(',')[1];
  39056. var latitude = param.location.split(',')[0];
  39057. var errMsg = 'input location';
  39058. var res = {
  39059. errMsg: errMsg,
  39060. latitude: latitude,
  39061. longitude: longitude
  39062. };
  39063. locationsuccess(res);
  39064. }
  39065. }
  39066. /**
  39067. * sug模糊检索
  39068. *
  39069. * @param {Object} param 检索配置
  39070. * 参数对象结构可以参考
  39071. * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
  39072. */
  39073. }, {
  39074. key: "suggestion",
  39075. value: function suggestion(param) {
  39076. var that = this;
  39077. param = param || {};
  39078. var suggestionparam = {
  39079. query: param["query"] || '',
  39080. region: param["region"] || '全国',
  39081. city_limit: param["city_limit"] || false,
  39082. output: param["output"] || 'json',
  39083. ak: that.ak,
  39084. sn: param["sn"] || '',
  39085. timestamp: param["timestamp"] || '',
  39086. ret_coordtype: 'gcj02ll'
  39087. };
  39088. var otherparam = {
  39089. success: param["success"] || function () {},
  39090. fail: param["fail"] || function () {}
  39091. };
  39092. wx.request({
  39093. url: 'https://api.map.baidu.com/place/v2/suggestion',
  39094. data: suggestionparam,
  39095. header: {
  39096. "content-type": "application/json"
  39097. },
  39098. method: 'GET',
  39099. success: function success(data) {
  39100. var res = data["data"];
  39101. if (res["status"] === 0) {
  39102. otherparam.success(res);
  39103. } else {
  39104. otherparam.fail({
  39105. errMsg: res["message"],
  39106. statusCode: res["status"]
  39107. });
  39108. }
  39109. },
  39110. fail: function fail(data) {
  39111. otherparam.fail(data);
  39112. }
  39113. });
  39114. }
  39115. /**
  39116. * rgc检索(逆地理编码:经纬度->地点描述)
  39117. *
  39118. * @param {Object} param 检索配置
  39119. * 参数对象结构可以参考
  39120. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
  39121. *
  39122. */
  39123. }, {
  39124. key: "regeocoding",
  39125. value: function regeocoding(param) {
  39126. var that = this;
  39127. param = param || {};
  39128. var regeocodingparam = {
  39129. coordtype: param["coordtype"] || 'gcj02ll',
  39130. ret_coordtype: 'gcj02ll',
  39131. radius: param["radius"] || 1000,
  39132. ak: that.ak,
  39133. sn: param["sn"] || '',
  39134. output: param["output"] || 'json',
  39135. callback: param["callback"] || function () {},
  39136. extensions_poi: param["extensions_poi"] || 1,
  39137. extensions_road: param["extensions_road"] || false,
  39138. extensions_town: param["extensions_town"] || false,
  39139. language: param["language"] || 'zh-CN',
  39140. language_auto: param["language_auto"] || 0
  39141. };
  39142. var otherparam = {
  39143. iconPath: param["iconPath"],
  39144. iconTapPath: param["iconTapPath"],
  39145. width: param["width"],
  39146. height: param["height"],
  39147. alpha: param["alpha"] || 1,
  39148. success: param["success"] || function () {},
  39149. fail: param["fail"] || function () {}
  39150. };
  39151. var type = 'gcj02';
  39152. var locationsuccess = function locationsuccess(result) {
  39153. regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
  39154. wx.request({
  39155. url: 'https://api.map.baidu.com/reverse_geocoding/v3',
  39156. data: regeocodingparam,
  39157. header: {
  39158. "content-type": "application/json"
  39159. },
  39160. method: 'GET',
  39161. success: function success(data) {
  39162. var res = data["data"];
  39163. if (res["status"] === 0) {
  39164. var poiObj = res["result"];
  39165. // outputRes 包含两个对象:
  39166. // originalData为百度接口返回的原始数据
  39167. // wxMarkerData为小程序规范的marker格式
  39168. var outputRes = {};
  39169. outputRes["originalData"] = res;
  39170. outputRes["wxMarkerData"] = [];
  39171. outputRes["wxMarkerData"][0] = {
  39172. id: 0,
  39173. latitude: result["latitude"],
  39174. longitude: result["longitude"],
  39175. address: poiObj["formatted_address"],
  39176. iconPath: otherparam["iconPath"],
  39177. iconTapPath: otherparam["iconTapPath"],
  39178. desc: poiObj["sematic_description"],
  39179. business: poiObj["business"],
  39180. alpha: otherparam["alpha"],
  39181. width: otherparam["width"],
  39182. height: otherparam["height"]
  39183. };
  39184. otherparam.success(outputRes);
  39185. } else {
  39186. otherparam.fail({
  39187. errMsg: res["message"],
  39188. statusCode: res["status"]
  39189. });
  39190. }
  39191. },
  39192. fail: function fail(data) {
  39193. otherparam.fail(data);
  39194. }
  39195. });
  39196. };
  39197. var locationfail = function locationfail(result) {
  39198. otherparam.fail(result);
  39199. };
  39200. var locationcomplete = function locationcomplete(result) {};
  39201. if (!param["location"]) {
  39202. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  39203. } else {
  39204. var longitude = param.location.split(',')[1];
  39205. var latitude = param.location.split(',')[0];
  39206. var errMsg = 'input location';
  39207. var res = {
  39208. errMsg: errMsg,
  39209. latitude: latitude,
  39210. longitude: longitude
  39211. };
  39212. locationsuccess(res);
  39213. }
  39214. }
  39215. /**
  39216. * gc检索(地理编码:地点->经纬度)
  39217. *
  39218. * @param {Object} param 检索配置
  39219. * 参数对象结构可以参考
  39220. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
  39221. *
  39222. */
  39223. }, {
  39224. key: "geocoding",
  39225. value: function geocoding(param) {
  39226. var that = this;
  39227. param = param || {};
  39228. var geocodingparam = {
  39229. address: param["address"] || '',
  39230. city: param["city"] || '',
  39231. ret_coordtype: param["coordtype"] || 'gcj02ll',
  39232. ak: that.ak,
  39233. sn: param["sn"] || '',
  39234. output: param["output"] || 'json',
  39235. callback: param["callback"] || function () {}
  39236. };
  39237. var otherparam = {
  39238. iconPath: param["iconPath"],
  39239. iconTapPath: param["iconTapPath"],
  39240. width: param["width"],
  39241. height: param["height"],
  39242. alpha: param["alpha"] || 1,
  39243. success: param["success"] || function () {},
  39244. fail: param["fail"] || function () {}
  39245. };
  39246. if (param["address"]) {
  39247. wx.request({
  39248. url: 'https://api.map.baidu.com/geocoding/v3',
  39249. data: geocodingparam,
  39250. header: {
  39251. "content-type": "application/json"
  39252. },
  39253. method: 'GET',
  39254. success: function success(data) {
  39255. var res = data["data"];
  39256. if (res["status"] === 0) {
  39257. var poiObj = res["result"];
  39258. // outputRes 包含两个对象:
  39259. // originalData为百度接口返回的原始数据
  39260. // wxMarkerData为小程序规范的marker格式
  39261. var outputRes = res;
  39262. outputRes["originalData"] = res;
  39263. outputRes["wxMarkerData"] = [];
  39264. outputRes["wxMarkerData"][0] = {
  39265. id: 0,
  39266. latitude: poiObj["location"]["lat"],
  39267. longitude: poiObj["location"]["lng"],
  39268. iconPath: otherparam["iconPath"],
  39269. iconTapPath: otherparam["iconTapPath"],
  39270. alpha: otherparam["alpha"],
  39271. width: otherparam["width"],
  39272. height: otherparam["height"]
  39273. };
  39274. otherparam.success(outputRes);
  39275. } else {
  39276. otherparam.fail({
  39277. errMsg: res["message"],
  39278. statusCode: res["status"]
  39279. });
  39280. }
  39281. },
  39282. fail: function fail(data) {
  39283. otherparam.fail(data);
  39284. }
  39285. });
  39286. } else {
  39287. var errMsg = 'input address!';
  39288. var res = {
  39289. errMsg: errMsg
  39290. };
  39291. otherparam.fail(res);
  39292. }
  39293. }
  39294. /**
  39295. * 天气检索
  39296. *
  39297. * @param {Object} param 检索配置
  39298. */
  39299. }, {
  39300. key: "weather",
  39301. value: function weather(param) {
  39302. var that = this;
  39303. param = param || {};
  39304. var weatherparam = {
  39305. coord_type: param["coord_type"] || 'gcj02',
  39306. output: param["output"] || 'json',
  39307. ak: that.ak,
  39308. sn: param["sn"] || '',
  39309. timestamp: param["timestamp"] || ''
  39310. };
  39311. var otherparam = {
  39312. success: param["success"] || function () {},
  39313. fail: param["fail"] || function () {}
  39314. };
  39315. var type = 'gcj02';
  39316. var locationsuccess = function locationsuccess(result) {
  39317. weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
  39318. wx.request({
  39319. url: 'https://api.map.baidu.com/telematics/v3/weather',
  39320. data: weatherparam,
  39321. header: {
  39322. "content-type": "application/json"
  39323. },
  39324. method: 'GET',
  39325. success: function success(data) {
  39326. var res = data["data"];
  39327. if (res["error"] === 0 && res["status"] === 'success') {
  39328. var weatherArr = res["results"];
  39329. // outputRes 包含两个对象,
  39330. // originalData为百度接口返回的原始数据
  39331. // wxMarkerData为小程序规范的marker格式
  39332. var outputRes = {};
  39333. outputRes["originalData"] = res;
  39334. outputRes["currentWeather"] = [];
  39335. outputRes["currentWeather"][0] = {
  39336. currentCity: weatherArr[0]["currentCity"],
  39337. pm25: weatherArr[0]["pm25"],
  39338. date: weatherArr[0]["weather_data"][0]["date"],
  39339. temperature: weatherArr[0]["weather_data"][0]["temperature"],
  39340. weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
  39341. wind: weatherArr[0]["weather_data"][0]["wind"]
  39342. };
  39343. otherparam.success(outputRes);
  39344. } else {
  39345. otherparam.fail({
  39346. errMsg: res["message"],
  39347. statusCode: res["status"]
  39348. });
  39349. }
  39350. },
  39351. fail: function fail(data) {
  39352. otherparam.fail(data);
  39353. }
  39354. });
  39355. };
  39356. var locationfail = function locationfail(result) {
  39357. otherparam.fail(result);
  39358. };
  39359. var locationcomplete = function locationcomplete(result) {};
  39360. if (!param["location"]) {
  39361. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  39362. } else {
  39363. var longitude = param.location.split(',')[0];
  39364. var latitude = param.location.split(',')[1];
  39365. var errMsg = 'input location';
  39366. var res = {
  39367. errMsg: errMsg,
  39368. latitude: latitude,
  39369. longitude: longitude
  39370. };
  39371. locationsuccess(res);
  39372. }
  39373. }
  39374. }]);
  39375. return BMapWX;
  39376. }();
  39377. module.exports.BMapWX = BMapWX;
  39378. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  39379. /***/ }),
  39380. /* 374 */,
  39381. /* 375 */,
  39382. /* 376 */,
  39383. /* 377 */,
  39384. /* 378 */,
  39385. /* 379 */,
  39386. /* 380 */,
  39387. /* 381 */,
  39388. /* 382 */,
  39389. /* 383 */,
  39390. /* 384 */,
  39391. /* 385 */,
  39392. /* 386 */,
  39393. /* 387 */,
  39394. /* 388 */
  39395. /*!**************************************************************************************!*\
  39396. !*** D:/code/work/broke_news_wx/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  39397. \**************************************************************************************/
  39398. /*! no static exports found */
  39399. /***/ (function(module, exports, __webpack_require__) {
  39400. "use strict";
  39401. Object.defineProperty(exports, "__esModule", {
  39402. value: true
  39403. });
  39404. exports.default = void 0;
  39405. var _default = {
  39406. "id": "2852637",
  39407. "name": "uniui图标库",
  39408. "font_family": "uniicons",
  39409. "css_prefix_text": "uniui-",
  39410. "description": "",
  39411. "glyphs": [{
  39412. "icon_id": "25027049",
  39413. "name": "yanse",
  39414. "font_class": "color",
  39415. "unicode": "e6cf",
  39416. "unicode_decimal": 59087
  39417. }, {
  39418. "icon_id": "25027048",
  39419. "name": "wallet",
  39420. "font_class": "wallet",
  39421. "unicode": "e6b1",
  39422. "unicode_decimal": 59057
  39423. }, {
  39424. "icon_id": "25015720",
  39425. "name": "settings-filled",
  39426. "font_class": "settings-filled",
  39427. "unicode": "e6ce",
  39428. "unicode_decimal": 59086
  39429. }, {
  39430. "icon_id": "25015434",
  39431. "name": "shimingrenzheng-filled",
  39432. "font_class": "auth-filled",
  39433. "unicode": "e6cc",
  39434. "unicode_decimal": 59084
  39435. }, {
  39436. "icon_id": "24934246",
  39437. "name": "shop-filled",
  39438. "font_class": "shop-filled",
  39439. "unicode": "e6cd",
  39440. "unicode_decimal": 59085
  39441. }, {
  39442. "icon_id": "24934159",
  39443. "name": "staff-filled-01",
  39444. "font_class": "staff-filled",
  39445. "unicode": "e6cb",
  39446. "unicode_decimal": 59083
  39447. }, {
  39448. "icon_id": "24932461",
  39449. "name": "VIP-filled",
  39450. "font_class": "vip-filled",
  39451. "unicode": "e6c6",
  39452. "unicode_decimal": 59078
  39453. }, {
  39454. "icon_id": "24932462",
  39455. "name": "plus_circle_fill",
  39456. "font_class": "plus-filled",
  39457. "unicode": "e6c7",
  39458. "unicode_decimal": 59079
  39459. }, {
  39460. "icon_id": "24932463",
  39461. "name": "folder_add-filled",
  39462. "font_class": "folder-add-filled",
  39463. "unicode": "e6c8",
  39464. "unicode_decimal": 59080
  39465. }, {
  39466. "icon_id": "24932464",
  39467. "name": "yanse-filled",
  39468. "font_class": "color-filled",
  39469. "unicode": "e6c9",
  39470. "unicode_decimal": 59081
  39471. }, {
  39472. "icon_id": "24932465",
  39473. "name": "tune-filled",
  39474. "font_class": "tune-filled",
  39475. "unicode": "e6ca",
  39476. "unicode_decimal": 59082
  39477. }, {
  39478. "icon_id": "24932455",
  39479. "name": "a-rilidaka-filled",
  39480. "font_class": "calendar-filled",
  39481. "unicode": "e6c0",
  39482. "unicode_decimal": 59072
  39483. }, {
  39484. "icon_id": "24932456",
  39485. "name": "notification-filled",
  39486. "font_class": "notification-filled",
  39487. "unicode": "e6c1",
  39488. "unicode_decimal": 59073
  39489. }, {
  39490. "icon_id": "24932457",
  39491. "name": "wallet-filled",
  39492. "font_class": "wallet-filled",
  39493. "unicode": "e6c2",
  39494. "unicode_decimal": 59074
  39495. }, {
  39496. "icon_id": "24932458",
  39497. "name": "paihangbang-filled",
  39498. "font_class": "medal-filled",
  39499. "unicode": "e6c3",
  39500. "unicode_decimal": 59075
  39501. }, {
  39502. "icon_id": "24932459",
  39503. "name": "gift-filled",
  39504. "font_class": "gift-filled",
  39505. "unicode": "e6c4",
  39506. "unicode_decimal": 59076
  39507. }, {
  39508. "icon_id": "24932460",
  39509. "name": "fire-filled",
  39510. "font_class": "fire-filled",
  39511. "unicode": "e6c5",
  39512. "unicode_decimal": 59077
  39513. }, {
  39514. "icon_id": "24928001",
  39515. "name": "refreshempty",
  39516. "font_class": "refreshempty",
  39517. "unicode": "e6bf",
  39518. "unicode_decimal": 59071
  39519. }, {
  39520. "icon_id": "24926853",
  39521. "name": "location-ellipse",
  39522. "font_class": "location-filled",
  39523. "unicode": "e6af",
  39524. "unicode_decimal": 59055
  39525. }, {
  39526. "icon_id": "24926735",
  39527. "name": "person-filled",
  39528. "font_class": "person-filled",
  39529. "unicode": "e69d",
  39530. "unicode_decimal": 59037
  39531. }, {
  39532. "icon_id": "24926703",
  39533. "name": "personadd-filled",
  39534. "font_class": "personadd-filled",
  39535. "unicode": "e698",
  39536. "unicode_decimal": 59032
  39537. }, {
  39538. "icon_id": "24923351",
  39539. "name": "back",
  39540. "font_class": "back",
  39541. "unicode": "e6b9",
  39542. "unicode_decimal": 59065
  39543. }, {
  39544. "icon_id": "24923352",
  39545. "name": "forward",
  39546. "font_class": "forward",
  39547. "unicode": "e6ba",
  39548. "unicode_decimal": 59066
  39549. }, {
  39550. "icon_id": "24923353",
  39551. "name": "arrowthinright",
  39552. "font_class": "arrow-right",
  39553. "unicode": "e6bb",
  39554. "unicode_decimal": 59067
  39555. }, {
  39556. "icon_id": "24923353",
  39557. "name": "arrowthinright",
  39558. "font_class": "arrowthinright",
  39559. "unicode": "e6bb",
  39560. "unicode_decimal": 59067
  39561. }, {
  39562. "icon_id": "24923354",
  39563. "name": "arrowthinleft",
  39564. "font_class": "arrow-left",
  39565. "unicode": "e6bc",
  39566. "unicode_decimal": 59068
  39567. }, {
  39568. "icon_id": "24923354",
  39569. "name": "arrowthinleft",
  39570. "font_class": "arrowthinleft",
  39571. "unicode": "e6bc",
  39572. "unicode_decimal": 59068
  39573. }, {
  39574. "icon_id": "24923355",
  39575. "name": "arrowthinup",
  39576. "font_class": "arrow-up",
  39577. "unicode": "e6bd",
  39578. "unicode_decimal": 59069
  39579. }, {
  39580. "icon_id": "24923355",
  39581. "name": "arrowthinup",
  39582. "font_class": "arrowthinup",
  39583. "unicode": "e6bd",
  39584. "unicode_decimal": 59069
  39585. }, {
  39586. "icon_id": "24923356",
  39587. "name": "arrowthindown",
  39588. "font_class": "arrow-down",
  39589. "unicode": "e6be",
  39590. "unicode_decimal": 59070
  39591. }, {
  39592. "icon_id": "24923356",
  39593. "name": "arrowthindown",
  39594. "font_class": "arrowthindown",
  39595. "unicode": "e6be",
  39596. "unicode_decimal": 59070
  39597. }, {
  39598. "icon_id": "24923349",
  39599. "name": "arrowdown",
  39600. "font_class": "bottom",
  39601. "unicode": "e6b8",
  39602. "unicode_decimal": 59064
  39603. }, {
  39604. "icon_id": "24923349",
  39605. "name": "arrowdown",
  39606. "font_class": "arrowdown",
  39607. "unicode": "e6b8",
  39608. "unicode_decimal": 59064
  39609. }, {
  39610. "icon_id": "24923346",
  39611. "name": "arrowright",
  39612. "font_class": "right",
  39613. "unicode": "e6b5",
  39614. "unicode_decimal": 59061
  39615. }, {
  39616. "icon_id": "24923346",
  39617. "name": "arrowright",
  39618. "font_class": "arrowright",
  39619. "unicode": "e6b5",
  39620. "unicode_decimal": 59061
  39621. }, {
  39622. "icon_id": "24923347",
  39623. "name": "arrowup",
  39624. "font_class": "top",
  39625. "unicode": "e6b6",
  39626. "unicode_decimal": 59062
  39627. }, {
  39628. "icon_id": "24923347",
  39629. "name": "arrowup",
  39630. "font_class": "arrowup",
  39631. "unicode": "e6b6",
  39632. "unicode_decimal": 59062
  39633. }, {
  39634. "icon_id": "24923348",
  39635. "name": "arrowleft",
  39636. "font_class": "left",
  39637. "unicode": "e6b7",
  39638. "unicode_decimal": 59063
  39639. }, {
  39640. "icon_id": "24923348",
  39641. "name": "arrowleft",
  39642. "font_class": "arrowleft",
  39643. "unicode": "e6b7",
  39644. "unicode_decimal": 59063
  39645. }, {
  39646. "icon_id": "24923334",
  39647. "name": "eye",
  39648. "font_class": "eye",
  39649. "unicode": "e651",
  39650. "unicode_decimal": 58961
  39651. }, {
  39652. "icon_id": "24923335",
  39653. "name": "eye-filled",
  39654. "font_class": "eye-filled",
  39655. "unicode": "e66a",
  39656. "unicode_decimal": 58986
  39657. }, {
  39658. "icon_id": "24923336",
  39659. "name": "eye-slash",
  39660. "font_class": "eye-slash",
  39661. "unicode": "e6b3",
  39662. "unicode_decimal": 59059
  39663. }, {
  39664. "icon_id": "24923337",
  39665. "name": "eye-slash-filled",
  39666. "font_class": "eye-slash-filled",
  39667. "unicode": "e6b4",
  39668. "unicode_decimal": 59060
  39669. }, {
  39670. "icon_id": "24923305",
  39671. "name": "info-filled",
  39672. "font_class": "info-filled",
  39673. "unicode": "e649",
  39674. "unicode_decimal": 58953
  39675. }, {
  39676. "icon_id": "24923299",
  39677. "name": "reload-01",
  39678. "font_class": "reload",
  39679. "unicode": "e6b2",
  39680. "unicode_decimal": 59058
  39681. }, {
  39682. "icon_id": "24923195",
  39683. "name": "mic_slash_fill",
  39684. "font_class": "micoff-filled",
  39685. "unicode": "e6b0",
  39686. "unicode_decimal": 59056
  39687. }, {
  39688. "icon_id": "24923165",
  39689. "name": "map-pin-ellipse",
  39690. "font_class": "map-pin-ellipse",
  39691. "unicode": "e6ac",
  39692. "unicode_decimal": 59052
  39693. }, {
  39694. "icon_id": "24923166",
  39695. "name": "map-pin",
  39696. "font_class": "map-pin",
  39697. "unicode": "e6ad",
  39698. "unicode_decimal": 59053
  39699. }, {
  39700. "icon_id": "24923167",
  39701. "name": "location",
  39702. "font_class": "location",
  39703. "unicode": "e6ae",
  39704. "unicode_decimal": 59054
  39705. }, {
  39706. "icon_id": "24923064",
  39707. "name": "starhalf",
  39708. "font_class": "starhalf",
  39709. "unicode": "e683",
  39710. "unicode_decimal": 59011
  39711. }, {
  39712. "icon_id": "24923065",
  39713. "name": "star",
  39714. "font_class": "star",
  39715. "unicode": "e688",
  39716. "unicode_decimal": 59016
  39717. }, {
  39718. "icon_id": "24923066",
  39719. "name": "star-filled",
  39720. "font_class": "star-filled",
  39721. "unicode": "e68f",
  39722. "unicode_decimal": 59023
  39723. }, {
  39724. "icon_id": "24899646",
  39725. "name": "a-rilidaka",
  39726. "font_class": "calendar",
  39727. "unicode": "e6a0",
  39728. "unicode_decimal": 59040
  39729. }, {
  39730. "icon_id": "24899647",
  39731. "name": "fire",
  39732. "font_class": "fire",
  39733. "unicode": "e6a1",
  39734. "unicode_decimal": 59041
  39735. }, {
  39736. "icon_id": "24899648",
  39737. "name": "paihangbang",
  39738. "font_class": "medal",
  39739. "unicode": "e6a2",
  39740. "unicode_decimal": 59042
  39741. }, {
  39742. "icon_id": "24899649",
  39743. "name": "font",
  39744. "font_class": "font",
  39745. "unicode": "e6a3",
  39746. "unicode_decimal": 59043
  39747. }, {
  39748. "icon_id": "24899650",
  39749. "name": "gift",
  39750. "font_class": "gift",
  39751. "unicode": "e6a4",
  39752. "unicode_decimal": 59044
  39753. }, {
  39754. "icon_id": "24899651",
  39755. "name": "link",
  39756. "font_class": "link",
  39757. "unicode": "e6a5",
  39758. "unicode_decimal": 59045
  39759. }, {
  39760. "icon_id": "24899652",
  39761. "name": "notification",
  39762. "font_class": "notification",
  39763. "unicode": "e6a6",
  39764. "unicode_decimal": 59046
  39765. }, {
  39766. "icon_id": "24899653",
  39767. "name": "staff",
  39768. "font_class": "staff",
  39769. "unicode": "e6a7",
  39770. "unicode_decimal": 59047
  39771. }, {
  39772. "icon_id": "24899654",
  39773. "name": "VIP",
  39774. "font_class": "vip",
  39775. "unicode": "e6a8",
  39776. "unicode_decimal": 59048
  39777. }, {
  39778. "icon_id": "24899655",
  39779. "name": "folder_add",
  39780. "font_class": "folder-add",
  39781. "unicode": "e6a9",
  39782. "unicode_decimal": 59049
  39783. }, {
  39784. "icon_id": "24899656",
  39785. "name": "tune",
  39786. "font_class": "tune",
  39787. "unicode": "e6aa",
  39788. "unicode_decimal": 59050
  39789. }, {
  39790. "icon_id": "24899657",
  39791. "name": "shimingrenzheng",
  39792. "font_class": "auth",
  39793. "unicode": "e6ab",
  39794. "unicode_decimal": 59051
  39795. }, {
  39796. "icon_id": "24899565",
  39797. "name": "person",
  39798. "font_class": "person",
  39799. "unicode": "e699",
  39800. "unicode_decimal": 59033
  39801. }, {
  39802. "icon_id": "24899566",
  39803. "name": "email-filled",
  39804. "font_class": "email-filled",
  39805. "unicode": "e69a",
  39806. "unicode_decimal": 59034
  39807. }, {
  39808. "icon_id": "24899567",
  39809. "name": "phone-filled",
  39810. "font_class": "phone-filled",
  39811. "unicode": "e69b",
  39812. "unicode_decimal": 59035
  39813. }, {
  39814. "icon_id": "24899568",
  39815. "name": "phone",
  39816. "font_class": "phone",
  39817. "unicode": "e69c",
  39818. "unicode_decimal": 59036
  39819. }, {
  39820. "icon_id": "24899570",
  39821. "name": "email",
  39822. "font_class": "email",
  39823. "unicode": "e69e",
  39824. "unicode_decimal": 59038
  39825. }, {
  39826. "icon_id": "24899571",
  39827. "name": "personadd",
  39828. "font_class": "personadd",
  39829. "unicode": "e69f",
  39830. "unicode_decimal": 59039
  39831. }, {
  39832. "icon_id": "24899558",
  39833. "name": "chatboxes-filled",
  39834. "font_class": "chatboxes-filled",
  39835. "unicode": "e692",
  39836. "unicode_decimal": 59026
  39837. }, {
  39838. "icon_id": "24899559",
  39839. "name": "contact",
  39840. "font_class": "contact",
  39841. "unicode": "e693",
  39842. "unicode_decimal": 59027
  39843. }, {
  39844. "icon_id": "24899560",
  39845. "name": "chatbubble-filled",
  39846. "font_class": "chatbubble-filled",
  39847. "unicode": "e694",
  39848. "unicode_decimal": 59028
  39849. }, {
  39850. "icon_id": "24899561",
  39851. "name": "contact-filled",
  39852. "font_class": "contact-filled",
  39853. "unicode": "e695",
  39854. "unicode_decimal": 59029
  39855. }, {
  39856. "icon_id": "24899562",
  39857. "name": "chatboxes",
  39858. "font_class": "chatboxes",
  39859. "unicode": "e696",
  39860. "unicode_decimal": 59030
  39861. }, {
  39862. "icon_id": "24899563",
  39863. "name": "chatbubble",
  39864. "font_class": "chatbubble",
  39865. "unicode": "e697",
  39866. "unicode_decimal": 59031
  39867. }, {
  39868. "icon_id": "24881290",
  39869. "name": "upload-filled",
  39870. "font_class": "upload-filled",
  39871. "unicode": "e68e",
  39872. "unicode_decimal": 59022
  39873. }, {
  39874. "icon_id": "24881292",
  39875. "name": "upload",
  39876. "font_class": "upload",
  39877. "unicode": "e690",
  39878. "unicode_decimal": 59024
  39879. }, {
  39880. "icon_id": "24881293",
  39881. "name": "weixin",
  39882. "font_class": "weixin",
  39883. "unicode": "e691",
  39884. "unicode_decimal": 59025
  39885. }, {
  39886. "icon_id": "24881274",
  39887. "name": "compose",
  39888. "font_class": "compose",
  39889. "unicode": "e67f",
  39890. "unicode_decimal": 59007
  39891. }, {
  39892. "icon_id": "24881275",
  39893. "name": "qq",
  39894. "font_class": "qq",
  39895. "unicode": "e680",
  39896. "unicode_decimal": 59008
  39897. }, {
  39898. "icon_id": "24881276",
  39899. "name": "download-filled",
  39900. "font_class": "download-filled",
  39901. "unicode": "e681",
  39902. "unicode_decimal": 59009
  39903. }, {
  39904. "icon_id": "24881277",
  39905. "name": "pengyouquan",
  39906. "font_class": "pyq",
  39907. "unicode": "e682",
  39908. "unicode_decimal": 59010
  39909. }, {
  39910. "icon_id": "24881279",
  39911. "name": "sound",
  39912. "font_class": "sound",
  39913. "unicode": "e684",
  39914. "unicode_decimal": 59012
  39915. }, {
  39916. "icon_id": "24881280",
  39917. "name": "trash-filled",
  39918. "font_class": "trash-filled",
  39919. "unicode": "e685",
  39920. "unicode_decimal": 59013
  39921. }, {
  39922. "icon_id": "24881281",
  39923. "name": "sound-filled",
  39924. "font_class": "sound-filled",
  39925. "unicode": "e686",
  39926. "unicode_decimal": 59014
  39927. }, {
  39928. "icon_id": "24881282",
  39929. "name": "trash",
  39930. "font_class": "trash",
  39931. "unicode": "e687",
  39932. "unicode_decimal": 59015
  39933. }, {
  39934. "icon_id": "24881284",
  39935. "name": "videocam-filled",
  39936. "font_class": "videocam-filled",
  39937. "unicode": "e689",
  39938. "unicode_decimal": 59017
  39939. }, {
  39940. "icon_id": "24881285",
  39941. "name": "spinner-cycle",
  39942. "font_class": "spinner-cycle",
  39943. "unicode": "e68a",
  39944. "unicode_decimal": 59018
  39945. }, {
  39946. "icon_id": "24881286",
  39947. "name": "weibo",
  39948. "font_class": "weibo",
  39949. "unicode": "e68b",
  39950. "unicode_decimal": 59019
  39951. }, {
  39952. "icon_id": "24881288",
  39953. "name": "videocam",
  39954. "font_class": "videocam",
  39955. "unicode": "e68c",
  39956. "unicode_decimal": 59020
  39957. }, {
  39958. "icon_id": "24881289",
  39959. "name": "download",
  39960. "font_class": "download",
  39961. "unicode": "e68d",
  39962. "unicode_decimal": 59021
  39963. }, {
  39964. "icon_id": "24879601",
  39965. "name": "help",
  39966. "font_class": "help",
  39967. "unicode": "e679",
  39968. "unicode_decimal": 59001
  39969. }, {
  39970. "icon_id": "24879602",
  39971. "name": "navigate-filled",
  39972. "font_class": "navigate-filled",
  39973. "unicode": "e67a",
  39974. "unicode_decimal": 59002
  39975. }, {
  39976. "icon_id": "24879603",
  39977. "name": "plusempty",
  39978. "font_class": "plusempty",
  39979. "unicode": "e67b",
  39980. "unicode_decimal": 59003
  39981. }, {
  39982. "icon_id": "24879604",
  39983. "name": "smallcircle",
  39984. "font_class": "smallcircle",
  39985. "unicode": "e67c",
  39986. "unicode_decimal": 59004
  39987. }, {
  39988. "icon_id": "24879605",
  39989. "name": "minus-filled",
  39990. "font_class": "minus-filled",
  39991. "unicode": "e67d",
  39992. "unicode_decimal": 59005
  39993. }, {
  39994. "icon_id": "24879606",
  39995. "name": "micoff",
  39996. "font_class": "micoff",
  39997. "unicode": "e67e",
  39998. "unicode_decimal": 59006
  39999. }, {
  40000. "icon_id": "24879588",
  40001. "name": "closeempty",
  40002. "font_class": "closeempty",
  40003. "unicode": "e66c",
  40004. "unicode_decimal": 58988
  40005. }, {
  40006. "icon_id": "24879589",
  40007. "name": "clear",
  40008. "font_class": "clear",
  40009. "unicode": "e66d",
  40010. "unicode_decimal": 58989
  40011. }, {
  40012. "icon_id": "24879590",
  40013. "name": "navigate",
  40014. "font_class": "navigate",
  40015. "unicode": "e66e",
  40016. "unicode_decimal": 58990
  40017. }, {
  40018. "icon_id": "24879591",
  40019. "name": "minus",
  40020. "font_class": "minus",
  40021. "unicode": "e66f",
  40022. "unicode_decimal": 58991
  40023. }, {
  40024. "icon_id": "24879592",
  40025. "name": "image",
  40026. "font_class": "image",
  40027. "unicode": "e670",
  40028. "unicode_decimal": 58992
  40029. }, {
  40030. "icon_id": "24879593",
  40031. "name": "mic",
  40032. "font_class": "mic",
  40033. "unicode": "e671",
  40034. "unicode_decimal": 58993
  40035. }, {
  40036. "icon_id": "24879594",
  40037. "name": "paperplane",
  40038. "font_class": "paperplane",
  40039. "unicode": "e672",
  40040. "unicode_decimal": 58994
  40041. }, {
  40042. "icon_id": "24879595",
  40043. "name": "close",
  40044. "font_class": "close",
  40045. "unicode": "e673",
  40046. "unicode_decimal": 58995
  40047. }, {
  40048. "icon_id": "24879596",
  40049. "name": "help-filled",
  40050. "font_class": "help-filled",
  40051. "unicode": "e674",
  40052. "unicode_decimal": 58996
  40053. }, {
  40054. "icon_id": "24879597",
  40055. "name": "plus-filled",
  40056. "font_class": "paperplane-filled",
  40057. "unicode": "e675",
  40058. "unicode_decimal": 58997
  40059. }, {
  40060. "icon_id": "24879598",
  40061. "name": "plus",
  40062. "font_class": "plus",
  40063. "unicode": "e676",
  40064. "unicode_decimal": 58998
  40065. }, {
  40066. "icon_id": "24879599",
  40067. "name": "mic-filled",
  40068. "font_class": "mic-filled",
  40069. "unicode": "e677",
  40070. "unicode_decimal": 58999
  40071. }, {
  40072. "icon_id": "24879600",
  40073. "name": "image-filled",
  40074. "font_class": "image-filled",
  40075. "unicode": "e678",
  40076. "unicode_decimal": 59000
  40077. }, {
  40078. "icon_id": "24855900",
  40079. "name": "locked-filled",
  40080. "font_class": "locked-filled",
  40081. "unicode": "e668",
  40082. "unicode_decimal": 58984
  40083. }, {
  40084. "icon_id": "24855901",
  40085. "name": "info",
  40086. "font_class": "info",
  40087. "unicode": "e669",
  40088. "unicode_decimal": 58985
  40089. }, {
  40090. "icon_id": "24855903",
  40091. "name": "locked",
  40092. "font_class": "locked",
  40093. "unicode": "e66b",
  40094. "unicode_decimal": 58987
  40095. }, {
  40096. "icon_id": "24855884",
  40097. "name": "camera-filled",
  40098. "font_class": "camera-filled",
  40099. "unicode": "e658",
  40100. "unicode_decimal": 58968
  40101. }, {
  40102. "icon_id": "24855885",
  40103. "name": "chat-filled",
  40104. "font_class": "chat-filled",
  40105. "unicode": "e659",
  40106. "unicode_decimal": 58969
  40107. }, {
  40108. "icon_id": "24855886",
  40109. "name": "camera",
  40110. "font_class": "camera",
  40111. "unicode": "e65a",
  40112. "unicode_decimal": 58970
  40113. }, {
  40114. "icon_id": "24855887",
  40115. "name": "circle",
  40116. "font_class": "circle",
  40117. "unicode": "e65b",
  40118. "unicode_decimal": 58971
  40119. }, {
  40120. "icon_id": "24855888",
  40121. "name": "checkmarkempty",
  40122. "font_class": "checkmarkempty",
  40123. "unicode": "e65c",
  40124. "unicode_decimal": 58972
  40125. }, {
  40126. "icon_id": "24855889",
  40127. "name": "chat",
  40128. "font_class": "chat",
  40129. "unicode": "e65d",
  40130. "unicode_decimal": 58973
  40131. }, {
  40132. "icon_id": "24855890",
  40133. "name": "circle-filled",
  40134. "font_class": "circle-filled",
  40135. "unicode": "e65e",
  40136. "unicode_decimal": 58974
  40137. }, {
  40138. "icon_id": "24855891",
  40139. "name": "flag",
  40140. "font_class": "flag",
  40141. "unicode": "e65f",
  40142. "unicode_decimal": 58975
  40143. }, {
  40144. "icon_id": "24855892",
  40145. "name": "flag-filled",
  40146. "font_class": "flag-filled",
  40147. "unicode": "e660",
  40148. "unicode_decimal": 58976
  40149. }, {
  40150. "icon_id": "24855893",
  40151. "name": "gear-filled",
  40152. "font_class": "gear-filled",
  40153. "unicode": "e661",
  40154. "unicode_decimal": 58977
  40155. }, {
  40156. "icon_id": "24855894",
  40157. "name": "home",
  40158. "font_class": "home",
  40159. "unicode": "e662",
  40160. "unicode_decimal": 58978
  40161. }, {
  40162. "icon_id": "24855895",
  40163. "name": "home-filled",
  40164. "font_class": "home-filled",
  40165. "unicode": "e663",
  40166. "unicode_decimal": 58979
  40167. }, {
  40168. "icon_id": "24855896",
  40169. "name": "gear",
  40170. "font_class": "gear",
  40171. "unicode": "e664",
  40172. "unicode_decimal": 58980
  40173. }, {
  40174. "icon_id": "24855897",
  40175. "name": "smallcircle-filled",
  40176. "font_class": "smallcircle-filled",
  40177. "unicode": "e665",
  40178. "unicode_decimal": 58981
  40179. }, {
  40180. "icon_id": "24855898",
  40181. "name": "map-filled",
  40182. "font_class": "map-filled",
  40183. "unicode": "e666",
  40184. "unicode_decimal": 58982
  40185. }, {
  40186. "icon_id": "24855899",
  40187. "name": "map",
  40188. "font_class": "map",
  40189. "unicode": "e667",
  40190. "unicode_decimal": 58983
  40191. }, {
  40192. "icon_id": "24855825",
  40193. "name": "refresh-filled",
  40194. "font_class": "refresh-filled",
  40195. "unicode": "e656",
  40196. "unicode_decimal": 58966
  40197. }, {
  40198. "icon_id": "24855826",
  40199. "name": "refresh",
  40200. "font_class": "refresh",
  40201. "unicode": "e657",
  40202. "unicode_decimal": 58967
  40203. }, {
  40204. "icon_id": "24855808",
  40205. "name": "cloud-upload",
  40206. "font_class": "cloud-upload",
  40207. "unicode": "e645",
  40208. "unicode_decimal": 58949
  40209. }, {
  40210. "icon_id": "24855809",
  40211. "name": "cloud-download-filled",
  40212. "font_class": "cloud-download-filled",
  40213. "unicode": "e646",
  40214. "unicode_decimal": 58950
  40215. }, {
  40216. "icon_id": "24855810",
  40217. "name": "cloud-download",
  40218. "font_class": "cloud-download",
  40219. "unicode": "e647",
  40220. "unicode_decimal": 58951
  40221. }, {
  40222. "icon_id": "24855811",
  40223. "name": "cloud-upload-filled",
  40224. "font_class": "cloud-upload-filled",
  40225. "unicode": "e648",
  40226. "unicode_decimal": 58952
  40227. }, {
  40228. "icon_id": "24855813",
  40229. "name": "redo",
  40230. "font_class": "redo",
  40231. "unicode": "e64a",
  40232. "unicode_decimal": 58954
  40233. }, {
  40234. "icon_id": "24855814",
  40235. "name": "images-filled",
  40236. "font_class": "images-filled",
  40237. "unicode": "e64b",
  40238. "unicode_decimal": 58955
  40239. }, {
  40240. "icon_id": "24855815",
  40241. "name": "undo-filled",
  40242. "font_class": "undo-filled",
  40243. "unicode": "e64c",
  40244. "unicode_decimal": 58956
  40245. }, {
  40246. "icon_id": "24855816",
  40247. "name": "more",
  40248. "font_class": "more",
  40249. "unicode": "e64d",
  40250. "unicode_decimal": 58957
  40251. }, {
  40252. "icon_id": "24855817",
  40253. "name": "more-filled",
  40254. "font_class": "more-filled",
  40255. "unicode": "e64e",
  40256. "unicode_decimal": 58958
  40257. }, {
  40258. "icon_id": "24855818",
  40259. "name": "undo",
  40260. "font_class": "undo",
  40261. "unicode": "e64f",
  40262. "unicode_decimal": 58959
  40263. }, {
  40264. "icon_id": "24855819",
  40265. "name": "images",
  40266. "font_class": "images",
  40267. "unicode": "e650",
  40268. "unicode_decimal": 58960
  40269. }, {
  40270. "icon_id": "24855821",
  40271. "name": "paperclip",
  40272. "font_class": "paperclip",
  40273. "unicode": "e652",
  40274. "unicode_decimal": 58962
  40275. }, {
  40276. "icon_id": "24855822",
  40277. "name": "settings",
  40278. "font_class": "settings",
  40279. "unicode": "e653",
  40280. "unicode_decimal": 58963
  40281. }, {
  40282. "icon_id": "24855823",
  40283. "name": "search",
  40284. "font_class": "search",
  40285. "unicode": "e654",
  40286. "unicode_decimal": 58964
  40287. }, {
  40288. "icon_id": "24855824",
  40289. "name": "redo-filled",
  40290. "font_class": "redo-filled",
  40291. "unicode": "e655",
  40292. "unicode_decimal": 58965
  40293. }, {
  40294. "icon_id": "24841702",
  40295. "name": "list",
  40296. "font_class": "list",
  40297. "unicode": "e644",
  40298. "unicode_decimal": 58948
  40299. }, {
  40300. "icon_id": "24841489",
  40301. "name": "mail-open-filled",
  40302. "font_class": "mail-open-filled",
  40303. "unicode": "e63a",
  40304. "unicode_decimal": 58938
  40305. }, {
  40306. "icon_id": "24841491",
  40307. "name": "hand-thumbsdown-filled",
  40308. "font_class": "hand-down-filled",
  40309. "unicode": "e63c",
  40310. "unicode_decimal": 58940
  40311. }, {
  40312. "icon_id": "24841492",
  40313. "name": "hand-thumbsdown",
  40314. "font_class": "hand-down",
  40315. "unicode": "e63d",
  40316. "unicode_decimal": 58941
  40317. }, {
  40318. "icon_id": "24841493",
  40319. "name": "hand-thumbsup-filled",
  40320. "font_class": "hand-up-filled",
  40321. "unicode": "e63e",
  40322. "unicode_decimal": 58942
  40323. }, {
  40324. "icon_id": "24841494",
  40325. "name": "hand-thumbsup",
  40326. "font_class": "hand-up",
  40327. "unicode": "e63f",
  40328. "unicode_decimal": 58943
  40329. }, {
  40330. "icon_id": "24841496",
  40331. "name": "heart-filled",
  40332. "font_class": "heart-filled",
  40333. "unicode": "e641",
  40334. "unicode_decimal": 58945
  40335. }, {
  40336. "icon_id": "24841498",
  40337. "name": "mail-open",
  40338. "font_class": "mail-open",
  40339. "unicode": "e643",
  40340. "unicode_decimal": 58947
  40341. }, {
  40342. "icon_id": "24841488",
  40343. "name": "heart",
  40344. "font_class": "heart",
  40345. "unicode": "e639",
  40346. "unicode_decimal": 58937
  40347. }, {
  40348. "icon_id": "24839963",
  40349. "name": "loop",
  40350. "font_class": "loop",
  40351. "unicode": "e633",
  40352. "unicode_decimal": 58931
  40353. }, {
  40354. "icon_id": "24839866",
  40355. "name": "pulldown",
  40356. "font_class": "pulldown",
  40357. "unicode": "e632",
  40358. "unicode_decimal": 58930
  40359. }, {
  40360. "icon_id": "24813798",
  40361. "name": "scan",
  40362. "font_class": "scan",
  40363. "unicode": "e62a",
  40364. "unicode_decimal": 58922
  40365. }, {
  40366. "icon_id": "24813786",
  40367. "name": "bars",
  40368. "font_class": "bars",
  40369. "unicode": "e627",
  40370. "unicode_decimal": 58919
  40371. }, {
  40372. "icon_id": "24813788",
  40373. "name": "cart-filled",
  40374. "font_class": "cart-filled",
  40375. "unicode": "e629",
  40376. "unicode_decimal": 58921
  40377. }, {
  40378. "icon_id": "24813790",
  40379. "name": "checkbox",
  40380. "font_class": "checkbox",
  40381. "unicode": "e62b",
  40382. "unicode_decimal": 58923
  40383. }, {
  40384. "icon_id": "24813791",
  40385. "name": "checkbox-filled",
  40386. "font_class": "checkbox-filled",
  40387. "unicode": "e62c",
  40388. "unicode_decimal": 58924
  40389. }, {
  40390. "icon_id": "24813794",
  40391. "name": "shop",
  40392. "font_class": "shop",
  40393. "unicode": "e62f",
  40394. "unicode_decimal": 58927
  40395. }, {
  40396. "icon_id": "24813795",
  40397. "name": "headphones",
  40398. "font_class": "headphones",
  40399. "unicode": "e630",
  40400. "unicode_decimal": 58928
  40401. }, {
  40402. "icon_id": "24813796",
  40403. "name": "cart",
  40404. "font_class": "cart",
  40405. "unicode": "e631",
  40406. "unicode_decimal": 58929
  40407. }]
  40408. };
  40409. exports.default = _default;
  40410. /***/ })
  40411. ]]);
  40412. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map