f_000014 1.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072
  1. import {
  2. __commonJS,
  3. __require
  4. } from "/node_modules/.vite/deps/chunk-WQG2LZMB.js?v=9548b9c3";
  5. // node_modules/ali-oss/dist/aliyun-oss-sdk.js
  6. var require_aliyun_oss_sdk = __commonJS({
  7. "node_modules/ali-oss/dist/aliyun-oss-sdk.js"(exports, module) {
  8. (function(global) {
  9. (function(f) {
  10. if (typeof exports === "object" && typeof module !== "undefined") {
  11. module.exports = f();
  12. } else if (typeof define === "function" && define.amd) {
  13. define([], f);
  14. } else {
  15. var g;
  16. if (typeof window !== "undefined") {
  17. g = window;
  18. } else if (typeof global !== "undefined") {
  19. g = global;
  20. } else if (typeof self !== "undefined") {
  21. g = self;
  22. } else {
  23. g = this;
  24. }
  25. g.OSS = f();
  26. }
  27. })(function() {
  28. var define2, module2, exports2;
  29. return function() {
  30. function r(e, n, t) {
  31. function o(i2, f) {
  32. if (!n[i2]) {
  33. if (!e[i2]) {
  34. var c = "function" == typeof __require && __require;
  35. if (!f && c)
  36. return c(i2, true);
  37. if (u)
  38. return u(i2, true);
  39. var a = new Error("Cannot find module '" + i2 + "'");
  40. throw a.code = "MODULE_NOT_FOUND", a;
  41. }
  42. var p = n[i2] = { exports: {} };
  43. e[i2][0].call(p.exports, function(r2) {
  44. var n2 = e[i2][1][r2];
  45. return o(n2 || r2);
  46. }, p, p.exports, r, e, n, t);
  47. }
  48. return n[i2].exports;
  49. }
  50. for (var u = "function" == typeof __require && __require, i = 0; i < t.length; i++)
  51. o(t[i]);
  52. return o;
  53. }
  54. return r;
  55. }()({ 1: [function(require2, module3, exports3) {
  56. "use strict";
  57. var OSS = require2("./browser/client");
  58. OSS.Buffer = require2("buffer").Buffer;
  59. OSS.urllib = require2("../shims/xhr");
  60. OSS.version = require2("./browser/version").version;
  61. module3.exports = OSS;
  62. }, { "../shims/xhr": 475, "./browser/client": 3, "./browser/version": 6, "buffer": 90 }], 2: [function(require2, module3, exports3) {
  63. "use strict";
  64. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  65. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  66. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  67. require2("core-js/modules/es.object.to-string.js");
  68. require2("core-js/modules/web.dom-collections.for-each.js");
  69. require2("core-js/modules/es.object.keys.js");
  70. require2("core-js/modules/es.array.slice.js");
  71. var assert = require2("assert");
  72. var _require = require2("../common/utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  73. var proto = exports3;
  74. function isArray(arr) {
  75. if (Array.isArray)
  76. return Array.isArray(arr);
  77. return Object.prototype.toString.call(arr) === "[object Array]";
  78. }
  79. function toArray(obj) {
  80. if (!obj)
  81. return [];
  82. if (isArray(obj))
  83. return obj;
  84. return [obj];
  85. }
  86. proto.useBucket = function useBucket(name) {
  87. _checkBucketName(name);
  88. this.options.bucket = name;
  89. return this;
  90. };
  91. proto.setBucket = function useBucket(name) {
  92. _checkBucketName(name);
  93. this.options.bucket = name;
  94. return this;
  95. };
  96. proto.getBucket = function getBucket() {
  97. return this.options.bucket;
  98. };
  99. proto.deleteBucket = function() {
  100. var _deleteBucket = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  101. var params, result;
  102. return _regenerator.default.wrap(function _callee$(_context) {
  103. while (1) {
  104. switch (_context.prev = _context.next) {
  105. case 0:
  106. params = this._bucketRequestParams("DELETE", name, "", options);
  107. _context.next = 3;
  108. return this.request(params);
  109. case 3:
  110. result = _context.sent;
  111. if (!(result.status === 200 || result.status === 204)) {
  112. _context.next = 6;
  113. break;
  114. }
  115. return _context.abrupt("return", {
  116. res: result.res
  117. });
  118. case 6:
  119. _context.next = 8;
  120. return this.requestError(result);
  121. case 8:
  122. throw _context.sent;
  123. case 9:
  124. case "end":
  125. return _context.stop();
  126. }
  127. }
  128. }, _callee, this);
  129. }));
  130. function deleteBucket(_x, _x2) {
  131. return _deleteBucket.apply(this, arguments);
  132. }
  133. return deleteBucket;
  134. }();
  135. proto.putBucketACL = function() {
  136. var _putBucketACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, acl, options) {
  137. var params, result;
  138. return _regenerator.default.wrap(function _callee2$(_context2) {
  139. while (1) {
  140. switch (_context2.prev = _context2.next) {
  141. case 0:
  142. params = this._bucketRequestParams("PUT", name, "acl", options);
  143. params.headers = {
  144. "x-oss-acl": acl
  145. };
  146. params.successStatuses = [200];
  147. _context2.next = 5;
  148. return this.request(params);
  149. case 5:
  150. result = _context2.sent;
  151. return _context2.abrupt("return", {
  152. bucket: result.headers.location && result.headers.location.substring(1) || null,
  153. res: result.res
  154. });
  155. case 7:
  156. case "end":
  157. return _context2.stop();
  158. }
  159. }
  160. }, _callee2, this);
  161. }));
  162. function putBucketACL(_x3, _x4, _x5) {
  163. return _putBucketACL.apply(this, arguments);
  164. }
  165. return putBucketACL;
  166. }();
  167. proto.getBucketACL = function() {
  168. var _getBucketACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, options) {
  169. var params, result;
  170. return _regenerator.default.wrap(function _callee3$(_context3) {
  171. while (1) {
  172. switch (_context3.prev = _context3.next) {
  173. case 0:
  174. params = this._bucketRequestParams("GET", name, "acl", options);
  175. params.successStatuses = [200];
  176. params.xmlResponse = true;
  177. _context3.next = 5;
  178. return this.request(params);
  179. case 5:
  180. result = _context3.sent;
  181. return _context3.abrupt("return", {
  182. acl: result.data.AccessControlList.Grant,
  183. owner: {
  184. id: result.data.Owner.ID,
  185. displayName: result.data.Owner.DisplayName
  186. },
  187. res: result.res
  188. });
  189. case 7:
  190. case "end":
  191. return _context3.stop();
  192. }
  193. }
  194. }, _callee3, this);
  195. }));
  196. function getBucketACL(_x6, _x7) {
  197. return _getBucketACL.apply(this, arguments);
  198. }
  199. return getBucketACL;
  200. }();
  201. proto.putBucketLogging = function() {
  202. var _putBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, prefix, options) {
  203. var params, xml, result;
  204. return _regenerator.default.wrap(function _callee4$(_context4) {
  205. while (1) {
  206. switch (_context4.prev = _context4.next) {
  207. case 0:
  208. params = this._bucketRequestParams("PUT", name, "logging", options);
  209. xml = '<?xml version="1.0" encoding="UTF-8"?>\n<BucketLoggingStatus>\n<LoggingEnabled>\n<TargetBucket>'.concat(name, "</TargetBucket>\n");
  210. if (prefix) {
  211. xml += "<TargetPrefix>".concat(prefix, "</TargetPrefix>\n");
  212. }
  213. xml += "</LoggingEnabled>\n</BucketLoggingStatus>";
  214. params.content = xml;
  215. params.mime = "xml";
  216. params.successStatuses = [200];
  217. _context4.next = 9;
  218. return this.request(params);
  219. case 9:
  220. result = _context4.sent;
  221. return _context4.abrupt("return", {
  222. res: result.res
  223. });
  224. case 11:
  225. case "end":
  226. return _context4.stop();
  227. }
  228. }
  229. }, _callee4, this);
  230. }));
  231. function putBucketLogging(_x8, _x9, _x10) {
  232. return _putBucketLogging.apply(this, arguments);
  233. }
  234. return putBucketLogging;
  235. }();
  236. proto.getBucketLogging = function() {
  237. var _getBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(name, options) {
  238. var params, result, enable;
  239. return _regenerator.default.wrap(function _callee5$(_context5) {
  240. while (1) {
  241. switch (_context5.prev = _context5.next) {
  242. case 0:
  243. params = this._bucketRequestParams("GET", name, "logging", options);
  244. params.successStatuses = [200];
  245. params.xmlResponse = true;
  246. _context5.next = 5;
  247. return this.request(params);
  248. case 5:
  249. result = _context5.sent;
  250. enable = result.data.LoggingEnabled;
  251. return _context5.abrupt("return", {
  252. enable: !!enable,
  253. prefix: enable && enable.TargetPrefix || null,
  254. res: result.res
  255. });
  256. case 8:
  257. case "end":
  258. return _context5.stop();
  259. }
  260. }
  261. }, _callee5, this);
  262. }));
  263. function getBucketLogging(_x11, _x12) {
  264. return _getBucketLogging.apply(this, arguments);
  265. }
  266. return getBucketLogging;
  267. }();
  268. proto.deleteBucketLogging = function() {
  269. var _deleteBucketLogging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(name, options) {
  270. var params, result;
  271. return _regenerator.default.wrap(function _callee6$(_context6) {
  272. while (1) {
  273. switch (_context6.prev = _context6.next) {
  274. case 0:
  275. params = this._bucketRequestParams("DELETE", name, "logging", options);
  276. params.successStatuses = [204, 200];
  277. _context6.next = 4;
  278. return this.request(params);
  279. case 4:
  280. result = _context6.sent;
  281. return _context6.abrupt("return", {
  282. res: result.res
  283. });
  284. case 6:
  285. case "end":
  286. return _context6.stop();
  287. }
  288. }
  289. }, _callee6, this);
  290. }));
  291. function deleteBucketLogging(_x13, _x14) {
  292. return _deleteBucketLogging.apply(this, arguments);
  293. }
  294. return deleteBucketLogging;
  295. }();
  296. proto.putBucketCORS = function() {
  297. var _putBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name, rules, options) {
  298. var params, xml, parseOrigin, parseMethod, parseHeader, parseExposeHeader, i, l, rule, result;
  299. return _regenerator.default.wrap(function _callee7$(_context7) {
  300. while (1) {
  301. switch (_context7.prev = _context7.next) {
  302. case 0:
  303. rules = rules || [];
  304. assert(rules.length, "rules is required");
  305. rules.forEach(function(rule2) {
  306. assert(rule2.allowedOrigin, "allowedOrigin is required");
  307. assert(rule2.allowedMethod, "allowedMethod is required");
  308. });
  309. params = this._bucketRequestParams("PUT", name, "cors", options);
  310. xml = '<?xml version="1.0" encoding="UTF-8"?>\n<CORSConfiguration>';
  311. parseOrigin = function parseOrigin2(val) {
  312. xml += "<AllowedOrigin>".concat(val, "</AllowedOrigin>");
  313. };
  314. parseMethod = function parseMethod2(val) {
  315. xml += "<AllowedMethod>".concat(val, "</AllowedMethod>");
  316. };
  317. parseHeader = function parseHeader2(val) {
  318. xml += "<AllowedHeader>".concat(val, "</AllowedHeader>");
  319. };
  320. parseExposeHeader = function parseExposeHeader2(val) {
  321. xml += "<ExposeHeader>".concat(val, "</ExposeHeader>");
  322. };
  323. for (i = 0, l = rules.length; i < l; i++) {
  324. rule = rules[i];
  325. xml += "<CORSRule>";
  326. toArray(rule.allowedOrigin).forEach(parseOrigin);
  327. toArray(rule.allowedMethod).forEach(parseMethod);
  328. toArray(rule.allowedHeader).forEach(parseHeader);
  329. toArray(rule.exposeHeader).forEach(parseExposeHeader);
  330. if (rule.maxAgeSeconds) {
  331. xml += "<MaxAgeSeconds>".concat(rule.maxAgeSeconds, "</MaxAgeSeconds>");
  332. }
  333. xml += "</CORSRule>";
  334. }
  335. xml += "</CORSConfiguration>";
  336. params.content = xml;
  337. params.mime = "xml";
  338. params.successStatuses = [200];
  339. _context7.next = 16;
  340. return this.request(params);
  341. case 16:
  342. result = _context7.sent;
  343. return _context7.abrupt("return", {
  344. res: result.res
  345. });
  346. case 18:
  347. case "end":
  348. return _context7.stop();
  349. }
  350. }
  351. }, _callee7, this);
  352. }));
  353. function putBucketCORS(_x15, _x16, _x17) {
  354. return _putBucketCORS.apply(this, arguments);
  355. }
  356. return putBucketCORS;
  357. }();
  358. proto.getBucketCORS = function() {
  359. var _getBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8(name, options) {
  360. var params, result, rules, CORSRule;
  361. return _regenerator.default.wrap(function _callee8$(_context8) {
  362. while (1) {
  363. switch (_context8.prev = _context8.next) {
  364. case 0:
  365. params = this._bucketRequestParams("GET", name, "cors", options);
  366. params.successStatuses = [200];
  367. params.xmlResponse = true;
  368. _context8.next = 5;
  369. return this.request(params);
  370. case 5:
  371. result = _context8.sent;
  372. rules = [];
  373. if (result.data && result.data.CORSRule) {
  374. CORSRule = result.data.CORSRule;
  375. if (!isArray(CORSRule))
  376. CORSRule = [CORSRule];
  377. CORSRule.forEach(function(rule) {
  378. var r = {};
  379. Object.keys(rule).forEach(function(key) {
  380. r[key.slice(0, 1).toLowerCase() + key.slice(1, key.length)] = rule[key];
  381. });
  382. rules.push(r);
  383. });
  384. }
  385. return _context8.abrupt("return", {
  386. rules,
  387. res: result.res
  388. });
  389. case 9:
  390. case "end":
  391. return _context8.stop();
  392. }
  393. }
  394. }, _callee8, this);
  395. }));
  396. function getBucketCORS(_x18, _x19) {
  397. return _getBucketCORS.apply(this, arguments);
  398. }
  399. return getBucketCORS;
  400. }();
  401. proto.deleteBucketCORS = function() {
  402. var _deleteBucketCORS = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(name, options) {
  403. var params, result;
  404. return _regenerator.default.wrap(function _callee9$(_context9) {
  405. while (1) {
  406. switch (_context9.prev = _context9.next) {
  407. case 0:
  408. params = this._bucketRequestParams("DELETE", name, "cors", options);
  409. params.successStatuses = [204];
  410. _context9.next = 4;
  411. return this.request(params);
  412. case 4:
  413. result = _context9.sent;
  414. return _context9.abrupt("return", {
  415. res: result.res
  416. });
  417. case 6:
  418. case "end":
  419. return _context9.stop();
  420. }
  421. }
  422. }, _callee9, this);
  423. }));
  424. function deleteBucketCORS(_x20, _x21) {
  425. return _deleteBucketCORS.apply(this, arguments);
  426. }
  427. return deleteBucketCORS;
  428. }();
  429. proto.putBucketReferer = function() {
  430. var _putBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee10(name, allowEmpty, referers, options) {
  431. var params, xml, i, result;
  432. return _regenerator.default.wrap(function _callee10$(_context10) {
  433. while (1) {
  434. switch (_context10.prev = _context10.next) {
  435. case 0:
  436. params = this._bucketRequestParams("PUT", name, "referer", options);
  437. xml = '<?xml version="1.0" encoding="UTF-8"?>\n<RefererConfiguration>\n';
  438. xml += " <AllowEmptyReferer>".concat(allowEmpty ? "true" : "false", "</AllowEmptyReferer>\n");
  439. if (referers && referers.length > 0) {
  440. xml += " <RefererList>\n";
  441. for (i = 0; i < referers.length; i++) {
  442. xml += " <Referer>".concat(referers[i], "</Referer>\n");
  443. }
  444. xml += " </RefererList>\n";
  445. } else {
  446. xml += " <RefererList />\n";
  447. }
  448. xml += "</RefererConfiguration>";
  449. params.content = xml;
  450. params.mime = "xml";
  451. params.successStatuses = [200];
  452. _context10.next = 10;
  453. return this.request(params);
  454. case 10:
  455. result = _context10.sent;
  456. return _context10.abrupt("return", {
  457. res: result.res
  458. });
  459. case 12:
  460. case "end":
  461. return _context10.stop();
  462. }
  463. }
  464. }, _callee10, this);
  465. }));
  466. function putBucketReferer(_x22, _x23, _x24, _x25) {
  467. return _putBucketReferer.apply(this, arguments);
  468. }
  469. return putBucketReferer;
  470. }();
  471. proto.getBucketReferer = function() {
  472. var _getBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee11(name, options) {
  473. var params, result, referers;
  474. return _regenerator.default.wrap(function _callee11$(_context11) {
  475. while (1) {
  476. switch (_context11.prev = _context11.next) {
  477. case 0:
  478. params = this._bucketRequestParams("GET", name, "referer", options);
  479. params.successStatuses = [200];
  480. params.xmlResponse = true;
  481. _context11.next = 5;
  482. return this.request(params);
  483. case 5:
  484. result = _context11.sent;
  485. referers = result.data.RefererList.Referer || null;
  486. if (referers) {
  487. if (!isArray(referers)) {
  488. referers = [referers];
  489. }
  490. }
  491. return _context11.abrupt("return", {
  492. allowEmpty: result.data.AllowEmptyReferer === "true",
  493. referers,
  494. res: result.res
  495. });
  496. case 9:
  497. case "end":
  498. return _context11.stop();
  499. }
  500. }
  501. }, _callee11, this);
  502. }));
  503. function getBucketReferer(_x26, _x27) {
  504. return _getBucketReferer.apply(this, arguments);
  505. }
  506. return getBucketReferer;
  507. }();
  508. proto.deleteBucketReferer = function() {
  509. var _deleteBucketReferer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee12(name, options) {
  510. return _regenerator.default.wrap(function _callee12$(_context12) {
  511. while (1) {
  512. switch (_context12.prev = _context12.next) {
  513. case 0:
  514. _context12.next = 2;
  515. return this.putBucketReferer(name, true, null, options);
  516. case 2:
  517. return _context12.abrupt("return", _context12.sent);
  518. case 3:
  519. case "end":
  520. return _context12.stop();
  521. }
  522. }
  523. }, _callee12, this);
  524. }));
  525. function deleteBucketReferer(_x28, _x29) {
  526. return _deleteBucketReferer.apply(this, arguments);
  527. }
  528. return deleteBucketReferer;
  529. }();
  530. proto._bucketRequestParams = function _bucketRequestParams(method, bucket, subres, options) {
  531. return {
  532. method,
  533. bucket,
  534. subres,
  535. timeout: options && options.timeout,
  536. ctx: options && options.ctx
  537. };
  538. };
  539. }, { "../common/utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "assert": 82, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 3: [function(require2, module3, exports3) {
  540. (function(Buffer, process) {
  541. (function() {
  542. "use strict";
  543. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  544. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  545. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  546. require2("core-js/modules/es.function.name.js");
  547. require2("core-js/modules/es.regexp.exec.js");
  548. require2("core-js/modules/es.string.split.js");
  549. require2("core-js/modules/es.object.assign.js");
  550. require2("core-js/modules/es.array.includes.js");
  551. require2("core-js/modules/es.string.replace.js");
  552. require2("core-js/modules/es.array.concat.js");
  553. require2("core-js/modules/es.symbol.js");
  554. require2("core-js/modules/es.symbol.description.js");
  555. require2("core-js/modules/es.array.slice.js");
  556. require2("core-js/modules/es.object.to-string.js");
  557. require2("core-js/modules/es.promise.js");
  558. require2("core-js/modules/es.regexp.to-string.js");
  559. var debug = require2("debug")("ali-oss");
  560. var xml = require2("xml2js");
  561. var AgentKeepalive = require2("agentkeepalive");
  562. var merge = require2("merge-descriptors");
  563. var platform = require2("platform");
  564. var utility = require2("utility");
  565. var urllib = require2("urllib");
  566. var pkg = require2("./version");
  567. var bowser = require2("bowser");
  568. var signUtils = require2("../common/signUtils");
  569. var _initOptions = require2("../common/client/initOptions");
  570. var _require = require2("../common/utils/createRequest"), createRequest = _require.createRequest;
  571. var _require2 = require2("../common/utils/encoder"), encoder = _require2.encoder;
  572. var _require3 = require2("../common/client/getReqUrl"), getReqUrl = _require3.getReqUrl;
  573. var _require4 = require2("../common/utils/setSTSToken"), setSTSToken = _require4.setSTSToken;
  574. var _require5 = require2("../common/utils/retry"), retry = _require5.retry;
  575. var _require6 = require2("../common/utils/isFunction"), isFunction = _require6.isFunction;
  576. var globalHttpAgent = new AgentKeepalive();
  577. function _unSupportBrowserTip() {
  578. var name = platform.name, version = platform.version;
  579. if (name && name.toLowerCase && name.toLowerCase() === "ie" && version.split(".")[0] < 10) {
  580. console.warn("ali-oss does not support the current browser");
  581. }
  582. }
  583. function isHttpsWebProtocol() {
  584. return location && location.protocol === "https:";
  585. }
  586. function Client(options, ctx) {
  587. _unSupportBrowserTip();
  588. if (!(this instanceof Client)) {
  589. return new Client(options, ctx);
  590. }
  591. if (options && options.inited) {
  592. this.options = options;
  593. } else {
  594. this.options = Client.initOptions(options);
  595. }
  596. this.options.cancelFlag = false;
  597. if (this.options.urllib) {
  598. this.urllib = this.options.urllib;
  599. } else {
  600. this.urllib = urllib;
  601. this.agent = this.options.agent || globalHttpAgent;
  602. }
  603. this.ctx = ctx;
  604. this.userAgent = this._getUserAgent();
  605. this.stsTokenFreshTime = /* @__PURE__ */ new Date();
  606. this.options.amendTimeSkewed = 0;
  607. }
  608. module3.exports = Client;
  609. Client.initOptions = function initOptions(options) {
  610. if (!options.stsToken) {
  611. console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");
  612. }
  613. var opts = Object.assign({
  614. secure: isHttpsWebProtocol(),
  615. // for browser compatibility disable fetch.
  616. useFetch: false
  617. }, options);
  618. return _initOptions(opts);
  619. };
  620. var proto = Client.prototype;
  621. proto.debug = debug;
  622. merge(proto, require2("./object"));
  623. merge(proto, require2("./bucket"));
  624. merge(proto, require2("../common/bucket/getBucketWebsite"));
  625. merge(proto, require2("../common/bucket/putBucketWebsite"));
  626. merge(proto, require2("../common/bucket/deleteBucketWebsite"));
  627. merge(proto, require2("../common/bucket/getBucketLifecycle"));
  628. merge(proto, require2("../common/bucket/putBucketLifecycle"));
  629. merge(proto, require2("../common/bucket/deleteBucketLifecycle"));
  630. merge(proto, require2("../common/bucket/putBucketVersioning"));
  631. merge(proto, require2("../common/bucket/getBucketVersioning"));
  632. merge(proto, require2("../common/bucket/getBucketInventory"));
  633. merge(proto, require2("../common/bucket/deleteBucketInventory"));
  634. merge(proto, require2("../common/bucket/listBucketInventory"));
  635. merge(proto, require2("../common/bucket/putBucketInventory"));
  636. merge(proto, require2("../common/bucket/abortBucketWorm"));
  637. merge(proto, require2("../common/bucket/completeBucketWorm"));
  638. merge(proto, require2("../common/bucket/extendBucketWorm"));
  639. merge(proto, require2("../common/bucket/getBucketWorm"));
  640. merge(proto, require2("../common/bucket/initiateBucketWorm"));
  641. merge(proto, require2("./managed-upload"));
  642. merge(proto, require2("../common/multipart-copy"));
  643. merge(proto, require2("../common/multipart"));
  644. merge(proto, require2("../common/parallel"));
  645. proto.signature = function signature(stringToSign) {
  646. this.debug("authorization stringToSign: %s", stringToSign, "info");
  647. return signUtils.computeSignature(this.options.accessKeySecret, stringToSign, this.options.headerEncoding);
  648. };
  649. proto._getReqUrl = getReqUrl;
  650. proto.authorization = function authorization(method, resource, subres, headers) {
  651. var stringToSign = signUtils.buildCanonicalString(method.toUpperCase(), resource, {
  652. headers,
  653. parameters: subres
  654. });
  655. return signUtils.authorization(this.options.accessKeyId, this.options.accessKeySecret, stringToSign, this.options.headerEncoding);
  656. };
  657. proto.request = function() {
  658. var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(params) {
  659. var _this = this;
  660. return _regenerator.default.wrap(function _callee$(_context) {
  661. while (1) {
  662. switch (_context.prev = _context.next) {
  663. case 0:
  664. if (!this.options.retryMax) {
  665. _context.next = 6;
  666. break;
  667. }
  668. _context.next = 3;
  669. return retry(request.bind(this), this.options.retryMax, {
  670. errorHandler: function errorHandler(err) {
  671. var _errHandle = function _errHandle2(_err) {
  672. if (params.stream)
  673. return false;
  674. var statusErr = [-1, -2].includes(_err.status);
  675. var requestErrorRetryHandle = _this.options.requestErrorRetryHandle || function() {
  676. return true;
  677. };
  678. return statusErr && requestErrorRetryHandle(_err);
  679. };
  680. if (_errHandle(err))
  681. return true;
  682. return false;
  683. }
  684. })(params);
  685. case 3:
  686. return _context.abrupt("return", _context.sent);
  687. case 6:
  688. return _context.abrupt("return", request.call(this, params));
  689. case 7:
  690. case "end":
  691. return _context.stop();
  692. }
  693. }
  694. }, _callee, this);
  695. }));
  696. return function(_x) {
  697. return _ref.apply(this, arguments);
  698. };
  699. }();
  700. function request(_x2) {
  701. return _request.apply(this, arguments);
  702. }
  703. function _request() {
  704. _request = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(params) {
  705. var reqParams, result, reqErr, useStream, err, parseData;
  706. return _regenerator.default.wrap(function _callee3$(_context3) {
  707. while (1) {
  708. switch (_context3.prev = _context3.next) {
  709. case 0:
  710. if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) {
  711. _context3.next = 3;
  712. break;
  713. }
  714. _context3.next = 3;
  715. return setSTSToken.call(this);
  716. case 3:
  717. reqParams = createRequest.call(this, params);
  718. if (!this.options.useFetch) {
  719. reqParams.params.mode = "disable-fetch";
  720. }
  721. useStream = !!params.stream;
  722. _context3.prev = 6;
  723. _context3.next = 9;
  724. return this.urllib.request(reqParams.url, reqParams.params);
  725. case 9:
  726. result = _context3.sent;
  727. this.debug("response %s %s, got %s, headers: %j", params.method, reqParams.url, result.status, result.headers, "info");
  728. _context3.next = 16;
  729. break;
  730. case 13:
  731. _context3.prev = 13;
  732. _context3.t0 = _context3["catch"](6);
  733. reqErr = _context3.t0;
  734. case 16:
  735. if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) {
  736. _context3.next = 28;
  737. break;
  738. }
  739. _context3.next = 19;
  740. return this.requestError(result);
  741. case 19:
  742. err = _context3.sent;
  743. if (!(err.code === "RequestTimeTooSkewed" && !useStream)) {
  744. _context3.next = 25;
  745. break;
  746. }
  747. this.options.amendTimeSkewed = +new Date(err.serverTime) - /* @__PURE__ */ new Date();
  748. _context3.next = 24;
  749. return this.request(params);
  750. case 24:
  751. return _context3.abrupt("return", _context3.sent);
  752. case 25:
  753. err.params = params;
  754. _context3.next = 32;
  755. break;
  756. case 28:
  757. if (!reqErr) {
  758. _context3.next = 32;
  759. break;
  760. }
  761. _context3.next = 31;
  762. return this.requestError(reqErr);
  763. case 31:
  764. err = _context3.sent;
  765. case 32:
  766. if (!err) {
  767. _context3.next = 34;
  768. break;
  769. }
  770. throw err;
  771. case 34:
  772. if (!params.xmlResponse) {
  773. _context3.next = 39;
  774. break;
  775. }
  776. _context3.next = 37;
  777. return this.parseXML(result.data);
  778. case 37:
  779. parseData = _context3.sent;
  780. result.data = parseData;
  781. case 39:
  782. return _context3.abrupt("return", result);
  783. case 40:
  784. case "end":
  785. return _context3.stop();
  786. }
  787. }
  788. }, _callee3, this, [[6, 13]]);
  789. }));
  790. return _request.apply(this, arguments);
  791. }
  792. proto._getResource = function _getResource(params) {
  793. var resource = "/";
  794. if (params.bucket)
  795. resource += "".concat(params.bucket, "/");
  796. if (params.object)
  797. resource += encoder(params.object, this.options.headerEncoding);
  798. return resource;
  799. };
  800. proto._escape = function _escape(name) {
  801. return utility.encodeURIComponent(name).replace(/%2F/g, "/");
  802. };
  803. proto._getUserAgent = function _getUserAgent() {
  804. var agent = process && process.browser ? "js" : "nodejs";
  805. var sdk = "aliyun-sdk-".concat(agent, "/").concat(pkg.version);
  806. var plat = platform.description;
  807. if (!plat && process) {
  808. plat = "Node.js ".concat(process.version.slice(1), " on ").concat(process.platform, " ").concat(process.arch);
  809. }
  810. return this._checkUserAgent("".concat(sdk, " ").concat(plat));
  811. };
  812. proto._checkUserAgent = function _checkUserAgent(ua) {
  813. var userAgent = ua.replace(/\u03b1/, "alpha").replace(/\u03b2/, "beta");
  814. return userAgent;
  815. };
  816. proto.checkBrowserAndVersion = function checkBrowserAndVersion(name, version) {
  817. return bowser.name === name && bowser.version.split(".")[0] === version;
  818. };
  819. proto.parseXML = function parseXMLThunk(str) {
  820. return new Promise(function(resolve, reject) {
  821. if (Buffer.isBuffer(str)) {
  822. str = str.toString();
  823. }
  824. xml.parseString(str, {
  825. explicitRoot: false,
  826. explicitArray: false
  827. }, function(err, result) {
  828. if (err) {
  829. reject(err);
  830. } else {
  831. resolve(result);
  832. }
  833. });
  834. });
  835. };
  836. proto.requestError = function() {
  837. var _requestError = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(result) {
  838. var err, message, info, msg;
  839. return _regenerator.default.wrap(function _callee2$(_context2) {
  840. while (1) {
  841. switch (_context2.prev = _context2.next) {
  842. case 0:
  843. err = null;
  844. if (!(!result.data || !result.data.length)) {
  845. _context2.next = 5;
  846. break;
  847. }
  848. if (result.status === -1 || result.status === -2) {
  849. err = new Error(result.message);
  850. err.name = result.name;
  851. err.status = result.status;
  852. err.code = result.name;
  853. } else {
  854. if (result.status === 404) {
  855. err = new Error("Object not exists");
  856. err.name = "NoSuchKeyError";
  857. err.status = 404;
  858. err.code = "NoSuchKey";
  859. } else if (result.status === 412) {
  860. err = new Error("Pre condition failed");
  861. err.name = "PreconditionFailedError";
  862. err.status = 412;
  863. err.code = "PreconditionFailed";
  864. } else {
  865. err = new Error("Unknow error, status: ".concat(result.status));
  866. err.name = "UnknownError";
  867. err.status = result.status;
  868. }
  869. err.requestId = result.headers["x-oss-request-id"];
  870. err.host = "";
  871. }
  872. _context2.next = 32;
  873. break;
  874. case 5:
  875. message = String(result.data);
  876. this.debug("request response error data: %s", message, "error");
  877. _context2.prev = 7;
  878. _context2.next = 10;
  879. return this.parseXML(message);
  880. case 10:
  881. _context2.t0 = _context2.sent;
  882. if (_context2.t0) {
  883. _context2.next = 13;
  884. break;
  885. }
  886. _context2.t0 = {};
  887. case 13:
  888. info = _context2.t0;
  889. _context2.next = 23;
  890. break;
  891. case 16:
  892. _context2.prev = 16;
  893. _context2.t1 = _context2["catch"](7);
  894. this.debug(message, "error");
  895. _context2.t1.message += "\nraw xml: ".concat(message);
  896. _context2.t1.status = result.status;
  897. _context2.t1.requestId = result.headers["x-oss-request-id"];
  898. return _context2.abrupt("return", _context2.t1);
  899. case 23:
  900. msg = info.Message || "unknow request error, status: ".concat(result.status);
  901. if (info.Condition) {
  902. msg += " (condition: ".concat(info.Condition, ")");
  903. }
  904. err = new Error(msg);
  905. err.name = info.Code ? "".concat(info.Code, "Error") : "UnknownError";
  906. err.status = result.status;
  907. err.code = info.Code;
  908. err.requestId = info.RequestId;
  909. err.hostId = info.HostId;
  910. err.serverTime = info.ServerTime;
  911. case 32:
  912. this.debug("generate error %j", err, "error");
  913. return _context2.abrupt("return", err);
  914. case 34:
  915. case "end":
  916. return _context2.stop();
  917. }
  918. }
  919. }, _callee2, this, [[7, 16]]);
  920. }));
  921. function requestError(_x3) {
  922. return _requestError.apply(this, arguments);
  923. }
  924. return requestError;
  925. }();
  926. }).call(this);
  927. }).call(this, { "isBuffer": require2("../../node_modules/is-buffer/index.js") }, require2("_process"));
  928. }, { "../../node_modules/is-buffer/index.js": 366, "../common/bucket/abortBucketWorm": 7, "../common/bucket/completeBucketWorm": 8, "../common/bucket/deleteBucketInventory": 9, "../common/bucket/deleteBucketLifecycle": 10, "../common/bucket/deleteBucketWebsite": 11, "../common/bucket/extendBucketWorm": 12, "../common/bucket/getBucketInventory": 13, "../common/bucket/getBucketLifecycle": 14, "../common/bucket/getBucketVersioning": 15, "../common/bucket/getBucketWebsite": 16, "../common/bucket/getBucketWorm": 17, "../common/bucket/initiateBucketWorm": 18, "../common/bucket/listBucketInventory": 19, "../common/bucket/putBucketInventory": 20, "../common/bucket/putBucketLifecycle": 21, "../common/bucket/putBucketVersioning": 22, "../common/bucket/putBucketWebsite": 23, "../common/client/getReqUrl": 25, "../common/client/initOptions": 26, "../common/multipart": 30, "../common/multipart-copy": 29, "../common/parallel": 49, "../common/signUtils": 50, "../common/utils/createRequest": 56, "../common/utils/encoder": 59, "../common/utils/isFunction": 68, "../common/utils/retry": 74, "../common/utils/setSTSToken": 76, "./bucket": 2, "./managed-upload": 4, "./object": 5, "./version": 6, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "agentkeepalive": 81, "bowser": 88, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.symbol.description.js": 310, "core-js/modules/es.symbol.js": 313, "debug": 465, "merge-descriptors": 372, "platform": 379, "urllib": 475, "utility": 474, "xml2js": 426 }], 4: [function(require2, module3, exports3) {
  929. (function(Buffer) {
  930. (function() {
  931. "use strict";
  932. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  933. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  934. require2("core-js/modules/es.function.name.js");
  935. require2("core-js/modules/es.object.to-string.js");
  936. require2("core-js/modules/es.promise.js");
  937. require2("core-js/modules/es.array.from.js");
  938. require2("core-js/modules/es.string.iterator.js");
  939. require2("core-js/modules/es.array.map.js");
  940. require2("core-js/modules/es.array.filter.js");
  941. require2("core-js/modules/es.array.find.js");
  942. require2("core-js/modules/es.array.concat.js");
  943. require2("core-js/modules/es.regexp.to-string.js");
  944. require2("core-js/modules/es.array.slice.js");
  945. require2("core-js/modules/es.array.iterator.js");
  946. require2("core-js/modules/es.array-buffer.slice.js");
  947. require2("core-js/modules/es.typed-array.uint8-array.js");
  948. require2("core-js/modules/es.typed-array.copy-within.js");
  949. require2("core-js/modules/es.typed-array.every.js");
  950. require2("core-js/modules/es.typed-array.fill.js");
  951. require2("core-js/modules/es.typed-array.filter.js");
  952. require2("core-js/modules/es.typed-array.find.js");
  953. require2("core-js/modules/es.typed-array.find-index.js");
  954. require2("core-js/modules/es.typed-array.for-each.js");
  955. require2("core-js/modules/es.typed-array.includes.js");
  956. require2("core-js/modules/es.typed-array.index-of.js");
  957. require2("core-js/modules/es.typed-array.iterator.js");
  958. require2("core-js/modules/es.typed-array.join.js");
  959. require2("core-js/modules/es.typed-array.last-index-of.js");
  960. require2("core-js/modules/es.typed-array.map.js");
  961. require2("core-js/modules/es.typed-array.reduce.js");
  962. require2("core-js/modules/es.typed-array.reduce-right.js");
  963. require2("core-js/modules/es.typed-array.reverse.js");
  964. require2("core-js/modules/es.typed-array.set.js");
  965. require2("core-js/modules/es.typed-array.slice.js");
  966. require2("core-js/modules/es.typed-array.some.js");
  967. require2("core-js/modules/es.typed-array.sort.js");
  968. require2("core-js/modules/es.typed-array.subarray.js");
  969. require2("core-js/modules/es.typed-array.to-locale-string.js");
  970. require2("core-js/modules/es.typed-array.to-string.js");
  971. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  972. var util = require2("util");
  973. var path = require2("path");
  974. var mime = require2("mime");
  975. var copy = require2("copy-to");
  976. var _require = require2("../common/utils/isBlob"), isBlob = _require.isBlob;
  977. var _require2 = require2("../common/utils/isFile"), isFile = _require2.isFile;
  978. var _require3 = require2("../common/utils/isBuffer"), isBuffer = _require3.isBuffer;
  979. var proto = exports3;
  980. proto.multipartUpload = function() {
  981. var _multipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file) {
  982. var options, minPartSize, fileSize, result, ret, initResult, uploadId, partSize, checkpoint, _args = arguments;
  983. return _regenerator.default.wrap(function _callee$(_context) {
  984. while (1) {
  985. switch (_context.prev = _context.next) {
  986. case 0:
  987. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  988. this.resetCancelFlag();
  989. options.disabledMD5 = options.disabledMD5 === void 0 ? true : !!options.disabledMD5;
  990. if (!(options.checkpoint && options.checkpoint.uploadId)) {
  991. _context.next = 8;
  992. break;
  993. }
  994. if (file && isFile(file))
  995. options.checkpoint.file = file;
  996. _context.next = 7;
  997. return this._resumeMultipart(options.checkpoint, options);
  998. case 7:
  999. return _context.abrupt("return", _context.sent);
  1000. case 8:
  1001. minPartSize = 100 * 1024;
  1002. if (!options.mime) {
  1003. if (isFile(file)) {
  1004. options.mime = mime.getType(path.extname(file.name));
  1005. } else if (isBlob(file)) {
  1006. options.mime = file.type;
  1007. } else if (isBuffer(file)) {
  1008. options.mime = "";
  1009. } else {
  1010. options.mime = mime.getType(path.extname(file));
  1011. }
  1012. }
  1013. options.headers = options.headers || {};
  1014. this._convertMetaToHeaders(options.meta, options.headers);
  1015. _context.next = 14;
  1016. return this._getFileSize(file);
  1017. case 14:
  1018. fileSize = _context.sent;
  1019. if (!(fileSize < minPartSize)) {
  1020. _context.next = 26;
  1021. break;
  1022. }
  1023. options.contentLength = fileSize;
  1024. _context.next = 19;
  1025. return this.put(name, file, options);
  1026. case 19:
  1027. result = _context.sent;
  1028. if (!(options && options.progress)) {
  1029. _context.next = 23;
  1030. break;
  1031. }
  1032. _context.next = 23;
  1033. return options.progress(1);
  1034. case 23:
  1035. ret = {
  1036. res: result.res,
  1037. bucket: this.options.bucket,
  1038. name,
  1039. etag: result.res.headers.etag
  1040. };
  1041. if (options.headers && options.headers["x-oss-callback"] || options.callback) {
  1042. ret.data = result.data;
  1043. }
  1044. return _context.abrupt("return", ret);
  1045. case 26:
  1046. if (!(options.partSize && !(parseInt(options.partSize, 10) === options.partSize))) {
  1047. _context.next = 28;
  1048. break;
  1049. }
  1050. throw new Error("partSize must be int number");
  1051. case 28:
  1052. if (!(options.partSize && options.partSize < minPartSize)) {
  1053. _context.next = 30;
  1054. break;
  1055. }
  1056. throw new Error("partSize must not be smaller than ".concat(minPartSize));
  1057. case 30:
  1058. _context.next = 32;
  1059. return this.initMultipartUpload(name, options);
  1060. case 32:
  1061. initResult = _context.sent;
  1062. uploadId = initResult.uploadId;
  1063. partSize = this._getPartSize(fileSize, options.partSize);
  1064. checkpoint = {
  1065. file,
  1066. name,
  1067. fileSize,
  1068. partSize,
  1069. uploadId,
  1070. doneParts: []
  1071. };
  1072. if (!(options && options.progress)) {
  1073. _context.next = 39;
  1074. break;
  1075. }
  1076. _context.next = 39;
  1077. return options.progress(0, checkpoint, initResult.res);
  1078. case 39:
  1079. _context.next = 41;
  1080. return this._resumeMultipart(checkpoint, options);
  1081. case 41:
  1082. return _context.abrupt("return", _context.sent);
  1083. case 42:
  1084. case "end":
  1085. return _context.stop();
  1086. }
  1087. }
  1088. }, _callee, this);
  1089. }));
  1090. function multipartUpload(_x, _x2) {
  1091. return _multipartUpload.apply(this, arguments);
  1092. }
  1093. return multipartUpload;
  1094. }();
  1095. proto._resumeMultipart = function() {
  1096. var _resumeMultipart2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(checkpoint, options) {
  1097. var that, file, fileSize, partSize, uploadId, doneParts, name, internalDoneParts, partOffs, numParts, multipartFinish, uploadPartJob, all, done, todo, defaultParallel, parallel, jobErr, abortEvent;
  1098. return _regenerator.default.wrap(function _callee3$(_context3) {
  1099. while (1) {
  1100. switch (_context3.prev = _context3.next) {
  1101. case 0:
  1102. that = this;
  1103. if (!this.isCancel()) {
  1104. _context3.next = 3;
  1105. break;
  1106. }
  1107. throw this._makeCancelEvent();
  1108. case 3:
  1109. file = checkpoint.file, fileSize = checkpoint.fileSize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name;
  1110. internalDoneParts = [];
  1111. if (doneParts.length > 0) {
  1112. copy(doneParts).to(internalDoneParts);
  1113. }
  1114. partOffs = this._divideParts(fileSize, partSize);
  1115. numParts = partOffs.length;
  1116. multipartFinish = false;
  1117. uploadPartJob = function uploadPartJob2(self2, partNo) {
  1118. return new Promise(function() {
  1119. var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(resolve, reject) {
  1120. var pi, content, data, result, tempErr;
  1121. return _regenerator.default.wrap(function _callee2$(_context2) {
  1122. while (1) {
  1123. switch (_context2.prev = _context2.next) {
  1124. case 0:
  1125. _context2.prev = 0;
  1126. if (self2.isCancel()) {
  1127. _context2.next = 29;
  1128. break;
  1129. }
  1130. pi = partOffs[partNo - 1];
  1131. _context2.next = 5;
  1132. return self2._createBuffer(file, pi.start, pi.end);
  1133. case 5:
  1134. content = _context2.sent;
  1135. data = {
  1136. content,
  1137. size: pi.end - pi.start
  1138. };
  1139. _context2.prev = 7;
  1140. _context2.next = 10;
  1141. return self2._uploadPart(name, uploadId, partNo, data, options);
  1142. case 10:
  1143. result = _context2.sent;
  1144. _context2.next = 18;
  1145. break;
  1146. case 13:
  1147. _context2.prev = 13;
  1148. _context2.t0 = _context2["catch"](7);
  1149. if (!(_context2.t0.status === 404)) {
  1150. _context2.next = 17;
  1151. break;
  1152. }
  1153. throw self2._makeAbortEvent();
  1154. case 17:
  1155. throw _context2.t0;
  1156. case 18:
  1157. if (!(!self2.isCancel() && !multipartFinish)) {
  1158. _context2.next = 26;
  1159. break;
  1160. }
  1161. checkpoint.doneParts.push({
  1162. number: partNo,
  1163. etag: result.res.headers.etag
  1164. });
  1165. if (!options.progress) {
  1166. _context2.next = 23;
  1167. break;
  1168. }
  1169. _context2.next = 23;
  1170. return options.progress(doneParts.length / (numParts + 1), checkpoint, result.res);
  1171. case 23:
  1172. resolve({
  1173. number: partNo,
  1174. etag: result.res.headers.etag
  1175. });
  1176. _context2.next = 27;
  1177. break;
  1178. case 26:
  1179. resolve();
  1180. case 27:
  1181. _context2.next = 30;
  1182. break;
  1183. case 29:
  1184. resolve();
  1185. case 30:
  1186. _context2.next = 41;
  1187. break;
  1188. case 32:
  1189. _context2.prev = 32;
  1190. _context2.t1 = _context2["catch"](0);
  1191. tempErr = new Error();
  1192. tempErr.name = _context2.t1.name;
  1193. tempErr.message = _context2.t1.message;
  1194. tempErr.stack = _context2.t1.stack;
  1195. tempErr.partNum = partNo;
  1196. copy(_context2.t1).to(tempErr);
  1197. reject(tempErr);
  1198. case 41:
  1199. case "end":
  1200. return _context2.stop();
  1201. }
  1202. }
  1203. }, _callee2, null, [[0, 32], [7, 13]]);
  1204. }));
  1205. return function(_x5, _x6) {
  1206. return _ref.apply(this, arguments);
  1207. };
  1208. }());
  1209. };
  1210. all = Array.from(new Array(numParts), function(x, i) {
  1211. return i + 1;
  1212. });
  1213. done = internalDoneParts.map(function(p) {
  1214. return p.number;
  1215. });
  1216. todo = all.filter(function(p) {
  1217. return done.indexOf(p) < 0;
  1218. });
  1219. defaultParallel = 5;
  1220. parallel = options.parallel || defaultParallel;
  1221. _context3.next = 17;
  1222. return this._parallel(todo, parallel, function(value) {
  1223. return new Promise(function(resolve, reject) {
  1224. uploadPartJob(that, value).then(function(result) {
  1225. if (result) {
  1226. internalDoneParts.push(result);
  1227. }
  1228. resolve();
  1229. }).catch(function(err) {
  1230. reject(err);
  1231. });
  1232. });
  1233. });
  1234. case 17:
  1235. jobErr = _context3.sent;
  1236. multipartFinish = true;
  1237. abortEvent = jobErr.find(function(err) {
  1238. return err.name === "abort";
  1239. });
  1240. if (!abortEvent) {
  1241. _context3.next = 22;
  1242. break;
  1243. }
  1244. throw abortEvent;
  1245. case 22:
  1246. if (!this.isCancel()) {
  1247. _context3.next = 25;
  1248. break;
  1249. }
  1250. uploadPartJob = null;
  1251. throw this._makeCancelEvent();
  1252. case 25:
  1253. if (!(jobErr && jobErr.length > 0)) {
  1254. _context3.next = 28;
  1255. break;
  1256. }
  1257. jobErr[0].message = "Failed to upload some parts with error: ".concat(jobErr[0].toString(), " part_num: ").concat(jobErr[0].partNum);
  1258. throw jobErr[0];
  1259. case 28:
  1260. _context3.next = 30;
  1261. return this.completeMultipartUpload(name, uploadId, internalDoneParts, options);
  1262. case 30:
  1263. return _context3.abrupt("return", _context3.sent);
  1264. case 31:
  1265. case "end":
  1266. return _context3.stop();
  1267. }
  1268. }
  1269. }, _callee3, this);
  1270. }));
  1271. function _resumeMultipart(_x3, _x4) {
  1272. return _resumeMultipart2.apply(this, arguments);
  1273. }
  1274. return _resumeMultipart;
  1275. }();
  1276. proto._getFileSize = function() {
  1277. var _getFileSize2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(file) {
  1278. return _regenerator.default.wrap(function _callee4$(_context4) {
  1279. while (1) {
  1280. switch (_context4.prev = _context4.next) {
  1281. case 0:
  1282. if (!isBuffer(file)) {
  1283. _context4.next = 4;
  1284. break;
  1285. }
  1286. return _context4.abrupt("return", file.length);
  1287. case 4:
  1288. if (!(isBlob(file) || isFile(file))) {
  1289. _context4.next = 6;
  1290. break;
  1291. }
  1292. return _context4.abrupt("return", file.size);
  1293. case 6:
  1294. throw new Error("_getFileSize requires Buffer/File/Blob.");
  1295. case 7:
  1296. case "end":
  1297. return _context4.stop();
  1298. }
  1299. }
  1300. }, _callee4);
  1301. }));
  1302. function _getFileSize(_x7) {
  1303. return _getFileSize2.apply(this, arguments);
  1304. }
  1305. return _getFileSize;
  1306. }();
  1307. var _require4 = require2("stream"), Readable = _require4.Readable;
  1308. function WebFileReadStream(file, options) {
  1309. if (!(this instanceof WebFileReadStream)) {
  1310. return new WebFileReadStream(file, options);
  1311. }
  1312. Readable.call(this, options);
  1313. this.file = file;
  1314. this.reader = new FileReader();
  1315. this.start = 0;
  1316. this.finish = false;
  1317. this.fileBuffer = null;
  1318. }
  1319. util.inherits(WebFileReadStream, Readable);
  1320. WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) {
  1321. if (this.fileBuffer) {
  1322. var pushRet = true;
  1323. while (pushRet && this.fileBuffer && this.start < this.fileBuffer.length) {
  1324. var start = this.start;
  1325. var end = start + size;
  1326. end = end > this.fileBuffer.length ? this.fileBuffer.length : end;
  1327. this.start = end;
  1328. pushRet = this.push(this.fileBuffer.slice(start, end));
  1329. }
  1330. }
  1331. };
  1332. WebFileReadStream.prototype._read = function _read(size) {
  1333. if (this.file && this.start >= this.file.size || this.fileBuffer && this.start >= this.fileBuffer.length || this.finish || this.start === 0 && !this.file) {
  1334. if (!this.finish) {
  1335. this.fileBuffer = null;
  1336. this.finish = true;
  1337. }
  1338. this.push(null);
  1339. return;
  1340. }
  1341. var defaultReadSize = 16 * 1024;
  1342. size = size || defaultReadSize;
  1343. var that = this;
  1344. this.reader.onload = function onload(e) {
  1345. that.fileBuffer = Buffer.from(new Uint8Array(e.target.result));
  1346. that.file = null;
  1347. that.readFileAndPush(size);
  1348. };
  1349. if (this.start === 0) {
  1350. this.reader.readAsArrayBuffer(this.file);
  1351. } else {
  1352. this.readFileAndPush(size);
  1353. }
  1354. };
  1355. function getBuffer(file) {
  1356. if (file.arrayBuffer)
  1357. return file.arrayBuffer();
  1358. return new Promise(function(resolve, reject) {
  1359. var reader = new FileReader();
  1360. reader.onload = function(e) {
  1361. resolve(e.target.result);
  1362. };
  1363. reader.onerror = function(e) {
  1364. reject(e);
  1365. };
  1366. reader.readAsArrayBuffer(file);
  1367. });
  1368. }
  1369. proto._createBuffer = function() {
  1370. var _createBuffer2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(file, start, end) {
  1371. var _file, fileContent;
  1372. return _regenerator.default.wrap(function _callee5$(_context5) {
  1373. while (1) {
  1374. switch (_context5.prev = _context5.next) {
  1375. case 0:
  1376. if (!(isBlob(file) || isFile(file))) {
  1377. _context5.next = 8;
  1378. break;
  1379. }
  1380. _file = file.slice(start, end);
  1381. _context5.next = 4;
  1382. return getBuffer(_file);
  1383. case 4:
  1384. fileContent = _context5.sent;
  1385. return _context5.abrupt("return", Buffer.from(fileContent));
  1386. case 8:
  1387. if (!isBuffer(file)) {
  1388. _context5.next = 12;
  1389. break;
  1390. }
  1391. return _context5.abrupt("return", file.subarray(start, end));
  1392. case 12:
  1393. throw new Error("_createBuffer requires File/Blob/Buffer.");
  1394. case 13:
  1395. case "end":
  1396. return _context5.stop();
  1397. }
  1398. }
  1399. }, _callee5);
  1400. }));
  1401. function _createBuffer(_x8, _x9, _x10) {
  1402. return _createBuffer2.apply(this, arguments);
  1403. }
  1404. return _createBuffer;
  1405. }();
  1406. proto._getPartSize = function _getPartSize(fileSize, partSize) {
  1407. var maxNumParts = 10 * 1e3;
  1408. var defaultPartSize = 1 * 1024 * 1024;
  1409. if (!partSize)
  1410. partSize = defaultPartSize;
  1411. var safeSize = Math.ceil(fileSize / maxNumParts);
  1412. if (partSize < safeSize) {
  1413. partSize = safeSize;
  1414. console.warn("partSize has been set to ".concat(partSize, ", because the partSize you provided causes partNumber to be greater than 10,000"));
  1415. }
  1416. return partSize;
  1417. };
  1418. proto._divideParts = function _divideParts(fileSize, partSize) {
  1419. var numParts = Math.ceil(fileSize / partSize);
  1420. var partOffs = [];
  1421. for (var i = 0; i < numParts; i++) {
  1422. var start = partSize * i;
  1423. var end = Math.min(start + partSize, fileSize);
  1424. partOffs.push({
  1425. start,
  1426. end
  1427. });
  1428. }
  1429. return partOffs;
  1430. };
  1431. }).call(this);
  1432. }).call(this, require2("buffer").Buffer);
  1433. }, { "../common/utils/isBlob": 64, "../common/utils/isBuffer": 65, "../common/utils/isFile": 67, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "buffer": 90, "copy-to": 94, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/es.typed-array.copy-within.js": 315, "core-js/modules/es.typed-array.every.js": 316, "core-js/modules/es.typed-array.fill.js": 317, "core-js/modules/es.typed-array.filter.js": 318, "core-js/modules/es.typed-array.find-index.js": 319, "core-js/modules/es.typed-array.find.js": 320, "core-js/modules/es.typed-array.for-each.js": 321, "core-js/modules/es.typed-array.includes.js": 322, "core-js/modules/es.typed-array.index-of.js": 323, "core-js/modules/es.typed-array.iterator.js": 324, "core-js/modules/es.typed-array.join.js": 325, "core-js/modules/es.typed-array.last-index-of.js": 326, "core-js/modules/es.typed-array.map.js": 327, "core-js/modules/es.typed-array.reduce-right.js": 328, "core-js/modules/es.typed-array.reduce.js": 329, "core-js/modules/es.typed-array.reverse.js": 330, "core-js/modules/es.typed-array.set.js": 331, "core-js/modules/es.typed-array.slice.js": 332, "core-js/modules/es.typed-array.some.js": 333, "core-js/modules/es.typed-array.sort.js": 334, "core-js/modules/es.typed-array.subarray.js": 335, "core-js/modules/es.typed-array.to-locale-string.js": 336, "core-js/modules/es.typed-array.to-string.js": 337, "core-js/modules/es.typed-array.uint8-array.js": 338, "mime": 374, "path": 378, "stream": 398, "util": 419 }], 5: [function(require2, module3, exports3) {
  1434. "use strict";
  1435. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  1436. require2("core-js/modules/es.function.name.js");
  1437. require2("core-js/modules/es.object.to-string.js");
  1438. require2("core-js/modules/es.regexp.to-string.js");
  1439. require2("core-js/modules/es.array.map.js");
  1440. require2("core-js/modules/es.number.constructor.js");
  1441. require2("core-js/modules/es.object.assign.js");
  1442. require2("core-js/modules/es.regexp.exec.js");
  1443. require2("core-js/modules/es.string.replace.js");
  1444. require2("core-js/modules/web.dom-collections.for-each.js");
  1445. require2("core-js/modules/es.object.keys.js");
  1446. require2("core-js/modules/es.promise.js");
  1447. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  1448. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  1449. var fs = require2("fs");
  1450. var copy = require2("copy-to");
  1451. var path = require2("path");
  1452. var mime = require2("mime");
  1453. var callback = require2("../common/callback");
  1454. var merge = require2("merge-descriptors");
  1455. var _require = require2("../common/utils/isBlob"), isBlob = _require.isBlob;
  1456. var _require2 = require2("../common/utils/isFile"), isFile = _require2.isFile;
  1457. var _require3 = require2("../common/utils/isBuffer"), isBuffer = _require3.isBuffer;
  1458. var _require4 = require2("../common/utils/obj2xml"), obj2xml = _require4.obj2xml;
  1459. var proto = exports3;
  1460. proto.append = function() {
  1461. var _append = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file, options) {
  1462. var result;
  1463. return _regenerator.default.wrap(function _callee$(_context) {
  1464. while (1) {
  1465. switch (_context.prev = _context.next) {
  1466. case 0:
  1467. options = options || {};
  1468. if (options.position === void 0)
  1469. options.position = "0";
  1470. options.subres = {
  1471. append: "",
  1472. position: options.position
  1473. };
  1474. options.method = "POST";
  1475. _context.next = 6;
  1476. return this.put(name, file, options);
  1477. case 6:
  1478. result = _context.sent;
  1479. result.nextAppendPosition = result.res.headers["x-oss-next-append-position"];
  1480. return _context.abrupt("return", result);
  1481. case 9:
  1482. case "end":
  1483. return _context.stop();
  1484. }
  1485. }
  1486. }, _callee, this);
  1487. }));
  1488. function append(_x, _x2, _x3) {
  1489. return _append.apply(this, arguments);
  1490. }
  1491. return append;
  1492. }();
  1493. proto.put = function() {
  1494. var _put = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, file, options) {
  1495. var content, method, params, result, ret;
  1496. return _regenerator.default.wrap(function _callee2$(_context2) {
  1497. while (1) {
  1498. switch (_context2.prev = _context2.next) {
  1499. case 0:
  1500. options = options || {};
  1501. options.disabledMD5 = options.disabledMD5 === void 0 ? true : !!options.disabledMD5;
  1502. options.headers = options.headers || {};
  1503. name = this._objectName(name);
  1504. if (!isBuffer(file)) {
  1505. _context2.next = 8;
  1506. break;
  1507. }
  1508. content = file;
  1509. _context2.next = 19;
  1510. break;
  1511. case 8:
  1512. if (!(isBlob(file) || isFile(file))) {
  1513. _context2.next = 18;
  1514. break;
  1515. }
  1516. if (!options.mime) {
  1517. if (isFile(file)) {
  1518. options.mime = mime.getType(path.extname(file.name));
  1519. } else {
  1520. options.mime = file.type;
  1521. }
  1522. }
  1523. _context2.next = 12;
  1524. return this._createBuffer(file, 0, file.size);
  1525. case 12:
  1526. content = _context2.sent;
  1527. _context2.next = 15;
  1528. return this._getFileSize(file);
  1529. case 15:
  1530. options.contentLength = _context2.sent;
  1531. _context2.next = 19;
  1532. break;
  1533. case 18:
  1534. throw new TypeError("Must provide Buffer/Blob/File for put.");
  1535. case 19:
  1536. this._convertMetaToHeaders(options.meta, options.headers);
  1537. method = options.method || "PUT";
  1538. params = this._objectRequestParams(method, name, options);
  1539. callback.encodeCallback(params, options);
  1540. params.mime = options.mime;
  1541. params.disabledMD5 = options.disabledMD5;
  1542. params.content = content;
  1543. params.successStatuses = [200];
  1544. _context2.next = 29;
  1545. return this.request(params);
  1546. case 29:
  1547. result = _context2.sent;
  1548. ret = {
  1549. name,
  1550. url: this._objectUrl(name),
  1551. res: result.res
  1552. };
  1553. if (params.headers && params.headers["x-oss-callback"]) {
  1554. ret.data = JSON.parse(result.data.toString());
  1555. }
  1556. return _context2.abrupt("return", ret);
  1557. case 33:
  1558. case "end":
  1559. return _context2.stop();
  1560. }
  1561. }
  1562. }, _callee2, this);
  1563. }));
  1564. function put(_x4, _x5, _x6) {
  1565. return _put.apply(this, arguments);
  1566. }
  1567. return put;
  1568. }();
  1569. proto.putStream = function() {
  1570. var _putStream = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, stream, options) {
  1571. var method, params, result, ret;
  1572. return _regenerator.default.wrap(function _callee3$(_context3) {
  1573. while (1) {
  1574. switch (_context3.prev = _context3.next) {
  1575. case 0:
  1576. options = options || {};
  1577. options.headers = options.headers || {};
  1578. name = this._objectName(name);
  1579. if (options.contentLength) {
  1580. options.headers["Content-Length"] = options.contentLength;
  1581. } else {
  1582. options.headers["Transfer-Encoding"] = "chunked";
  1583. }
  1584. this._convertMetaToHeaders(options.meta, options.headers);
  1585. method = options.method || "PUT";
  1586. params = this._objectRequestParams(method, name, options);
  1587. callback.encodeCallback(params, options);
  1588. params.mime = options.mime;
  1589. params.stream = stream;
  1590. params.successStatuses = [200];
  1591. _context3.next = 13;
  1592. return this.request(params);
  1593. case 13:
  1594. result = _context3.sent;
  1595. ret = {
  1596. name,
  1597. url: this._objectUrl(name),
  1598. res: result.res
  1599. };
  1600. if (params.headers && params.headers["x-oss-callback"]) {
  1601. ret.data = JSON.parse(result.data.toString());
  1602. }
  1603. return _context3.abrupt("return", ret);
  1604. case 17:
  1605. case "end":
  1606. return _context3.stop();
  1607. }
  1608. }
  1609. }, _callee3, this);
  1610. }));
  1611. function putStream(_x7, _x8, _x9) {
  1612. return _putStream.apply(this, arguments);
  1613. }
  1614. return putStream;
  1615. }();
  1616. merge(proto, require2("../common/object/copyObject"));
  1617. merge(proto, require2("../common/object/getObjectTagging"));
  1618. merge(proto, require2("../common/object/putObjectTagging"));
  1619. merge(proto, require2("../common/object/deleteObjectTagging"));
  1620. merge(proto, require2("../common/image"));
  1621. merge(proto, require2("../common/object/getBucketVersions"));
  1622. merge(proto, require2("../common/object/getACL"));
  1623. merge(proto, require2("../common/object/putACL"));
  1624. merge(proto, require2("../common/object/head"));
  1625. merge(proto, require2("../common/object/delete"));
  1626. merge(proto, require2("../common/object/get"));
  1627. merge(proto, require2("../common/object/putSymlink"));
  1628. merge(proto, require2("../common/object/getSymlink"));
  1629. merge(proto, require2("../common/object/deleteMulti"));
  1630. merge(proto, require2("../common/object/getObjectMeta"));
  1631. merge(proto, require2("../common/object/getObjectUrl"));
  1632. merge(proto, require2("../common/object/generateObjectUrl"));
  1633. merge(proto, require2("../common/object/signatureUrl"));
  1634. merge(proto, require2("../common/object/asyncSignatureUrl"));
  1635. proto.putMeta = function() {
  1636. var _putMeta = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, meta, options) {
  1637. var copyResult;
  1638. return _regenerator.default.wrap(function _callee4$(_context4) {
  1639. while (1) {
  1640. switch (_context4.prev = _context4.next) {
  1641. case 0:
  1642. _context4.next = 2;
  1643. return this.copy(name, name, {
  1644. meta: meta || {},
  1645. timeout: options && options.timeout,
  1646. ctx: options && options.ctx
  1647. });
  1648. case 2:
  1649. copyResult = _context4.sent;
  1650. return _context4.abrupt("return", copyResult);
  1651. case 4:
  1652. case "end":
  1653. return _context4.stop();
  1654. }
  1655. }
  1656. }, _callee4, this);
  1657. }));
  1658. function putMeta(_x10, _x11, _x12) {
  1659. return _putMeta.apply(this, arguments);
  1660. }
  1661. return putMeta;
  1662. }();
  1663. proto.list = function() {
  1664. var _list = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(query, options) {
  1665. var params, result, objects, that, prefixes;
  1666. return _regenerator.default.wrap(function _callee5$(_context5) {
  1667. while (1) {
  1668. switch (_context5.prev = _context5.next) {
  1669. case 0:
  1670. params = this._objectRequestParams("GET", "", options);
  1671. params.query = query;
  1672. params.xmlResponse = true;
  1673. params.successStatuses = [200];
  1674. _context5.next = 6;
  1675. return this.request(params);
  1676. case 6:
  1677. result = _context5.sent;
  1678. objects = result.data.Contents || [];
  1679. that = this;
  1680. if (objects) {
  1681. if (!Array.isArray(objects)) {
  1682. objects = [objects];
  1683. }
  1684. objects = objects.map(function(obj) {
  1685. return {
  1686. name: obj.Key,
  1687. url: that._objectUrl(obj.Key),
  1688. lastModified: obj.LastModified,
  1689. etag: obj.ETag,
  1690. type: obj.Type,
  1691. size: Number(obj.Size),
  1692. storageClass: obj.StorageClass,
  1693. owner: {
  1694. id: obj.Owner.ID,
  1695. displayName: obj.Owner.DisplayName
  1696. }
  1697. };
  1698. });
  1699. }
  1700. prefixes = result.data.CommonPrefixes || null;
  1701. if (prefixes) {
  1702. if (!Array.isArray(prefixes)) {
  1703. prefixes = [prefixes];
  1704. }
  1705. prefixes = prefixes.map(function(item) {
  1706. return item.Prefix;
  1707. });
  1708. }
  1709. return _context5.abrupt("return", {
  1710. res: result.res,
  1711. objects,
  1712. prefixes,
  1713. nextMarker: result.data.NextMarker || null,
  1714. isTruncated: result.data.IsTruncated === "true"
  1715. });
  1716. case 13:
  1717. case "end":
  1718. return _context5.stop();
  1719. }
  1720. }
  1721. }, _callee5, this);
  1722. }));
  1723. function list(_x13, _x14) {
  1724. return _list.apply(this, arguments);
  1725. }
  1726. return list;
  1727. }();
  1728. proto.listV2 = function() {
  1729. var _listV = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(query) {
  1730. var options, continuation_token, params, result, objects, that, prefixes, _args6 = arguments;
  1731. return _regenerator.default.wrap(function _callee6$(_context6) {
  1732. while (1) {
  1733. switch (_context6.prev = _context6.next) {
  1734. case 0:
  1735. options = _args6.length > 1 && _args6[1] !== void 0 ? _args6[1] : {};
  1736. continuation_token = query["continuation-token"] || query.continuationToken;
  1737. if (continuation_token) {
  1738. options.subres = Object.assign({
  1739. "continuation-token": continuation_token
  1740. }, options.subres);
  1741. }
  1742. params = this._objectRequestParams("GET", "", options);
  1743. params.query = Object.assign({
  1744. "list-type": 2
  1745. }, query);
  1746. delete params.query["continuation-token"];
  1747. delete params.query.continuationToken;
  1748. params.xmlResponse = true;
  1749. params.successStatuses = [200];
  1750. _context6.next = 11;
  1751. return this.request(params);
  1752. case 11:
  1753. result = _context6.sent;
  1754. objects = result.data.Contents || [];
  1755. that = this;
  1756. if (objects) {
  1757. if (!Array.isArray(objects)) {
  1758. objects = [objects];
  1759. }
  1760. objects = objects.map(function(obj) {
  1761. var owner = null;
  1762. if (obj.Owner) {
  1763. owner = {
  1764. id: obj.Owner.ID,
  1765. displayName: obj.Owner.DisplayName
  1766. };
  1767. }
  1768. return {
  1769. name: obj.Key,
  1770. url: that._objectUrl(obj.Key),
  1771. lastModified: obj.LastModified,
  1772. etag: obj.ETag,
  1773. type: obj.Type,
  1774. size: Number(obj.Size),
  1775. storageClass: obj.StorageClass,
  1776. owner
  1777. };
  1778. });
  1779. }
  1780. prefixes = result.data.CommonPrefixes || null;
  1781. if (prefixes) {
  1782. if (!Array.isArray(prefixes)) {
  1783. prefixes = [prefixes];
  1784. }
  1785. prefixes = prefixes.map(function(item) {
  1786. return item.Prefix;
  1787. });
  1788. }
  1789. return _context6.abrupt("return", {
  1790. res: result.res,
  1791. objects,
  1792. prefixes,
  1793. isTruncated: result.data.IsTruncated === "true",
  1794. keyCount: +result.data.KeyCount,
  1795. continuationToken: result.data.ContinuationToken || null,
  1796. nextContinuationToken: result.data.NextContinuationToken || null
  1797. });
  1798. case 18:
  1799. case "end":
  1800. return _context6.stop();
  1801. }
  1802. }
  1803. }, _callee6, this);
  1804. }));
  1805. function listV2(_x15) {
  1806. return _listV.apply(this, arguments);
  1807. }
  1808. return listV2;
  1809. }();
  1810. proto.restore = function() {
  1811. var _restore = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name) {
  1812. var options, params, paramsXMLObj, result, _args7 = arguments;
  1813. return _regenerator.default.wrap(function _callee7$(_context7) {
  1814. while (1) {
  1815. switch (_context7.prev = _context7.next) {
  1816. case 0:
  1817. options = _args7.length > 1 && _args7[1] !== void 0 ? _args7[1] : {
  1818. type: "Archive"
  1819. };
  1820. options = options || {};
  1821. options.subres = Object.assign({
  1822. restore: ""
  1823. }, options.subres);
  1824. if (options.versionId) {
  1825. options.subres.versionId = options.versionId;
  1826. }
  1827. params = this._objectRequestParams("POST", name, options);
  1828. if (options.type === "ColdArchive") {
  1829. paramsXMLObj = {
  1830. RestoreRequest: {
  1831. Days: options.Days ? options.Days : 2,
  1832. JobParameters: {
  1833. Tier: options.JobParameters ? options.JobParameters : "Standard"
  1834. }
  1835. }
  1836. };
  1837. params.content = obj2xml(paramsXMLObj, {
  1838. headers: true
  1839. });
  1840. params.mime = "xml";
  1841. }
  1842. params.successStatuses = [202];
  1843. _context7.next = 9;
  1844. return this.request(params);
  1845. case 9:
  1846. result = _context7.sent;
  1847. return _context7.abrupt("return", {
  1848. res: result.res
  1849. });
  1850. case 11:
  1851. case "end":
  1852. return _context7.stop();
  1853. }
  1854. }
  1855. }, _callee7, this);
  1856. }));
  1857. function restore(_x16) {
  1858. return _restore.apply(this, arguments);
  1859. }
  1860. return restore;
  1861. }();
  1862. proto._objectUrl = function _objectUrl(name) {
  1863. return this._getReqUrl({
  1864. bucket: this.options.bucket,
  1865. object: name
  1866. });
  1867. };
  1868. proto._objectRequestParams = function _objectRequestParams(method, name, options) {
  1869. if (!this.options.bucket && !this.options.cname) {
  1870. throw new Error("Please create a bucket first");
  1871. }
  1872. options = options || {};
  1873. name = this._objectName(name);
  1874. var params = {
  1875. object: name,
  1876. bucket: this.options.bucket,
  1877. method,
  1878. subres: options && options.subres,
  1879. timeout: options && options.timeout,
  1880. ctx: options && options.ctx
  1881. };
  1882. if (options.headers) {
  1883. params.headers = {};
  1884. copy(options.headers).to(params.headers);
  1885. }
  1886. return params;
  1887. };
  1888. proto._objectName = function _objectName(name) {
  1889. return name.replace(/^\/+/, "");
  1890. };
  1891. proto._convertMetaToHeaders = function _convertMetaToHeaders(meta, headers) {
  1892. if (!meta) {
  1893. return;
  1894. }
  1895. Object.keys(meta).forEach(function(k) {
  1896. headers["x-oss-meta-".concat(k)] = meta[k];
  1897. });
  1898. };
  1899. proto._deleteFileSafe = function _deleteFileSafe(filepath) {
  1900. var _this = this;
  1901. return new Promise(function(resolve) {
  1902. fs.exists(filepath, function(exists) {
  1903. if (!exists) {
  1904. resolve();
  1905. } else {
  1906. fs.unlink(filepath, function(err) {
  1907. if (err) {
  1908. _this.debug("unlink %j error: %s", filepath, err, "error");
  1909. }
  1910. resolve();
  1911. });
  1912. }
  1913. });
  1914. });
  1915. };
  1916. }, { "../common/callback": 24, "../common/image": 27, "../common/object/asyncSignatureUrl": 31, "../common/object/copyObject": 32, "../common/object/delete": 33, "../common/object/deleteMulti": 34, "../common/object/deleteObjectTagging": 35, "../common/object/generateObjectUrl": 36, "../common/object/get": 37, "../common/object/getACL": 38, "../common/object/getBucketVersions": 39, "../common/object/getObjectMeta": 40, "../common/object/getObjectTagging": 41, "../common/object/getObjectUrl": 42, "../common/object/getSymlink": 43, "../common/object/head": 44, "../common/object/putACL": 45, "../common/object/putObjectTagging": 46, "../common/object/putSymlink": 47, "../common/object/signatureUrl": 48, "../common/utils/isBlob": 64, "../common/utils/isBuffer": 65, "../common/utils/isFile": 67, "../common/utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.number.constructor.js": 286, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339, "fs": 89, "merge-descriptors": 372, "mime": 374, "path": 378 }], 6: [function(require2, module3, exports3) {
  1917. "use strict";
  1918. exports3.version = "6.19.0";
  1919. }, {}], 7: [function(require2, module3, exports3) {
  1920. "use strict";
  1921. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  1922. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  1923. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  1924. Object.defineProperty(exports3, "__esModule", {
  1925. value: true
  1926. });
  1927. exports3.abortBucketWorm = void 0;
  1928. var checkBucketName_1 = require2("../utils/checkBucketName");
  1929. function abortBucketWorm(_x, _x2) {
  1930. return _abortBucketWorm.apply(this, arguments);
  1931. }
  1932. function _abortBucketWorm() {
  1933. _abortBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  1934. var params, result;
  1935. return _regenerator.default.wrap(function _callee$(_context) {
  1936. while (1) {
  1937. switch (_context.prev = _context.next) {
  1938. case 0:
  1939. checkBucketName_1.checkBucketName(name);
  1940. params = this._bucketRequestParams("DELETE", name, "worm", options);
  1941. _context.next = 4;
  1942. return this.request(params);
  1943. case 4:
  1944. result = _context.sent;
  1945. return _context.abrupt("return", {
  1946. res: result.res,
  1947. status: result.status
  1948. });
  1949. case 6:
  1950. case "end":
  1951. return _context.stop();
  1952. }
  1953. }
  1954. }, _callee, this);
  1955. }));
  1956. return _abortBucketWorm.apply(this, arguments);
  1957. }
  1958. exports3.abortBucketWorm = abortBucketWorm;
  1959. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 8: [function(require2, module3, exports3) {
  1960. "use strict";
  1961. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  1962. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  1963. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  1964. Object.defineProperty(exports3, "__esModule", {
  1965. value: true
  1966. });
  1967. exports3.completeBucketWorm = void 0;
  1968. var checkBucketName_1 = require2("../utils/checkBucketName");
  1969. function completeBucketWorm(_x, _x2, _x3) {
  1970. return _completeBucketWorm.apply(this, arguments);
  1971. }
  1972. function _completeBucketWorm() {
  1973. _completeBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, wormId, options) {
  1974. var params, result;
  1975. return _regenerator.default.wrap(function _callee$(_context) {
  1976. while (1) {
  1977. switch (_context.prev = _context.next) {
  1978. case 0:
  1979. checkBucketName_1.checkBucketName(name);
  1980. params = this._bucketRequestParams("POST", name, {
  1981. wormId
  1982. }, options);
  1983. _context.next = 4;
  1984. return this.request(params);
  1985. case 4:
  1986. result = _context.sent;
  1987. return _context.abrupt("return", {
  1988. res: result.res,
  1989. status: result.status
  1990. });
  1991. case 6:
  1992. case "end":
  1993. return _context.stop();
  1994. }
  1995. }
  1996. }, _callee, this);
  1997. }));
  1998. return _completeBucketWorm.apply(this, arguments);
  1999. }
  2000. exports3.completeBucketWorm = completeBucketWorm;
  2001. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 9: [function(require2, module3, exports3) {
  2002. "use strict";
  2003. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2004. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2005. require2("core-js/modules/es.object.assign.js");
  2006. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2007. Object.defineProperty(exports3, "__esModule", {
  2008. value: true
  2009. });
  2010. exports3.deleteBucketInventory = void 0;
  2011. var checkBucketName_1 = require2("../utils/checkBucketName");
  2012. function deleteBucketInventory(_x, _x2) {
  2013. return _deleteBucketInventory.apply(this, arguments);
  2014. }
  2015. function _deleteBucketInventory() {
  2016. _deleteBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventoryId) {
  2017. var options, subres, params, result, _args = arguments;
  2018. return _regenerator.default.wrap(function _callee$(_context) {
  2019. while (1) {
  2020. switch (_context.prev = _context.next) {
  2021. case 0:
  2022. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  2023. subres = Object.assign({
  2024. inventory: "",
  2025. inventoryId
  2026. }, options.subres);
  2027. checkBucketName_1.checkBucketName(bucketName);
  2028. params = this._bucketRequestParams("DELETE", bucketName, subres, options);
  2029. params.successStatuses = [204];
  2030. _context.next = 7;
  2031. return this.request(params);
  2032. case 7:
  2033. result = _context.sent;
  2034. return _context.abrupt("return", {
  2035. status: result.status,
  2036. res: result.res
  2037. });
  2038. case 9:
  2039. case "end":
  2040. return _context.stop();
  2041. }
  2042. }
  2043. }, _callee, this);
  2044. }));
  2045. return _deleteBucketInventory.apply(this, arguments);
  2046. }
  2047. exports3.deleteBucketInventory = deleteBucketInventory;
  2048. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 10: [function(require2, module3, exports3) {
  2049. "use strict";
  2050. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2051. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2052. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2053. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2054. var proto = exports3;
  2055. proto.deleteBucketLifecycle = function() {
  2056. var _deleteBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  2057. var params, result;
  2058. return _regenerator.default.wrap(function _callee$(_context) {
  2059. while (1) {
  2060. switch (_context.prev = _context.next) {
  2061. case 0:
  2062. _checkBucketName(name);
  2063. params = this._bucketRequestParams("DELETE", name, "lifecycle", options);
  2064. params.successStatuses = [204];
  2065. _context.next = 5;
  2066. return this.request(params);
  2067. case 5:
  2068. result = _context.sent;
  2069. return _context.abrupt("return", {
  2070. res: result.res
  2071. });
  2072. case 7:
  2073. case "end":
  2074. return _context.stop();
  2075. }
  2076. }
  2077. }, _callee, this);
  2078. }));
  2079. function deleteBucketLifecycle(_x, _x2) {
  2080. return _deleteBucketLifecycle.apply(this, arguments);
  2081. }
  2082. return deleteBucketLifecycle;
  2083. }();
  2084. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 11: [function(require2, module3, exports3) {
  2085. "use strict";
  2086. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2087. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2088. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2089. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2090. var proto = exports3;
  2091. proto.deleteBucketWebsite = function() {
  2092. var _deleteBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  2093. var params, result;
  2094. return _regenerator.default.wrap(function _callee$(_context) {
  2095. while (1) {
  2096. switch (_context.prev = _context.next) {
  2097. case 0:
  2098. _checkBucketName(name);
  2099. params = this._bucketRequestParams("DELETE", name, "website", options);
  2100. params.successStatuses = [204];
  2101. _context.next = 5;
  2102. return this.request(params);
  2103. case 5:
  2104. result = _context.sent;
  2105. return _context.abrupt("return", {
  2106. res: result.res
  2107. });
  2108. case 7:
  2109. case "end":
  2110. return _context.stop();
  2111. }
  2112. }
  2113. }, _callee, this);
  2114. }));
  2115. function deleteBucketWebsite(_x, _x2) {
  2116. return _deleteBucketWebsite.apply(this, arguments);
  2117. }
  2118. return deleteBucketWebsite;
  2119. }();
  2120. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 12: [function(require2, module3, exports3) {
  2121. "use strict";
  2122. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2123. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2124. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2125. Object.defineProperty(exports3, "__esModule", {
  2126. value: true
  2127. });
  2128. exports3.extendBucketWorm = void 0;
  2129. var checkBucketName_1 = require2("../utils/checkBucketName");
  2130. var obj2xml_1 = require2("../utils/obj2xml");
  2131. function extendBucketWorm(_x, _x2, _x3, _x4) {
  2132. return _extendBucketWorm.apply(this, arguments);
  2133. }
  2134. function _extendBucketWorm() {
  2135. _extendBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, wormId, days, options) {
  2136. var params, paramlXMLObJ, result;
  2137. return _regenerator.default.wrap(function _callee$(_context) {
  2138. while (1) {
  2139. switch (_context.prev = _context.next) {
  2140. case 0:
  2141. checkBucketName_1.checkBucketName(name);
  2142. params = this._bucketRequestParams("POST", name, {
  2143. wormExtend: "",
  2144. wormId
  2145. }, options);
  2146. paramlXMLObJ = {
  2147. ExtendWormConfiguration: {
  2148. RetentionPeriodInDays: days
  2149. }
  2150. };
  2151. params.mime = "xml";
  2152. params.content = obj2xml_1.obj2xml(paramlXMLObJ, {
  2153. headers: true
  2154. });
  2155. params.successStatuses = [200];
  2156. _context.next = 8;
  2157. return this.request(params);
  2158. case 8:
  2159. result = _context.sent;
  2160. return _context.abrupt("return", {
  2161. res: result.res,
  2162. status: result.status
  2163. });
  2164. case 10:
  2165. case "end":
  2166. return _context.stop();
  2167. }
  2168. }
  2169. }, _callee, this);
  2170. }));
  2171. return _extendBucketWorm.apply(this, arguments);
  2172. }
  2173. exports3.extendBucketWorm = extendBucketWorm;
  2174. }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 13: [function(require2, module3, exports3) {
  2175. "use strict";
  2176. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2177. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2178. require2("core-js/modules/es.object.assign.js");
  2179. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2180. Object.defineProperty(exports3, "__esModule", {
  2181. value: true
  2182. });
  2183. exports3.getBucketInventory = void 0;
  2184. var checkBucketName_1 = require2("../utils/checkBucketName");
  2185. var formatInventoryConfig_1 = require2("../utils/formatInventoryConfig");
  2186. function getBucketInventory(_x, _x2) {
  2187. return _getBucketInventory.apply(this, arguments);
  2188. }
  2189. function _getBucketInventory() {
  2190. _getBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventoryId) {
  2191. var options, subres, params, result, _args = arguments;
  2192. return _regenerator.default.wrap(function _callee$(_context) {
  2193. while (1) {
  2194. switch (_context.prev = _context.next) {
  2195. case 0:
  2196. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  2197. subres = Object.assign({
  2198. inventory: "",
  2199. inventoryId
  2200. }, options.subres);
  2201. checkBucketName_1.checkBucketName(bucketName);
  2202. params = this._bucketRequestParams("GET", bucketName, subres, options);
  2203. params.successStatuses = [200];
  2204. params.xmlResponse = true;
  2205. _context.next = 8;
  2206. return this.request(params);
  2207. case 8:
  2208. result = _context.sent;
  2209. return _context.abrupt("return", {
  2210. status: result.status,
  2211. res: result.res,
  2212. inventory: formatInventoryConfig_1.formatInventoryConfig(result.data)
  2213. });
  2214. case 10:
  2215. case "end":
  2216. return _context.stop();
  2217. }
  2218. }
  2219. }, _callee, this);
  2220. }));
  2221. return _getBucketInventory.apply(this, arguments);
  2222. }
  2223. exports3.getBucketInventory = getBucketInventory;
  2224. }, { "../utils/checkBucketName": 51, "../utils/formatInventoryConfig": 60, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 14: [function(require2, module3, exports3) {
  2225. "use strict";
  2226. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2227. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2228. require2("core-js/modules/es.array.map.js");
  2229. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2230. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2231. var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
  2232. var _require3 = require2("../utils/formatObjKey"), formatObjKey = _require3.formatObjKey;
  2233. var proto = exports3;
  2234. proto.getBucketLifecycle = function() {
  2235. var _getBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  2236. var params, result, rules;
  2237. return _regenerator.default.wrap(function _callee$(_context) {
  2238. while (1) {
  2239. switch (_context.prev = _context.next) {
  2240. case 0:
  2241. _checkBucketName(name);
  2242. params = this._bucketRequestParams("GET", name, "lifecycle", options);
  2243. params.successStatuses = [200];
  2244. params.xmlResponse = true;
  2245. _context.next = 6;
  2246. return this.request(params);
  2247. case 6:
  2248. result = _context.sent;
  2249. rules = result.data.Rule || null;
  2250. if (rules) {
  2251. if (!isArray(rules)) {
  2252. rules = [rules];
  2253. }
  2254. rules = rules.map(function(_) {
  2255. if (_.ID) {
  2256. _.id = _.ID;
  2257. delete _.ID;
  2258. }
  2259. if (_.Tag && !isArray(_.Tag)) {
  2260. _.Tag = [_.Tag];
  2261. }
  2262. return formatObjKey(_, "firstLowerCase");
  2263. });
  2264. }
  2265. return _context.abrupt("return", {
  2266. rules,
  2267. res: result.res
  2268. });
  2269. case 10:
  2270. case "end":
  2271. return _context.stop();
  2272. }
  2273. }
  2274. }, _callee, this);
  2275. }));
  2276. function getBucketLifecycle(_x, _x2) {
  2277. return _getBucketLifecycle.apply(this, arguments);
  2278. }
  2279. return getBucketLifecycle;
  2280. }();
  2281. }, { "../utils/checkBucketName": 51, "../utils/formatObjKey": 61, "../utils/isArray": 63, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280 }], 15: [function(require2, module3, exports3) {
  2282. "use strict";
  2283. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2284. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2285. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2286. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2287. var proto = exports3;
  2288. proto.getBucketVersioning = function() {
  2289. var _getBucketVersioning = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, options) {
  2290. var params, result, versionStatus;
  2291. return _regenerator.default.wrap(function _callee$(_context) {
  2292. while (1) {
  2293. switch (_context.prev = _context.next) {
  2294. case 0:
  2295. _checkBucketName(bucketName);
  2296. params = this._bucketRequestParams("GET", bucketName, "versioning", options);
  2297. params.xmlResponse = true;
  2298. params.successStatuses = [200];
  2299. _context.next = 6;
  2300. return this.request(params);
  2301. case 6:
  2302. result = _context.sent;
  2303. versionStatus = result.data.Status;
  2304. return _context.abrupt("return", {
  2305. status: result.status,
  2306. versionStatus,
  2307. res: result.res
  2308. });
  2309. case 9:
  2310. case "end":
  2311. return _context.stop();
  2312. }
  2313. }
  2314. }, _callee, this);
  2315. }));
  2316. function getBucketVersioning(_x, _x2) {
  2317. return _getBucketVersioning.apply(this, arguments);
  2318. }
  2319. return getBucketVersioning;
  2320. }();
  2321. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 16: [function(require2, module3, exports3) {
  2322. "use strict";
  2323. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2324. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2325. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2326. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2327. var _require2 = require2("../utils/isObject"), isObject = _require2.isObject;
  2328. var proto = exports3;
  2329. proto.getBucketWebsite = function() {
  2330. var _getBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  2331. var params, result, routingRules;
  2332. return _regenerator.default.wrap(function _callee$(_context) {
  2333. while (1) {
  2334. switch (_context.prev = _context.next) {
  2335. case 0:
  2336. _checkBucketName(name);
  2337. params = this._bucketRequestParams("GET", name, "website", options);
  2338. params.successStatuses = [200];
  2339. params.xmlResponse = true;
  2340. _context.next = 6;
  2341. return this.request(params);
  2342. case 6:
  2343. result = _context.sent;
  2344. routingRules = [];
  2345. if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) {
  2346. if (isObject(result.data.RoutingRules.RoutingRule)) {
  2347. routingRules = [result.data.RoutingRules.RoutingRule];
  2348. } else {
  2349. routingRules = result.data.RoutingRules.RoutingRule;
  2350. }
  2351. }
  2352. return _context.abrupt("return", {
  2353. index: result.data.IndexDocument && result.data.IndexDocument.Suffix || "",
  2354. supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || "false",
  2355. type: result.data.IndexDocument && result.data.IndexDocument.Type,
  2356. routingRules,
  2357. error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null,
  2358. res: result.res
  2359. });
  2360. case 10:
  2361. case "end":
  2362. return _context.stop();
  2363. }
  2364. }
  2365. }, _callee, this);
  2366. }));
  2367. function getBucketWebsite(_x, _x2) {
  2368. return _getBucketWebsite.apply(this, arguments);
  2369. }
  2370. return getBucketWebsite;
  2371. }();
  2372. }, { "../utils/checkBucketName": 51, "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 17: [function(require2, module3, exports3) {
  2373. "use strict";
  2374. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2375. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2376. require2("core-js/modules/es.object.assign.js");
  2377. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2378. Object.defineProperty(exports3, "__esModule", {
  2379. value: true
  2380. });
  2381. exports3.getBucketWorm = void 0;
  2382. var checkBucketName_1 = require2("../utils/checkBucketName");
  2383. var dataFix_1 = require2("../utils/dataFix");
  2384. function getBucketWorm(_x, _x2) {
  2385. return _getBucketWorm.apply(this, arguments);
  2386. }
  2387. function _getBucketWorm() {
  2388. _getBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  2389. var params, result;
  2390. return _regenerator.default.wrap(function _callee$(_context) {
  2391. while (1) {
  2392. switch (_context.prev = _context.next) {
  2393. case 0:
  2394. checkBucketName_1.checkBucketName(name);
  2395. params = this._bucketRequestParams("GET", name, "worm", options);
  2396. params.successStatuses = [200];
  2397. params.xmlResponse = true;
  2398. _context.next = 6;
  2399. return this.request(params);
  2400. case 6:
  2401. result = _context.sent;
  2402. dataFix_1.dataFix(result.data, {
  2403. lowerFirst: true,
  2404. rename: {
  2405. RetentionPeriodInDays: "days"
  2406. }
  2407. });
  2408. return _context.abrupt("return", Object.assign(Object.assign({}, result.data), {
  2409. res: result.res,
  2410. status: result.status
  2411. }));
  2412. case 9:
  2413. case "end":
  2414. return _context.stop();
  2415. }
  2416. }
  2417. }, _callee, this);
  2418. }));
  2419. return _getBucketWorm.apply(this, arguments);
  2420. }
  2421. exports3.getBucketWorm = getBucketWorm;
  2422. }, { "../utils/checkBucketName": 51, "../utils/dataFix": 57, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 18: [function(require2, module3, exports3) {
  2423. "use strict";
  2424. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2425. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2426. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2427. Object.defineProperty(exports3, "__esModule", {
  2428. value: true
  2429. });
  2430. exports3.initiateBucketWorm = void 0;
  2431. var obj2xml_1 = require2("../utils/obj2xml");
  2432. var checkBucketName_1 = require2("../utils/checkBucketName");
  2433. function initiateBucketWorm(_x, _x2, _x3) {
  2434. return _initiateBucketWorm.apply(this, arguments);
  2435. }
  2436. function _initiateBucketWorm() {
  2437. _initiateBucketWorm = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, days, options) {
  2438. var params, paramlXMLObJ, result;
  2439. return _regenerator.default.wrap(function _callee$(_context) {
  2440. while (1) {
  2441. switch (_context.prev = _context.next) {
  2442. case 0:
  2443. checkBucketName_1.checkBucketName(name);
  2444. params = this._bucketRequestParams("POST", name, "worm", options);
  2445. paramlXMLObJ = {
  2446. InitiateWormConfiguration: {
  2447. RetentionPeriodInDays: days
  2448. }
  2449. };
  2450. params.mime = "xml";
  2451. params.content = obj2xml_1.obj2xml(paramlXMLObJ, {
  2452. headers: true
  2453. });
  2454. params.successStatuses = [200];
  2455. _context.next = 8;
  2456. return this.request(params);
  2457. case 8:
  2458. result = _context.sent;
  2459. return _context.abrupt("return", {
  2460. res: result.res,
  2461. wormId: result.res.headers["x-oss-worm-id"],
  2462. status: result.status
  2463. });
  2464. case 10:
  2465. case "end":
  2466. return _context.stop();
  2467. }
  2468. }
  2469. }, _callee, this);
  2470. }));
  2471. return _initiateBucketWorm.apply(this, arguments);
  2472. }
  2473. exports3.initiateBucketWorm = initiateBucketWorm;
  2474. }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 19: [function(require2, module3, exports3) {
  2475. "use strict";
  2476. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2477. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2478. require2("core-js/modules/es.object.assign.js");
  2479. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2480. Object.defineProperty(exports3, "__esModule", {
  2481. value: true
  2482. });
  2483. exports3.listBucketInventory = void 0;
  2484. var checkBucketName_1 = require2("../utils/checkBucketName");
  2485. var formatInventoryConfig_1 = require2("../utils/formatInventoryConfig");
  2486. function listBucketInventory(_x) {
  2487. return _listBucketInventory.apply(this, arguments);
  2488. }
  2489. function _listBucketInventory() {
  2490. _listBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName) {
  2491. var options, continuationToken, subres, params, result, data, res, status, _args = arguments;
  2492. return _regenerator.default.wrap(function _callee$(_context) {
  2493. while (1) {
  2494. switch (_context.prev = _context.next) {
  2495. case 0:
  2496. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  2497. continuationToken = options.continuationToken;
  2498. subres = Object.assign({
  2499. inventory: ""
  2500. }, continuationToken && {
  2501. "continuation-token": continuationToken
  2502. }, options.subres);
  2503. checkBucketName_1.checkBucketName(bucketName);
  2504. params = this._bucketRequestParams("GET", bucketName, subres, options);
  2505. params.successStatuses = [200];
  2506. params.xmlResponse = true;
  2507. _context.next = 9;
  2508. return this.request(params);
  2509. case 9:
  2510. result = _context.sent;
  2511. data = result.data, res = result.res, status = result.status;
  2512. return _context.abrupt("return", {
  2513. isTruncated: data.IsTruncated === "true",
  2514. nextContinuationToken: data.NextContinuationToken,
  2515. inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true),
  2516. status,
  2517. res
  2518. });
  2519. case 12:
  2520. case "end":
  2521. return _context.stop();
  2522. }
  2523. }
  2524. }, _callee, this);
  2525. }));
  2526. return _listBucketInventory.apply(this, arguments);
  2527. }
  2528. exports3.listBucketInventory = listBucketInventory;
  2529. }, { "../utils/checkBucketName": 51, "../utils/formatInventoryConfig": 60, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 20: [function(require2, module3, exports3) {
  2530. "use strict";
  2531. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2532. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2533. require2("core-js/modules/es.object.assign.js");
  2534. require2("core-js/modules/es.array.concat.js");
  2535. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2536. Object.defineProperty(exports3, "__esModule", {
  2537. value: true
  2538. });
  2539. exports3.putBucketInventory = void 0;
  2540. var checkBucketName_1 = require2("../utils/checkBucketName");
  2541. var obj2xml_1 = require2("../utils/obj2xml");
  2542. function putBucketInventory(_x, _x2) {
  2543. return _putBucketInventory.apply(this, arguments);
  2544. }
  2545. function _putBucketInventory() {
  2546. _putBucketInventory = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(bucketName, inventory) {
  2547. var options, subres, OSSBucketDestination, optionalFields, includedObjectVersions, destinationBucketPrefix, rolePrefix, paramXMLObj, paramXML, params, result, _args = arguments;
  2548. return _regenerator.default.wrap(function _callee$(_context) {
  2549. while (1) {
  2550. switch (_context.prev = _context.next) {
  2551. case 0:
  2552. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  2553. subres = Object.assign({
  2554. inventory: "",
  2555. inventoryId: inventory.id
  2556. }, options.subres);
  2557. checkBucketName_1.checkBucketName(bucketName);
  2558. OSSBucketDestination = inventory.OSSBucketDestination, optionalFields = inventory.optionalFields, includedObjectVersions = inventory.includedObjectVersions;
  2559. destinationBucketPrefix = "acs:oss:::";
  2560. rolePrefix = "acs:ram::".concat(OSSBucketDestination.accountId, ":role/");
  2561. paramXMLObj = {
  2562. InventoryConfiguration: {
  2563. Id: inventory.id,
  2564. IsEnabled: inventory.isEnabled,
  2565. Filter: {
  2566. Prefix: inventory.prefix || ""
  2567. },
  2568. Destination: {
  2569. OSSBucketDestination: {
  2570. Format: OSSBucketDestination.format,
  2571. AccountId: OSSBucketDestination.accountId,
  2572. RoleArn: "".concat(rolePrefix).concat(OSSBucketDestination.rolename),
  2573. Bucket: "".concat(destinationBucketPrefix).concat(OSSBucketDestination.bucket),
  2574. Prefix: OSSBucketDestination.prefix || "",
  2575. Encryption: OSSBucketDestination.encryption || ""
  2576. }
  2577. },
  2578. Schedule: {
  2579. Frequency: inventory.frequency
  2580. },
  2581. IncludedObjectVersions: includedObjectVersions,
  2582. OptionalFields: {
  2583. Field: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.field) || []
  2584. }
  2585. }
  2586. };
  2587. paramXML = obj2xml_1.obj2xml(paramXMLObj, {
  2588. headers: true,
  2589. firstUpperCase: true
  2590. });
  2591. params = this._bucketRequestParams("PUT", bucketName, subres, options);
  2592. params.successStatuses = [200];
  2593. params.mime = "xml";
  2594. params.content = paramXML;
  2595. _context.next = 14;
  2596. return this.request(params);
  2597. case 14:
  2598. result = _context.sent;
  2599. return _context.abrupt("return", {
  2600. status: result.status,
  2601. res: result.res
  2602. });
  2603. case 16:
  2604. case "end":
  2605. return _context.stop();
  2606. }
  2607. }
  2608. }, _callee, this);
  2609. }));
  2610. return _putBucketInventory.apply(this, arguments);
  2611. }
  2612. exports3.putBucketInventory = putBucketInventory;
  2613. }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.assign.js": 287 }], 21: [function(require2, module3, exports3) {
  2614. "use strict";
  2615. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2616. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2617. require2("core-js/modules/es.object.to-string.js");
  2618. require2("core-js/modules/web.dom-collections.for-each.js");
  2619. require2("core-js/modules/es.regexp.exec.js");
  2620. require2("core-js/modules/es.array.includes.js");
  2621. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2622. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2623. var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
  2624. var _require3 = require2("../utils/deepCopy"), deepCopy = _require3.deepCopy;
  2625. var _require4 = require2("../utils/isObject"), isObject = _require4.isObject;
  2626. var _require5 = require2("../utils/obj2xml"), obj2xml = _require5.obj2xml;
  2627. var _require6 = require2("../utils/checkObjectTag"), checkObjectTag = _require6.checkObjectTag;
  2628. var _require7 = require2("../utils/getStrBytesCount"), getStrBytesCount = _require7.getStrBytesCount;
  2629. var proto = exports3;
  2630. proto.putBucketLifecycle = function() {
  2631. var _putBucketLifecycle = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, rules, options) {
  2632. var params, Rule, paramXMLObj, paramXML, result;
  2633. return _regenerator.default.wrap(function _callee$(_context) {
  2634. while (1) {
  2635. switch (_context.prev = _context.next) {
  2636. case 0:
  2637. _checkBucketName(name);
  2638. if (isArray(rules)) {
  2639. _context.next = 3;
  2640. break;
  2641. }
  2642. throw new Error("rules must be Array");
  2643. case 3:
  2644. params = this._bucketRequestParams("PUT", name, "lifecycle", options);
  2645. Rule = [];
  2646. paramXMLObj = {
  2647. LifecycleConfiguration: {
  2648. Rule
  2649. }
  2650. };
  2651. rules.forEach(function(_) {
  2652. defaultDaysAndDate2Expiration(_);
  2653. checkRule(_);
  2654. if (_.id) {
  2655. _.ID = _.id;
  2656. delete _.id;
  2657. }
  2658. Rule.push(_);
  2659. });
  2660. paramXML = obj2xml(paramXMLObj, {
  2661. headers: true,
  2662. firstUpperCase: true
  2663. });
  2664. params.content = paramXML;
  2665. params.mime = "xml";
  2666. params.successStatuses = [200];
  2667. _context.next = 13;
  2668. return this.request(params);
  2669. case 13:
  2670. result = _context.sent;
  2671. return _context.abrupt("return", {
  2672. res: result.res
  2673. });
  2674. case 15:
  2675. case "end":
  2676. return _context.stop();
  2677. }
  2678. }
  2679. }, _callee, this);
  2680. }));
  2681. function putBucketLifecycle(_x, _x2, _x3) {
  2682. return _putBucketLifecycle.apply(this, arguments);
  2683. }
  2684. return putBucketLifecycle;
  2685. }();
  2686. function defaultDaysAndDate2Expiration(obj) {
  2687. if (obj.days) {
  2688. obj.expiration = {
  2689. days: obj.days
  2690. };
  2691. }
  2692. if (obj.date) {
  2693. obj.expiration = {
  2694. createdBeforeDate: obj.date
  2695. };
  2696. }
  2697. }
  2698. function checkDaysAndDate(obj, key) {
  2699. var days = obj.days, createdBeforeDate = obj.createdBeforeDate;
  2700. if (!days && !createdBeforeDate) {
  2701. throw new Error("".concat(key, " must includes days or createdBeforeDate"));
  2702. } else if (days && !/^[1-9][0-9]*$/.test(days)) {
  2703. throw new Error("days must be a positive integer");
  2704. } else if (createdBeforeDate && !/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(createdBeforeDate)) {
  2705. throw new Error("createdBeforeDate must be date and conform to iso8601 format");
  2706. }
  2707. }
  2708. function handleCheckTag(tag) {
  2709. if (!isArray(tag) && !isObject(tag)) {
  2710. throw new Error("tag must be Object or Array");
  2711. }
  2712. tag = isObject(tag) ? [tag] : tag;
  2713. var tagObj = {};
  2714. var tagClone = deepCopy(tag);
  2715. tagClone.forEach(function(v) {
  2716. tagObj[v.key] = v.value;
  2717. });
  2718. checkObjectTag(tagObj);
  2719. }
  2720. function checkRule(rule) {
  2721. if (rule.id && getStrBytesCount(rule.id) > 255)
  2722. throw new Error("ID is composed of 255 bytes at most");
  2723. if (rule.prefix === void 0)
  2724. throw new Error("Rule must includes prefix");
  2725. if (!["Enabled", "Disabled"].includes(rule.status))
  2726. throw new Error("Status must be Enabled or Disabled");
  2727. if (rule.transition) {
  2728. if (!["IA", "Archive"].includes(rule.transition.storageClass))
  2729. throw new Error("StorageClass must be IA or Archive");
  2730. checkDaysAndDate(rule.transition, "Transition");
  2731. }
  2732. if (rule.expiration) {
  2733. if (!rule.expiration.expiredObjectDeleteMarker) {
  2734. checkDaysAndDate(rule.expiration, "Expiration");
  2735. } else if (rule.expiration.days || rule.expiration.createdBeforeDate) {
  2736. throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate");
  2737. }
  2738. }
  2739. if (rule.abortMultipartUpload) {
  2740. checkDaysAndDate(rule.abortMultipartUpload, "AbortMultipartUpload");
  2741. }
  2742. if (!rule.expiration && !rule.abortMultipartUpload && !rule.transition && !rule.noncurrentVersionTransition) {
  2743. throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");
  2744. }
  2745. if (rule.tag) {
  2746. if (rule.abortMultipartUpload) {
  2747. throw new Error("Tag cannot be used with abortMultipartUpload");
  2748. }
  2749. handleCheckTag(rule.tag);
  2750. }
  2751. }
  2752. }, { "../utils/checkBucketName": 51, "../utils/checkObjectTag": 54, "../utils/deepCopy": 58, "../utils/getStrBytesCount": 62, "../utils/isArray": 63, "../utils/isObject": 70, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/web.dom-collections.for-each.js": 339 }], 22: [function(require2, module3, exports3) {
  2753. "use strict";
  2754. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2755. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2756. require2("core-js/modules/es.array.includes.js");
  2757. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2758. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2759. var _require2 = require2("../utils/obj2xml"), obj2xml = _require2.obj2xml;
  2760. var proto = exports3;
  2761. proto.putBucketVersioning = function() {
  2762. var _putBucketVersioning = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, status) {
  2763. var options, params, paramXMLObj, result, _args = arguments;
  2764. return _regenerator.default.wrap(function _callee$(_context) {
  2765. while (1) {
  2766. switch (_context.prev = _context.next) {
  2767. case 0:
  2768. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  2769. _checkBucketName(name);
  2770. if (["Enabled", "Suspended"].includes(status)) {
  2771. _context.next = 4;
  2772. break;
  2773. }
  2774. throw new Error("status must be Enabled or Suspended");
  2775. case 4:
  2776. params = this._bucketRequestParams("PUT", name, "versioning", options);
  2777. paramXMLObj = {
  2778. VersioningConfiguration: {
  2779. Status: status
  2780. }
  2781. };
  2782. params.mime = "xml";
  2783. params.content = obj2xml(paramXMLObj, {
  2784. headers: true
  2785. });
  2786. _context.next = 10;
  2787. return this.request(params);
  2788. case 10:
  2789. result = _context.sent;
  2790. return _context.abrupt("return", {
  2791. res: result.res,
  2792. status: result.status
  2793. });
  2794. case 12:
  2795. case "end":
  2796. return _context.stop();
  2797. }
  2798. }
  2799. }, _callee, this);
  2800. }));
  2801. function putBucketVersioning(_x, _x2) {
  2802. return _putBucketVersioning.apply(this, arguments);
  2803. }
  2804. return putBucketVersioning;
  2805. }();
  2806. }, { "../utils/checkBucketName": 51, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.includes.js": 277 }], 23: [function(require2, module3, exports3) {
  2807. "use strict";
  2808. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  2809. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  2810. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  2811. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2812. var _require2 = require2("../utils/obj2xml"), obj2xml = _require2.obj2xml;
  2813. var _require3 = require2("../utils/isArray"), isArray = _require3.isArray;
  2814. var proto = exports3;
  2815. proto.putBucketWebsite = function() {
  2816. var _putBucketWebsite = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  2817. var config, options, params, IndexDocument, WebsiteConfiguration, website, result, _args = arguments;
  2818. return _regenerator.default.wrap(function _callee$(_context) {
  2819. while (1) {
  2820. switch (_context.prev = _context.next) {
  2821. case 0:
  2822. config = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  2823. options = _args.length > 2 ? _args[2] : void 0;
  2824. _checkBucketName(name);
  2825. params = this._bucketRequestParams("PUT", name, "website", options);
  2826. IndexDocument = {
  2827. Suffix: config.index || "index.html"
  2828. };
  2829. WebsiteConfiguration = {
  2830. IndexDocument
  2831. };
  2832. website = {
  2833. WebsiteConfiguration
  2834. };
  2835. if (config.supportSubDir) {
  2836. IndexDocument.SupportSubDir = config.supportSubDir;
  2837. }
  2838. if (config.type) {
  2839. IndexDocument.Type = config.type;
  2840. }
  2841. if (config.error) {
  2842. WebsiteConfiguration.ErrorDocument = {
  2843. Key: config.error
  2844. };
  2845. }
  2846. if (!(config.routingRules !== void 0)) {
  2847. _context.next = 14;
  2848. break;
  2849. }
  2850. if (isArray(config.routingRules)) {
  2851. _context.next = 13;
  2852. break;
  2853. }
  2854. throw new Error("RoutingRules must be Array");
  2855. case 13:
  2856. WebsiteConfiguration.RoutingRules = {
  2857. RoutingRule: config.routingRules
  2858. };
  2859. case 14:
  2860. website = obj2xml(website);
  2861. params.content = website;
  2862. params.mime = "xml";
  2863. params.successStatuses = [200];
  2864. _context.next = 20;
  2865. return this.request(params);
  2866. case 20:
  2867. result = _context.sent;
  2868. return _context.abrupt("return", {
  2869. res: result.res
  2870. });
  2871. case 22:
  2872. case "end":
  2873. return _context.stop();
  2874. }
  2875. }
  2876. }, _callee, this);
  2877. }));
  2878. function putBucketWebsite(_x) {
  2879. return _putBucketWebsite.apply(this, arguments);
  2880. }
  2881. return putBucketWebsite;
  2882. }();
  2883. }, { "../utils/checkBucketName": 51, "../utils/isArray": 63, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80 }], 24: [function(require2, module3, exports3) {
  2884. (function(Buffer) {
  2885. (function() {
  2886. "use strict";
  2887. require2("core-js/modules/es.object.to-string.js");
  2888. require2("core-js/modules/es.regexp.to-string.js");
  2889. require2("core-js/modules/web.dom-collections.for-each.js");
  2890. require2("core-js/modules/es.object.keys.js");
  2891. exports3.encodeCallback = function encodeCallback(reqParams, options) {
  2892. reqParams.headers = reqParams.headers || {};
  2893. if (!Object.prototype.hasOwnProperty.call(reqParams.headers, "x-oss-callback")) {
  2894. if (options.callback) {
  2895. var json = {
  2896. callbackUrl: encodeURI(options.callback.url),
  2897. callbackBody: options.callback.body
  2898. };
  2899. if (options.callback.host) {
  2900. json.callbackHost = options.callback.host;
  2901. }
  2902. if (options.callback.contentType) {
  2903. json.callbackBodyType = options.callback.contentType;
  2904. }
  2905. var callback = Buffer.from(JSON.stringify(json)).toString("base64");
  2906. reqParams.headers["x-oss-callback"] = callback;
  2907. if (options.callback.customValue) {
  2908. var callbackVar = {};
  2909. Object.keys(options.callback.customValue).forEach(function(key) {
  2910. callbackVar["x:".concat(key)] = options.callback.customValue[key].toString();
  2911. });
  2912. reqParams.headers["x-oss-callback-var"] = Buffer.from(JSON.stringify(callbackVar)).toString("base64");
  2913. }
  2914. }
  2915. }
  2916. };
  2917. }).call(this);
  2918. }).call(this, require2("buffer").Buffer);
  2919. }, { "buffer": 90, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/web.dom-collections.for-each.js": 339 }], 25: [function(require2, module3, exports3) {
  2920. "use strict";
  2921. require2("core-js/modules/es.array.concat.js");
  2922. require2("core-js/modules/es.regexp.exec.js");
  2923. require2("core-js/modules/es.string.replace.js");
  2924. require2("core-js/modules/es.object.to-string.js");
  2925. require2("core-js/modules/web.dom-collections.for-each.js");
  2926. var __importDefault = function(mod) {
  2927. return mod && mod.__esModule ? mod : {
  2928. "default": mod
  2929. };
  2930. };
  2931. Object.defineProperty(exports3, "__esModule", {
  2932. value: true
  2933. });
  2934. exports3.getReqUrl = void 0;
  2935. var copy_to_1 = __importDefault(require2("copy-to"));
  2936. var url_1 = __importDefault(require2("url"));
  2937. var merge_descriptors_1 = __importDefault(require2("merge-descriptors"));
  2938. var is_type_of_1 = __importDefault(require2("is-type-of"));
  2939. var isIP_1 = require2("../utils/isIP");
  2940. var checkConfigValid_1 = require2("../utils/checkConfigValid");
  2941. function getReqUrl(params) {
  2942. var ep = {};
  2943. var isCname = this.options.cname;
  2944. checkConfigValid_1.checkConfigValid(this.options.endpoint, "endpoint");
  2945. copy_to_1.default(this.options.endpoint, false).to(ep);
  2946. if (params.bucket && !isCname && !isIP_1.isIP(ep.hostname) && !this.options.sldEnable) {
  2947. ep.host = "".concat(params.bucket, ".").concat(ep.host);
  2948. }
  2949. var resourcePath = "/";
  2950. if (params.bucket && this.options.sldEnable) {
  2951. resourcePath += "".concat(params.bucket, "/");
  2952. }
  2953. if (params.object) {
  2954. resourcePath += this._escape(params.object).replace(/\+/g, "%2B");
  2955. }
  2956. ep.pathname = resourcePath;
  2957. var query = {};
  2958. if (params.query) {
  2959. merge_descriptors_1.default(query, params.query);
  2960. }
  2961. if (params.subres) {
  2962. var subresAsQuery = {};
  2963. if (is_type_of_1.default.string(params.subres)) {
  2964. subresAsQuery[params.subres] = "";
  2965. } else if (is_type_of_1.default.array(params.subres)) {
  2966. params.subres.forEach(function(k) {
  2967. subresAsQuery[k] = "";
  2968. });
  2969. } else {
  2970. subresAsQuery = params.subres;
  2971. }
  2972. merge_descriptors_1.default(query, subresAsQuery);
  2973. }
  2974. ep.query = query;
  2975. return url_1.default.format(ep);
  2976. }
  2977. exports3.getReqUrl = getReqUrl;
  2978. }, { "../utils/checkConfigValid": 52, "../utils/isIP": 69, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339, "is-type-of": 466, "merge-descriptors": 372, "url": 472 }], 26: [function(require2, module3, exports3) {
  2979. "use strict";
  2980. require2("core-js/modules/es.array.concat.js");
  2981. require2("core-js/modules/es.object.assign.js");
  2982. require2("core-js/modules/es.string.trim.js");
  2983. var ms = require2("humanize-ms");
  2984. var urlutil = require2("url");
  2985. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  2986. var _require2 = require2("../utils/setRegion"), setRegion = _require2.setRegion;
  2987. var _require3 = require2("../utils/checkConfigValid"), checkConfigValid = _require3.checkConfigValid;
  2988. function setEndpoint(endpoint, secure) {
  2989. checkConfigValid(endpoint, "endpoint");
  2990. var url = urlutil.parse(endpoint);
  2991. if (!url.protocol) {
  2992. url = urlutil.parse("http".concat(secure ? "s" : "", "://").concat(endpoint));
  2993. }
  2994. if (url.protocol !== "http:" && url.protocol !== "https:") {
  2995. throw new Error("Endpoint protocol must be http or https.");
  2996. }
  2997. return url;
  2998. }
  2999. module3.exports = function(options) {
  3000. if (!options || !options.accessKeyId || !options.accessKeySecret) {
  3001. throw new Error("require accessKeyId, accessKeySecret");
  3002. }
  3003. if (options.stsToken && !options.refreshSTSToken && !options.refreshSTSTokenInterval) {
  3004. console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken、accessKeyId、accessKeySecret automatically when sts token has expired");
  3005. }
  3006. if (options.bucket) {
  3007. _checkBucketName(options.bucket);
  3008. }
  3009. var opts = Object.assign({
  3010. region: "oss-cn-hangzhou",
  3011. internal: false,
  3012. secure: false,
  3013. timeout: 6e4,
  3014. bucket: null,
  3015. endpoint: null,
  3016. cname: false,
  3017. isRequestPay: false,
  3018. sldEnable: false,
  3019. headerEncoding: "utf-8",
  3020. refreshSTSToken: null,
  3021. refreshSTSTokenInterval: 6e4 * 5,
  3022. retryMax: 0
  3023. }, options);
  3024. opts.accessKeyId = opts.accessKeyId.trim();
  3025. opts.accessKeySecret = opts.accessKeySecret.trim();
  3026. if (opts.timeout) {
  3027. opts.timeout = ms(opts.timeout);
  3028. }
  3029. if (opts.endpoint) {
  3030. opts.endpoint = setEndpoint(opts.endpoint, opts.secure);
  3031. } else if (opts.region) {
  3032. opts.endpoint = setRegion(opts.region, opts.internal, opts.secure);
  3033. } else {
  3034. throw new Error("require options.endpoint or options.region");
  3035. }
  3036. opts.inited = true;
  3037. return opts;
  3038. };
  3039. }, { "../utils/checkBucketName": 51, "../utils/checkConfigValid": 52, "../utils/setRegion": 75, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.string.trim.js": 308, "humanize-ms": 356, "url": 472 }], 27: [function(require2, module3, exports3) {
  3040. "use strict";
  3041. var merge = require2("merge-descriptors");
  3042. var proto = exports3;
  3043. merge(proto, require2("./processObjectSave"));
  3044. }, { "./processObjectSave": 28, "merge-descriptors": 372 }], 28: [function(require2, module3, exports3) {
  3045. "use strict";
  3046. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3047. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3048. require2("core-js/modules/es.array.concat.js");
  3049. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3050. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  3051. var querystring2 = require2("querystring");
  3052. var _require2 = require2("js-base64"), str2Base64 = _require2.Base64.encode;
  3053. var proto = exports3;
  3054. proto.processObjectSave = function() {
  3055. var _processObjectSave = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(sourceObject, targetObject, process, targetBucket) {
  3056. var params, bucketParam, content, result;
  3057. return _regenerator.default.wrap(function _callee$(_context) {
  3058. while (1) {
  3059. switch (_context.prev = _context.next) {
  3060. case 0:
  3061. checkArgs(sourceObject, "sourceObject");
  3062. checkArgs(targetObject, "targetObject");
  3063. checkArgs(process, "process");
  3064. targetObject = this._objectName(targetObject);
  3065. if (targetBucket) {
  3066. _checkBucketName(targetBucket);
  3067. }
  3068. params = this._objectRequestParams("POST", sourceObject, {
  3069. subres: "x-oss-process"
  3070. });
  3071. bucketParam = targetBucket ? ",b_".concat(str2Base64(targetBucket)) : "";
  3072. targetObject = str2Base64(targetObject);
  3073. content = {
  3074. "x-oss-process": "".concat(process, "|sys/saveas,o_").concat(targetObject).concat(bucketParam)
  3075. };
  3076. params.content = querystring2.stringify(content);
  3077. _context.next = 12;
  3078. return this.request(params);
  3079. case 12:
  3080. result = _context.sent;
  3081. return _context.abrupt("return", {
  3082. res: result.res,
  3083. status: result.res.status
  3084. });
  3085. case 14:
  3086. case "end":
  3087. return _context.stop();
  3088. }
  3089. }
  3090. }, _callee, this);
  3091. }));
  3092. function processObjectSave(_x, _x2, _x3, _x4) {
  3093. return _processObjectSave.apply(this, arguments);
  3094. }
  3095. return processObjectSave;
  3096. }();
  3097. function checkArgs(name, key) {
  3098. if (!name) {
  3099. throw new Error("".concat(key, " is required"));
  3100. }
  3101. if (typeof name !== "string") {
  3102. throw new Error("".concat(key, " must be String"));
  3103. }
  3104. }
  3105. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "js-base64": 371, "querystring": 385 }], 29: [function(require2, module3, exports3) {
  3106. "use strict";
  3107. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3108. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3109. require2("core-js/modules/es.array.concat.js");
  3110. require2("core-js/modules/es.function.name.js");
  3111. require2("core-js/modules/es.object.to-string.js");
  3112. require2("core-js/modules/es.promise.js");
  3113. require2("core-js/modules/es.array.from.js");
  3114. require2("core-js/modules/es.string.iterator.js");
  3115. require2("core-js/modules/es.array.map.js");
  3116. require2("core-js/modules/es.array.filter.js");
  3117. require2("core-js/modules/es.array.find.js");
  3118. require2("core-js/modules/es.regexp.to-string.js");
  3119. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3120. var debug = require2("debug")("ali-oss:multipart-copy");
  3121. var copy = require2("copy-to");
  3122. var proto = exports3;
  3123. proto.uploadPartCopy = function() {
  3124. var _uploadPartCopy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, uploadId, partNo, range, sourceData) {
  3125. var options, versionId, copySource, params, result, _args = arguments;
  3126. return _regenerator.default.wrap(function _callee$(_context) {
  3127. while (1) {
  3128. switch (_context.prev = _context.next) {
  3129. case 0:
  3130. options = _args.length > 5 && _args[5] !== void 0 ? _args[5] : {};
  3131. options.headers = options.headers || {};
  3132. versionId = options.versionId || options.subres && options.subres.versionId || null;
  3133. if (versionId) {
  3134. copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey), "?versionId=").concat(versionId);
  3135. } else {
  3136. copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey));
  3137. }
  3138. options.headers["x-oss-copy-source"] = copySource;
  3139. if (range) {
  3140. options.headers["x-oss-copy-source-range"] = "bytes=".concat(range);
  3141. }
  3142. options.subres = {
  3143. partNumber: partNo,
  3144. uploadId
  3145. };
  3146. params = this._objectRequestParams("PUT", name, options);
  3147. params.mime = options.mime;
  3148. params.successStatuses = [200];
  3149. _context.next = 12;
  3150. return this.request(params);
  3151. case 12:
  3152. result = _context.sent;
  3153. return _context.abrupt("return", {
  3154. name,
  3155. etag: result.res.headers.etag,
  3156. res: result.res
  3157. });
  3158. case 14:
  3159. case "end":
  3160. return _context.stop();
  3161. }
  3162. }
  3163. }, _callee, this);
  3164. }));
  3165. function uploadPartCopy(_x, _x2, _x3, _x4, _x5) {
  3166. return _uploadPartCopy.apply(this, arguments);
  3167. }
  3168. return uploadPartCopy;
  3169. }();
  3170. proto.multipartUploadCopy = function() {
  3171. var _multipartUploadCopy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, sourceData) {
  3172. var options, _options$versionId, versionId, metaOpt, objectMeta, fileSize, minPartSize, copySize, init, uploadId, partSize, checkpoint, _args2 = arguments;
  3173. return _regenerator.default.wrap(function _callee2$(_context2) {
  3174. while (1) {
  3175. switch (_context2.prev = _context2.next) {
  3176. case 0:
  3177. options = _args2.length > 2 && _args2[2] !== void 0 ? _args2[2] : {};
  3178. this.resetCancelFlag();
  3179. _options$versionId = options.versionId, versionId = _options$versionId === void 0 ? null : _options$versionId;
  3180. metaOpt = {
  3181. versionId
  3182. };
  3183. _context2.next = 6;
  3184. return this._getObjectMeta(sourceData.sourceBucketName, sourceData.sourceKey, metaOpt);
  3185. case 6:
  3186. objectMeta = _context2.sent;
  3187. fileSize = objectMeta.res.headers["content-length"];
  3188. sourceData.startOffset = sourceData.startOffset || 0;
  3189. sourceData.endOffset = sourceData.endOffset || fileSize;
  3190. if (!(options.checkpoint && options.checkpoint.uploadId)) {
  3191. _context2.next = 14;
  3192. break;
  3193. }
  3194. _context2.next = 13;
  3195. return this._resumeMultipartCopy(options.checkpoint, sourceData, options);
  3196. case 13:
  3197. return _context2.abrupt("return", _context2.sent);
  3198. case 14:
  3199. minPartSize = 100 * 1024;
  3200. copySize = sourceData.endOffset - sourceData.startOffset;
  3201. if (!(copySize < minPartSize)) {
  3202. _context2.next = 18;
  3203. break;
  3204. }
  3205. throw new Error("copySize must not be smaller than ".concat(minPartSize));
  3206. case 18:
  3207. if (!(options.partSize && options.partSize < minPartSize)) {
  3208. _context2.next = 20;
  3209. break;
  3210. }
  3211. throw new Error("partSize must not be smaller than ".concat(minPartSize));
  3212. case 20:
  3213. _context2.next = 22;
  3214. return this.initMultipartUpload(name, options);
  3215. case 22:
  3216. init = _context2.sent;
  3217. uploadId = init.uploadId;
  3218. partSize = this._getPartSize(copySize, options.partSize);
  3219. checkpoint = {
  3220. name,
  3221. copySize,
  3222. partSize,
  3223. uploadId,
  3224. doneParts: []
  3225. };
  3226. if (!(options && options.progress)) {
  3227. _context2.next = 29;
  3228. break;
  3229. }
  3230. _context2.next = 29;
  3231. return options.progress(0, checkpoint, init.res);
  3232. case 29:
  3233. _context2.next = 31;
  3234. return this._resumeMultipartCopy(checkpoint, sourceData, options);
  3235. case 31:
  3236. return _context2.abrupt("return", _context2.sent);
  3237. case 32:
  3238. case "end":
  3239. return _context2.stop();
  3240. }
  3241. }
  3242. }, _callee2, this);
  3243. }));
  3244. function multipartUploadCopy(_x6, _x7) {
  3245. return _multipartUploadCopy.apply(this, arguments);
  3246. }
  3247. return multipartUploadCopy;
  3248. }();
  3249. proto._resumeMultipartCopy = function() {
  3250. var _resumeMultipartCopy2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(checkpoint, sourceData, options) {
  3251. var _options$versionId2, versionId, metaOpt, copySize, partSize, uploadId, doneParts, name, partOffs, numParts, uploadPartCopyOptions, uploadPartJob, all, done, todo, defaultParallel, parallel, i, errors, abortEvent, err;
  3252. return _regenerator.default.wrap(function _callee4$(_context4) {
  3253. while (1) {
  3254. switch (_context4.prev = _context4.next) {
  3255. case 0:
  3256. if (!this.isCancel()) {
  3257. _context4.next = 2;
  3258. break;
  3259. }
  3260. throw this._makeCancelEvent();
  3261. case 2:
  3262. _options$versionId2 = options.versionId, versionId = _options$versionId2 === void 0 ? null : _options$versionId2;
  3263. metaOpt = {
  3264. versionId
  3265. };
  3266. copySize = checkpoint.copySize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name;
  3267. partOffs = this._divideMultipartCopyParts(copySize, partSize, sourceData.startOffset);
  3268. numParts = partOffs.length;
  3269. uploadPartCopyOptions = {
  3270. headers: {}
  3271. };
  3272. if (options.copyheaders) {
  3273. copy(options.copyheaders).to(uploadPartCopyOptions.headers);
  3274. }
  3275. if (versionId) {
  3276. copy(metaOpt).to(uploadPartCopyOptions);
  3277. }
  3278. uploadPartJob = function uploadPartJob2(self2, partNo, source) {
  3279. return new Promise(function() {
  3280. var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(resolve, reject) {
  3281. var pi, range, result;
  3282. return _regenerator.default.wrap(function _callee3$(_context3) {
  3283. while (1) {
  3284. switch (_context3.prev = _context3.next) {
  3285. case 0:
  3286. _context3.prev = 0;
  3287. if (self2.isCancel()) {
  3288. _context3.next = 22;
  3289. break;
  3290. }
  3291. pi = partOffs[partNo - 1];
  3292. range = "".concat(pi.start, "-").concat(pi.end - 1);
  3293. _context3.prev = 4;
  3294. _context3.next = 7;
  3295. return self2.uploadPartCopy(name, uploadId, partNo, range, source, uploadPartCopyOptions);
  3296. case 7:
  3297. result = _context3.sent;
  3298. _context3.next = 15;
  3299. break;
  3300. case 10:
  3301. _context3.prev = 10;
  3302. _context3.t0 = _context3["catch"](4);
  3303. if (!(_context3.t0.status === 404)) {
  3304. _context3.next = 14;
  3305. break;
  3306. }
  3307. throw self2._makeAbortEvent();
  3308. case 14:
  3309. throw _context3.t0;
  3310. case 15:
  3311. if (self2.isCancel()) {
  3312. _context3.next = 22;
  3313. break;
  3314. }
  3315. debug("content-range ".concat(result.res.headers["content-range"]));
  3316. doneParts.push({
  3317. number: partNo,
  3318. etag: result.res.headers.etag
  3319. });
  3320. checkpoint.doneParts = doneParts;
  3321. if (!(options && options.progress)) {
  3322. _context3.next = 22;
  3323. break;
  3324. }
  3325. _context3.next = 22;
  3326. return options.progress(doneParts.length / numParts, checkpoint, result.res);
  3327. case 22:
  3328. resolve();
  3329. _context3.next = 29;
  3330. break;
  3331. case 25:
  3332. _context3.prev = 25;
  3333. _context3.t1 = _context3["catch"](0);
  3334. _context3.t1.partNum = partNo;
  3335. reject(_context3.t1);
  3336. case 29:
  3337. case "end":
  3338. return _context3.stop();
  3339. }
  3340. }
  3341. }, _callee3, null, [[0, 25], [4, 10]]);
  3342. }));
  3343. return function(_x11, _x12) {
  3344. return _ref.apply(this, arguments);
  3345. };
  3346. }());
  3347. };
  3348. all = Array.from(new Array(numParts), function(x, i2) {
  3349. return i2 + 1;
  3350. });
  3351. done = doneParts.map(function(p) {
  3352. return p.number;
  3353. });
  3354. todo = all.filter(function(p) {
  3355. return done.indexOf(p) < 0;
  3356. });
  3357. defaultParallel = 5;
  3358. parallel = options.parallel || defaultParallel;
  3359. if (!(this.checkBrowserAndVersion("Internet Explorer", "10") || parallel === 1)) {
  3360. _context4.next = 28;
  3361. break;
  3362. }
  3363. i = 0;
  3364. case 18:
  3365. if (!(i < todo.length)) {
  3366. _context4.next = 26;
  3367. break;
  3368. }
  3369. if (!this.isCancel()) {
  3370. _context4.next = 21;
  3371. break;
  3372. }
  3373. throw this._makeCancelEvent();
  3374. case 21:
  3375. _context4.next = 23;
  3376. return uploadPartJob(this, todo[i], sourceData);
  3377. case 23:
  3378. i++;
  3379. _context4.next = 18;
  3380. break;
  3381. case 26:
  3382. _context4.next = 40;
  3383. break;
  3384. case 28:
  3385. _context4.next = 30;
  3386. return this._parallelNode(todo, parallel, uploadPartJob, sourceData);
  3387. case 30:
  3388. errors = _context4.sent;
  3389. abortEvent = errors.find(function(err2) {
  3390. return err2.name === "abort";
  3391. });
  3392. if (!abortEvent) {
  3393. _context4.next = 34;
  3394. break;
  3395. }
  3396. throw abortEvent;
  3397. case 34:
  3398. if (!this.isCancel()) {
  3399. _context4.next = 36;
  3400. break;
  3401. }
  3402. throw this._makeCancelEvent();
  3403. case 36:
  3404. if (!(errors && errors.length > 0)) {
  3405. _context4.next = 40;
  3406. break;
  3407. }
  3408. err = errors[0];
  3409. err.message = "Failed to copy some parts with error: ".concat(err.toString(), " part_num: ").concat(err.partNum);
  3410. throw err;
  3411. case 40:
  3412. _context4.next = 42;
  3413. return this.completeMultipartUpload(name, uploadId, doneParts, options);
  3414. case 42:
  3415. return _context4.abrupt("return", _context4.sent);
  3416. case 43:
  3417. case "end":
  3418. return _context4.stop();
  3419. }
  3420. }
  3421. }, _callee4, this);
  3422. }));
  3423. function _resumeMultipartCopy(_x8, _x9, _x10) {
  3424. return _resumeMultipartCopy2.apply(this, arguments);
  3425. }
  3426. return _resumeMultipartCopy;
  3427. }();
  3428. proto._divideMultipartCopyParts = function _divideMultipartCopyParts(fileSize, partSize, startOffset) {
  3429. var numParts = Math.ceil(fileSize / partSize);
  3430. var partOffs = [];
  3431. for (var i = 0; i < numParts; i++) {
  3432. var start = partSize * i + startOffset;
  3433. var end = Math.min(start + partSize, fileSize + startOffset);
  3434. partOffs.push({
  3435. start,
  3436. end
  3437. });
  3438. }
  3439. return partOffs;
  3440. };
  3441. proto._getObjectMeta = function() {
  3442. var _getObjectMeta2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(bucket, name, options) {
  3443. var currentBucket, data;
  3444. return _regenerator.default.wrap(function _callee5$(_context5) {
  3445. while (1) {
  3446. switch (_context5.prev = _context5.next) {
  3447. case 0:
  3448. currentBucket = this.getBucket();
  3449. this.setBucket(bucket);
  3450. _context5.next = 4;
  3451. return this.head(name, options);
  3452. case 4:
  3453. data = _context5.sent;
  3454. this.setBucket(currentBucket);
  3455. return _context5.abrupt("return", data);
  3456. case 7:
  3457. case "end":
  3458. return _context5.stop();
  3459. }
  3460. }
  3461. }, _callee5, this);
  3462. }));
  3463. function _getObjectMeta(_x13, _x14, _x15) {
  3464. return _getObjectMeta2.apply(this, arguments);
  3465. }
  3466. return _getObjectMeta;
  3467. }();
  3468. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.iterator.js": 303, "debug": 465 }], 30: [function(require2, module3, exports3) {
  3469. (function(process) {
  3470. (function() {
  3471. "use strict";
  3472. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3473. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3474. require2("core-js/modules/es.array.map.js");
  3475. require2("core-js/modules/es.array.filter.js");
  3476. require2("core-js/modules/es.object.to-string.js");
  3477. require2("core-js/modules/es.array.sort.js");
  3478. require2("core-js/modules/es.array.concat.js");
  3479. require2("core-js/modules/es.regexp.to-string.js");
  3480. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3481. var copy = require2("copy-to");
  3482. var callback = require2("./callback");
  3483. var _require = require2("./utils/deepCopy"), deepCopyWith = _require.deepCopyWith;
  3484. var _require2 = require2("./utils/isBuffer"), isBuffer = _require2.isBuffer;
  3485. var _require3 = require2("./utils/omit"), omit = _require3.omit;
  3486. var proto = exports3;
  3487. proto.listUploads = function() {
  3488. var _listUploads = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(query, options) {
  3489. var opt, params, result, uploads;
  3490. return _regenerator.default.wrap(function _callee$(_context) {
  3491. while (1) {
  3492. switch (_context.prev = _context.next) {
  3493. case 0:
  3494. options = options || {};
  3495. opt = {};
  3496. copy(options).to(opt);
  3497. opt.subres = "uploads";
  3498. params = this._objectRequestParams("GET", "", opt);
  3499. params.query = query;
  3500. params.xmlResponse = true;
  3501. params.successStatuses = [200];
  3502. _context.next = 10;
  3503. return this.request(params);
  3504. case 10:
  3505. result = _context.sent;
  3506. uploads = result.data.Upload || [];
  3507. if (!Array.isArray(uploads)) {
  3508. uploads = [uploads];
  3509. }
  3510. uploads = uploads.map(function(up) {
  3511. return {
  3512. name: up.Key,
  3513. uploadId: up.UploadId,
  3514. initiated: up.Initiated
  3515. };
  3516. });
  3517. return _context.abrupt("return", {
  3518. res: result.res,
  3519. uploads,
  3520. bucket: result.data.Bucket,
  3521. nextKeyMarker: result.data.NextKeyMarker,
  3522. nextUploadIdMarker: result.data.NextUploadIdMarker,
  3523. isTruncated: result.data.IsTruncated === "true"
  3524. });
  3525. case 15:
  3526. case "end":
  3527. return _context.stop();
  3528. }
  3529. }
  3530. }, _callee, this);
  3531. }));
  3532. function listUploads(_x, _x2) {
  3533. return _listUploads.apply(this, arguments);
  3534. }
  3535. return listUploads;
  3536. }();
  3537. proto.listParts = function() {
  3538. var _listParts = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(name, uploadId, query, options) {
  3539. var opt, params, result;
  3540. return _regenerator.default.wrap(function _callee2$(_context2) {
  3541. while (1) {
  3542. switch (_context2.prev = _context2.next) {
  3543. case 0:
  3544. options = options || {};
  3545. opt = {};
  3546. copy(options).to(opt);
  3547. opt.subres = {
  3548. uploadId
  3549. };
  3550. params = this._objectRequestParams("GET", name, opt);
  3551. params.query = query;
  3552. params.xmlResponse = true;
  3553. params.successStatuses = [200];
  3554. _context2.next = 10;
  3555. return this.request(params);
  3556. case 10:
  3557. result = _context2.sent;
  3558. return _context2.abrupt("return", {
  3559. res: result.res,
  3560. uploadId: result.data.UploadId,
  3561. bucket: result.data.Bucket,
  3562. name: result.data.Key,
  3563. partNumberMarker: result.data.PartNumberMarker,
  3564. nextPartNumberMarker: result.data.NextPartNumberMarker,
  3565. maxParts: result.data.MaxParts,
  3566. isTruncated: result.data.IsTruncated,
  3567. parts: result.data.Part || []
  3568. });
  3569. case 12:
  3570. case "end":
  3571. return _context2.stop();
  3572. }
  3573. }
  3574. }, _callee2, this);
  3575. }));
  3576. function listParts(_x3, _x4, _x5, _x6) {
  3577. return _listParts.apply(this, arguments);
  3578. }
  3579. return listParts;
  3580. }();
  3581. proto.abortMultipartUpload = function() {
  3582. var _abortMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(name, uploadId, options) {
  3583. var opt, params, result;
  3584. return _regenerator.default.wrap(function _callee3$(_context3) {
  3585. while (1) {
  3586. switch (_context3.prev = _context3.next) {
  3587. case 0:
  3588. this._stop();
  3589. options = options || {};
  3590. opt = {};
  3591. copy(options).to(opt);
  3592. opt.subres = {
  3593. uploadId
  3594. };
  3595. params = this._objectRequestParams("DELETE", name, opt);
  3596. params.successStatuses = [204];
  3597. _context3.next = 9;
  3598. return this.request(params);
  3599. case 9:
  3600. result = _context3.sent;
  3601. return _context3.abrupt("return", {
  3602. res: result.res
  3603. });
  3604. case 11:
  3605. case "end":
  3606. return _context3.stop();
  3607. }
  3608. }
  3609. }, _callee3, this);
  3610. }));
  3611. function abortMultipartUpload(_x7, _x8, _x9) {
  3612. return _abortMultipartUpload.apply(this, arguments);
  3613. }
  3614. return abortMultipartUpload;
  3615. }();
  3616. proto.initMultipartUpload = function() {
  3617. var _initMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(name, options) {
  3618. var opt, params, result;
  3619. return _regenerator.default.wrap(function _callee4$(_context4) {
  3620. while (1) {
  3621. switch (_context4.prev = _context4.next) {
  3622. case 0:
  3623. options = options || {};
  3624. opt = {};
  3625. copy(options).to(opt);
  3626. opt.headers = opt.headers || {};
  3627. this._convertMetaToHeaders(options.meta, opt.headers);
  3628. opt.subres = "uploads";
  3629. params = this._objectRequestParams("POST", name, opt);
  3630. params.mime = options.mime;
  3631. params.xmlResponse = true;
  3632. params.successStatuses = [200];
  3633. _context4.next = 12;
  3634. return this.request(params);
  3635. case 12:
  3636. result = _context4.sent;
  3637. return _context4.abrupt("return", {
  3638. res: result.res,
  3639. bucket: result.data.Bucket,
  3640. name: result.data.Key,
  3641. uploadId: result.data.UploadId
  3642. });
  3643. case 14:
  3644. case "end":
  3645. return _context4.stop();
  3646. }
  3647. }
  3648. }, _callee4, this);
  3649. }));
  3650. function initMultipartUpload(_x10, _x11) {
  3651. return _initMultipartUpload.apply(this, arguments);
  3652. }
  3653. return initMultipartUpload;
  3654. }();
  3655. proto.uploadPart = function() {
  3656. var _uploadPart2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(name, uploadId, partNo, file, start, end, options) {
  3657. var data, isBrowserEnv;
  3658. return _regenerator.default.wrap(function _callee5$(_context5) {
  3659. while (1) {
  3660. switch (_context5.prev = _context5.next) {
  3661. case 0:
  3662. data = {
  3663. size: end - start
  3664. };
  3665. isBrowserEnv = process && process.browser;
  3666. if (!isBrowserEnv) {
  3667. _context5.next = 8;
  3668. break;
  3669. }
  3670. _context5.next = 5;
  3671. return this._createBuffer(file, start, end);
  3672. case 5:
  3673. data.content = _context5.sent;
  3674. _context5.next = 11;
  3675. break;
  3676. case 8:
  3677. _context5.next = 10;
  3678. return this._createStream(file, start, end);
  3679. case 10:
  3680. data.stream = _context5.sent;
  3681. case 11:
  3682. _context5.next = 13;
  3683. return this._uploadPart(name, uploadId, partNo, data, options);
  3684. case 13:
  3685. return _context5.abrupt("return", _context5.sent);
  3686. case 14:
  3687. case "end":
  3688. return _context5.stop();
  3689. }
  3690. }
  3691. }, _callee5, this);
  3692. }));
  3693. function uploadPart(_x12, _x13, _x14, _x15, _x16, _x17, _x18) {
  3694. return _uploadPart2.apply(this, arguments);
  3695. }
  3696. return uploadPart;
  3697. }();
  3698. proto.completeMultipartUpload = function() {
  3699. var _completeMultipartUpload = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(name, uploadId, parts, options) {
  3700. var completeParts, xml, i, p, opt, params, result, ret;
  3701. return _regenerator.default.wrap(function _callee6$(_context6) {
  3702. while (1) {
  3703. switch (_context6.prev = _context6.next) {
  3704. case 0:
  3705. completeParts = parts.concat().sort(function(a, b) {
  3706. return a.number - b.number;
  3707. }).filter(function(item, index, arr) {
  3708. return !index || item.number !== arr[index - 1].number;
  3709. });
  3710. xml = '<?xml version="1.0" encoding="UTF-8"?>\n<CompleteMultipartUpload>\n';
  3711. for (i = 0; i < completeParts.length; i++) {
  3712. p = completeParts[i];
  3713. xml += "<Part>\n";
  3714. xml += "<PartNumber>".concat(p.number, "</PartNumber>\n");
  3715. xml += "<ETag>".concat(p.etag, "</ETag>\n");
  3716. xml += "</Part>\n";
  3717. }
  3718. xml += "</CompleteMultipartUpload>";
  3719. options = options || {};
  3720. opt = {};
  3721. opt = deepCopyWith(options, function(_) {
  3722. if (isBuffer(_))
  3723. return null;
  3724. });
  3725. opt.subres = {
  3726. uploadId
  3727. };
  3728. opt.headers = omit(opt.headers, ["x-oss-server-side-encryption", "x-oss-storage-class"]);
  3729. params = this._objectRequestParams("POST", name, opt);
  3730. callback.encodeCallback(params, opt);
  3731. params.mime = "xml";
  3732. params.content = xml;
  3733. if (!(params.headers && params.headers["x-oss-callback"])) {
  3734. params.xmlResponse = true;
  3735. }
  3736. params.successStatuses = [200];
  3737. _context6.next = 17;
  3738. return this.request(params);
  3739. case 17:
  3740. result = _context6.sent;
  3741. if (!options.progress) {
  3742. _context6.next = 21;
  3743. break;
  3744. }
  3745. _context6.next = 21;
  3746. return options.progress(1, null, result.res);
  3747. case 21:
  3748. ret = {
  3749. res: result.res,
  3750. bucket: params.bucket,
  3751. name,
  3752. etag: result.res.headers.etag
  3753. };
  3754. if (params.headers && params.headers["x-oss-callback"]) {
  3755. ret.data = JSON.parse(result.data.toString());
  3756. }
  3757. return _context6.abrupt("return", ret);
  3758. case 24:
  3759. case "end":
  3760. return _context6.stop();
  3761. }
  3762. }
  3763. }, _callee6, this);
  3764. }));
  3765. function completeMultipartUpload(_x19, _x20, _x21, _x22) {
  3766. return _completeMultipartUpload.apply(this, arguments);
  3767. }
  3768. return completeMultipartUpload;
  3769. }();
  3770. proto._uploadPart = function() {
  3771. var _uploadPart3 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(name, uploadId, partNo, data, options) {
  3772. var opt, params, isBrowserEnv, result;
  3773. return _regenerator.default.wrap(function _callee7$(_context7) {
  3774. while (1) {
  3775. switch (_context7.prev = _context7.next) {
  3776. case 0:
  3777. options = options || {};
  3778. opt = {};
  3779. copy(options).to(opt);
  3780. opt.headers = opt.headers || {};
  3781. opt.headers["Content-Length"] = data.size;
  3782. opt.headers = omit(opt.headers, ["x-oss-server-side-encryption"]);
  3783. opt.subres = {
  3784. partNumber: partNo,
  3785. uploadId
  3786. };
  3787. params = this._objectRequestParams("PUT", name, opt);
  3788. params.mime = opt.mime;
  3789. isBrowserEnv = process && process.browser;
  3790. isBrowserEnv ? params.content = data.content : params.stream = data.stream;
  3791. params.successStatuses = [200];
  3792. params.disabledMD5 = options.disabledMD5;
  3793. _context7.next = 15;
  3794. return this.request(params);
  3795. case 15:
  3796. result = _context7.sent;
  3797. if (result.res.headers.etag) {
  3798. _context7.next = 18;
  3799. break;
  3800. }
  3801. throw new Error("Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html");
  3802. case 18:
  3803. if (data.stream) {
  3804. data.stream = null;
  3805. params.stream = null;
  3806. }
  3807. return _context7.abrupt("return", {
  3808. name,
  3809. etag: result.res.headers.etag,
  3810. res: result.res
  3811. });
  3812. case 20:
  3813. case "end":
  3814. return _context7.stop();
  3815. }
  3816. }
  3817. }, _callee7, this);
  3818. }));
  3819. function _uploadPart(_x23, _x24, _x25, _x26, _x27) {
  3820. return _uploadPart3.apply(this, arguments);
  3821. }
  3822. return _uploadPart;
  3823. }();
  3824. }).call(this);
  3825. }).call(this, require2("_process"));
  3826. }, { "./callback": 24, "./utils/deepCopy": 58, "./utils/isBuffer": 65, "./utils/omit": 73, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.filter.js": 274, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.array.sort.js": 282, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 31: [function(require2, module3, exports3) {
  3827. "use strict";
  3828. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3829. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3830. require2("core-js/modules/es.regexp.exec.js");
  3831. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3832. var urlutil = require2("url");
  3833. var utility = require2("utility");
  3834. var copy = require2("copy-to");
  3835. var signHelper = require2("../../common/signUtils");
  3836. var _require = require2("../utils/isIP"), isIP = _require.isIP;
  3837. var _require2 = require2("../utils/setSTSToken"), setSTSToken = _require2.setSTSToken;
  3838. var _require3 = require2("../utils/isFunction"), isFunction = _require3.isFunction;
  3839. var proto = exports3;
  3840. proto.asyncSignatureUrl = function() {
  3841. var _asyncSignatureUrl = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  3842. var strictObjectNameValidation, expires, params, resource, signRes, url, _args = arguments;
  3843. return _regenerator.default.wrap(function _callee$(_context) {
  3844. while (1) {
  3845. switch (_context.prev = _context.next) {
  3846. case 0:
  3847. strictObjectNameValidation = _args.length > 2 && _args[2] !== void 0 ? _args[2] : true;
  3848. if (!isIP(this.options.endpoint.hostname)) {
  3849. _context.next = 3;
  3850. break;
  3851. }
  3852. throw new Error("can not get the object URL when endpoint is IP");
  3853. case 3:
  3854. if (!(strictObjectNameValidation && /^\?/.test(name))) {
  3855. _context.next = 5;
  3856. break;
  3857. }
  3858. throw new Error("Invalid object name ".concat(name));
  3859. case 5:
  3860. options = options || {};
  3861. name = this._objectName(name);
  3862. options.method = options.method || "GET";
  3863. expires = utility.timestamp() + (options.expires || 1800);
  3864. params = {
  3865. bucket: this.options.bucket,
  3866. object: name
  3867. };
  3868. resource = this._getResource(params);
  3869. if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) {
  3870. _context.next = 14;
  3871. break;
  3872. }
  3873. _context.next = 14;
  3874. return setSTSToken.call(this);
  3875. case 14:
  3876. if (this.options.stsToken) {
  3877. options["security-token"] = this.options.stsToken;
  3878. }
  3879. signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires);
  3880. url = urlutil.parse(this._getReqUrl(params));
  3881. url.query = {
  3882. OSSAccessKeyId: this.options.accessKeyId,
  3883. Expires: expires,
  3884. Signature: signRes.Signature
  3885. };
  3886. copy(signRes.subResource).to(url.query);
  3887. return _context.abrupt("return", url.format());
  3888. case 20:
  3889. case "end":
  3890. return _context.stop();
  3891. }
  3892. }
  3893. }, _callee, this);
  3894. }));
  3895. function asyncSignatureUrl(_x, _x2) {
  3896. return _asyncSignatureUrl.apply(this, arguments);
  3897. }
  3898. return asyncSignatureUrl;
  3899. }();
  3900. }, { "../../common/signUtils": 50, "../utils/isFunction": 68, "../utils/isIP": 69, "../utils/setSTSToken": 76, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "copy-to": 94, "core-js/modules/es.regexp.exec.js": 300, "url": 472, "utility": 474 }], 32: [function(require2, module3, exports3) {
  3901. "use strict";
  3902. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3903. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3904. require2("core-js/modules/es.object.to-string.js");
  3905. require2("core-js/modules/web.dom-collections.for-each.js");
  3906. require2("core-js/modules/es.object.keys.js");
  3907. require2("core-js/modules/es.array.find.js");
  3908. require2("core-js/modules/es.array.includes.js");
  3909. require2("core-js/modules/es.array.concat.js");
  3910. require2("core-js/modules/es.regexp.exec.js");
  3911. require2("core-js/modules/es.string.replace.js");
  3912. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  3913. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3914. var _require = require2("../utils/checkBucketName"), _checkBucketName = _require.checkBucketName;
  3915. var proto = exports3;
  3916. var REPLACE_HEDERS = ["content-type", "content-encoding", "content-language", "content-disposition", "cache-control", "expires"];
  3917. proto.copy = function() {
  3918. var _copy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, sourceName, bucketName, options) {
  3919. var params, result, data;
  3920. return _regenerator.default.wrap(function _callee$(_context) {
  3921. while (1) {
  3922. switch (_context.prev = _context.next) {
  3923. case 0:
  3924. if ((0, _typeof2.default)(bucketName) === "object") {
  3925. options = bucketName;
  3926. }
  3927. options = options || {};
  3928. options.headers = options.headers || {};
  3929. Object.keys(options.headers).forEach(function(key) {
  3930. options.headers["x-oss-copy-source-".concat(key.toLowerCase())] = options.headers[key];
  3931. });
  3932. if (options.meta || Object.keys(options.headers).find(function(_) {
  3933. return REPLACE_HEDERS.includes(_.toLowerCase());
  3934. })) {
  3935. options.headers["x-oss-metadata-directive"] = "REPLACE";
  3936. }
  3937. this._convertMetaToHeaders(options.meta, options.headers);
  3938. sourceName = this._getSourceName(sourceName, bucketName);
  3939. if (options.versionId) {
  3940. sourceName = "".concat(sourceName, "?versionId=").concat(options.versionId);
  3941. }
  3942. options.headers["x-oss-copy-source"] = sourceName;
  3943. params = this._objectRequestParams("PUT", name, options);
  3944. params.xmlResponse = true;
  3945. params.successStatuses = [200, 304];
  3946. _context.next = 14;
  3947. return this.request(params);
  3948. case 14:
  3949. result = _context.sent;
  3950. data = result.data;
  3951. if (data) {
  3952. data = {
  3953. etag: data.ETag,
  3954. lastModified: data.LastModified
  3955. };
  3956. }
  3957. return _context.abrupt("return", {
  3958. data,
  3959. res: result.res
  3960. });
  3961. case 18:
  3962. case "end":
  3963. return _context.stop();
  3964. }
  3965. }
  3966. }, _callee, this);
  3967. }));
  3968. function copy(_x, _x2, _x3, _x4) {
  3969. return _copy.apply(this, arguments);
  3970. }
  3971. return copy;
  3972. }();
  3973. proto._getSourceName = function _getSourceName(sourceName, bucketName) {
  3974. if (typeof bucketName === "string") {
  3975. sourceName = this._objectName(sourceName);
  3976. } else if (sourceName[0] !== "/") {
  3977. bucketName = this.options.bucket;
  3978. } else {
  3979. bucketName = sourceName.replace(/\/(.+?)(\/.*)/, "$1");
  3980. sourceName = sourceName.replace(/(\/.+?\/)(.*)/, "$2");
  3981. }
  3982. _checkBucketName(bucketName);
  3983. sourceName = encodeURIComponent(sourceName);
  3984. sourceName = "/".concat(bucketName, "/").concat(sourceName);
  3985. return sourceName;
  3986. };
  3987. }, { "../utils/checkBucketName": 51, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 33: [function(require2, module3, exports3) {
  3988. "use strict";
  3989. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  3990. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  3991. require2("core-js/modules/es.object.assign.js");
  3992. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  3993. var proto = exports3;
  3994. proto.delete = function() {
  3995. var _delete2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  3996. var options, params, result, _args = arguments;
  3997. return _regenerator.default.wrap(function _callee$(_context) {
  3998. while (1) {
  3999. switch (_context.prev = _context.next) {
  4000. case 0:
  4001. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4002. options.subres = Object.assign({}, options.subres);
  4003. if (options.versionId) {
  4004. options.subres.versionId = options.versionId;
  4005. }
  4006. params = this._objectRequestParams("DELETE", name, options);
  4007. params.successStatuses = [204];
  4008. _context.next = 7;
  4009. return this.request(params);
  4010. case 7:
  4011. result = _context.sent;
  4012. return _context.abrupt("return", {
  4013. res: result.res
  4014. });
  4015. case 9:
  4016. case "end":
  4017. return _context.stop();
  4018. }
  4019. }
  4020. }, _callee, this);
  4021. }));
  4022. function _delete(_x) {
  4023. return _delete2.apply(this, arguments);
  4024. }
  4025. return _delete;
  4026. }();
  4027. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 34: [function(require2, module3, exports3) {
  4028. "use strict";
  4029. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4030. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4031. require2("core-js/modules/es.object.assign.js");
  4032. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4033. var utility = require2("utility");
  4034. var _require = require2("../utils/obj2xml"), obj2xml = _require.obj2xml;
  4035. var proto = exports3;
  4036. proto.deleteMulti = function() {
  4037. var _deleteMulti = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(names) {
  4038. var options, objects, i, object, _names$i, key, versionId, paramXMLObj, paramXML, params, result, r, deleted, _args = arguments;
  4039. return _regenerator.default.wrap(function _callee$(_context) {
  4040. while (1) {
  4041. switch (_context.prev = _context.next) {
  4042. case 0:
  4043. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4044. objects = [];
  4045. if (!(!names || !names.length)) {
  4046. _context.next = 4;
  4047. break;
  4048. }
  4049. throw new Error("names is required");
  4050. case 4:
  4051. for (i = 0; i < names.length; i++) {
  4052. object = {};
  4053. if (typeof names[i] === "string") {
  4054. object.Key = utility.escape(this._objectName(names[i]));
  4055. } else {
  4056. _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId;
  4057. object.Key = utility.escape(this._objectName(key));
  4058. object.VersionId = versionId;
  4059. }
  4060. objects.push(object);
  4061. }
  4062. paramXMLObj = {
  4063. Delete: {
  4064. Quiet: !!options.quiet,
  4065. Object: objects
  4066. }
  4067. };
  4068. paramXML = obj2xml(paramXMLObj, {
  4069. headers: true
  4070. });
  4071. options.subres = Object.assign({
  4072. delete: ""
  4073. }, options.subres);
  4074. if (options.versionId) {
  4075. options.subres.versionId = options.versionId;
  4076. }
  4077. params = this._objectRequestParams("POST", "", options);
  4078. params.mime = "xml";
  4079. params.content = paramXML;
  4080. params.xmlResponse = true;
  4081. params.successStatuses = [200];
  4082. _context.next = 16;
  4083. return this.request(params);
  4084. case 16:
  4085. result = _context.sent;
  4086. r = result.data;
  4087. deleted = r && r.Deleted || null;
  4088. if (deleted) {
  4089. if (!Array.isArray(deleted)) {
  4090. deleted = [deleted];
  4091. }
  4092. }
  4093. return _context.abrupt("return", {
  4094. res: result.res,
  4095. deleted: deleted || []
  4096. });
  4097. case 21:
  4098. case "end":
  4099. return _context.stop();
  4100. }
  4101. }
  4102. }, _callee, this);
  4103. }));
  4104. function deleteMulti(_x) {
  4105. return _deleteMulti.apply(this, arguments);
  4106. }
  4107. return deleteMulti;
  4108. }();
  4109. }, { "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "utility": 474 }], 35: [function(require2, module3, exports3) {
  4110. "use strict";
  4111. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4112. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4113. require2("core-js/modules/es.object.assign.js");
  4114. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4115. var proto = exports3;
  4116. proto.deleteObjectTagging = function() {
  4117. var _deleteObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  4118. var options, params, result, _args = arguments;
  4119. return _regenerator.default.wrap(function _callee$(_context) {
  4120. while (1) {
  4121. switch (_context.prev = _context.next) {
  4122. case 0:
  4123. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4124. options.subres = Object.assign({
  4125. tagging: ""
  4126. }, options.subres);
  4127. if (options.versionId) {
  4128. options.subres.versionId = options.versionId;
  4129. }
  4130. name = this._objectName(name);
  4131. params = this._objectRequestParams("DELETE", name, options);
  4132. params.successStatuses = [204];
  4133. _context.next = 8;
  4134. return this.request(params);
  4135. case 8:
  4136. result = _context.sent;
  4137. return _context.abrupt("return", {
  4138. status: result.status,
  4139. res: result.res
  4140. });
  4141. case 10:
  4142. case "end":
  4143. return _context.stop();
  4144. }
  4145. }
  4146. }, _callee, this);
  4147. }));
  4148. function deleteObjectTagging(_x) {
  4149. return _deleteObjectTagging.apply(this, arguments);
  4150. }
  4151. return deleteObjectTagging;
  4152. }();
  4153. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 36: [function(require2, module3, exports3) {
  4154. "use strict";
  4155. require2("core-js/modules/es.array.concat.js");
  4156. var urlutil = require2("url");
  4157. var _require = require2("../utils/isIP"), isIP = _require.isIP;
  4158. var proto = exports3;
  4159. proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) {
  4160. if (isIP(this.options.endpoint.hostname)) {
  4161. throw new Error("can not get the object URL when endpoint is IP");
  4162. }
  4163. if (!baseUrl) {
  4164. baseUrl = this.options.endpoint.format();
  4165. var copyUrl = urlutil.parse(baseUrl);
  4166. var bucket = this.options.bucket;
  4167. copyUrl.hostname = "".concat(bucket, ".").concat(copyUrl.hostname);
  4168. copyUrl.host = "".concat(bucket, ".").concat(copyUrl.host);
  4169. baseUrl = copyUrl.format();
  4170. } else if (baseUrl[baseUrl.length - 1] !== "/") {
  4171. baseUrl += "/";
  4172. }
  4173. return baseUrl + this._escape(this._objectName(name));
  4174. };
  4175. }, { "../utils/isIP": 69, "core-js/modules/es.array.concat.js": 272, "url": 472 }], 37: [function(require2, module3, exports3) {
  4176. (function(process) {
  4177. (function() {
  4178. "use strict";
  4179. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4180. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4181. require2("core-js/modules/es.object.assign.js");
  4182. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4183. var fs = require2("fs");
  4184. var is = require2("is-type-of");
  4185. var proto = exports3;
  4186. proto.get = function() {
  4187. var _get = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, file) {
  4188. var options, writeStream, needDestroy, isBrowserEnv, responseCacheControl, defaultSubresOptions, result, params, _args = arguments;
  4189. return _regenerator.default.wrap(function _callee$(_context) {
  4190. while (1) {
  4191. switch (_context.prev = _context.next) {
  4192. case 0:
  4193. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  4194. writeStream = null;
  4195. needDestroy = false;
  4196. if (is.writableStream(file)) {
  4197. writeStream = file;
  4198. } else if (is.string(file)) {
  4199. writeStream = fs.createWriteStream(file);
  4200. needDestroy = true;
  4201. } else {
  4202. options = file;
  4203. }
  4204. options = options || {};
  4205. isBrowserEnv = process && process.browser;
  4206. responseCacheControl = options.responseCacheControl === null ? "" : "no-cache";
  4207. defaultSubresOptions = isBrowserEnv && responseCacheControl ? {
  4208. "response-cache-control": responseCacheControl
  4209. } : {};
  4210. options.subres = Object.assign(defaultSubresOptions, options.subres);
  4211. if (options.versionId) {
  4212. options.subres.versionId = options.versionId;
  4213. }
  4214. if (options.process) {
  4215. options.subres["x-oss-process"] = options.process;
  4216. }
  4217. _context.prev = 11;
  4218. params = this._objectRequestParams("GET", name, options);
  4219. params.writeStream = writeStream;
  4220. params.successStatuses = [200, 206, 304];
  4221. _context.next = 17;
  4222. return this.request(params);
  4223. case 17:
  4224. result = _context.sent;
  4225. if (needDestroy) {
  4226. writeStream.destroy();
  4227. }
  4228. _context.next = 28;
  4229. break;
  4230. case 21:
  4231. _context.prev = 21;
  4232. _context.t0 = _context["catch"](11);
  4233. if (!needDestroy) {
  4234. _context.next = 27;
  4235. break;
  4236. }
  4237. writeStream.destroy();
  4238. _context.next = 27;
  4239. return this._deleteFileSafe(file);
  4240. case 27:
  4241. throw _context.t0;
  4242. case 28:
  4243. return _context.abrupt("return", {
  4244. res: result.res,
  4245. content: result.data
  4246. });
  4247. case 29:
  4248. case "end":
  4249. return _context.stop();
  4250. }
  4251. }
  4252. }, _callee, this, [[11, 21]]);
  4253. }));
  4254. function get(_x, _x2) {
  4255. return _get.apply(this, arguments);
  4256. }
  4257. return get;
  4258. }();
  4259. }).call(this);
  4260. }).call(this, require2("_process"));
  4261. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "_process": 467, "core-js/modules/es.object.assign.js": 287, "fs": 89, "is-type-of": 466 }], 38: [function(require2, module3, exports3) {
  4262. "use strict";
  4263. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4264. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4265. require2("core-js/modules/es.object.assign.js");
  4266. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4267. var proto = exports3;
  4268. proto.getACL = function() {
  4269. var _getACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  4270. var options, params, result, _args = arguments;
  4271. return _regenerator.default.wrap(function _callee$(_context) {
  4272. while (1) {
  4273. switch (_context.prev = _context.next) {
  4274. case 0:
  4275. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4276. options.subres = Object.assign({
  4277. acl: ""
  4278. }, options.subres);
  4279. if (options.versionId) {
  4280. options.subres.versionId = options.versionId;
  4281. }
  4282. name = this._objectName(name);
  4283. params = this._objectRequestParams("GET", name, options);
  4284. params.successStatuses = [200];
  4285. params.xmlResponse = true;
  4286. _context.next = 9;
  4287. return this.request(params);
  4288. case 9:
  4289. result = _context.sent;
  4290. return _context.abrupt("return", {
  4291. acl: result.data.AccessControlList.Grant,
  4292. owner: {
  4293. id: result.data.Owner.ID,
  4294. displayName: result.data.Owner.DisplayName
  4295. },
  4296. res: result.res
  4297. });
  4298. case 11:
  4299. case "end":
  4300. return _context.stop();
  4301. }
  4302. }
  4303. }, _callee, this);
  4304. }));
  4305. function getACL(_x) {
  4306. return _getACL.apply(this, arguments);
  4307. }
  4308. return getACL;
  4309. }();
  4310. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 39: [function(require2, module3, exports3) {
  4311. "use strict";
  4312. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4313. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4314. require2("core-js/modules/es.regexp.exec.js");
  4315. require2("core-js/modules/es.string.replace.js");
  4316. require2("core-js/modules/es.object.to-string.js");
  4317. require2("core-js/modules/web.dom-collections.for-each.js");
  4318. require2("core-js/modules/es.object.keys.js");
  4319. require2("core-js/modules/es.object.assign.js");
  4320. require2("core-js/modules/es.array.map.js");
  4321. require2("core-js/modules/es.number.constructor.js");
  4322. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4323. var proto = exports3;
  4324. var _require = require2("../utils/isObject"), isObject = _require.isObject;
  4325. var _require2 = require2("../utils/isArray"), isArray = _require2.isArray;
  4326. proto.getBucketVersions = getBucketVersions;
  4327. proto.listObjectVersions = getBucketVersions;
  4328. function getBucketVersions() {
  4329. return _getBucketVersions.apply(this, arguments);
  4330. }
  4331. function _getBucketVersions() {
  4332. _getBucketVersions = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
  4333. var query, options, params, result, objects, deleteMarker, that, prefixes, _args = arguments;
  4334. return _regenerator.default.wrap(function _callee$(_context) {
  4335. while (1) {
  4336. switch (_context.prev = _context.next) {
  4337. case 0:
  4338. query = _args.length > 0 && _args[0] !== void 0 ? _args[0] : {};
  4339. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4340. if (!(query.versionIdMarker && query.keyMarker === void 0)) {
  4341. _context.next = 4;
  4342. break;
  4343. }
  4344. throw new Error("A version-id marker cannot be specified without a key marker");
  4345. case 4:
  4346. options.subres = Object.assign({
  4347. versions: ""
  4348. }, options.subres);
  4349. if (options.versionId) {
  4350. options.subres.versionId = options.versionId;
  4351. }
  4352. params = this._objectRequestParams("GET", "", options);
  4353. params.xmlResponse = true;
  4354. params.successStatuses = [200];
  4355. params.query = formatQuery(query);
  4356. _context.next = 12;
  4357. return this.request(params);
  4358. case 12:
  4359. result = _context.sent;
  4360. objects = result.data.Version || [];
  4361. deleteMarker = result.data.DeleteMarker || [];
  4362. that = this;
  4363. if (objects) {
  4364. if (!Array.isArray(objects)) {
  4365. objects = [objects];
  4366. }
  4367. objects = objects.map(function(obj) {
  4368. return {
  4369. name: obj.Key,
  4370. url: that._objectUrl(obj.Key),
  4371. lastModified: obj.LastModified,
  4372. isLatest: obj.IsLatest === "true",
  4373. versionId: obj.VersionId,
  4374. etag: obj.ETag,
  4375. type: obj.Type,
  4376. size: Number(obj.Size),
  4377. storageClass: obj.StorageClass,
  4378. owner: {
  4379. id: obj.Owner.ID,
  4380. displayName: obj.Owner.DisplayName
  4381. }
  4382. };
  4383. });
  4384. }
  4385. if (deleteMarker) {
  4386. if (!isArray(deleteMarker)) {
  4387. deleteMarker = [deleteMarker];
  4388. }
  4389. deleteMarker = deleteMarker.map(function(obj) {
  4390. return {
  4391. name: obj.Key,
  4392. lastModified: obj.LastModified,
  4393. versionId: obj.VersionId,
  4394. owner: {
  4395. id: obj.Owner.ID,
  4396. displayName: obj.Owner.DisplayName
  4397. }
  4398. };
  4399. });
  4400. }
  4401. prefixes = result.data.CommonPrefixes || null;
  4402. if (prefixes) {
  4403. if (!isArray(prefixes)) {
  4404. prefixes = [prefixes];
  4405. }
  4406. prefixes = prefixes.map(function(item) {
  4407. return item.Prefix;
  4408. });
  4409. }
  4410. return _context.abrupt("return", {
  4411. res: result.res,
  4412. objects,
  4413. deleteMarker,
  4414. prefixes,
  4415. // attirbute of legacy error
  4416. nextMarker: result.data.NextKeyMarker || null,
  4417. // attirbute of legacy error
  4418. NextVersionIdMarker: result.data.NextVersionIdMarker || null,
  4419. nextKeyMarker: result.data.NextKeyMarker || null,
  4420. nextVersionIdMarker: result.data.NextVersionIdMarker || null,
  4421. isTruncated: result.data.IsTruncated === "true"
  4422. });
  4423. case 21:
  4424. case "end":
  4425. return _context.stop();
  4426. }
  4427. }
  4428. }, _callee, this);
  4429. }));
  4430. return _getBucketVersions.apply(this, arguments);
  4431. }
  4432. function camel2Line(name) {
  4433. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  4434. }
  4435. function formatQuery() {
  4436. var query = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  4437. var obj = {};
  4438. if (isObject(query)) {
  4439. Object.keys(query).forEach(function(key) {
  4440. obj[camel2Line(key)] = query[key];
  4441. });
  4442. }
  4443. return obj;
  4444. }
  4445. }, { "../utils/isArray": 63, "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.number.constructor.js": 286, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 40: [function(require2, module3, exports3) {
  4446. "use strict";
  4447. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4448. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4449. require2("core-js/modules/es.object.assign.js");
  4450. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4451. var proto = exports3;
  4452. proto.getObjectMeta = function() {
  4453. var _getObjectMeta = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, options) {
  4454. var params, result;
  4455. return _regenerator.default.wrap(function _callee$(_context) {
  4456. while (1) {
  4457. switch (_context.prev = _context.next) {
  4458. case 0:
  4459. options = options || {};
  4460. name = this._objectName(name);
  4461. options.subres = Object.assign({
  4462. objectMeta: ""
  4463. }, options.subres);
  4464. if (options.versionId) {
  4465. options.subres.versionId = options.versionId;
  4466. }
  4467. params = this._objectRequestParams("HEAD", name, options);
  4468. params.successStatuses = [200];
  4469. _context.next = 8;
  4470. return this.request(params);
  4471. case 8:
  4472. result = _context.sent;
  4473. return _context.abrupt("return", {
  4474. status: result.status,
  4475. res: result.res
  4476. });
  4477. case 10:
  4478. case "end":
  4479. return _context.stop();
  4480. }
  4481. }
  4482. }, _callee, this);
  4483. }));
  4484. function getObjectMeta(_x, _x2) {
  4485. return _getObjectMeta.apply(this, arguments);
  4486. }
  4487. return getObjectMeta;
  4488. }();
  4489. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 41: [function(require2, module3, exports3) {
  4490. "use strict";
  4491. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4492. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4493. require2("core-js/modules/es.object.assign.js");
  4494. require2("core-js/modules/es.object.to-string.js");
  4495. require2("core-js/modules/web.dom-collections.for-each.js");
  4496. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4497. var proto = exports3;
  4498. var _require = require2("../utils/isObject"), isObject = _require.isObject;
  4499. proto.getObjectTagging = function() {
  4500. var _getObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  4501. var options, params, result, Tagging, Tag, tag, _args = arguments;
  4502. return _regenerator.default.wrap(function _callee$(_context) {
  4503. while (1) {
  4504. switch (_context.prev = _context.next) {
  4505. case 0:
  4506. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4507. options.subres = Object.assign({
  4508. tagging: ""
  4509. }, options.subres);
  4510. if (options.versionId) {
  4511. options.subres.versionId = options.versionId;
  4512. }
  4513. name = this._objectName(name);
  4514. params = this._objectRequestParams("GET", name, options);
  4515. params.successStatuses = [200];
  4516. _context.next = 8;
  4517. return this.request(params);
  4518. case 8:
  4519. result = _context.sent;
  4520. _context.next = 11;
  4521. return this.parseXML(result.data);
  4522. case 11:
  4523. Tagging = _context.sent;
  4524. Tag = Tagging.TagSet.Tag;
  4525. Tag = Tag && isObject(Tag) ? [Tag] : Tag || [];
  4526. tag = {};
  4527. Tag.forEach(function(item) {
  4528. tag[item.Key] = item.Value;
  4529. });
  4530. return _context.abrupt("return", {
  4531. status: result.status,
  4532. res: result.res,
  4533. tag
  4534. });
  4535. case 17:
  4536. case "end":
  4537. return _context.stop();
  4538. }
  4539. }
  4540. }, _callee, this);
  4541. }));
  4542. function getObjectTagging(_x) {
  4543. return _getObjectTagging.apply(this, arguments);
  4544. }
  4545. return getObjectTagging;
  4546. }();
  4547. }, { "../utils/isObject": 70, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 42: [function(require2, module3, exports3) {
  4548. "use strict";
  4549. var _require = require2("../utils/isIP"), isIP = _require.isIP;
  4550. var proto = exports3;
  4551. proto.getObjectUrl = function getObjectUrl(name, baseUrl) {
  4552. if (isIP(this.options.endpoint.hostname)) {
  4553. throw new Error("can not get the object URL when endpoint is IP");
  4554. }
  4555. if (!baseUrl) {
  4556. baseUrl = this.options.endpoint.format();
  4557. } else if (baseUrl[baseUrl.length - 1] !== "/") {
  4558. baseUrl += "/";
  4559. }
  4560. return baseUrl + this._escape(this._objectName(name));
  4561. };
  4562. }, { "../utils/isIP": 69 }], 43: [function(require2, module3, exports3) {
  4563. "use strict";
  4564. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4565. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4566. require2("core-js/modules/es.object.assign.js");
  4567. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4568. var proto = exports3;
  4569. proto.getSymlink = function() {
  4570. var _getSymlink = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  4571. var options, params, result, target, _args = arguments;
  4572. return _regenerator.default.wrap(function _callee$(_context) {
  4573. while (1) {
  4574. switch (_context.prev = _context.next) {
  4575. case 0:
  4576. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4577. options.subres = Object.assign({
  4578. symlink: ""
  4579. }, options.subres);
  4580. if (options.versionId) {
  4581. options.subres.versionId = options.versionId;
  4582. }
  4583. name = this._objectName(name);
  4584. params = this._objectRequestParams("GET", name, options);
  4585. params.successStatuses = [200];
  4586. _context.next = 8;
  4587. return this.request(params);
  4588. case 8:
  4589. result = _context.sent;
  4590. target = result.res.headers["x-oss-symlink-target"];
  4591. return _context.abrupt("return", {
  4592. targetName: decodeURIComponent(target),
  4593. res: result.res
  4594. });
  4595. case 11:
  4596. case "end":
  4597. return _context.stop();
  4598. }
  4599. }
  4600. }, _callee, this);
  4601. }));
  4602. function getSymlink(_x) {
  4603. return _getSymlink.apply(this, arguments);
  4604. }
  4605. return getSymlink;
  4606. }();
  4607. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 44: [function(require2, module3, exports3) {
  4608. "use strict";
  4609. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4610. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4611. require2("core-js/modules/es.object.assign.js");
  4612. require2("core-js/modules/es.object.to-string.js");
  4613. require2("core-js/modules/web.dom-collections.for-each.js");
  4614. require2("core-js/modules/es.object.keys.js");
  4615. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4616. var _require = require2("../utils/checkEnv"), checkEnv = _require.checkEnv;
  4617. var proto = exports3;
  4618. proto.head = function() {
  4619. var _head = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name) {
  4620. var options, params, result, data, _args = arguments;
  4621. return _regenerator.default.wrap(function _callee$(_context) {
  4622. while (1) {
  4623. switch (_context.prev = _context.next) {
  4624. case 0:
  4625. options = _args.length > 1 && _args[1] !== void 0 ? _args[1] : {};
  4626. checkEnv("Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta");
  4627. options.subres = Object.assign({}, options.subres);
  4628. if (options.versionId) {
  4629. options.subres.versionId = options.versionId;
  4630. }
  4631. params = this._objectRequestParams("HEAD", name, options);
  4632. params.successStatuses = [200, 304];
  4633. _context.next = 8;
  4634. return this.request(params);
  4635. case 8:
  4636. result = _context.sent;
  4637. data = {
  4638. meta: null,
  4639. res: result.res,
  4640. status: result.status
  4641. };
  4642. if (result.status === 200) {
  4643. Object.keys(result.headers).forEach(function(k) {
  4644. if (k.indexOf("x-oss-meta-") === 0) {
  4645. if (!data.meta) {
  4646. data.meta = {};
  4647. }
  4648. data.meta[k.substring(11)] = result.headers[k];
  4649. }
  4650. });
  4651. }
  4652. return _context.abrupt("return", data);
  4653. case 12:
  4654. case "end":
  4655. return _context.stop();
  4656. }
  4657. }
  4658. }, _callee, this);
  4659. }));
  4660. function head(_x) {
  4661. return _head.apply(this, arguments);
  4662. }
  4663. return head;
  4664. }();
  4665. }, { "../utils/checkEnv": 53, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 45: [function(require2, module3, exports3) {
  4666. "use strict";
  4667. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4668. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4669. require2("core-js/modules/es.object.assign.js");
  4670. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4671. var proto = exports3;
  4672. proto.putACL = function() {
  4673. var _putACL = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, acl, options) {
  4674. var params, result;
  4675. return _regenerator.default.wrap(function _callee$(_context) {
  4676. while (1) {
  4677. switch (_context.prev = _context.next) {
  4678. case 0:
  4679. options = options || {};
  4680. options.subres = Object.assign({
  4681. acl: ""
  4682. }, options.subres);
  4683. if (options.versionId) {
  4684. options.subres.versionId = options.versionId;
  4685. }
  4686. options.headers = options.headers || {};
  4687. options.headers["x-oss-object-acl"] = acl;
  4688. name = this._objectName(name);
  4689. params = this._objectRequestParams("PUT", name, options);
  4690. params.successStatuses = [200];
  4691. _context.next = 10;
  4692. return this.request(params);
  4693. case 10:
  4694. result = _context.sent;
  4695. return _context.abrupt("return", {
  4696. res: result.res
  4697. });
  4698. case 12:
  4699. case "end":
  4700. return _context.stop();
  4701. }
  4702. }
  4703. }, _callee, this);
  4704. }));
  4705. function putACL(_x, _x2, _x3) {
  4706. return _putACL.apply(this, arguments);
  4707. }
  4708. return putACL;
  4709. }();
  4710. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 46: [function(require2, module3, exports3) {
  4711. "use strict";
  4712. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4713. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4714. require2("core-js/modules/es.object.assign.js");
  4715. require2("core-js/modules/es.array.map.js");
  4716. require2("core-js/modules/es.object.keys.js");
  4717. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4718. var _require = require2("../utils/obj2xml"), obj2xml = _require.obj2xml;
  4719. var _require2 = require2("../utils/checkObjectTag"), checkObjectTag = _require2.checkObjectTag;
  4720. var proto = exports3;
  4721. proto.putObjectTagging = function() {
  4722. var _putObjectTagging = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, tag) {
  4723. var options, params, paramXMLObj, result, _args = arguments;
  4724. return _regenerator.default.wrap(function _callee$(_context) {
  4725. while (1) {
  4726. switch (_context.prev = _context.next) {
  4727. case 0:
  4728. options = _args.length > 2 && _args[2] !== void 0 ? _args[2] : {};
  4729. checkObjectTag(tag);
  4730. options.subres = Object.assign({
  4731. tagging: ""
  4732. }, options.subres);
  4733. if (options.versionId) {
  4734. options.subres.versionId = options.versionId;
  4735. }
  4736. name = this._objectName(name);
  4737. params = this._objectRequestParams("PUT", name, options);
  4738. params.successStatuses = [200];
  4739. tag = Object.keys(tag).map(function(key) {
  4740. return {
  4741. Key: key,
  4742. Value: tag[key]
  4743. };
  4744. });
  4745. paramXMLObj = {
  4746. Tagging: {
  4747. TagSet: {
  4748. Tag: tag
  4749. }
  4750. }
  4751. };
  4752. params.mime = "xml";
  4753. params.content = obj2xml(paramXMLObj);
  4754. _context.next = 13;
  4755. return this.request(params);
  4756. case 13:
  4757. result = _context.sent;
  4758. return _context.abrupt("return", {
  4759. res: result.res,
  4760. status: result.status
  4761. });
  4762. case 15:
  4763. case "end":
  4764. return _context.stop();
  4765. }
  4766. }
  4767. }, _callee, this);
  4768. }));
  4769. function putObjectTagging(_x, _x2) {
  4770. return _putObjectTagging.apply(this, arguments);
  4771. }
  4772. return putObjectTagging;
  4773. }();
  4774. }, { "../utils/checkObjectTag": 54, "../utils/obj2xml": 72, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290 }], 47: [function(require2, module3, exports3) {
  4775. "use strict";
  4776. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4777. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4778. require2("core-js/modules/es.object.assign.js");
  4779. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4780. var proto = exports3;
  4781. proto.putSymlink = function() {
  4782. var _putSymlink = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(name, targetName, options) {
  4783. var params, result;
  4784. return _regenerator.default.wrap(function _callee$(_context) {
  4785. while (1) {
  4786. switch (_context.prev = _context.next) {
  4787. case 0:
  4788. options = options || {};
  4789. options.headers = options.headers || {};
  4790. targetName = this._escape(this._objectName(targetName));
  4791. this._convertMetaToHeaders(options.meta, options.headers);
  4792. options.headers["x-oss-symlink-target"] = targetName;
  4793. options.subres = Object.assign({
  4794. symlink: ""
  4795. }, options.subres);
  4796. if (options.versionId) {
  4797. options.subres.versionId = options.versionId;
  4798. }
  4799. if (options.storageClass) {
  4800. options.headers["x-oss-storage-class"] = options.storageClass;
  4801. }
  4802. name = this._objectName(name);
  4803. params = this._objectRequestParams("PUT", name, options);
  4804. params.successStatuses = [200];
  4805. _context.next = 13;
  4806. return this.request(params);
  4807. case 13:
  4808. result = _context.sent;
  4809. return _context.abrupt("return", {
  4810. res: result.res
  4811. });
  4812. case 15:
  4813. case "end":
  4814. return _context.stop();
  4815. }
  4816. }
  4817. }, _callee, this);
  4818. }));
  4819. function putSymlink(_x, _x2, _x3) {
  4820. return _putSymlink.apply(this, arguments);
  4821. }
  4822. return putSymlink;
  4823. }();
  4824. }, { "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.object.assign.js": 287 }], 48: [function(require2, module3, exports3) {
  4825. "use strict";
  4826. require2("core-js/modules/es.regexp.exec.js");
  4827. var urlutil = require2("url");
  4828. var utility = require2("utility");
  4829. var copy = require2("copy-to");
  4830. var signHelper = require2("../../common/signUtils");
  4831. var _require = require2("../utils/isIP"), isIP = _require.isIP;
  4832. var proto = exports3;
  4833. proto.signatureUrl = function signatureUrl(name, options) {
  4834. var strictObjectNameValidation = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  4835. if (isIP(this.options.endpoint.hostname)) {
  4836. throw new Error("can not get the object URL when endpoint is IP");
  4837. }
  4838. if (strictObjectNameValidation && /^\?/.test(name)) {
  4839. throw new Error("Invalid object name ".concat(name));
  4840. }
  4841. options = options || {};
  4842. name = this._objectName(name);
  4843. options.method = options.method || "GET";
  4844. var expires = utility.timestamp() + (options.expires || 1800);
  4845. var params = {
  4846. bucket: this.options.bucket,
  4847. object: name
  4848. };
  4849. var resource = this._getResource(params);
  4850. if (this.options.stsToken) {
  4851. options["security-token"] = this.options.stsToken;
  4852. }
  4853. var signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires);
  4854. var url = urlutil.parse(this._getReqUrl(params));
  4855. url.query = {
  4856. OSSAccessKeyId: this.options.accessKeyId,
  4857. Expires: expires,
  4858. Signature: signRes.Signature
  4859. };
  4860. copy(signRes.subResource).to(url.query);
  4861. return url.format();
  4862. };
  4863. }, { "../../common/signUtils": 50, "../utils/isIP": 69, "copy-to": 94, "core-js/modules/es.regexp.exec.js": 300, "url": 472, "utility": 474 }], 49: [function(require2, module3, exports3) {
  4864. "use strict";
  4865. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  4866. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  4867. require2("core-js/modules/es.array.iterator.js");
  4868. require2("core-js/modules/es.object.to-string.js");
  4869. require2("core-js/modules/es.promise.js");
  4870. require2("core-js/modules/es.string.iterator.js");
  4871. require2("core-js/modules/web.dom-collections.iterator.js");
  4872. require2("core-js/modules/web.dom-collections.for-each.js");
  4873. require2("core-js/modules/es.function.name.js");
  4874. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  4875. var _require = require2("./utils/isArray"), isArray = _require.isArray;
  4876. var proto = exports3;
  4877. proto._parallelNode = function() {
  4878. var _parallelNode2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(todo, parallel, fn, sourceData) {
  4879. var that, jobErr, jobs, tempBatch, remainder, batch, taskIndex, i;
  4880. return _regenerator.default.wrap(function _callee$(_context) {
  4881. while (1) {
  4882. switch (_context.prev = _context.next) {
  4883. case 0:
  4884. that = this;
  4885. jobErr = [];
  4886. jobs = [];
  4887. tempBatch = todo.length / parallel;
  4888. remainder = todo.length % parallel;
  4889. batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1;
  4890. taskIndex = 1;
  4891. i = 0;
  4892. case 8:
  4893. if (!(i < todo.length)) {
  4894. _context.next = 26;
  4895. break;
  4896. }
  4897. if (!that.isCancel()) {
  4898. _context.next = 11;
  4899. break;
  4900. }
  4901. return _context.abrupt("break", 26);
  4902. case 11:
  4903. if (sourceData) {
  4904. jobs.push(fn(that, todo[i], sourceData));
  4905. } else {
  4906. jobs.push(fn(that, todo[i]));
  4907. }
  4908. if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) {
  4909. _context.next = 23;
  4910. break;
  4911. }
  4912. _context.prev = 13;
  4913. taskIndex += 1;
  4914. _context.next = 17;
  4915. return Promise.all(jobs);
  4916. case 17:
  4917. _context.next = 22;
  4918. break;
  4919. case 19:
  4920. _context.prev = 19;
  4921. _context.t0 = _context["catch"](13);
  4922. jobErr.push(_context.t0);
  4923. case 22:
  4924. jobs = [];
  4925. case 23:
  4926. i++;
  4927. _context.next = 8;
  4928. break;
  4929. case 26:
  4930. return _context.abrupt("return", jobErr);
  4931. case 27:
  4932. case "end":
  4933. return _context.stop();
  4934. }
  4935. }
  4936. }, _callee, this, [[13, 19]]);
  4937. }));
  4938. function _parallelNode(_x, _x2, _x3, _x4) {
  4939. return _parallelNode2.apply(this, arguments);
  4940. }
  4941. return _parallelNode;
  4942. }();
  4943. proto._parallel = function _parallel(todo, parallel, jobPromise) {
  4944. var that = this;
  4945. return new Promise(function(resolve) {
  4946. var _jobErr = [];
  4947. if (parallel <= 0 || !todo) {
  4948. resolve(_jobErr);
  4949. return;
  4950. }
  4951. function onlyOnce(fn) {
  4952. return function() {
  4953. if (fn === null)
  4954. throw new Error("Callback was already called.");
  4955. var callFn = fn;
  4956. fn = null;
  4957. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  4958. args[_key] = arguments[_key];
  4959. }
  4960. callFn.apply(this, args);
  4961. };
  4962. }
  4963. function createArrayIterator(coll) {
  4964. var i = -1;
  4965. var len = coll.length;
  4966. return function next() {
  4967. return ++i < len && !that.isCancel() ? {
  4968. value: coll[i],
  4969. key: i
  4970. } : null;
  4971. };
  4972. }
  4973. var nextElem = createArrayIterator(todo);
  4974. var done = false;
  4975. var running = 0;
  4976. var looping = false;
  4977. function iterateeCallback(err) {
  4978. running -= 1;
  4979. if (err) {
  4980. done = true;
  4981. _jobErr.push(err);
  4982. resolve(_jobErr);
  4983. } else if (done && running <= 0) {
  4984. done = true;
  4985. resolve(_jobErr);
  4986. } else if (!looping) {
  4987. if (that.isCancel()) {
  4988. resolve(_jobErr);
  4989. } else {
  4990. replenish();
  4991. }
  4992. }
  4993. }
  4994. function iteratee(value, callback) {
  4995. jobPromise(value).then(function(result) {
  4996. callback(null, result);
  4997. }).catch(function(err) {
  4998. callback(err);
  4999. });
  5000. }
  5001. function replenish() {
  5002. looping = true;
  5003. while (running < parallel && !done && !that.isCancel()) {
  5004. var elem = nextElem();
  5005. if (elem === null || _jobErr.length > 0) {
  5006. done = true;
  5007. if (running <= 0) {
  5008. resolve(_jobErr);
  5009. }
  5010. return;
  5011. }
  5012. running += 1;
  5013. iteratee(elem.value, onlyOnce(iterateeCallback));
  5014. }
  5015. looping = false;
  5016. }
  5017. replenish();
  5018. });
  5019. };
  5020. proto.cancel = function cancel(abort) {
  5021. this.options.cancelFlag = true;
  5022. if (isArray(this.multipartUploadStreams)) {
  5023. this.multipartUploadStreams.forEach(function(_) {
  5024. if (_.destroyed === false) {
  5025. var err = {
  5026. name: "cancel",
  5027. message: "cancel"
  5028. };
  5029. _.destroy(err);
  5030. }
  5031. });
  5032. }
  5033. this.multipartUploadStreams = [];
  5034. if (abort) {
  5035. this.abortMultipartUpload(abort.name, abort.uploadId, abort.options);
  5036. }
  5037. };
  5038. proto.isCancel = function isCancel() {
  5039. return this.options.cancelFlag;
  5040. };
  5041. proto.resetCancelFlag = function resetCancelFlag() {
  5042. this.options.cancelFlag = false;
  5043. };
  5044. proto._stop = function _stop() {
  5045. this.options.cancelFlag = true;
  5046. };
  5047. proto._makeCancelEvent = function _makeCancelEvent() {
  5048. var cancelEvent = {
  5049. status: 0,
  5050. name: "cancel"
  5051. };
  5052. return cancelEvent;
  5053. };
  5054. proto._makeAbortEvent = function _makeAbortEvent() {
  5055. var abortEvent = {
  5056. status: 0,
  5057. name: "abort",
  5058. message: "upload task has been abort"
  5059. };
  5060. return abortEvent;
  5061. };
  5062. }, { "./utils/isArray": 63, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/web.dom-collections.for-each.js": 339, "core-js/modules/web.dom-collections.iterator.js": 340 }], 50: [function(require2, module3, exports3) {
  5063. (function(Buffer) {
  5064. (function() {
  5065. "use strict";
  5066. require2("core-js/modules/es.string.trim.js");
  5067. require2("core-js/modules/es.array.sort.js");
  5068. require2("core-js/modules/es.array.join.js");
  5069. require2("core-js/modules/es.object.to-string.js");
  5070. require2("core-js/modules/web.dom-collections.for-each.js");
  5071. require2("core-js/modules/es.object.keys.js");
  5072. require2("core-js/modules/es.array.concat.js");
  5073. require2("core-js/modules/es.regexp.to-string.js");
  5074. var crypto = require2("./../../shims/crypto/crypto.js");
  5075. var is = require2("is-type-of");
  5076. var _require = require2("./utils/lowercaseKeyHeader"), lowercaseKeyHeader = _require.lowercaseKeyHeader;
  5077. exports3.buildCanonicalizedResource = function buildCanonicalizedResource(resourcePath, parameters) {
  5078. var canonicalizedResource = "".concat(resourcePath);
  5079. var separatorString = "?";
  5080. if (is.string(parameters) && parameters.trim() !== "") {
  5081. canonicalizedResource += separatorString + parameters;
  5082. } else if (is.array(parameters)) {
  5083. parameters.sort();
  5084. canonicalizedResource += separatorString + parameters.join("&");
  5085. } else if (parameters) {
  5086. var compareFunc = function compareFunc2(entry1, entry2) {
  5087. if (entry1[0] > entry2[0]) {
  5088. return 1;
  5089. } else if (entry1[0] < entry2[0]) {
  5090. return -1;
  5091. }
  5092. return 0;
  5093. };
  5094. var processFunc = function processFunc2(key) {
  5095. canonicalizedResource += separatorString + key;
  5096. if (parameters[key] || parameters[key] === 0) {
  5097. canonicalizedResource += "=".concat(parameters[key]);
  5098. }
  5099. separatorString = "&";
  5100. };
  5101. Object.keys(parameters).sort(compareFunc).forEach(processFunc);
  5102. }
  5103. return canonicalizedResource;
  5104. };
  5105. exports3.buildCanonicalString = function canonicalString(method, resourcePath, request, expires) {
  5106. request = request || {};
  5107. var headers = lowercaseKeyHeader(request.headers);
  5108. var OSS_PREFIX = "x-oss-";
  5109. var ossHeaders = [];
  5110. var headersToSign = {};
  5111. var signContent = [method.toUpperCase(), headers["content-md5"] || "", headers["content-type"], expires || headers["x-oss-date"]];
  5112. Object.keys(headers).forEach(function(key) {
  5113. var lowerKey = key.toLowerCase();
  5114. if (lowerKey.indexOf(OSS_PREFIX) === 0) {
  5115. headersToSign[lowerKey] = String(headers[key]).trim();
  5116. }
  5117. });
  5118. Object.keys(headersToSign).sort().forEach(function(key) {
  5119. ossHeaders.push("".concat(key, ":").concat(headersToSign[key]));
  5120. });
  5121. signContent = signContent.concat(ossHeaders);
  5122. signContent.push(this.buildCanonicalizedResource(resourcePath, request.parameters));
  5123. return signContent.join("\n");
  5124. };
  5125. exports3.computeSignature = function computeSignature(accessKeySecret, canonicalString) {
  5126. var headerEncoding = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "utf-8";
  5127. var signature = crypto.createHmac("sha1", accessKeySecret);
  5128. return signature.update(Buffer.from(canonicalString, headerEncoding)).digest("base64");
  5129. };
  5130. exports3.authorization = function authorization(accessKeyId, accessKeySecret, canonicalString, headerEncoding) {
  5131. return "OSS ".concat(accessKeyId, ":").concat(this.computeSignature(accessKeySecret, canonicalString, headerEncoding));
  5132. };
  5133. exports3._signatureForURL = function _signatureForURL(accessKeySecret) {
  5134. var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  5135. var resource = arguments.length > 2 ? arguments[2] : void 0;
  5136. var expires = arguments.length > 3 ? arguments[3] : void 0;
  5137. var headerEncoding = arguments.length > 4 ? arguments[4] : void 0;
  5138. var headers = {};
  5139. var _options$subResource = options.subResource, subResource = _options$subResource === void 0 ? {} : _options$subResource;
  5140. if (options.process) {
  5141. var processKeyword = "x-oss-process";
  5142. subResource[processKeyword] = options.process;
  5143. }
  5144. if (options.trafficLimit) {
  5145. var trafficLimitKey = "x-oss-traffic-limit";
  5146. subResource[trafficLimitKey] = options.trafficLimit;
  5147. }
  5148. if (options.response) {
  5149. Object.keys(options.response).forEach(function(k) {
  5150. var key = "response-".concat(k.toLowerCase());
  5151. subResource[key] = options.response[k];
  5152. });
  5153. }
  5154. Object.keys(options).forEach(function(key) {
  5155. var lowerKey = key.toLowerCase();
  5156. var value = options[key];
  5157. if (lowerKey.indexOf("x-oss-") === 0) {
  5158. headers[lowerKey] = value;
  5159. } else if (lowerKey.indexOf("content-md5") === 0) {
  5160. headers[key] = value;
  5161. } else if (lowerKey.indexOf("content-type") === 0) {
  5162. headers[key] = value;
  5163. }
  5164. });
  5165. if (Object.prototype.hasOwnProperty.call(options, "security-token")) {
  5166. subResource["security-token"] = options["security-token"];
  5167. }
  5168. if (Object.prototype.hasOwnProperty.call(options, "callback")) {
  5169. var json = {
  5170. callbackUrl: encodeURI(options.callback.url),
  5171. callbackBody: options.callback.body
  5172. };
  5173. if (options.callback.host) {
  5174. json.callbackHost = options.callback.host;
  5175. }
  5176. if (options.callback.contentType) {
  5177. json.callbackBodyType = options.callback.contentType;
  5178. }
  5179. subResource.callback = Buffer.from(JSON.stringify(json)).toString("base64");
  5180. if (options.callback.customValue) {
  5181. var callbackVar = {};
  5182. Object.keys(options.callback.customValue).forEach(function(key) {
  5183. callbackVar["x:".concat(key)] = options.callback.customValue[key];
  5184. });
  5185. subResource["callback-var"] = Buffer.from(JSON.stringify(callbackVar)).toString("base64");
  5186. }
  5187. }
  5188. var canonicalString = this.buildCanonicalString(options.method, resource, {
  5189. headers,
  5190. parameters: subResource
  5191. }, expires.toString());
  5192. return {
  5193. Signature: this.computeSignature(accessKeySecret, canonicalString, headerEncoding),
  5194. subResource
  5195. };
  5196. };
  5197. }).call(this);
  5198. }).call(this, require2("buffer").Buffer);
  5199. }, { "./../../shims/crypto/crypto.js": 461, "./utils/lowercaseKeyHeader": 71, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.sort.js": 282, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.trim.js": 308, "core-js/modules/web.dom-collections.for-each.js": 339, "is-type-of": 466 }], 51: [function(require2, module3, exports3) {
  5200. "use strict";
  5201. require2("core-js/modules/es.regexp.exec.js");
  5202. Object.defineProperty(exports3, "__esModule", {
  5203. value: true
  5204. });
  5205. exports3.checkBucketName = void 0;
  5206. exports3.checkBucketName = function(name) {
  5207. var createBucket = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  5208. var bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;
  5209. if (!bucketRegex.test(name)) {
  5210. throw new Error("The bucket must be conform to the specifications");
  5211. }
  5212. };
  5213. }, { "core-js/modules/es.regexp.exec.js": 300 }], 52: [function(require2, module3, exports3) {
  5214. "use strict";
  5215. require2("core-js/modules/es.regexp.exec.js");
  5216. Object.defineProperty(exports3, "__esModule", {
  5217. value: true
  5218. });
  5219. exports3.checkConfigValid = void 0;
  5220. var checkConfigMap = {
  5221. endpoint: checkEndpoint,
  5222. region: /^[a-zA-Z0-9\-_]+$/
  5223. };
  5224. function checkEndpoint(endpoint) {
  5225. if (typeof endpoint === "string") {
  5226. return /^[a-zA-Z0-9._:/-]+$/.test(endpoint);
  5227. } else if (endpoint.host) {
  5228. return /^[a-zA-Z0-9._:/-]+$/.test(endpoint.host);
  5229. }
  5230. return false;
  5231. }
  5232. exports3.checkConfigValid = function(conf, key) {
  5233. if (checkConfigMap[key]) {
  5234. var isConfigValid = true;
  5235. if (checkConfigMap[key] instanceof Function) {
  5236. isConfigValid = checkConfigMap[key](conf);
  5237. } else {
  5238. isConfigValid = checkConfigMap[key].test(conf);
  5239. }
  5240. if (!isConfigValid) {
  5241. throw new Error("The ".concat(key, " must be conform to the specifications"));
  5242. }
  5243. }
  5244. };
  5245. }, { "core-js/modules/es.regexp.exec.js": 300 }], 53: [function(require2, module3, exports3) {
  5246. (function(process) {
  5247. (function() {
  5248. "use strict";
  5249. Object.defineProperty(exports3, "__esModule", {
  5250. value: true
  5251. });
  5252. exports3.checkEnv = void 0;
  5253. function checkEnv(msg) {
  5254. if (process.browser) {
  5255. console.warn(msg);
  5256. }
  5257. }
  5258. exports3.checkEnv = checkEnv;
  5259. }).call(this);
  5260. }).call(this, require2("_process"));
  5261. }, { "_process": 467 }], 54: [function(require2, module3, exports3) {
  5262. "use strict";
  5263. require2("core-js/modules/es.array.concat.js");
  5264. require2("core-js/modules/es.object.entries.js");
  5265. require2("core-js/modules/es.object.to-string.js");
  5266. require2("core-js/modules/web.dom-collections.for-each.js");
  5267. Object.defineProperty(exports3, "__esModule", {
  5268. value: true
  5269. });
  5270. exports3.checkObjectTag = void 0;
  5271. var _require = require2("./checkValid"), checkValid = _require.checkValid;
  5272. var _require2 = require2("./isObject"), isObject = _require2.isObject;
  5273. var commonRules = [{
  5274. validator: function validator(value) {
  5275. if (typeof value !== "string") {
  5276. throw new Error("the key and value of the tag must be String");
  5277. }
  5278. }
  5279. }, {
  5280. pattern: /^[a-zA-Z0-9 +-=._:/]+$/,
  5281. msg: "tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"
  5282. }];
  5283. var rules = {
  5284. key: [].concat(commonRules, [{
  5285. pattern: /^.{1,128}$/,
  5286. msg: "tag key can be a maximum of 128 bytes in length"
  5287. }]),
  5288. value: [].concat(commonRules, [{
  5289. pattern: /^.{0,256}$/,
  5290. msg: "tag value can be a maximum of 256 bytes in length"
  5291. }])
  5292. };
  5293. function checkObjectTag(tag) {
  5294. if (!isObject(tag)) {
  5295. throw new Error("tag must be Object");
  5296. }
  5297. var entries = Object.entries(tag);
  5298. if (entries.length > 10) {
  5299. throw new Error("maximum of 10 tags for a object");
  5300. }
  5301. var rulesIndexKey = ["key", "value"];
  5302. entries.forEach(function(keyValue) {
  5303. keyValue.forEach(function(item, index) {
  5304. checkValid(item, rules[rulesIndexKey[index]]);
  5305. });
  5306. });
  5307. }
  5308. exports3.checkObjectTag = checkObjectTag;
  5309. }, { "./checkValid": 55, "./isObject": 70, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.object.entries.js": 288, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 55: [function(require2, module3, exports3) {
  5310. "use strict";
  5311. require2("core-js/modules/es.object.to-string.js");
  5312. require2("core-js/modules/web.dom-collections.for-each.js");
  5313. require2("core-js/modules/es.regexp.exec.js");
  5314. Object.defineProperty(exports3, "__esModule", {
  5315. value: true
  5316. });
  5317. exports3.checkValid = void 0;
  5318. function checkValid(_value, _rules) {
  5319. _rules.forEach(function(rule) {
  5320. if (rule.validator) {
  5321. rule.validator(_value);
  5322. } else if (rule.pattern && !rule.pattern.test(_value)) {
  5323. throw new Error(rule.msg);
  5324. }
  5325. });
  5326. }
  5327. exports3.checkValid = checkValid;
  5328. }, { "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/web.dom-collections.for-each.js": 339 }], 56: [function(require2, module3, exports3) {
  5329. (function(Buffer) {
  5330. (function() {
  5331. "use strict";
  5332. require2("core-js/modules/es.array.includes.js");
  5333. require2("core-js/modules/es.string.includes.js");
  5334. require2("core-js/modules/es.object.assign.js");
  5335. require2("core-js/modules/es.array.concat.js");
  5336. Object.defineProperty(exports3, "__esModule", {
  5337. value: true
  5338. });
  5339. exports3.createRequest = void 0;
  5340. var crypto = require2("./../../../shims/crypto/crypto.js");
  5341. var debug = require2("debug")("ali-oss");
  5342. var mime = require2("mime");
  5343. var dateFormat = require2("dateformat");
  5344. var copy = require2("copy-to");
  5345. var path = require2("path");
  5346. var _require = require2("./encoder"), encoder = _require.encoder;
  5347. var _require2 = require2("./isIP"), isIP = _require2.isIP;
  5348. var _require3 = require2("./setRegion"), setRegion = _require3.setRegion;
  5349. var _require4 = require2("../client/getReqUrl"), getReqUrl = _require4.getReqUrl;
  5350. var _require5 = require2("./isDingTalk"), isDingTalk = _require5.isDingTalk;
  5351. function getHeader(headers, name) {
  5352. return headers[name] || headers[name.toLowerCase()];
  5353. }
  5354. function delHeader(headers, name) {
  5355. delete headers[name];
  5356. delete headers[name.toLowerCase()];
  5357. }
  5358. function createRequest(params) {
  5359. var date = /* @__PURE__ */ new Date();
  5360. if (this.options.amendTimeSkewed) {
  5361. date = +/* @__PURE__ */ new Date() + this.options.amendTimeSkewed;
  5362. }
  5363. var headers = {
  5364. "x-oss-date": dateFormat(date, "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'")
  5365. };
  5366. if (typeof window !== "undefined") {
  5367. headers["x-oss-user-agent"] = this.userAgent;
  5368. }
  5369. if (this.userAgent.includes("nodejs")) {
  5370. headers["User-Agent"] = this.userAgent;
  5371. }
  5372. if (this.options.isRequestPay) {
  5373. Object.assign(headers, {
  5374. "x-oss-request-payer": "requester"
  5375. });
  5376. }
  5377. if (this.options.stsToken) {
  5378. headers["x-oss-security-token"] = this.options.stsToken;
  5379. }
  5380. copy(params.headers).to(headers);
  5381. if (!getHeader(headers, "Content-Type")) {
  5382. if (params.mime && params.mime.indexOf("/") > 0) {
  5383. headers["Content-Type"] = params.mime;
  5384. } else if (isDingTalk()) {
  5385. headers["Content-Type"] = "application/octet-stream";
  5386. } else {
  5387. headers["Content-Type"] = mime.getType(params.mime || path.extname(params.object || ""));
  5388. }
  5389. }
  5390. if (!getHeader(headers, "Content-Type")) {
  5391. delHeader(headers, "Content-Type");
  5392. }
  5393. if (params.content) {
  5394. if (!params.disabledMD5) {
  5395. if (!params.headers || !params.headers["Content-MD5"]) {
  5396. headers["Content-MD5"] = crypto.createHash("md5").update(Buffer.from(params.content, "utf8")).digest("base64");
  5397. } else {
  5398. headers["Content-MD5"] = params.headers["Content-MD5"];
  5399. }
  5400. }
  5401. if (!headers["Content-Length"]) {
  5402. headers["Content-Length"] = params.content.length;
  5403. }
  5404. }
  5405. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5406. for (var k in headers) {
  5407. if (headers[k] && hasOwnProperty.call(headers, k)) {
  5408. headers[k] = encoder(String(headers[k]), this.options.headerEncoding);
  5409. }
  5410. }
  5411. var authResource = this._getResource(params);
  5412. headers.authorization = this.authorization(params.method, authResource, params.subres, headers, this.options.headerEncoding);
  5413. if (isIP(this.options.endpoint.hostname)) {
  5414. var _this$options = this.options, region = _this$options.region, internal = _this$options.internal, secure = _this$options.secure;
  5415. var hostInfo = setRegion(region, internal, secure);
  5416. headers.host = "".concat(params.bucket, ".").concat(hostInfo.host);
  5417. }
  5418. var url = getReqUrl.bind(this)(params);
  5419. debug("request %s %s, with headers %j, !!stream: %s", params.method, url, headers, !!params.stream);
  5420. var timeout = params.timeout || this.options.timeout;
  5421. var reqParams = {
  5422. method: params.method,
  5423. content: params.content,
  5424. stream: params.stream,
  5425. headers,
  5426. timeout,
  5427. writeStream: params.writeStream,
  5428. customResponse: params.customResponse,
  5429. ctx: params.ctx || this.ctx
  5430. };
  5431. if (this.agent) {
  5432. reqParams.agent = this.agent;
  5433. }
  5434. if (this.httpsAgent) {
  5435. reqParams.httpsAgent = this.httpsAgent;
  5436. }
  5437. reqParams.enableProxy = !!this.options.enableProxy;
  5438. reqParams.proxy = this.options.proxy ? this.options.proxy : null;
  5439. return {
  5440. url,
  5441. params: reqParams
  5442. };
  5443. }
  5444. exports3.createRequest = createRequest;
  5445. }).call(this);
  5446. }).call(this, require2("buffer").Buffer);
  5447. }, { "../client/getReqUrl": 25, "./../../../shims/crypto/crypto.js": 461, "./encoder": 59, "./isDingTalk": 66, "./isIP": 69, "./setRegion": 75, "buffer": 90, "copy-to": 94, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.string.includes.js": 302, "dateformat": 342, "debug": 465, "mime": 374, "path": 378 }], 57: [function(require2, module3, exports3) {
  5448. "use strict";
  5449. require2("core-js/modules/es.object.to-string.js");
  5450. require2("core-js/modules/web.dom-collections.for-each.js");
  5451. require2("core-js/modules/es.object.entries.js");
  5452. require2("core-js/modules/es.regexp.exec.js");
  5453. require2("core-js/modules/es.string.replace.js");
  5454. require2("core-js/modules/es.array.includes.js");
  5455. require2("core-js/modules/es.object.keys.js");
  5456. Object.defineProperty(exports3, "__esModule", {
  5457. value: true
  5458. });
  5459. exports3.dataFix = void 0;
  5460. var isObject_1 = require2("./isObject");
  5461. var TRUE = ["true", "TRUE", "1", 1];
  5462. var FALSE = ["false", "FALSE", "0", 0];
  5463. function dataFix(o, conf, finalKill) {
  5464. if (!isObject_1.isObject(o))
  5465. return;
  5466. var _conf$remove = conf.remove, remove = _conf$remove === void 0 ? [] : _conf$remove, _conf$rename = conf.rename, rename = _conf$rename === void 0 ? {} : _conf$rename, _conf$camel = conf.camel, camel = _conf$camel === void 0 ? [] : _conf$camel, _conf$bool = conf.bool, bool = _conf$bool === void 0 ? [] : _conf$bool, _conf$lowerFirst = conf.lowerFirst, lowerFirst = _conf$lowerFirst === void 0 ? false : _conf$lowerFirst;
  5467. remove.forEach(function(v) {
  5468. return delete o[v];
  5469. });
  5470. Object.entries(rename).forEach(function(v) {
  5471. if (!o[v[0]])
  5472. return;
  5473. if (o[v[1]])
  5474. return;
  5475. o[v[1]] = o[v[0]];
  5476. delete o[v[0]];
  5477. });
  5478. camel.forEach(function(v) {
  5479. if (!o[v])
  5480. return;
  5481. var afterKey = v.replace(/^(.)/, function($0) {
  5482. return $0.toLowerCase();
  5483. }).replace(/-(\w)/g, function(_, $1) {
  5484. return $1.toUpperCase();
  5485. });
  5486. if (o[afterKey])
  5487. return;
  5488. o[afterKey] = o[v];
  5489. });
  5490. bool.forEach(function(v) {
  5491. o[v] = fixBool(o[v]);
  5492. });
  5493. if (typeof finalKill === "function") {
  5494. finalKill(o);
  5495. }
  5496. fixLowerFirst(o, lowerFirst);
  5497. return dataFix;
  5498. }
  5499. exports3.dataFix = dataFix;
  5500. function fixBool(value) {
  5501. if (!value)
  5502. return false;
  5503. if (TRUE.includes(value))
  5504. return true;
  5505. return FALSE.includes(value) ? false : value;
  5506. }
  5507. function fixLowerFirst(o, lowerFirst) {
  5508. if (lowerFirst) {
  5509. Object.keys(o).forEach(function(key) {
  5510. var lowerK = key.replace(/^\w/, function(match) {
  5511. return match.toLowerCase();
  5512. });
  5513. if (typeof o[lowerK] === "undefined") {
  5514. o[lowerK] = o[key];
  5515. delete o[key];
  5516. }
  5517. });
  5518. }
  5519. }
  5520. }, { "./isObject": 70, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.entries.js": 288, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 58: [function(require2, module3, exports3) {
  5521. "use strict";
  5522. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  5523. require2("core-js/modules/es.array.slice.js");
  5524. require2("core-js/modules/es.object.to-string.js");
  5525. require2("core-js/modules/web.dom-collections.for-each.js");
  5526. require2("core-js/modules/es.object.keys.js");
  5527. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  5528. Object.defineProperty(exports3, "__esModule", {
  5529. value: true
  5530. });
  5531. exports3.deepCopyWith = exports3.deepCopy = void 0;
  5532. var isBuffer_1 = require2("./isBuffer");
  5533. exports3.deepCopy = function(obj) {
  5534. if (obj === null || (0, _typeof2.default)(obj) !== "object") {
  5535. return obj;
  5536. }
  5537. if (isBuffer_1.isBuffer(obj)) {
  5538. return obj.slice();
  5539. }
  5540. var copy = Array.isArray(obj) ? [] : {};
  5541. Object.keys(obj).forEach(function(key) {
  5542. copy[key] = exports3.deepCopy(obj[key]);
  5543. });
  5544. return copy;
  5545. };
  5546. exports3.deepCopyWith = function(obj, customizer) {
  5547. function deepCopyWithHelper(value, innerKey, innerObject) {
  5548. var result = customizer(value, innerKey, innerObject);
  5549. if (result !== void 0)
  5550. return result;
  5551. if (value === null || (0, _typeof2.default)(value) !== "object") {
  5552. return value;
  5553. }
  5554. if (isBuffer_1.isBuffer(value)) {
  5555. return value.slice();
  5556. }
  5557. var copy = Array.isArray(value) ? [] : {};
  5558. Object.keys(value).forEach(function(k) {
  5559. copy[k] = deepCopyWithHelper(value[k], k, value);
  5560. });
  5561. return copy;
  5562. }
  5563. if (customizer) {
  5564. return deepCopyWithHelper(obj, "", null);
  5565. } else {
  5566. return exports3.deepCopy(obj);
  5567. }
  5568. };
  5569. }, { "./isBuffer": 65, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 59: [function(require2, module3, exports3) {
  5570. (function(Buffer) {
  5571. (function() {
  5572. "use strict";
  5573. require2("core-js/modules/es.object.to-string.js");
  5574. require2("core-js/modules/es.regexp.to-string.js");
  5575. Object.defineProperty(exports3, "__esModule", {
  5576. value: true
  5577. });
  5578. exports3.encoder = void 0;
  5579. function encoder(str) {
  5580. var encoding = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "utf-8";
  5581. if (encoding === "utf-8")
  5582. return str;
  5583. return Buffer.from(str).toString("latin1");
  5584. }
  5585. exports3.encoder = encoder;
  5586. }).call(this);
  5587. }).call(this, require2("buffer").Buffer);
  5588. }, { "buffer": 90, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 60: [function(require2, module3, exports3) {
  5589. "use strict";
  5590. require2("core-js/modules/es.array.map.js");
  5591. require2("core-js/modules/es.regexp.exec.js");
  5592. require2("core-js/modules/es.string.replace.js");
  5593. Object.defineProperty(exports3, "__esModule", {
  5594. value: true
  5595. });
  5596. exports3.formatInventoryConfig = void 0;
  5597. var dataFix_1 = require2("../utils/dataFix");
  5598. var isObject_1 = require2("../utils/isObject");
  5599. var isArray_1 = require2("../utils/isArray");
  5600. var formatObjKey_1 = require2("../utils/formatObjKey");
  5601. function formatInventoryConfig(inventoryConfig) {
  5602. var toArray = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  5603. if (toArray && isObject_1.isObject(inventoryConfig))
  5604. inventoryConfig = [inventoryConfig];
  5605. if (isArray_1.isArray(inventoryConfig)) {
  5606. inventoryConfig = inventoryConfig.map(formatFn);
  5607. } else {
  5608. inventoryConfig = formatFn(inventoryConfig);
  5609. }
  5610. return inventoryConfig;
  5611. }
  5612. exports3.formatInventoryConfig = formatInventoryConfig;
  5613. function formatFn(_) {
  5614. dataFix_1.dataFix(_, {
  5615. bool: ["IsEnabled"]
  5616. }, function(conf) {
  5617. var _a, _b;
  5618. conf.prefix = conf.Filter.Prefix;
  5619. delete conf.Filter;
  5620. conf.OSSBucketDestination = conf.Destination.OSSBucketDestination;
  5621. conf.OSSBucketDestination.rolename = conf.OSSBucketDestination.RoleArn.replace(/.*\//, "");
  5622. delete conf.OSSBucketDestination.RoleArn;
  5623. conf.OSSBucketDestination.bucket = conf.OSSBucketDestination.Bucket.replace(/.*:::/, "");
  5624. delete conf.OSSBucketDestination.Bucket;
  5625. delete conf.Destination;
  5626. conf.frequency = conf.Schedule.Frequency;
  5627. delete conf.Schedule.Frequency;
  5628. if (((_a = conf === null || conf === void 0 ? void 0 : conf.OptionalFields) === null || _a === void 0 ? void 0 : _a.Field) && !isArray_1.isArray((_b = conf.OptionalFields) === null || _b === void 0 ? void 0 : _b.Field))
  5629. conf.OptionalFields.Field = [conf.OptionalFields.Field];
  5630. });
  5631. _ = formatObjKey_1.formatObjKey(_, "firstLowerCase", {
  5632. exclude: ["OSSBucketDestination", "SSE-OSS", "SSE-KMS"]
  5633. });
  5634. return _;
  5635. }
  5636. }, { "../utils/dataFix": 57, "../utils/formatObjKey": 61, "../utils/isArray": 63, "../utils/isObject": 70, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.replace.js": 305 }], 61: [function(require2, module3, exports3) {
  5637. "use strict";
  5638. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  5639. require2("core-js/modules/es.object.to-string.js");
  5640. require2("core-js/modules/web.dom-collections.for-each.js");
  5641. require2("core-js/modules/es.object.keys.js");
  5642. require2("core-js/modules/es.array.includes.js");
  5643. require2("core-js/modules/es.string.includes.js");
  5644. require2("core-js/modules/es.regexp.exec.js");
  5645. require2("core-js/modules/es.string.replace.js");
  5646. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  5647. Object.defineProperty(exports3, "__esModule", {
  5648. value: true
  5649. });
  5650. exports3.formatObjKey = void 0;
  5651. function formatObjKey(obj, type, options) {
  5652. if (obj === null || (0, _typeof2.default)(obj) !== "object") {
  5653. return obj;
  5654. }
  5655. var o;
  5656. if (Array.isArray(obj)) {
  5657. o = [];
  5658. for (var i = 0; i < obj.length; i++) {
  5659. o.push(formatObjKey(obj[i], type, options));
  5660. }
  5661. } else {
  5662. o = {};
  5663. Object.keys(obj).forEach(function(key) {
  5664. o[handelFormat(key, type, options)] = formatObjKey(obj[key], type, options);
  5665. });
  5666. }
  5667. return o;
  5668. }
  5669. exports3.formatObjKey = formatObjKey;
  5670. function handelFormat(key, type, options) {
  5671. if (options && options.exclude && options.exclude.includes(key))
  5672. return key;
  5673. if (type === "firstUpperCase") {
  5674. key = key.replace(/^./, function(_) {
  5675. return _.toUpperCase();
  5676. });
  5677. } else if (type === "firstLowerCase") {
  5678. key = key.replace(/^./, function(_) {
  5679. return _.toLowerCase();
  5680. });
  5681. }
  5682. return key;
  5683. }
  5684. }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.includes.js": 302, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 62: [function(require2, module3, exports3) {
  5685. "use strict";
  5686. require2("core-js/modules/es.regexp.exec.js");
  5687. Object.defineProperty(exports3, "__esModule", {
  5688. value: true
  5689. });
  5690. exports3.getStrBytesCount = void 0;
  5691. function getStrBytesCount(str) {
  5692. var bytesCount = 0;
  5693. for (var i = 0; i < str.length; i++) {
  5694. var c = str.charAt(i);
  5695. if (/^[\u00-\uff]$/.test(c)) {
  5696. bytesCount += 1;
  5697. } else {
  5698. bytesCount += 2;
  5699. }
  5700. }
  5701. return bytesCount;
  5702. }
  5703. exports3.getStrBytesCount = getStrBytesCount;
  5704. }, { "core-js/modules/es.regexp.exec.js": 300 }], 63: [function(require2, module3, exports3) {
  5705. "use strict";
  5706. require2("core-js/modules/es.object.to-string.js");
  5707. Object.defineProperty(exports3, "__esModule", {
  5708. value: true
  5709. });
  5710. exports3.isArray = void 0;
  5711. exports3.isArray = function(obj) {
  5712. return Object.prototype.toString.call(obj) === "[object Array]";
  5713. };
  5714. }, { "core-js/modules/es.object.to-string.js": 291 }], 64: [function(require2, module3, exports3) {
  5715. "use strict";
  5716. Object.defineProperty(exports3, "__esModule", {
  5717. value: true
  5718. });
  5719. exports3.isBlob = void 0;
  5720. function isBlob(blob) {
  5721. return typeof Blob !== "undefined" && blob instanceof Blob;
  5722. }
  5723. exports3.isBlob = isBlob;
  5724. }, {}], 65: [function(require2, module3, exports3) {
  5725. (function(Buffer) {
  5726. (function() {
  5727. "use strict";
  5728. Object.defineProperty(exports3, "__esModule", {
  5729. value: true
  5730. });
  5731. exports3.isBuffer = void 0;
  5732. function isBuffer(obj) {
  5733. return Buffer.isBuffer(obj);
  5734. }
  5735. exports3.isBuffer = isBuffer;
  5736. }).call(this);
  5737. }).call(this, { "isBuffer": require2("../../../node_modules/is-buffer/index.js") });
  5738. }, { "../../../node_modules/is-buffer/index.js": 366 }], 66: [function(require2, module3, exports3) {
  5739. (function(process) {
  5740. (function() {
  5741. "use strict";
  5742. require2("core-js/modules/es.array.includes.js");
  5743. require2("core-js/modules/es.string.includes.js");
  5744. Object.defineProperty(exports3, "__esModule", {
  5745. value: true
  5746. });
  5747. exports3.isDingTalk = void 0;
  5748. function isDingTalk() {
  5749. if (process.browser && window.navigator.userAgent.toLowerCase().includes("aliapp(dingtalk")) {
  5750. return true;
  5751. }
  5752. return false;
  5753. }
  5754. exports3.isDingTalk = isDingTalk;
  5755. }).call(this);
  5756. }).call(this, require2("_process"));
  5757. }, { "_process": 467, "core-js/modules/es.array.includes.js": 277, "core-js/modules/es.string.includes.js": 302 }], 67: [function(require2, module3, exports3) {
  5758. "use strict";
  5759. Object.defineProperty(exports3, "__esModule", {
  5760. value: true
  5761. });
  5762. exports3.isFile = void 0;
  5763. exports3.isFile = function(obj) {
  5764. return typeof File !== "undefined" && obj instanceof File;
  5765. };
  5766. }, {}], 68: [function(require2, module3, exports3) {
  5767. "use strict";
  5768. Object.defineProperty(exports3, "__esModule", {
  5769. value: true
  5770. });
  5771. exports3.isFunction = void 0;
  5772. exports3.isFunction = function(v) {
  5773. return typeof v === "function";
  5774. };
  5775. }, {}], 69: [function(require2, module3, exports3) {
  5776. "use strict";
  5777. require2("core-js/modules/es.regexp.exec.js");
  5778. Object.defineProperty(exports3, "__esModule", {
  5779. value: true
  5780. });
  5781. exports3.isIP = void 0;
  5782. exports3.isIP = function(host) {
  5783. var ipv4Regex = /^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
  5784. var ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
  5785. return ipv4Regex.test(host) || ipv6Regex.test(host);
  5786. };
  5787. }, { "core-js/modules/es.regexp.exec.js": 300 }], 70: [function(require2, module3, exports3) {
  5788. "use strict";
  5789. require2("core-js/modules/es.object.to-string.js");
  5790. Object.defineProperty(exports3, "__esModule", {
  5791. value: true
  5792. });
  5793. exports3.isObject = void 0;
  5794. exports3.isObject = function(obj) {
  5795. return Object.prototype.toString.call(obj) === "[object Object]";
  5796. };
  5797. }, { "core-js/modules/es.object.to-string.js": 291 }], 71: [function(require2, module3, exports3) {
  5798. "use strict";
  5799. require2("core-js/modules/es.object.to-string.js");
  5800. require2("core-js/modules/web.dom-collections.for-each.js");
  5801. require2("core-js/modules/es.object.keys.js");
  5802. Object.defineProperty(exports3, "__esModule", {
  5803. value: true
  5804. });
  5805. exports3.lowercaseKeyHeader = void 0;
  5806. var isObject_1 = require2("./isObject");
  5807. function lowercaseKeyHeader(headers) {
  5808. var lowercaseHeader = {};
  5809. if (isObject_1.isObject(headers)) {
  5810. Object.keys(headers).forEach(function(key) {
  5811. lowercaseHeader[key.toLowerCase()] = headers[key];
  5812. });
  5813. }
  5814. return lowercaseHeader;
  5815. }
  5816. exports3.lowercaseKeyHeader = lowercaseKeyHeader;
  5817. }, { "./isObject": 70, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/web.dom-collections.for-each.js": 339 }], 72: [function(require2, module3, exports3) {
  5818. "use strict";
  5819. require2("core-js/modules/es.regexp.exec.js");
  5820. require2("core-js/modules/es.string.replace.js");
  5821. require2("core-js/modules/es.object.to-string.js");
  5822. require2("core-js/modules/web.dom-collections.for-each.js");
  5823. require2("core-js/modules/es.object.keys.js");
  5824. require2("core-js/modules/es.array.concat.js");
  5825. require2("core-js/modules/es.array.join.js");
  5826. require2("core-js/modules/es.array.map.js");
  5827. require2("core-js/modules/es.regexp.to-string.js");
  5828. Object.defineProperty(exports3, "__esModule", {
  5829. value: true
  5830. });
  5831. exports3.obj2xml = void 0;
  5832. var formatObjKey_1 = require2("./formatObjKey");
  5833. function type(params) {
  5834. return Object.prototype.toString.call(params).replace(/(.*? |])/g, "").toLowerCase();
  5835. }
  5836. function obj2xml(obj, options) {
  5837. var s = "";
  5838. if (options && options.headers) {
  5839. s = '<?xml version="1.0" encoding="UTF-8"?>\n';
  5840. }
  5841. if (options && options.firstUpperCase) {
  5842. obj = formatObjKey_1.formatObjKey(obj, "firstUpperCase");
  5843. }
  5844. if (type(obj) === "object") {
  5845. Object.keys(obj).forEach(function(key) {
  5846. if (type(obj[key]) !== "undefined" && type(obj[key]) !== "null") {
  5847. if (type(obj[key]) === "string" || type(obj[key]) === "number") {
  5848. s += "<".concat(key, ">").concat(obj[key], "</").concat(key, ">");
  5849. } else if (type(obj[key]) === "object") {
  5850. s += "<".concat(key, ">").concat(obj2xml(obj[key]), "</").concat(key, ">");
  5851. } else if (type(obj[key]) === "array") {
  5852. s += obj[key].map(function(keyChild) {
  5853. return "<".concat(key, ">").concat(obj2xml(keyChild), "</").concat(key, ">");
  5854. }).join("");
  5855. } else {
  5856. s += "<".concat(key, ">").concat(obj[key].toString(), "</").concat(key, ">");
  5857. }
  5858. }
  5859. });
  5860. } else {
  5861. s += obj.toString();
  5862. }
  5863. return s;
  5864. }
  5865. exports3.obj2xml = obj2xml;
  5866. }, { "./formatObjKey": 61, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305, "core-js/modules/web.dom-collections.for-each.js": 339 }], 73: [function(require2, module3, exports3) {
  5867. "use strict";
  5868. require2("core-js/modules/es.array.slice.js");
  5869. require2("core-js/modules/es.object.to-string.js");
  5870. require2("core-js/modules/es.function.name.js");
  5871. require2("core-js/modules/es.array.from.js");
  5872. require2("core-js/modules/es.string.iterator.js");
  5873. require2("core-js/modules/es.regexp.exec.js");
  5874. require2("core-js/modules/es.symbol.js");
  5875. require2("core-js/modules/es.symbol.description.js");
  5876. require2("core-js/modules/es.symbol.iterator.js");
  5877. require2("core-js/modules/es.array.iterator.js");
  5878. require2("core-js/modules/web.dom-collections.iterator.js");
  5879. require2("core-js/modules/es.object.assign.js");
  5880. function _createForOfIteratorHelper(o, allowArrayLike) {
  5881. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  5882. if (!it) {
  5883. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  5884. if (it)
  5885. o = it;
  5886. var i = 0;
  5887. var F = function F2() {
  5888. };
  5889. return { s: F, n: function n() {
  5890. if (i >= o.length)
  5891. return { done: true };
  5892. return { done: false, value: o[i++] };
  5893. }, e: function e(_e) {
  5894. throw _e;
  5895. }, f: F };
  5896. }
  5897. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  5898. }
  5899. var normalCompletion = true, didErr = false, err;
  5900. return { s: function s() {
  5901. it = it.call(o);
  5902. }, n: function n() {
  5903. var step = it.next();
  5904. normalCompletion = step.done;
  5905. return step;
  5906. }, e: function e(_e2) {
  5907. didErr = true;
  5908. err = _e2;
  5909. }, f: function f() {
  5910. try {
  5911. if (!normalCompletion && it.return != null)
  5912. it.return();
  5913. } finally {
  5914. if (didErr)
  5915. throw err;
  5916. }
  5917. } };
  5918. }
  5919. function _unsupportedIterableToArray(o, minLen) {
  5920. if (!o)
  5921. return;
  5922. if (typeof o === "string")
  5923. return _arrayLikeToArray(o, minLen);
  5924. var n = Object.prototype.toString.call(o).slice(8, -1);
  5925. if (n === "Object" && o.constructor)
  5926. n = o.constructor.name;
  5927. if (n === "Map" || n === "Set")
  5928. return Array.from(o);
  5929. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  5930. return _arrayLikeToArray(o, minLen);
  5931. }
  5932. function _arrayLikeToArray(arr, len) {
  5933. if (len == null || len > arr.length)
  5934. len = arr.length;
  5935. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  5936. arr2[i] = arr[i];
  5937. }
  5938. return arr2;
  5939. }
  5940. Object.defineProperty(exports3, "__esModule", {
  5941. value: true
  5942. });
  5943. exports3.omit = void 0;
  5944. function omit(originalObject, keysToOmit) {
  5945. var cloneObject = Object.assign({}, originalObject);
  5946. var _iterator = _createForOfIteratorHelper(keysToOmit), _step;
  5947. try {
  5948. for (_iterator.s(); !(_step = _iterator.n()).done; ) {
  5949. var path = _step.value;
  5950. delete cloneObject[path];
  5951. }
  5952. } catch (err) {
  5953. _iterator.e(err);
  5954. } finally {
  5955. _iterator.f();
  5956. }
  5957. return cloneObject;
  5958. }
  5959. exports3.omit = omit;
  5960. }, { "core-js/modules/es.array.from.js": 276, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.iterator.js": 303, "core-js/modules/es.symbol.description.js": 310, "core-js/modules/es.symbol.iterator.js": 312, "core-js/modules/es.symbol.js": 313, "core-js/modules/web.dom-collections.iterator.js": 340 }], 74: [function(require2, module3, exports3) {
  5961. "use strict";
  5962. require2("core-js/modules/es.object.to-string.js");
  5963. require2("core-js/modules/es.promise.js");
  5964. Object.defineProperty(exports3, "__esModule", {
  5965. value: true
  5966. });
  5967. exports3.retry = void 0;
  5968. function retry(func, retryMax) {
  5969. var config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  5970. var retryNum = 0;
  5971. var _config$retryDelay = config.retryDelay, retryDelay = _config$retryDelay === void 0 ? 500 : _config$retryDelay, _config$errorHandler = config.errorHandler, errorHandler = _config$errorHandler === void 0 ? function() {
  5972. return true;
  5973. } : _config$errorHandler;
  5974. var funcR = function funcR2() {
  5975. for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
  5976. arg[_key] = arguments[_key];
  5977. }
  5978. return new Promise(function(resolve, reject) {
  5979. func.apply(void 0, arg).then(function(result) {
  5980. retryNum = 0;
  5981. resolve(result);
  5982. }).catch(function(err) {
  5983. if (retryNum < retryMax && errorHandler(err)) {
  5984. retryNum++;
  5985. setTimeout(function() {
  5986. resolve(funcR2.apply(void 0, arg));
  5987. }, retryDelay);
  5988. } else {
  5989. retryNum = 0;
  5990. reject(err);
  5991. }
  5992. });
  5993. });
  5994. };
  5995. return funcR;
  5996. }
  5997. exports3.retry = retry;
  5998. }, { "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295 }], 75: [function(require2, module3, exports3) {
  5999. "use strict";
  6000. var __importDefault = function(mod) {
  6001. return mod && mod.__esModule ? mod : {
  6002. "default": mod
  6003. };
  6004. };
  6005. Object.defineProperty(exports3, "__esModule", {
  6006. value: true
  6007. });
  6008. exports3.setRegion = void 0;
  6009. var url_1 = __importDefault(require2("url"));
  6010. var checkConfigValid_1 = require2("./checkConfigValid");
  6011. function setRegion(region) {
  6012. var internal = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  6013. var secure = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
  6014. checkConfigValid_1.checkConfigValid(region, "region");
  6015. var protocol = secure ? "https://" : "http://";
  6016. var suffix = internal ? "-internal.aliyuncs.com" : ".aliyuncs.com";
  6017. var prefix = "vpc100-oss-cn-";
  6018. if (region.substr(0, prefix.length) === prefix) {
  6019. suffix = ".aliyuncs.com";
  6020. }
  6021. return url_1.default.parse(protocol + region + suffix);
  6022. }
  6023. exports3.setRegion = setRegion;
  6024. }, { "./checkConfigValid": 52, "url": 472 }], 76: [function(require2, module3, exports3) {
  6025. "use strict";
  6026. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  6027. var _regenerator = _interopRequireDefault(require2("@babel/runtime/regenerator"));
  6028. require2("core-js/modules/es.object.keys.js");
  6029. require2("core-js/modules/es.object.to-string.js");
  6030. require2("core-js/modules/es.array.find.js");
  6031. require2("core-js/modules/es.object.assign.js");
  6032. var _asyncToGenerator2 = _interopRequireDefault(require2("@babel/runtime/helpers/asyncToGenerator"));
  6033. Object.defineProperty(exports3, "__esModule", {
  6034. value: true
  6035. });
  6036. exports3.checkCredentials = exports3.setSTSToken = void 0;
  6037. var formatObjKey_1 = require2("./formatObjKey");
  6038. function setSTSToken() {
  6039. return _setSTSToken.apply(this, arguments);
  6040. }
  6041. function _setSTSToken() {
  6042. _setSTSToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
  6043. var now, credentials;
  6044. return _regenerator.default.wrap(function _callee$(_context) {
  6045. while (1) {
  6046. switch (_context.prev = _context.next) {
  6047. case 0:
  6048. if (!this.options)
  6049. this.options = {};
  6050. now = /* @__PURE__ */ new Date();
  6051. if (!this.stsTokenFreshTime) {
  6052. _context.next = 14;
  6053. break;
  6054. }
  6055. if (!(+now - this.stsTokenFreshTime >= this.options.refreshSTSTokenInterval)) {
  6056. _context.next = 12;
  6057. break;
  6058. }
  6059. this.stsTokenFreshTime = now;
  6060. _context.next = 7;
  6061. return this.options.refreshSTSToken();
  6062. case 7:
  6063. credentials = _context.sent;
  6064. credentials = formatObjKey_1.formatObjKey(credentials, "firstLowerCase");
  6065. if (credentials.securityToken) {
  6066. credentials.stsToken = credentials.securityToken;
  6067. }
  6068. checkCredentials(credentials);
  6069. Object.assign(this.options, credentials);
  6070. case 12:
  6071. _context.next = 15;
  6072. break;
  6073. case 14:
  6074. this.stsTokenFreshTime = now;
  6075. case 15:
  6076. return _context.abrupt("return", null);
  6077. case 16:
  6078. case "end":
  6079. return _context.stop();
  6080. }
  6081. }
  6082. }, _callee, this);
  6083. }));
  6084. return _setSTSToken.apply(this, arguments);
  6085. }
  6086. exports3.setSTSToken = setSTSToken;
  6087. function checkCredentials(obj) {
  6088. var stsTokenKey = ["accessKeySecret", "accessKeyId", "stsToken"];
  6089. var objKeys = Object.keys(obj);
  6090. stsTokenKey.forEach(function(_) {
  6091. if (!objKeys.find(function(key) {
  6092. return key === _;
  6093. })) {
  6094. throw Error("refreshSTSToken must return contains ".concat(_));
  6095. }
  6096. });
  6097. }
  6098. exports3.checkCredentials = checkCredentials;
  6099. }, { "./formatObjKey": 61, "@babel/runtime/helpers/asyncToGenerator": 77, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/regenerator": 80, "core-js/modules/es.array.find.js": 275, "core-js/modules/es.object.assign.js": 287, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291 }], 77: [function(require2, module3, exports3) {
  6100. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  6101. try {
  6102. var info = gen[key](arg);
  6103. var value = info.value;
  6104. } catch (error) {
  6105. reject(error);
  6106. return;
  6107. }
  6108. if (info.done) {
  6109. resolve(value);
  6110. } else {
  6111. Promise.resolve(value).then(_next, _throw);
  6112. }
  6113. }
  6114. function _asyncToGenerator(fn) {
  6115. return function() {
  6116. var self2 = this, args = arguments;
  6117. return new Promise(function(resolve, reject) {
  6118. var gen = fn.apply(self2, args);
  6119. function _next(value) {
  6120. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  6121. }
  6122. function _throw(err) {
  6123. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  6124. }
  6125. _next(void 0);
  6126. });
  6127. };
  6128. }
  6129. module3.exports = _asyncToGenerator, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
  6130. }, {}], 78: [function(require2, module3, exports3) {
  6131. function _interopRequireDefault(obj) {
  6132. return obj && obj.__esModule ? obj : {
  6133. "default": obj
  6134. };
  6135. }
  6136. module3.exports = _interopRequireDefault, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
  6137. }, {}], 79: [function(require2, module3, exports3) {
  6138. function _typeof(obj) {
  6139. "@babel/helpers - typeof";
  6140. return module3.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
  6141. return typeof obj2;
  6142. } : function(obj2) {
  6143. return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  6144. }, module3.exports.__esModule = true, module3.exports["default"] = module3.exports, _typeof(obj);
  6145. }
  6146. module3.exports = _typeof, module3.exports.__esModule = true, module3.exports["default"] = module3.exports;
  6147. }, {}], 80: [function(require2, module3, exports3) {
  6148. module3.exports = require2("regenerator-runtime");
  6149. }, { "regenerator-runtime": 395 }], 81: [function(require2, module3, exports3) {
  6150. module3.exports = noop;
  6151. module3.exports.HttpsAgent = noop;
  6152. function noop() {
  6153. }
  6154. }, {}], 82: [function(require2, module3, exports3) {
  6155. (function(global2) {
  6156. (function() {
  6157. "use strict";
  6158. var objectAssign = require2("object-assign");
  6159. function compare(a, b) {
  6160. if (a === b) {
  6161. return 0;
  6162. }
  6163. var x = a.length;
  6164. var y = b.length;
  6165. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  6166. if (a[i] !== b[i]) {
  6167. x = a[i];
  6168. y = b[i];
  6169. break;
  6170. }
  6171. }
  6172. if (x < y) {
  6173. return -1;
  6174. }
  6175. if (y < x) {
  6176. return 1;
  6177. }
  6178. return 0;
  6179. }
  6180. function isBuffer(b) {
  6181. if (global2.Buffer && typeof global2.Buffer.isBuffer === "function") {
  6182. return global2.Buffer.isBuffer(b);
  6183. }
  6184. return !!(b != null && b._isBuffer);
  6185. }
  6186. var util = require2("util/");
  6187. var hasOwn = Object.prototype.hasOwnProperty;
  6188. var pSlice = Array.prototype.slice;
  6189. var functionsHaveNames = function() {
  6190. return function foo() {
  6191. }.name === "foo";
  6192. }();
  6193. function pToString(obj) {
  6194. return Object.prototype.toString.call(obj);
  6195. }
  6196. function isView(arrbuf) {
  6197. if (isBuffer(arrbuf)) {
  6198. return false;
  6199. }
  6200. if (typeof global2.ArrayBuffer !== "function") {
  6201. return false;
  6202. }
  6203. if (typeof ArrayBuffer.isView === "function") {
  6204. return ArrayBuffer.isView(arrbuf);
  6205. }
  6206. if (!arrbuf) {
  6207. return false;
  6208. }
  6209. if (arrbuf instanceof DataView) {
  6210. return true;
  6211. }
  6212. if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  6213. return true;
  6214. }
  6215. return false;
  6216. }
  6217. var assert = module3.exports = ok;
  6218. var regex = /\s*function\s+([^\(\s]*)\s*/;
  6219. function getName(func) {
  6220. if (!util.isFunction(func)) {
  6221. return;
  6222. }
  6223. if (functionsHaveNames) {
  6224. return func.name;
  6225. }
  6226. var str = func.toString();
  6227. var match = str.match(regex);
  6228. return match && match[1];
  6229. }
  6230. assert.AssertionError = function AssertionError(options) {
  6231. this.name = "AssertionError";
  6232. this.actual = options.actual;
  6233. this.expected = options.expected;
  6234. this.operator = options.operator;
  6235. if (options.message) {
  6236. this.message = options.message;
  6237. this.generatedMessage = false;
  6238. } else {
  6239. this.message = getMessage(this);
  6240. this.generatedMessage = true;
  6241. }
  6242. var stackStartFunction = options.stackStartFunction || fail;
  6243. if (Error.captureStackTrace) {
  6244. Error.captureStackTrace(this, stackStartFunction);
  6245. } else {
  6246. var err = new Error();
  6247. if (err.stack) {
  6248. var out = err.stack;
  6249. var fn_name = getName(stackStartFunction);
  6250. var idx = out.indexOf("\n" + fn_name);
  6251. if (idx >= 0) {
  6252. var next_line = out.indexOf("\n", idx + 1);
  6253. out = out.substring(next_line + 1);
  6254. }
  6255. this.stack = out;
  6256. }
  6257. }
  6258. };
  6259. util.inherits(assert.AssertionError, Error);
  6260. function truncate(s, n) {
  6261. if (typeof s === "string") {
  6262. return s.length < n ? s : s.slice(0, n);
  6263. } else {
  6264. return s;
  6265. }
  6266. }
  6267. function inspect(something) {
  6268. if (functionsHaveNames || !util.isFunction(something)) {
  6269. return util.inspect(something);
  6270. }
  6271. var rawname = getName(something);
  6272. var name = rawname ? ": " + rawname : "";
  6273. return "[Function" + name + "]";
  6274. }
  6275. function getMessage(self2) {
  6276. return truncate(inspect(self2.actual), 128) + " " + self2.operator + " " + truncate(inspect(self2.expected), 128);
  6277. }
  6278. function fail(actual, expected, message, operator, stackStartFunction) {
  6279. throw new assert.AssertionError({
  6280. message,
  6281. actual,
  6282. expected,
  6283. operator,
  6284. stackStartFunction
  6285. });
  6286. }
  6287. assert.fail = fail;
  6288. function ok(value, message) {
  6289. if (!value)
  6290. fail(value, true, message, "==", assert.ok);
  6291. }
  6292. assert.ok = ok;
  6293. assert.equal = function equal(actual, expected, message) {
  6294. if (actual != expected)
  6295. fail(actual, expected, message, "==", assert.equal);
  6296. };
  6297. assert.notEqual = function notEqual(actual, expected, message) {
  6298. if (actual == expected) {
  6299. fail(actual, expected, message, "!=", assert.notEqual);
  6300. }
  6301. };
  6302. assert.deepEqual = function deepEqual(actual, expected, message) {
  6303. if (!_deepEqual(actual, expected, false)) {
  6304. fail(actual, expected, message, "deepEqual", assert.deepEqual);
  6305. }
  6306. };
  6307. assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  6308. if (!_deepEqual(actual, expected, true)) {
  6309. fail(actual, expected, message, "deepStrictEqual", assert.deepStrictEqual);
  6310. }
  6311. };
  6312. function _deepEqual(actual, expected, strict2, memos) {
  6313. if (actual === expected) {
  6314. return true;
  6315. } else if (isBuffer(actual) && isBuffer(expected)) {
  6316. return compare(actual, expected) === 0;
  6317. } else if (util.isDate(actual) && util.isDate(expected)) {
  6318. return actual.getTime() === expected.getTime();
  6319. } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  6320. return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase;
  6321. } else if ((actual === null || typeof actual !== "object") && (expected === null || typeof expected !== "object")) {
  6322. return strict2 ? actual === expected : actual == expected;
  6323. } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) {
  6324. return compare(
  6325. new Uint8Array(actual.buffer),
  6326. new Uint8Array(expected.buffer)
  6327. ) === 0;
  6328. } else if (isBuffer(actual) !== isBuffer(expected)) {
  6329. return false;
  6330. } else {
  6331. memos = memos || { actual: [], expected: [] };
  6332. var actualIndex = memos.actual.indexOf(actual);
  6333. if (actualIndex !== -1) {
  6334. if (actualIndex === memos.expected.indexOf(expected)) {
  6335. return true;
  6336. }
  6337. }
  6338. memos.actual.push(actual);
  6339. memos.expected.push(expected);
  6340. return objEquiv(actual, expected, strict2, memos);
  6341. }
  6342. }
  6343. function isArguments(object) {
  6344. return Object.prototype.toString.call(object) == "[object Arguments]";
  6345. }
  6346. function objEquiv(a, b, strict2, actualVisitedObjects) {
  6347. if (a === null || a === void 0 || b === null || b === void 0)
  6348. return false;
  6349. if (util.isPrimitive(a) || util.isPrimitive(b))
  6350. return a === b;
  6351. if (strict2 && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
  6352. return false;
  6353. var aIsArgs = isArguments(a);
  6354. var bIsArgs = isArguments(b);
  6355. if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs)
  6356. return false;
  6357. if (aIsArgs) {
  6358. a = pSlice.call(a);
  6359. b = pSlice.call(b);
  6360. return _deepEqual(a, b, strict2);
  6361. }
  6362. var ka = objectKeys(a);
  6363. var kb = objectKeys(b);
  6364. var key, i;
  6365. if (ka.length !== kb.length)
  6366. return false;
  6367. ka.sort();
  6368. kb.sort();
  6369. for (i = ka.length - 1; i >= 0; i--) {
  6370. if (ka[i] !== kb[i])
  6371. return false;
  6372. }
  6373. for (i = ka.length - 1; i >= 0; i--) {
  6374. key = ka[i];
  6375. if (!_deepEqual(a[key], b[key], strict2, actualVisitedObjects))
  6376. return false;
  6377. }
  6378. return true;
  6379. }
  6380. assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  6381. if (_deepEqual(actual, expected, false)) {
  6382. fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);
  6383. }
  6384. };
  6385. assert.notDeepStrictEqual = notDeepStrictEqual;
  6386. function notDeepStrictEqual(actual, expected, message) {
  6387. if (_deepEqual(actual, expected, true)) {
  6388. fail(actual, expected, message, "notDeepStrictEqual", notDeepStrictEqual);
  6389. }
  6390. }
  6391. assert.strictEqual = function strictEqual(actual, expected, message) {
  6392. if (actual !== expected) {
  6393. fail(actual, expected, message, "===", assert.strictEqual);
  6394. }
  6395. };
  6396. assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  6397. if (actual === expected) {
  6398. fail(actual, expected, message, "!==", assert.notStrictEqual);
  6399. }
  6400. };
  6401. function expectedException(actual, expected) {
  6402. if (!actual || !expected) {
  6403. return false;
  6404. }
  6405. if (Object.prototype.toString.call(expected) == "[object RegExp]") {
  6406. return expected.test(actual);
  6407. }
  6408. try {
  6409. if (actual instanceof expected) {
  6410. return true;
  6411. }
  6412. } catch (e) {
  6413. }
  6414. if (Error.isPrototypeOf(expected)) {
  6415. return false;
  6416. }
  6417. return expected.call({}, actual) === true;
  6418. }
  6419. function _tryBlock(block) {
  6420. var error;
  6421. try {
  6422. block();
  6423. } catch (e) {
  6424. error = e;
  6425. }
  6426. return error;
  6427. }
  6428. function _throws(shouldThrow, block, expected, message) {
  6429. var actual;
  6430. if (typeof block !== "function") {
  6431. throw new TypeError('"block" argument must be a function');
  6432. }
  6433. if (typeof expected === "string") {
  6434. message = expected;
  6435. expected = null;
  6436. }
  6437. actual = _tryBlock(block);
  6438. message = (expected && expected.name ? " (" + expected.name + ")." : ".") + (message ? " " + message : ".");
  6439. if (shouldThrow && !actual) {
  6440. fail(actual, expected, "Missing expected exception" + message);
  6441. }
  6442. var userProvidedMessage = typeof message === "string";
  6443. var isUnwantedException = !shouldThrow && util.isError(actual);
  6444. var isUnexpectedException = !shouldThrow && actual && !expected;
  6445. if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) {
  6446. fail(actual, expected, "Got unwanted exception" + message);
  6447. }
  6448. if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) {
  6449. throw actual;
  6450. }
  6451. }
  6452. assert.throws = function(block, error, message) {
  6453. _throws(true, block, error, message);
  6454. };
  6455. assert.doesNotThrow = function(block, error, message) {
  6456. _throws(false, block, error, message);
  6457. };
  6458. assert.ifError = function(err) {
  6459. if (err)
  6460. throw err;
  6461. };
  6462. function strict(value, message) {
  6463. if (!value)
  6464. fail(value, true, message, "==", strict);
  6465. }
  6466. assert.strict = objectAssign(strict, assert, {
  6467. equal: assert.strictEqual,
  6468. deepEqual: assert.deepStrictEqual,
  6469. notEqual: assert.notStrictEqual,
  6470. notDeepEqual: assert.notDeepStrictEqual
  6471. });
  6472. assert.strict.strict = assert.strict;
  6473. var objectKeys = Object.keys || function(obj) {
  6474. var keys = [];
  6475. for (var key in obj) {
  6476. if (hasOwn.call(obj, key))
  6477. keys.push(key);
  6478. }
  6479. return keys;
  6480. };
  6481. }).call(this);
  6482. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  6483. }, { "object-assign": 377, "util/": 85 }], 83: [function(require2, module3, exports3) {
  6484. if (typeof Object.create === "function") {
  6485. module3.exports = function inherits(ctor, superCtor) {
  6486. ctor.super_ = superCtor;
  6487. ctor.prototype = Object.create(superCtor.prototype, {
  6488. constructor: {
  6489. value: ctor,
  6490. enumerable: false,
  6491. writable: true,
  6492. configurable: true
  6493. }
  6494. });
  6495. };
  6496. } else {
  6497. module3.exports = function inherits(ctor, superCtor) {
  6498. ctor.super_ = superCtor;
  6499. var TempCtor = function() {
  6500. };
  6501. TempCtor.prototype = superCtor.prototype;
  6502. ctor.prototype = new TempCtor();
  6503. ctor.prototype.constructor = ctor;
  6504. };
  6505. }
  6506. }, {}], 84: [function(require2, module3, exports3) {
  6507. module3.exports = function isBuffer(arg) {
  6508. return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function";
  6509. };
  6510. }, {}], 85: [function(require2, module3, exports3) {
  6511. (function(process, global2) {
  6512. (function() {
  6513. var formatRegExp = /%[sdj%]/g;
  6514. exports3.format = function(f) {
  6515. if (!isString(f)) {
  6516. var objects = [];
  6517. for (var i = 0; i < arguments.length; i++) {
  6518. objects.push(inspect(arguments[i]));
  6519. }
  6520. return objects.join(" ");
  6521. }
  6522. var i = 1;
  6523. var args = arguments;
  6524. var len = args.length;
  6525. var str = String(f).replace(formatRegExp, function(x2) {
  6526. if (x2 === "%%")
  6527. return "%";
  6528. if (i >= len)
  6529. return x2;
  6530. switch (x2) {
  6531. case "%s":
  6532. return String(args[i++]);
  6533. case "%d":
  6534. return Number(args[i++]);
  6535. case "%j":
  6536. try {
  6537. return JSON.stringify(args[i++]);
  6538. } catch (_) {
  6539. return "[Circular]";
  6540. }
  6541. default:
  6542. return x2;
  6543. }
  6544. });
  6545. for (var x = args[i]; i < len; x = args[++i]) {
  6546. if (isNull(x) || !isObject(x)) {
  6547. str += " " + x;
  6548. } else {
  6549. str += " " + inspect(x);
  6550. }
  6551. }
  6552. return str;
  6553. };
  6554. exports3.deprecate = function(fn, msg) {
  6555. if (isUndefined(global2.process)) {
  6556. return function() {
  6557. return exports3.deprecate(fn, msg).apply(this, arguments);
  6558. };
  6559. }
  6560. if (process.noDeprecation === true) {
  6561. return fn;
  6562. }
  6563. var warned = false;
  6564. function deprecated() {
  6565. if (!warned) {
  6566. if (process.throwDeprecation) {
  6567. throw new Error(msg);
  6568. } else if (process.traceDeprecation) {
  6569. console.trace(msg);
  6570. } else {
  6571. console.error(msg);
  6572. }
  6573. warned = true;
  6574. }
  6575. return fn.apply(this, arguments);
  6576. }
  6577. return deprecated;
  6578. };
  6579. var debugs = {};
  6580. var debugEnviron;
  6581. exports3.debuglog = function(set) {
  6582. if (isUndefined(debugEnviron))
  6583. debugEnviron = process.env.NODE_DEBUG || "";
  6584. set = set.toUpperCase();
  6585. if (!debugs[set]) {
  6586. if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) {
  6587. var pid = process.pid;
  6588. debugs[set] = function() {
  6589. var msg = exports3.format.apply(exports3, arguments);
  6590. console.error("%s %d: %s", set, pid, msg);
  6591. };
  6592. } else {
  6593. debugs[set] = function() {
  6594. };
  6595. }
  6596. }
  6597. return debugs[set];
  6598. };
  6599. function inspect(obj, opts) {
  6600. var ctx = {
  6601. seen: [],
  6602. stylize: stylizeNoColor
  6603. };
  6604. if (arguments.length >= 3)
  6605. ctx.depth = arguments[2];
  6606. if (arguments.length >= 4)
  6607. ctx.colors = arguments[3];
  6608. if (isBoolean(opts)) {
  6609. ctx.showHidden = opts;
  6610. } else if (opts) {
  6611. exports3._extend(ctx, opts);
  6612. }
  6613. if (isUndefined(ctx.showHidden))
  6614. ctx.showHidden = false;
  6615. if (isUndefined(ctx.depth))
  6616. ctx.depth = 2;
  6617. if (isUndefined(ctx.colors))
  6618. ctx.colors = false;
  6619. if (isUndefined(ctx.customInspect))
  6620. ctx.customInspect = true;
  6621. if (ctx.colors)
  6622. ctx.stylize = stylizeWithColor;
  6623. return formatValue(ctx, obj, ctx.depth);
  6624. }
  6625. exports3.inspect = inspect;
  6626. inspect.colors = {
  6627. "bold": [1, 22],
  6628. "italic": [3, 23],
  6629. "underline": [4, 24],
  6630. "inverse": [7, 27],
  6631. "white": [37, 39],
  6632. "grey": [90, 39],
  6633. "black": [30, 39],
  6634. "blue": [34, 39],
  6635. "cyan": [36, 39],
  6636. "green": [32, 39],
  6637. "magenta": [35, 39],
  6638. "red": [31, 39],
  6639. "yellow": [33, 39]
  6640. };
  6641. inspect.styles = {
  6642. "special": "cyan",
  6643. "number": "yellow",
  6644. "boolean": "yellow",
  6645. "undefined": "grey",
  6646. "null": "bold",
  6647. "string": "green",
  6648. "date": "magenta",
  6649. // "name": intentionally not styling
  6650. "regexp": "red"
  6651. };
  6652. function stylizeWithColor(str, styleType) {
  6653. var style = inspect.styles[styleType];
  6654. if (style) {
  6655. return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
  6656. } else {
  6657. return str;
  6658. }
  6659. }
  6660. function stylizeNoColor(str, styleType) {
  6661. return str;
  6662. }
  6663. function arrayToHash(array) {
  6664. var hash = {};
  6665. array.forEach(function(val, idx) {
  6666. hash[val] = true;
  6667. });
  6668. return hash;
  6669. }
  6670. function formatValue(ctx, value, recurseTimes) {
  6671. if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
  6672. value.inspect !== exports3.inspect && // Also filter out any prototype objects using the circular check.
  6673. !(value.constructor && value.constructor.prototype === value)) {
  6674. var ret = value.inspect(recurseTimes, ctx);
  6675. if (!isString(ret)) {
  6676. ret = formatValue(ctx, ret, recurseTimes);
  6677. }
  6678. return ret;
  6679. }
  6680. var primitive = formatPrimitive(ctx, value);
  6681. if (primitive) {
  6682. return primitive;
  6683. }
  6684. var keys = Object.keys(value);
  6685. var visibleKeys = arrayToHash(keys);
  6686. if (ctx.showHidden) {
  6687. keys = Object.getOwnPropertyNames(value);
  6688. }
  6689. if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
  6690. return formatError(value);
  6691. }
  6692. if (keys.length === 0) {
  6693. if (isFunction(value)) {
  6694. var name = value.name ? ": " + value.name : "";
  6695. return ctx.stylize("[Function" + name + "]", "special");
  6696. }
  6697. if (isRegExp(value)) {
  6698. return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
  6699. }
  6700. if (isDate(value)) {
  6701. return ctx.stylize(Date.prototype.toString.call(value), "date");
  6702. }
  6703. if (isError(value)) {
  6704. return formatError(value);
  6705. }
  6706. }
  6707. var base = "", array = false, braces = ["{", "}"];
  6708. if (isArray(value)) {
  6709. array = true;
  6710. braces = ["[", "]"];
  6711. }
  6712. if (isFunction(value)) {
  6713. var n = value.name ? ": " + value.name : "";
  6714. base = " [Function" + n + "]";
  6715. }
  6716. if (isRegExp(value)) {
  6717. base = " " + RegExp.prototype.toString.call(value);
  6718. }
  6719. if (isDate(value)) {
  6720. base = " " + Date.prototype.toUTCString.call(value);
  6721. }
  6722. if (isError(value)) {
  6723. base = " " + formatError(value);
  6724. }
  6725. if (keys.length === 0 && (!array || value.length == 0)) {
  6726. return braces[0] + base + braces[1];
  6727. }
  6728. if (recurseTimes < 0) {
  6729. if (isRegExp(value)) {
  6730. return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
  6731. } else {
  6732. return ctx.stylize("[Object]", "special");
  6733. }
  6734. }
  6735. ctx.seen.push(value);
  6736. var output;
  6737. if (array) {
  6738. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  6739. } else {
  6740. output = keys.map(function(key) {
  6741. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  6742. });
  6743. }
  6744. ctx.seen.pop();
  6745. return reduceToSingleString(output, base, braces);
  6746. }
  6747. function formatPrimitive(ctx, value) {
  6748. if (isUndefined(value))
  6749. return ctx.stylize("undefined", "undefined");
  6750. if (isString(value)) {
  6751. var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
  6752. return ctx.stylize(simple, "string");
  6753. }
  6754. if (isNumber(value))
  6755. return ctx.stylize("" + value, "number");
  6756. if (isBoolean(value))
  6757. return ctx.stylize("" + value, "boolean");
  6758. if (isNull(value))
  6759. return ctx.stylize("null", "null");
  6760. }
  6761. function formatError(value) {
  6762. return "[" + Error.prototype.toString.call(value) + "]";
  6763. }
  6764. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  6765. var output = [];
  6766. for (var i = 0, l = value.length; i < l; ++i) {
  6767. if (hasOwnProperty(value, String(i))) {
  6768. output.push(formatProperty(
  6769. ctx,
  6770. value,
  6771. recurseTimes,
  6772. visibleKeys,
  6773. String(i),
  6774. true
  6775. ));
  6776. } else {
  6777. output.push("");
  6778. }
  6779. }
  6780. keys.forEach(function(key) {
  6781. if (!key.match(/^\d+$/)) {
  6782. output.push(formatProperty(
  6783. ctx,
  6784. value,
  6785. recurseTimes,
  6786. visibleKeys,
  6787. key,
  6788. true
  6789. ));
  6790. }
  6791. });
  6792. return output;
  6793. }
  6794. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  6795. var name, str, desc;
  6796. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  6797. if (desc.get) {
  6798. if (desc.set) {
  6799. str = ctx.stylize("[Getter/Setter]", "special");
  6800. } else {
  6801. str = ctx.stylize("[Getter]", "special");
  6802. }
  6803. } else {
  6804. if (desc.set) {
  6805. str = ctx.stylize("[Setter]", "special");
  6806. }
  6807. }
  6808. if (!hasOwnProperty(visibleKeys, key)) {
  6809. name = "[" + key + "]";
  6810. }
  6811. if (!str) {
  6812. if (ctx.seen.indexOf(desc.value) < 0) {
  6813. if (isNull(recurseTimes)) {
  6814. str = formatValue(ctx, desc.value, null);
  6815. } else {
  6816. str = formatValue(ctx, desc.value, recurseTimes - 1);
  6817. }
  6818. if (str.indexOf("\n") > -1) {
  6819. if (array) {
  6820. str = str.split("\n").map(function(line) {
  6821. return " " + line;
  6822. }).join("\n").substr(2);
  6823. } else {
  6824. str = "\n" + str.split("\n").map(function(line) {
  6825. return " " + line;
  6826. }).join("\n");
  6827. }
  6828. }
  6829. } else {
  6830. str = ctx.stylize("[Circular]", "special");
  6831. }
  6832. }
  6833. if (isUndefined(name)) {
  6834. if (array && key.match(/^\d+$/)) {
  6835. return str;
  6836. }
  6837. name = JSON.stringify("" + key);
  6838. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  6839. name = name.substr(1, name.length - 2);
  6840. name = ctx.stylize(name, "name");
  6841. } else {
  6842. name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
  6843. name = ctx.stylize(name, "string");
  6844. }
  6845. }
  6846. return name + ": " + str;
  6847. }
  6848. function reduceToSingleString(output, base, braces) {
  6849. var numLinesEst = 0;
  6850. var length = output.reduce(function(prev, cur) {
  6851. numLinesEst++;
  6852. if (cur.indexOf("\n") >= 0)
  6853. numLinesEst++;
  6854. return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
  6855. }, 0);
  6856. if (length > 60) {
  6857. return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
  6858. }
  6859. return braces[0] + base + " " + output.join(", ") + " " + braces[1];
  6860. }
  6861. function isArray(ar) {
  6862. return Array.isArray(ar);
  6863. }
  6864. exports3.isArray = isArray;
  6865. function isBoolean(arg) {
  6866. return typeof arg === "boolean";
  6867. }
  6868. exports3.isBoolean = isBoolean;
  6869. function isNull(arg) {
  6870. return arg === null;
  6871. }
  6872. exports3.isNull = isNull;
  6873. function isNullOrUndefined(arg) {
  6874. return arg == null;
  6875. }
  6876. exports3.isNullOrUndefined = isNullOrUndefined;
  6877. function isNumber(arg) {
  6878. return typeof arg === "number";
  6879. }
  6880. exports3.isNumber = isNumber;
  6881. function isString(arg) {
  6882. return typeof arg === "string";
  6883. }
  6884. exports3.isString = isString;
  6885. function isSymbol(arg) {
  6886. return typeof arg === "symbol";
  6887. }
  6888. exports3.isSymbol = isSymbol;
  6889. function isUndefined(arg) {
  6890. return arg === void 0;
  6891. }
  6892. exports3.isUndefined = isUndefined;
  6893. function isRegExp(re) {
  6894. return isObject(re) && objectToString(re) === "[object RegExp]";
  6895. }
  6896. exports3.isRegExp = isRegExp;
  6897. function isObject(arg) {
  6898. return typeof arg === "object" && arg !== null;
  6899. }
  6900. exports3.isObject = isObject;
  6901. function isDate(d) {
  6902. return isObject(d) && objectToString(d) === "[object Date]";
  6903. }
  6904. exports3.isDate = isDate;
  6905. function isError(e) {
  6906. return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
  6907. }
  6908. exports3.isError = isError;
  6909. function isFunction(arg) {
  6910. return typeof arg === "function";
  6911. }
  6912. exports3.isFunction = isFunction;
  6913. function isPrimitive(arg) {
  6914. return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
  6915. typeof arg === "undefined";
  6916. }
  6917. exports3.isPrimitive = isPrimitive;
  6918. exports3.isBuffer = require2("./support/isBuffer");
  6919. function objectToString(o) {
  6920. return Object.prototype.toString.call(o);
  6921. }
  6922. function pad(n) {
  6923. return n < 10 ? "0" + n.toString(10) : n.toString(10);
  6924. }
  6925. var months = [
  6926. "Jan",
  6927. "Feb",
  6928. "Mar",
  6929. "Apr",
  6930. "May",
  6931. "Jun",
  6932. "Jul",
  6933. "Aug",
  6934. "Sep",
  6935. "Oct",
  6936. "Nov",
  6937. "Dec"
  6938. ];
  6939. function timestamp() {
  6940. var d = /* @__PURE__ */ new Date();
  6941. var time = [
  6942. pad(d.getHours()),
  6943. pad(d.getMinutes()),
  6944. pad(d.getSeconds())
  6945. ].join(":");
  6946. return [d.getDate(), months[d.getMonth()], time].join(" ");
  6947. }
  6948. exports3.log = function() {
  6949. console.log("%s - %s", timestamp(), exports3.format.apply(exports3, arguments));
  6950. };
  6951. exports3.inherits = require2("inherits");
  6952. exports3._extend = function(origin, add) {
  6953. if (!add || !isObject(add))
  6954. return origin;
  6955. var keys = Object.keys(add);
  6956. var i = keys.length;
  6957. while (i--) {
  6958. origin[keys[i]] = add[keys[i]];
  6959. }
  6960. return origin;
  6961. };
  6962. function hasOwnProperty(obj, prop) {
  6963. return Object.prototype.hasOwnProperty.call(obj, prop);
  6964. }
  6965. }).call(this);
  6966. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  6967. }, { "./support/isBuffer": 84, "_process": 467, "inherits": 83 }], 86: [function(require2, module3, exports3) {
  6968. (function(global2) {
  6969. (function() {
  6970. "use strict";
  6971. var possibleNames = [
  6972. "BigInt64Array",
  6973. "BigUint64Array",
  6974. "Float32Array",
  6975. "Float64Array",
  6976. "Int16Array",
  6977. "Int32Array",
  6978. "Int8Array",
  6979. "Uint16Array",
  6980. "Uint32Array",
  6981. "Uint8Array",
  6982. "Uint8ClampedArray"
  6983. ];
  6984. var g = typeof globalThis === "undefined" ? global2 : globalThis;
  6985. module3.exports = function availableTypedArrays() {
  6986. var out = [];
  6987. for (var i = 0; i < possibleNames.length; i++) {
  6988. if (typeof g[possibleNames[i]] === "function") {
  6989. out[out.length] = possibleNames[i];
  6990. }
  6991. }
  6992. return out;
  6993. };
  6994. }).call(this);
  6995. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  6996. }, {}], 87: [function(require2, module3, exports3) {
  6997. "use strict";
  6998. exports3.byteLength = byteLength;
  6999. exports3.toByteArray = toByteArray;
  7000. exports3.fromByteArray = fromByteArray;
  7001. var lookup = [];
  7002. var revLookup = [];
  7003. var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
  7004. var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  7005. for (var i = 0, len = code.length; i < len; ++i) {
  7006. lookup[i] = code[i];
  7007. revLookup[code.charCodeAt(i)] = i;
  7008. }
  7009. revLookup["-".charCodeAt(0)] = 62;
  7010. revLookup["_".charCodeAt(0)] = 63;
  7011. function getLens(b64) {
  7012. var len2 = b64.length;
  7013. if (len2 % 4 > 0) {
  7014. throw new Error("Invalid string. Length must be a multiple of 4");
  7015. }
  7016. var validLen = b64.indexOf("=");
  7017. if (validLen === -1)
  7018. validLen = len2;
  7019. var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
  7020. return [validLen, placeHoldersLen];
  7021. }
  7022. function byteLength(b64) {
  7023. var lens = getLens(b64);
  7024. var validLen = lens[0];
  7025. var placeHoldersLen = lens[1];
  7026. return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  7027. }
  7028. function _byteLength(b64, validLen, placeHoldersLen) {
  7029. return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  7030. }
  7031. function toByteArray(b64) {
  7032. var tmp;
  7033. var lens = getLens(b64);
  7034. var validLen = lens[0];
  7035. var placeHoldersLen = lens[1];
  7036. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
  7037. var curByte = 0;
  7038. var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
  7039. var i2;
  7040. for (i2 = 0; i2 < len2; i2 += 4) {
  7041. tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
  7042. arr[curByte++] = tmp >> 16 & 255;
  7043. arr[curByte++] = tmp >> 8 & 255;
  7044. arr[curByte++] = tmp & 255;
  7045. }
  7046. if (placeHoldersLen === 2) {
  7047. tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
  7048. arr[curByte++] = tmp & 255;
  7049. }
  7050. if (placeHoldersLen === 1) {
  7051. tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
  7052. arr[curByte++] = tmp >> 8 & 255;
  7053. arr[curByte++] = tmp & 255;
  7054. }
  7055. return arr;
  7056. }
  7057. function tripletToBase64(num) {
  7058. return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
  7059. }
  7060. function encodeChunk(uint8, start, end) {
  7061. var tmp;
  7062. var output = [];
  7063. for (var i2 = start; i2 < end; i2 += 3) {
  7064. tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
  7065. output.push(tripletToBase64(tmp));
  7066. }
  7067. return output.join("");
  7068. }
  7069. function fromByteArray(uint8) {
  7070. var tmp;
  7071. var len2 = uint8.length;
  7072. var extraBytes = len2 % 3;
  7073. var parts = [];
  7074. var maxChunkLength = 16383;
  7075. for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
  7076. parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
  7077. }
  7078. if (extraBytes === 1) {
  7079. tmp = uint8[len2 - 1];
  7080. parts.push(
  7081. lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
  7082. );
  7083. } else if (extraBytes === 2) {
  7084. tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
  7085. parts.push(
  7086. lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
  7087. );
  7088. }
  7089. return parts.join("");
  7090. }
  7091. }, {}], 88: [function(require2, module3, exports3) {
  7092. !function(root, name, definition) {
  7093. if (typeof module3 != "undefined" && module3.exports)
  7094. module3.exports = definition();
  7095. else if (typeof define2 == "function" && define2.amd)
  7096. define2(name, definition);
  7097. else
  7098. root[name] = definition();
  7099. }(this, "bowser", function() {
  7100. var t = true;
  7101. function detect(ua) {
  7102. function getFirstMatch(regex) {
  7103. var match = ua.match(regex);
  7104. return match && match.length > 1 && match[1] || "";
  7105. }
  7106. function getSecondMatch(regex) {
  7107. var match = ua.match(regex);
  7108. return match && match.length > 1 && match[2] || "";
  7109. }
  7110. var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase(), likeAndroid = /like android/i.test(ua), android = !likeAndroid && /android/i.test(ua), nexusMobile = /nexus\s*[0-6]\s*/i.test(ua), nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua), chromeos = /CrOS/.test(ua), silk = /silk/i.test(ua), sailfish = /sailfish/i.test(ua), tizen = /tizen/i.test(ua), webos = /(web|hpw)(o|0)s/i.test(ua), windowsphone = /windows phone/i.test(ua), samsungBrowser = /SamsungBrowser/i.test(ua), windows = !windowsphone && /windows/i.test(ua), mac = !iosdevice && !silk && /macintosh/i.test(ua), linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua), edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i), versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i), tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua), mobile = !tablet && /[^-]mobi/i.test(ua), xbox = /xbox/i.test(ua), result;
  7111. if (/opera/i.test(ua)) {
  7112. result = {
  7113. name: "Opera",
  7114. opera: t,
  7115. version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
  7116. };
  7117. } else if (/opr\/|opios/i.test(ua)) {
  7118. result = {
  7119. name: "Opera",
  7120. opera: t,
  7121. version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier
  7122. };
  7123. } else if (/SamsungBrowser/i.test(ua)) {
  7124. result = {
  7125. name: "Samsung Internet for Android",
  7126. samsungBrowser: t,
  7127. version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)
  7128. };
  7129. } else if (/Whale/i.test(ua)) {
  7130. result = {
  7131. name: "NAVER Whale browser",
  7132. whale: t,
  7133. version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)
  7134. };
  7135. } else if (/MZBrowser/i.test(ua)) {
  7136. result = {
  7137. name: "MZ Browser",
  7138. mzbrowser: t,
  7139. version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)
  7140. };
  7141. } else if (/coast/i.test(ua)) {
  7142. result = {
  7143. name: "Opera Coast",
  7144. coast: t,
  7145. version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
  7146. };
  7147. } else if (/focus/i.test(ua)) {
  7148. result = {
  7149. name: "Focus",
  7150. focus: t,
  7151. version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)
  7152. };
  7153. } else if (/yabrowser/i.test(ua)) {
  7154. result = {
  7155. name: "Yandex Browser",
  7156. yandexbrowser: t,
  7157. version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)
  7158. };
  7159. } else if (/ucbrowser/i.test(ua)) {
  7160. result = {
  7161. name: "UC Browser",
  7162. ucbrowser: t,
  7163. version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)
  7164. };
  7165. } else if (/mxios/i.test(ua)) {
  7166. result = {
  7167. name: "Maxthon",
  7168. maxthon: t,
  7169. version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)
  7170. };
  7171. } else if (/epiphany/i.test(ua)) {
  7172. result = {
  7173. name: "Epiphany",
  7174. epiphany: t,
  7175. version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)
  7176. };
  7177. } else if (/puffin/i.test(ua)) {
  7178. result = {
  7179. name: "Puffin",
  7180. puffin: t,
  7181. version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)
  7182. };
  7183. } else if (/sleipnir/i.test(ua)) {
  7184. result = {
  7185. name: "Sleipnir",
  7186. sleipnir: t,
  7187. version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
  7188. };
  7189. } else if (/k-meleon/i.test(ua)) {
  7190. result = {
  7191. name: "K-Meleon",
  7192. kMeleon: t,
  7193. version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)
  7194. };
  7195. } else if (windowsphone) {
  7196. result = {
  7197. name: "Windows Phone",
  7198. osname: "Windows Phone",
  7199. windowsphone: t
  7200. };
  7201. if (edgeVersion) {
  7202. result.msedge = t;
  7203. result.version = edgeVersion;
  7204. } else {
  7205. result.msie = t;
  7206. result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i);
  7207. }
  7208. } else if (/msie|trident/i.test(ua)) {
  7209. result = {
  7210. name: "Internet Explorer",
  7211. msie: t,
  7212. version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
  7213. };
  7214. } else if (chromeos) {
  7215. result = {
  7216. name: "Chrome",
  7217. osname: "Chrome OS",
  7218. chromeos: t,
  7219. chromeBook: t,
  7220. chrome: t,
  7221. version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
  7222. };
  7223. } else if (/edg([ea]|ios)/i.test(ua)) {
  7224. result = {
  7225. name: "Microsoft Edge",
  7226. msedge: t,
  7227. version: edgeVersion
  7228. };
  7229. } else if (/vivaldi/i.test(ua)) {
  7230. result = {
  7231. name: "Vivaldi",
  7232. vivaldi: t,
  7233. version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
  7234. };
  7235. } else if (sailfish) {
  7236. result = {
  7237. name: "Sailfish",
  7238. osname: "Sailfish OS",
  7239. sailfish: t,
  7240. version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i)
  7241. };
  7242. } else if (/seamonkey\//i.test(ua)) {
  7243. result = {
  7244. name: "SeaMonkey",
  7245. seamonkey: t,
  7246. version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i)
  7247. };
  7248. } else if (/firefox|iceweasel|fxios/i.test(ua)) {
  7249. result = {
  7250. name: "Firefox",
  7251. firefox: t,
  7252. version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)
  7253. };
  7254. if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) {
  7255. result.firefoxos = t;
  7256. result.osname = "Firefox OS";
  7257. }
  7258. } else if (silk) {
  7259. result = {
  7260. name: "Amazon Silk",
  7261. silk: t,
  7262. version: getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
  7263. };
  7264. } else if (/phantom/i.test(ua)) {
  7265. result = {
  7266. name: "PhantomJS",
  7267. phantom: t,
  7268. version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i)
  7269. };
  7270. } else if (/slimerjs/i.test(ua)) {
  7271. result = {
  7272. name: "SlimerJS",
  7273. slimer: t,
  7274. version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i)
  7275. };
  7276. } else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) {
  7277. result = {
  7278. name: "BlackBerry",
  7279. osname: "BlackBerry OS",
  7280. blackberry: t,
  7281. version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
  7282. };
  7283. } else if (webos) {
  7284. result = {
  7285. name: "WebOS",
  7286. osname: "WebOS",
  7287. webos: t,
  7288. version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
  7289. };
  7290. /touchpad\//i.test(ua) && (result.touchpad = t);
  7291. } else if (/bada/i.test(ua)) {
  7292. result = {
  7293. name: "Bada",
  7294. osname: "Bada",
  7295. bada: t,
  7296. version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i)
  7297. };
  7298. } else if (tizen) {
  7299. result = {
  7300. name: "Tizen",
  7301. osname: "Tizen",
  7302. tizen: t,
  7303. version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier
  7304. };
  7305. } else if (/qupzilla/i.test(ua)) {
  7306. result = {
  7307. name: "QupZilla",
  7308. qupzilla: t,
  7309. version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
  7310. };
  7311. } else if (/chromium/i.test(ua)) {
  7312. result = {
  7313. name: "Chromium",
  7314. chromium: t,
  7315. version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier
  7316. };
  7317. } else if (/chrome|crios|crmo/i.test(ua)) {
  7318. result = {
  7319. name: "Chrome",
  7320. chrome: t,
  7321. version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
  7322. };
  7323. } else if (android) {
  7324. result = {
  7325. name: "Android",
  7326. version: versionIdentifier
  7327. };
  7328. } else if (/safari|applewebkit/i.test(ua)) {
  7329. result = {
  7330. name: "Safari",
  7331. safari: t
  7332. };
  7333. if (versionIdentifier) {
  7334. result.version = versionIdentifier;
  7335. }
  7336. } else if (iosdevice) {
  7337. result = {
  7338. name: iosdevice == "iphone" ? "iPhone" : iosdevice == "ipad" ? "iPad" : "iPod"
  7339. };
  7340. if (versionIdentifier) {
  7341. result.version = versionIdentifier;
  7342. }
  7343. } else if (/googlebot/i.test(ua)) {
  7344. result = {
  7345. name: "Googlebot",
  7346. googlebot: t,
  7347. version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier
  7348. };
  7349. } else {
  7350. result = {
  7351. name: getFirstMatch(/^(.*)\/(.*) /),
  7352. version: getSecondMatch(/^(.*)\/(.*) /)
  7353. };
  7354. }
  7355. if (!result.msedge && /(apple)?webkit/i.test(ua)) {
  7356. if (/(apple)?webkit\/537\.36/i.test(ua)) {
  7357. result.name = result.name || "Blink";
  7358. result.blink = t;
  7359. } else {
  7360. result.name = result.name || "Webkit";
  7361. result.webkit = t;
  7362. }
  7363. if (!result.version && versionIdentifier) {
  7364. result.version = versionIdentifier;
  7365. }
  7366. } else if (!result.opera && /gecko\//i.test(ua)) {
  7367. result.name = result.name || "Gecko";
  7368. result.gecko = t;
  7369. result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i);
  7370. }
  7371. if (!result.windowsphone && (android || result.silk)) {
  7372. result.android = t;
  7373. result.osname = "Android";
  7374. } else if (!result.windowsphone && iosdevice) {
  7375. result[iosdevice] = t;
  7376. result.ios = t;
  7377. result.osname = "iOS";
  7378. } else if (mac) {
  7379. result.mac = t;
  7380. result.osname = "macOS";
  7381. } else if (xbox) {
  7382. result.xbox = t;
  7383. result.osname = "Xbox";
  7384. } else if (windows) {
  7385. result.windows = t;
  7386. result.osname = "Windows";
  7387. } else if (linux) {
  7388. result.linux = t;
  7389. result.osname = "Linux";
  7390. }
  7391. function getWindowsVersion(s) {
  7392. switch (s) {
  7393. case "NT":
  7394. return "NT";
  7395. case "XP":
  7396. return "XP";
  7397. case "NT 5.0":
  7398. return "2000";
  7399. case "NT 5.1":
  7400. return "XP";
  7401. case "NT 5.2":
  7402. return "2003";
  7403. case "NT 6.0":
  7404. return "Vista";
  7405. case "NT 6.1":
  7406. return "7";
  7407. case "NT 6.2":
  7408. return "8";
  7409. case "NT 6.3":
  7410. return "8.1";
  7411. case "NT 10.0":
  7412. return "10";
  7413. default:
  7414. return void 0;
  7415. }
  7416. }
  7417. var osVersion = "";
  7418. if (result.windows) {
  7419. osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i));
  7420. } else if (result.windowsphone) {
  7421. osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i);
  7422. } else if (result.mac) {
  7423. osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i);
  7424. osVersion = osVersion.replace(/[_\s]/g, ".");
  7425. } else if (iosdevice) {
  7426. osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i);
  7427. osVersion = osVersion.replace(/[_\s]/g, ".");
  7428. } else if (android) {
  7429. osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i);
  7430. } else if (result.webos) {
  7431. osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i);
  7432. } else if (result.blackberry) {
  7433. osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i);
  7434. } else if (result.bada) {
  7435. osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i);
  7436. } else if (result.tizen) {
  7437. osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i);
  7438. }
  7439. if (osVersion) {
  7440. result.osversion = osVersion;
  7441. }
  7442. var osMajorVersion = !result.windows && osVersion.split(".")[0];
  7443. if (tablet || nexusTablet || iosdevice == "ipad" || android && (osMajorVersion == 3 || osMajorVersion >= 4 && !mobile) || result.silk) {
  7444. result.tablet = t;
  7445. } else if (mobile || iosdevice == "iphone" || iosdevice == "ipod" || android || nexusMobile || result.blackberry || result.webos || result.bada) {
  7446. result.mobile = t;
  7447. }
  7448. if (result.msedge || result.msie && result.version >= 10 || result.yandexbrowser && result.version >= 15 || result.vivaldi && result.version >= 1 || result.chrome && result.version >= 20 || result.samsungBrowser && result.version >= 4 || result.whale && compareVersions([result.version, "1.0"]) === 1 || result.mzbrowser && compareVersions([result.version, "6.0"]) === 1 || result.focus && compareVersions([result.version, "1.0"]) === 1 || result.firefox && result.version >= 20 || result.safari && result.version >= 6 || result.opera && result.version >= 10 || result.ios && result.osversion && result.osversion.split(".")[0] >= 6 || result.blackberry && result.version >= 10.1 || result.chromium && result.version >= 20) {
  7449. result.a = t;
  7450. } else if (result.msie && result.version < 10 || result.chrome && result.version < 20 || result.firefox && result.version < 20 || result.safari && result.version < 6 || result.opera && result.version < 10 || result.ios && result.osversion && result.osversion.split(".")[0] < 6 || result.chromium && result.version < 20) {
  7451. result.c = t;
  7452. } else
  7453. result.x = t;
  7454. return result;
  7455. }
  7456. var bowser = detect(typeof navigator !== "undefined" ? navigator.userAgent || "" : "");
  7457. bowser.test = function(browserList) {
  7458. for (var i = 0; i < browserList.length; ++i) {
  7459. var browserItem = browserList[i];
  7460. if (typeof browserItem === "string") {
  7461. if (browserItem in bowser) {
  7462. return true;
  7463. }
  7464. }
  7465. }
  7466. return false;
  7467. };
  7468. function getVersionPrecision(version) {
  7469. return version.split(".").length;
  7470. }
  7471. function map(arr, iterator) {
  7472. var result = [], i;
  7473. if (Array.prototype.map) {
  7474. return Array.prototype.map.call(arr, iterator);
  7475. }
  7476. for (i = 0; i < arr.length; i++) {
  7477. result.push(iterator(arr[i]));
  7478. }
  7479. return result;
  7480. }
  7481. function compareVersions(versions) {
  7482. var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));
  7483. var chunks = map(versions, function(version) {
  7484. var delta = precision - getVersionPrecision(version);
  7485. version = version + new Array(delta + 1).join(".0");
  7486. return map(version.split("."), function(chunk) {
  7487. return new Array(20 - chunk.length).join("0") + chunk;
  7488. }).reverse();
  7489. });
  7490. while (--precision >= 0) {
  7491. if (chunks[0][precision] > chunks[1][precision]) {
  7492. return 1;
  7493. } else if (chunks[0][precision] === chunks[1][precision]) {
  7494. if (precision === 0) {
  7495. return 0;
  7496. }
  7497. } else {
  7498. return -1;
  7499. }
  7500. }
  7501. }
  7502. function isUnsupportedBrowser(minVersions, strictMode, ua) {
  7503. var _bowser = bowser;
  7504. if (typeof strictMode === "string") {
  7505. ua = strictMode;
  7506. strictMode = void 0;
  7507. }
  7508. if (strictMode === void 0) {
  7509. strictMode = false;
  7510. }
  7511. if (ua) {
  7512. _bowser = detect(ua);
  7513. }
  7514. var version = "" + _bowser.version;
  7515. for (var browser in minVersions) {
  7516. if (minVersions.hasOwnProperty(browser)) {
  7517. if (_bowser[browser]) {
  7518. if (typeof minVersions[browser] !== "string") {
  7519. throw new Error("Browser version in the minVersion map should be a string: " + browser + ": " + String(minVersions));
  7520. }
  7521. return compareVersions([version, minVersions[browser]]) < 0;
  7522. }
  7523. }
  7524. }
  7525. return strictMode;
  7526. }
  7527. function check(minVersions, strictMode, ua) {
  7528. return !isUnsupportedBrowser(minVersions, strictMode, ua);
  7529. }
  7530. bowser.isUnsupportedBrowser = isUnsupportedBrowser;
  7531. bowser.compareVersions = compareVersions;
  7532. bowser.check = check;
  7533. bowser._detect = detect;
  7534. bowser.detect = detect;
  7535. return bowser;
  7536. });
  7537. }, {}], 89: [function(require2, module3, exports3) {
  7538. }, {}], 90: [function(require2, module3, exports3) {
  7539. (function(Buffer) {
  7540. (function() {
  7541. "use strict";
  7542. var base64 = require2("base64-js");
  7543. var ieee754 = require2("ieee754");
  7544. exports3.Buffer = Buffer2;
  7545. exports3.SlowBuffer = SlowBuffer;
  7546. exports3.INSPECT_MAX_BYTES = 50;
  7547. var K_MAX_LENGTH = 2147483647;
  7548. exports3.kMaxLength = K_MAX_LENGTH;
  7549. Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
  7550. if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
  7551. console.error(
  7552. "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
  7553. );
  7554. }
  7555. function typedArraySupport() {
  7556. try {
  7557. var arr = new Uint8Array(1);
  7558. arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
  7559. return 42;
  7560. } };
  7561. return arr.foo() === 42;
  7562. } catch (e) {
  7563. return false;
  7564. }
  7565. }
  7566. Object.defineProperty(Buffer2.prototype, "parent", {
  7567. enumerable: true,
  7568. get: function() {
  7569. if (!Buffer2.isBuffer(this))
  7570. return void 0;
  7571. return this.buffer;
  7572. }
  7573. });
  7574. Object.defineProperty(Buffer2.prototype, "offset", {
  7575. enumerable: true,
  7576. get: function() {
  7577. if (!Buffer2.isBuffer(this))
  7578. return void 0;
  7579. return this.byteOffset;
  7580. }
  7581. });
  7582. function createBuffer(length) {
  7583. if (length > K_MAX_LENGTH) {
  7584. throw new RangeError('The value "' + length + '" is invalid for option "size"');
  7585. }
  7586. var buf = new Uint8Array(length);
  7587. buf.__proto__ = Buffer2.prototype;
  7588. return buf;
  7589. }
  7590. function Buffer2(arg, encodingOrOffset, length) {
  7591. if (typeof arg === "number") {
  7592. if (typeof encodingOrOffset === "string") {
  7593. throw new TypeError(
  7594. 'The "string" argument must be of type string. Received type number'
  7595. );
  7596. }
  7597. return allocUnsafe(arg);
  7598. }
  7599. return from(arg, encodingOrOffset, length);
  7600. }
  7601. if (typeof Symbol !== "undefined" && Symbol.species != null && Buffer2[Symbol.species] === Buffer2) {
  7602. Object.defineProperty(Buffer2, Symbol.species, {
  7603. value: null,
  7604. configurable: true,
  7605. enumerable: false,
  7606. writable: false
  7607. });
  7608. }
  7609. Buffer2.poolSize = 8192;
  7610. function from(value, encodingOrOffset, length) {
  7611. if (typeof value === "string") {
  7612. return fromString(value, encodingOrOffset);
  7613. }
  7614. if (ArrayBuffer.isView(value)) {
  7615. return fromArrayLike(value);
  7616. }
  7617. if (value == null) {
  7618. throw TypeError(
  7619. "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
  7620. );
  7621. }
  7622. if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
  7623. return fromArrayBuffer(value, encodingOrOffset, length);
  7624. }
  7625. if (typeof value === "number") {
  7626. throw new TypeError(
  7627. 'The "value" argument must not be of type number. Received type number'
  7628. );
  7629. }
  7630. var valueOf = value.valueOf && value.valueOf();
  7631. if (valueOf != null && valueOf !== value) {
  7632. return Buffer2.from(valueOf, encodingOrOffset, length);
  7633. }
  7634. var b = fromObject(value);
  7635. if (b)
  7636. return b;
  7637. if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
  7638. return Buffer2.from(
  7639. value[Symbol.toPrimitive]("string"),
  7640. encodingOrOffset,
  7641. length
  7642. );
  7643. }
  7644. throw new TypeError(
  7645. "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
  7646. );
  7647. }
  7648. Buffer2.from = function(value, encodingOrOffset, length) {
  7649. return from(value, encodingOrOffset, length);
  7650. };
  7651. Buffer2.prototype.__proto__ = Uint8Array.prototype;
  7652. Buffer2.__proto__ = Uint8Array;
  7653. function assertSize(size) {
  7654. if (typeof size !== "number") {
  7655. throw new TypeError('"size" argument must be of type number');
  7656. } else if (size < 0) {
  7657. throw new RangeError('The value "' + size + '" is invalid for option "size"');
  7658. }
  7659. }
  7660. function alloc(size, fill, encoding) {
  7661. assertSize(size);
  7662. if (size <= 0) {
  7663. return createBuffer(size);
  7664. }
  7665. if (fill !== void 0) {
  7666. return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
  7667. }
  7668. return createBuffer(size);
  7669. }
  7670. Buffer2.alloc = function(size, fill, encoding) {
  7671. return alloc(size, fill, encoding);
  7672. };
  7673. function allocUnsafe(size) {
  7674. assertSize(size);
  7675. return createBuffer(size < 0 ? 0 : checked(size) | 0);
  7676. }
  7677. Buffer2.allocUnsafe = function(size) {
  7678. return allocUnsafe(size);
  7679. };
  7680. Buffer2.allocUnsafeSlow = function(size) {
  7681. return allocUnsafe(size);
  7682. };
  7683. function fromString(string, encoding) {
  7684. if (typeof encoding !== "string" || encoding === "") {
  7685. encoding = "utf8";
  7686. }
  7687. if (!Buffer2.isEncoding(encoding)) {
  7688. throw new TypeError("Unknown encoding: " + encoding);
  7689. }
  7690. var length = byteLength(string, encoding) | 0;
  7691. var buf = createBuffer(length);
  7692. var actual = buf.write(string, encoding);
  7693. if (actual !== length) {
  7694. buf = buf.slice(0, actual);
  7695. }
  7696. return buf;
  7697. }
  7698. function fromArrayLike(array) {
  7699. var length = array.length < 0 ? 0 : checked(array.length) | 0;
  7700. var buf = createBuffer(length);
  7701. for (var i = 0; i < length; i += 1) {
  7702. buf[i] = array[i] & 255;
  7703. }
  7704. return buf;
  7705. }
  7706. function fromArrayBuffer(array, byteOffset, length) {
  7707. if (byteOffset < 0 || array.byteLength < byteOffset) {
  7708. throw new RangeError('"offset" is outside of buffer bounds');
  7709. }
  7710. if (array.byteLength < byteOffset + (length || 0)) {
  7711. throw new RangeError('"length" is outside of buffer bounds');
  7712. }
  7713. var buf;
  7714. if (byteOffset === void 0 && length === void 0) {
  7715. buf = new Uint8Array(array);
  7716. } else if (length === void 0) {
  7717. buf = new Uint8Array(array, byteOffset);
  7718. } else {
  7719. buf = new Uint8Array(array, byteOffset, length);
  7720. }
  7721. buf.__proto__ = Buffer2.prototype;
  7722. return buf;
  7723. }
  7724. function fromObject(obj) {
  7725. if (Buffer2.isBuffer(obj)) {
  7726. var len = checked(obj.length) | 0;
  7727. var buf = createBuffer(len);
  7728. if (buf.length === 0) {
  7729. return buf;
  7730. }
  7731. obj.copy(buf, 0, 0, len);
  7732. return buf;
  7733. }
  7734. if (obj.length !== void 0) {
  7735. if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
  7736. return createBuffer(0);
  7737. }
  7738. return fromArrayLike(obj);
  7739. }
  7740. if (obj.type === "Buffer" && Array.isArray(obj.data)) {
  7741. return fromArrayLike(obj.data);
  7742. }
  7743. }
  7744. function checked(length) {
  7745. if (length >= K_MAX_LENGTH) {
  7746. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
  7747. }
  7748. return length | 0;
  7749. }
  7750. function SlowBuffer(length) {
  7751. if (+length != length) {
  7752. length = 0;
  7753. }
  7754. return Buffer2.alloc(+length);
  7755. }
  7756. Buffer2.isBuffer = function isBuffer(b) {
  7757. return b != null && b._isBuffer === true && b !== Buffer2.prototype;
  7758. };
  7759. Buffer2.compare = function compare(a, b) {
  7760. if (isInstance(a, Uint8Array))
  7761. a = Buffer2.from(a, a.offset, a.byteLength);
  7762. if (isInstance(b, Uint8Array))
  7763. b = Buffer2.from(b, b.offset, b.byteLength);
  7764. if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
  7765. throw new TypeError(
  7766. 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
  7767. );
  7768. }
  7769. if (a === b)
  7770. return 0;
  7771. var x = a.length;
  7772. var y = b.length;
  7773. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  7774. if (a[i] !== b[i]) {
  7775. x = a[i];
  7776. y = b[i];
  7777. break;
  7778. }
  7779. }
  7780. if (x < y)
  7781. return -1;
  7782. if (y < x)
  7783. return 1;
  7784. return 0;
  7785. };
  7786. Buffer2.isEncoding = function isEncoding(encoding) {
  7787. switch (String(encoding).toLowerCase()) {
  7788. case "hex":
  7789. case "utf8":
  7790. case "utf-8":
  7791. case "ascii":
  7792. case "latin1":
  7793. case "binary":
  7794. case "base64":
  7795. case "ucs2":
  7796. case "ucs-2":
  7797. case "utf16le":
  7798. case "utf-16le":
  7799. return true;
  7800. default:
  7801. return false;
  7802. }
  7803. };
  7804. Buffer2.concat = function concat(list, length) {
  7805. if (!Array.isArray(list)) {
  7806. throw new TypeError('"list" argument must be an Array of Buffers');
  7807. }
  7808. if (list.length === 0) {
  7809. return Buffer2.alloc(0);
  7810. }
  7811. var i;
  7812. if (length === void 0) {
  7813. length = 0;
  7814. for (i = 0; i < list.length; ++i) {
  7815. length += list[i].length;
  7816. }
  7817. }
  7818. var buffer = Buffer2.allocUnsafe(length);
  7819. var pos = 0;
  7820. for (i = 0; i < list.length; ++i) {
  7821. var buf = list[i];
  7822. if (isInstance(buf, Uint8Array)) {
  7823. buf = Buffer2.from(buf);
  7824. }
  7825. if (!Buffer2.isBuffer(buf)) {
  7826. throw new TypeError('"list" argument must be an Array of Buffers');
  7827. }
  7828. buf.copy(buffer, pos);
  7829. pos += buf.length;
  7830. }
  7831. return buffer;
  7832. };
  7833. function byteLength(string, encoding) {
  7834. if (Buffer2.isBuffer(string)) {
  7835. return string.length;
  7836. }
  7837. if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
  7838. return string.byteLength;
  7839. }
  7840. if (typeof string !== "string") {
  7841. throw new TypeError(
  7842. 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string
  7843. );
  7844. }
  7845. var len = string.length;
  7846. var mustMatch = arguments.length > 2 && arguments[2] === true;
  7847. if (!mustMatch && len === 0)
  7848. return 0;
  7849. var loweredCase = false;
  7850. for (; ; ) {
  7851. switch (encoding) {
  7852. case "ascii":
  7853. case "latin1":
  7854. case "binary":
  7855. return len;
  7856. case "utf8":
  7857. case "utf-8":
  7858. return utf8ToBytes(string).length;
  7859. case "ucs2":
  7860. case "ucs-2":
  7861. case "utf16le":
  7862. case "utf-16le":
  7863. return len * 2;
  7864. case "hex":
  7865. return len >>> 1;
  7866. case "base64":
  7867. return base64ToBytes(string).length;
  7868. default:
  7869. if (loweredCase) {
  7870. return mustMatch ? -1 : utf8ToBytes(string).length;
  7871. }
  7872. encoding = ("" + encoding).toLowerCase();
  7873. loweredCase = true;
  7874. }
  7875. }
  7876. }
  7877. Buffer2.byteLength = byteLength;
  7878. function slowToString(encoding, start, end) {
  7879. var loweredCase = false;
  7880. if (start === void 0 || start < 0) {
  7881. start = 0;
  7882. }
  7883. if (start > this.length) {
  7884. return "";
  7885. }
  7886. if (end === void 0 || end > this.length) {
  7887. end = this.length;
  7888. }
  7889. if (end <= 0) {
  7890. return "";
  7891. }
  7892. end >>>= 0;
  7893. start >>>= 0;
  7894. if (end <= start) {
  7895. return "";
  7896. }
  7897. if (!encoding)
  7898. encoding = "utf8";
  7899. while (true) {
  7900. switch (encoding) {
  7901. case "hex":
  7902. return hexSlice(this, start, end);
  7903. case "utf8":
  7904. case "utf-8":
  7905. return utf8Slice(this, start, end);
  7906. case "ascii":
  7907. return asciiSlice(this, start, end);
  7908. case "latin1":
  7909. case "binary":
  7910. return latin1Slice(this, start, end);
  7911. case "base64":
  7912. return base64Slice(this, start, end);
  7913. case "ucs2":
  7914. case "ucs-2":
  7915. case "utf16le":
  7916. case "utf-16le":
  7917. return utf16leSlice(this, start, end);
  7918. default:
  7919. if (loweredCase)
  7920. throw new TypeError("Unknown encoding: " + encoding);
  7921. encoding = (encoding + "").toLowerCase();
  7922. loweredCase = true;
  7923. }
  7924. }
  7925. }
  7926. Buffer2.prototype._isBuffer = true;
  7927. function swap(b, n, m) {
  7928. var i = b[n];
  7929. b[n] = b[m];
  7930. b[m] = i;
  7931. }
  7932. Buffer2.prototype.swap16 = function swap16() {
  7933. var len = this.length;
  7934. if (len % 2 !== 0) {
  7935. throw new RangeError("Buffer size must be a multiple of 16-bits");
  7936. }
  7937. for (var i = 0; i < len; i += 2) {
  7938. swap(this, i, i + 1);
  7939. }
  7940. return this;
  7941. };
  7942. Buffer2.prototype.swap32 = function swap32() {
  7943. var len = this.length;
  7944. if (len % 4 !== 0) {
  7945. throw new RangeError("Buffer size must be a multiple of 32-bits");
  7946. }
  7947. for (var i = 0; i < len; i += 4) {
  7948. swap(this, i, i + 3);
  7949. swap(this, i + 1, i + 2);
  7950. }
  7951. return this;
  7952. };
  7953. Buffer2.prototype.swap64 = function swap64() {
  7954. var len = this.length;
  7955. if (len % 8 !== 0) {
  7956. throw new RangeError("Buffer size must be a multiple of 64-bits");
  7957. }
  7958. for (var i = 0; i < len; i += 8) {
  7959. swap(this, i, i + 7);
  7960. swap(this, i + 1, i + 6);
  7961. swap(this, i + 2, i + 5);
  7962. swap(this, i + 3, i + 4);
  7963. }
  7964. return this;
  7965. };
  7966. Buffer2.prototype.toString = function toString() {
  7967. var length = this.length;
  7968. if (length === 0)
  7969. return "";
  7970. if (arguments.length === 0)
  7971. return utf8Slice(this, 0, length);
  7972. return slowToString.apply(this, arguments);
  7973. };
  7974. Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
  7975. Buffer2.prototype.equals = function equals(b) {
  7976. if (!Buffer2.isBuffer(b))
  7977. throw new TypeError("Argument must be a Buffer");
  7978. if (this === b)
  7979. return true;
  7980. return Buffer2.compare(this, b) === 0;
  7981. };
  7982. Buffer2.prototype.inspect = function inspect() {
  7983. var str = "";
  7984. var max = exports3.INSPECT_MAX_BYTES;
  7985. str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
  7986. if (this.length > max)
  7987. str += " ... ";
  7988. return "<Buffer " + str + ">";
  7989. };
  7990. Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
  7991. if (isInstance(target, Uint8Array)) {
  7992. target = Buffer2.from(target, target.offset, target.byteLength);
  7993. }
  7994. if (!Buffer2.isBuffer(target)) {
  7995. throw new TypeError(
  7996. 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target
  7997. );
  7998. }
  7999. if (start === void 0) {
  8000. start = 0;
  8001. }
  8002. if (end === void 0) {
  8003. end = target ? target.length : 0;
  8004. }
  8005. if (thisStart === void 0) {
  8006. thisStart = 0;
  8007. }
  8008. if (thisEnd === void 0) {
  8009. thisEnd = this.length;
  8010. }
  8011. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  8012. throw new RangeError("out of range index");
  8013. }
  8014. if (thisStart >= thisEnd && start >= end) {
  8015. return 0;
  8016. }
  8017. if (thisStart >= thisEnd) {
  8018. return -1;
  8019. }
  8020. if (start >= end) {
  8021. return 1;
  8022. }
  8023. start >>>= 0;
  8024. end >>>= 0;
  8025. thisStart >>>= 0;
  8026. thisEnd >>>= 0;
  8027. if (this === target)
  8028. return 0;
  8029. var x = thisEnd - thisStart;
  8030. var y = end - start;
  8031. var len = Math.min(x, y);
  8032. var thisCopy = this.slice(thisStart, thisEnd);
  8033. var targetCopy = target.slice(start, end);
  8034. for (var i = 0; i < len; ++i) {
  8035. if (thisCopy[i] !== targetCopy[i]) {
  8036. x = thisCopy[i];
  8037. y = targetCopy[i];
  8038. break;
  8039. }
  8040. }
  8041. if (x < y)
  8042. return -1;
  8043. if (y < x)
  8044. return 1;
  8045. return 0;
  8046. };
  8047. function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
  8048. if (buffer.length === 0)
  8049. return -1;
  8050. if (typeof byteOffset === "string") {
  8051. encoding = byteOffset;
  8052. byteOffset = 0;
  8053. } else if (byteOffset > 2147483647) {
  8054. byteOffset = 2147483647;
  8055. } else if (byteOffset < -2147483648) {
  8056. byteOffset = -2147483648;
  8057. }
  8058. byteOffset = +byteOffset;
  8059. if (numberIsNaN(byteOffset)) {
  8060. byteOffset = dir ? 0 : buffer.length - 1;
  8061. }
  8062. if (byteOffset < 0)
  8063. byteOffset = buffer.length + byteOffset;
  8064. if (byteOffset >= buffer.length) {
  8065. if (dir)
  8066. return -1;
  8067. else
  8068. byteOffset = buffer.length - 1;
  8069. } else if (byteOffset < 0) {
  8070. if (dir)
  8071. byteOffset = 0;
  8072. else
  8073. return -1;
  8074. }
  8075. if (typeof val === "string") {
  8076. val = Buffer2.from(val, encoding);
  8077. }
  8078. if (Buffer2.isBuffer(val)) {
  8079. if (val.length === 0) {
  8080. return -1;
  8081. }
  8082. return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
  8083. } else if (typeof val === "number") {
  8084. val = val & 255;
  8085. if (typeof Uint8Array.prototype.indexOf === "function") {
  8086. if (dir) {
  8087. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
  8088. } else {
  8089. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
  8090. }
  8091. }
  8092. return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
  8093. }
  8094. throw new TypeError("val must be string, number or Buffer");
  8095. }
  8096. function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
  8097. var indexSize = 1;
  8098. var arrLength = arr.length;
  8099. var valLength = val.length;
  8100. if (encoding !== void 0) {
  8101. encoding = String(encoding).toLowerCase();
  8102. if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
  8103. if (arr.length < 2 || val.length < 2) {
  8104. return -1;
  8105. }
  8106. indexSize = 2;
  8107. arrLength /= 2;
  8108. valLength /= 2;
  8109. byteOffset /= 2;
  8110. }
  8111. }
  8112. function read(buf, i2) {
  8113. if (indexSize === 1) {
  8114. return buf[i2];
  8115. } else {
  8116. return buf.readUInt16BE(i2 * indexSize);
  8117. }
  8118. }
  8119. var i;
  8120. if (dir) {
  8121. var foundIndex = -1;
  8122. for (i = byteOffset; i < arrLength; i++) {
  8123. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  8124. if (foundIndex === -1)
  8125. foundIndex = i;
  8126. if (i - foundIndex + 1 === valLength)
  8127. return foundIndex * indexSize;
  8128. } else {
  8129. if (foundIndex !== -1)
  8130. i -= i - foundIndex;
  8131. foundIndex = -1;
  8132. }
  8133. }
  8134. } else {
  8135. if (byteOffset + valLength > arrLength)
  8136. byteOffset = arrLength - valLength;
  8137. for (i = byteOffset; i >= 0; i--) {
  8138. var found = true;
  8139. for (var j = 0; j < valLength; j++) {
  8140. if (read(arr, i + j) !== read(val, j)) {
  8141. found = false;
  8142. break;
  8143. }
  8144. }
  8145. if (found)
  8146. return i;
  8147. }
  8148. }
  8149. return -1;
  8150. }
  8151. Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
  8152. return this.indexOf(val, byteOffset, encoding) !== -1;
  8153. };
  8154. Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
  8155. return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
  8156. };
  8157. Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
  8158. return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
  8159. };
  8160. function hexWrite(buf, string, offset, length) {
  8161. offset = Number(offset) || 0;
  8162. var remaining = buf.length - offset;
  8163. if (!length) {
  8164. length = remaining;
  8165. } else {
  8166. length = Number(length);
  8167. if (length > remaining) {
  8168. length = remaining;
  8169. }
  8170. }
  8171. var strLen = string.length;
  8172. if (length > strLen / 2) {
  8173. length = strLen / 2;
  8174. }
  8175. for (var i = 0; i < length; ++i) {
  8176. var parsed = parseInt(string.substr(i * 2, 2), 16);
  8177. if (numberIsNaN(parsed))
  8178. return i;
  8179. buf[offset + i] = parsed;
  8180. }
  8181. return i;
  8182. }
  8183. function utf8Write(buf, string, offset, length) {
  8184. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
  8185. }
  8186. function asciiWrite(buf, string, offset, length) {
  8187. return blitBuffer(asciiToBytes(string), buf, offset, length);
  8188. }
  8189. function latin1Write(buf, string, offset, length) {
  8190. return asciiWrite(buf, string, offset, length);
  8191. }
  8192. function base64Write(buf, string, offset, length) {
  8193. return blitBuffer(base64ToBytes(string), buf, offset, length);
  8194. }
  8195. function ucs2Write(buf, string, offset, length) {
  8196. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
  8197. }
  8198. Buffer2.prototype.write = function write(string, offset, length, encoding) {
  8199. if (offset === void 0) {
  8200. encoding = "utf8";
  8201. length = this.length;
  8202. offset = 0;
  8203. } else if (length === void 0 && typeof offset === "string") {
  8204. encoding = offset;
  8205. length = this.length;
  8206. offset = 0;
  8207. } else if (isFinite(offset)) {
  8208. offset = offset >>> 0;
  8209. if (isFinite(length)) {
  8210. length = length >>> 0;
  8211. if (encoding === void 0)
  8212. encoding = "utf8";
  8213. } else {
  8214. encoding = length;
  8215. length = void 0;
  8216. }
  8217. } else {
  8218. throw new Error(
  8219. "Buffer.write(string, encoding, offset[, length]) is no longer supported"
  8220. );
  8221. }
  8222. var remaining = this.length - offset;
  8223. if (length === void 0 || length > remaining)
  8224. length = remaining;
  8225. if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
  8226. throw new RangeError("Attempt to write outside buffer bounds");
  8227. }
  8228. if (!encoding)
  8229. encoding = "utf8";
  8230. var loweredCase = false;
  8231. for (; ; ) {
  8232. switch (encoding) {
  8233. case "hex":
  8234. return hexWrite(this, string, offset, length);
  8235. case "utf8":
  8236. case "utf-8":
  8237. return utf8Write(this, string, offset, length);
  8238. case "ascii":
  8239. return asciiWrite(this, string, offset, length);
  8240. case "latin1":
  8241. case "binary":
  8242. return latin1Write(this, string, offset, length);
  8243. case "base64":
  8244. return base64Write(this, string, offset, length);
  8245. case "ucs2":
  8246. case "ucs-2":
  8247. case "utf16le":
  8248. case "utf-16le":
  8249. return ucs2Write(this, string, offset, length);
  8250. default:
  8251. if (loweredCase)
  8252. throw new TypeError("Unknown encoding: " + encoding);
  8253. encoding = ("" + encoding).toLowerCase();
  8254. loweredCase = true;
  8255. }
  8256. }
  8257. };
  8258. Buffer2.prototype.toJSON = function toJSON() {
  8259. return {
  8260. type: "Buffer",
  8261. data: Array.prototype.slice.call(this._arr || this, 0)
  8262. };
  8263. };
  8264. function base64Slice(buf, start, end) {
  8265. if (start === 0 && end === buf.length) {
  8266. return base64.fromByteArray(buf);
  8267. } else {
  8268. return base64.fromByteArray(buf.slice(start, end));
  8269. }
  8270. }
  8271. function utf8Slice(buf, start, end) {
  8272. end = Math.min(buf.length, end);
  8273. var res = [];
  8274. var i = start;
  8275. while (i < end) {
  8276. var firstByte = buf[i];
  8277. var codePoint = null;
  8278. var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
  8279. if (i + bytesPerSequence <= end) {
  8280. var secondByte, thirdByte, fourthByte, tempCodePoint;
  8281. switch (bytesPerSequence) {
  8282. case 1:
  8283. if (firstByte < 128) {
  8284. codePoint = firstByte;
  8285. }
  8286. break;
  8287. case 2:
  8288. secondByte = buf[i + 1];
  8289. if ((secondByte & 192) === 128) {
  8290. tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
  8291. if (tempCodePoint > 127) {
  8292. codePoint = tempCodePoint;
  8293. }
  8294. }
  8295. break;
  8296. case 3:
  8297. secondByte = buf[i + 1];
  8298. thirdByte = buf[i + 2];
  8299. if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
  8300. tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
  8301. if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
  8302. codePoint = tempCodePoint;
  8303. }
  8304. }
  8305. break;
  8306. case 4:
  8307. secondByte = buf[i + 1];
  8308. thirdByte = buf[i + 2];
  8309. fourthByte = buf[i + 3];
  8310. if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
  8311. tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
  8312. if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
  8313. codePoint = tempCodePoint;
  8314. }
  8315. }
  8316. }
  8317. }
  8318. if (codePoint === null) {
  8319. codePoint = 65533;
  8320. bytesPerSequence = 1;
  8321. } else if (codePoint > 65535) {
  8322. codePoint -= 65536;
  8323. res.push(codePoint >>> 10 & 1023 | 55296);
  8324. codePoint = 56320 | codePoint & 1023;
  8325. }
  8326. res.push(codePoint);
  8327. i += bytesPerSequence;
  8328. }
  8329. return decodeCodePointsArray(res);
  8330. }
  8331. var MAX_ARGUMENTS_LENGTH = 4096;
  8332. function decodeCodePointsArray(codePoints) {
  8333. var len = codePoints.length;
  8334. if (len <= MAX_ARGUMENTS_LENGTH) {
  8335. return String.fromCharCode.apply(String, codePoints);
  8336. }
  8337. var res = "";
  8338. var i = 0;
  8339. while (i < len) {
  8340. res += String.fromCharCode.apply(
  8341. String,
  8342. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  8343. );
  8344. }
  8345. return res;
  8346. }
  8347. function asciiSlice(buf, start, end) {
  8348. var ret = "";
  8349. end = Math.min(buf.length, end);
  8350. for (var i = start; i < end; ++i) {
  8351. ret += String.fromCharCode(buf[i] & 127);
  8352. }
  8353. return ret;
  8354. }
  8355. function latin1Slice(buf, start, end) {
  8356. var ret = "";
  8357. end = Math.min(buf.length, end);
  8358. for (var i = start; i < end; ++i) {
  8359. ret += String.fromCharCode(buf[i]);
  8360. }
  8361. return ret;
  8362. }
  8363. function hexSlice(buf, start, end) {
  8364. var len = buf.length;
  8365. if (!start || start < 0)
  8366. start = 0;
  8367. if (!end || end < 0 || end > len)
  8368. end = len;
  8369. var out = "";
  8370. for (var i = start; i < end; ++i) {
  8371. out += toHex(buf[i]);
  8372. }
  8373. return out;
  8374. }
  8375. function utf16leSlice(buf, start, end) {
  8376. var bytes = buf.slice(start, end);
  8377. var res = "";
  8378. for (var i = 0; i < bytes.length; i += 2) {
  8379. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
  8380. }
  8381. return res;
  8382. }
  8383. Buffer2.prototype.slice = function slice(start, end) {
  8384. var len = this.length;
  8385. start = ~~start;
  8386. end = end === void 0 ? len : ~~end;
  8387. if (start < 0) {
  8388. start += len;
  8389. if (start < 0)
  8390. start = 0;
  8391. } else if (start > len) {
  8392. start = len;
  8393. }
  8394. if (end < 0) {
  8395. end += len;
  8396. if (end < 0)
  8397. end = 0;
  8398. } else if (end > len) {
  8399. end = len;
  8400. }
  8401. if (end < start)
  8402. end = start;
  8403. var newBuf = this.subarray(start, end);
  8404. newBuf.__proto__ = Buffer2.prototype;
  8405. return newBuf;
  8406. };
  8407. function checkOffset(offset, ext, length) {
  8408. if (offset % 1 !== 0 || offset < 0)
  8409. throw new RangeError("offset is not uint");
  8410. if (offset + ext > length)
  8411. throw new RangeError("Trying to access beyond buffer length");
  8412. }
  8413. Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
  8414. offset = offset >>> 0;
  8415. byteLength2 = byteLength2 >>> 0;
  8416. if (!noAssert)
  8417. checkOffset(offset, byteLength2, this.length);
  8418. var val = this[offset];
  8419. var mul = 1;
  8420. var i = 0;
  8421. while (++i < byteLength2 && (mul *= 256)) {
  8422. val += this[offset + i] * mul;
  8423. }
  8424. return val;
  8425. };
  8426. Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
  8427. offset = offset >>> 0;
  8428. byteLength2 = byteLength2 >>> 0;
  8429. if (!noAssert) {
  8430. checkOffset(offset, byteLength2, this.length);
  8431. }
  8432. var val = this[offset + --byteLength2];
  8433. var mul = 1;
  8434. while (byteLength2 > 0 && (mul *= 256)) {
  8435. val += this[offset + --byteLength2] * mul;
  8436. }
  8437. return val;
  8438. };
  8439. Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
  8440. offset = offset >>> 0;
  8441. if (!noAssert)
  8442. checkOffset(offset, 1, this.length);
  8443. return this[offset];
  8444. };
  8445. Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
  8446. offset = offset >>> 0;
  8447. if (!noAssert)
  8448. checkOffset(offset, 2, this.length);
  8449. return this[offset] | this[offset + 1] << 8;
  8450. };
  8451. Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
  8452. offset = offset >>> 0;
  8453. if (!noAssert)
  8454. checkOffset(offset, 2, this.length);
  8455. return this[offset] << 8 | this[offset + 1];
  8456. };
  8457. Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
  8458. offset = offset >>> 0;
  8459. if (!noAssert)
  8460. checkOffset(offset, 4, this.length);
  8461. return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
  8462. };
  8463. Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
  8464. offset = offset >>> 0;
  8465. if (!noAssert)
  8466. checkOffset(offset, 4, this.length);
  8467. return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
  8468. };
  8469. Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
  8470. offset = offset >>> 0;
  8471. byteLength2 = byteLength2 >>> 0;
  8472. if (!noAssert)
  8473. checkOffset(offset, byteLength2, this.length);
  8474. var val = this[offset];
  8475. var mul = 1;
  8476. var i = 0;
  8477. while (++i < byteLength2 && (mul *= 256)) {
  8478. val += this[offset + i] * mul;
  8479. }
  8480. mul *= 128;
  8481. if (val >= mul)
  8482. val -= Math.pow(2, 8 * byteLength2);
  8483. return val;
  8484. };
  8485. Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
  8486. offset = offset >>> 0;
  8487. byteLength2 = byteLength2 >>> 0;
  8488. if (!noAssert)
  8489. checkOffset(offset, byteLength2, this.length);
  8490. var i = byteLength2;
  8491. var mul = 1;
  8492. var val = this[offset + --i];
  8493. while (i > 0 && (mul *= 256)) {
  8494. val += this[offset + --i] * mul;
  8495. }
  8496. mul *= 128;
  8497. if (val >= mul)
  8498. val -= Math.pow(2, 8 * byteLength2);
  8499. return val;
  8500. };
  8501. Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
  8502. offset = offset >>> 0;
  8503. if (!noAssert)
  8504. checkOffset(offset, 1, this.length);
  8505. if (!(this[offset] & 128))
  8506. return this[offset];
  8507. return (255 - this[offset] + 1) * -1;
  8508. };
  8509. Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
  8510. offset = offset >>> 0;
  8511. if (!noAssert)
  8512. checkOffset(offset, 2, this.length);
  8513. var val = this[offset] | this[offset + 1] << 8;
  8514. return val & 32768 ? val | 4294901760 : val;
  8515. };
  8516. Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
  8517. offset = offset >>> 0;
  8518. if (!noAssert)
  8519. checkOffset(offset, 2, this.length);
  8520. var val = this[offset + 1] | this[offset] << 8;
  8521. return val & 32768 ? val | 4294901760 : val;
  8522. };
  8523. Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
  8524. offset = offset >>> 0;
  8525. if (!noAssert)
  8526. checkOffset(offset, 4, this.length);
  8527. return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
  8528. };
  8529. Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
  8530. offset = offset >>> 0;
  8531. if (!noAssert)
  8532. checkOffset(offset, 4, this.length);
  8533. return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
  8534. };
  8535. Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
  8536. offset = offset >>> 0;
  8537. if (!noAssert)
  8538. checkOffset(offset, 4, this.length);
  8539. return ieee754.read(this, offset, true, 23, 4);
  8540. };
  8541. Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
  8542. offset = offset >>> 0;
  8543. if (!noAssert)
  8544. checkOffset(offset, 4, this.length);
  8545. return ieee754.read(this, offset, false, 23, 4);
  8546. };
  8547. Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
  8548. offset = offset >>> 0;
  8549. if (!noAssert)
  8550. checkOffset(offset, 8, this.length);
  8551. return ieee754.read(this, offset, true, 52, 8);
  8552. };
  8553. Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
  8554. offset = offset >>> 0;
  8555. if (!noAssert)
  8556. checkOffset(offset, 8, this.length);
  8557. return ieee754.read(this, offset, false, 52, 8);
  8558. };
  8559. function checkInt(buf, value, offset, ext, max, min) {
  8560. if (!Buffer2.isBuffer(buf))
  8561. throw new TypeError('"buffer" argument must be a Buffer instance');
  8562. if (value > max || value < min)
  8563. throw new RangeError('"value" argument is out of bounds');
  8564. if (offset + ext > buf.length)
  8565. throw new RangeError("Index out of range");
  8566. }
  8567. Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
  8568. value = +value;
  8569. offset = offset >>> 0;
  8570. byteLength2 = byteLength2 >>> 0;
  8571. if (!noAssert) {
  8572. var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
  8573. checkInt(this, value, offset, byteLength2, maxBytes, 0);
  8574. }
  8575. var mul = 1;
  8576. var i = 0;
  8577. this[offset] = value & 255;
  8578. while (++i < byteLength2 && (mul *= 256)) {
  8579. this[offset + i] = value / mul & 255;
  8580. }
  8581. return offset + byteLength2;
  8582. };
  8583. Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
  8584. value = +value;
  8585. offset = offset >>> 0;
  8586. byteLength2 = byteLength2 >>> 0;
  8587. if (!noAssert) {
  8588. var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
  8589. checkInt(this, value, offset, byteLength2, maxBytes, 0);
  8590. }
  8591. var i = byteLength2 - 1;
  8592. var mul = 1;
  8593. this[offset + i] = value & 255;
  8594. while (--i >= 0 && (mul *= 256)) {
  8595. this[offset + i] = value / mul & 255;
  8596. }
  8597. return offset + byteLength2;
  8598. };
  8599. Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
  8600. value = +value;
  8601. offset = offset >>> 0;
  8602. if (!noAssert)
  8603. checkInt(this, value, offset, 1, 255, 0);
  8604. this[offset] = value & 255;
  8605. return offset + 1;
  8606. };
  8607. Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
  8608. value = +value;
  8609. offset = offset >>> 0;
  8610. if (!noAssert)
  8611. checkInt(this, value, offset, 2, 65535, 0);
  8612. this[offset] = value & 255;
  8613. this[offset + 1] = value >>> 8;
  8614. return offset + 2;
  8615. };
  8616. Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
  8617. value = +value;
  8618. offset = offset >>> 0;
  8619. if (!noAssert)
  8620. checkInt(this, value, offset, 2, 65535, 0);
  8621. this[offset] = value >>> 8;
  8622. this[offset + 1] = value & 255;
  8623. return offset + 2;
  8624. };
  8625. Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
  8626. value = +value;
  8627. offset = offset >>> 0;
  8628. if (!noAssert)
  8629. checkInt(this, value, offset, 4, 4294967295, 0);
  8630. this[offset + 3] = value >>> 24;
  8631. this[offset + 2] = value >>> 16;
  8632. this[offset + 1] = value >>> 8;
  8633. this[offset] = value & 255;
  8634. return offset + 4;
  8635. };
  8636. Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
  8637. value = +value;
  8638. offset = offset >>> 0;
  8639. if (!noAssert)
  8640. checkInt(this, value, offset, 4, 4294967295, 0);
  8641. this[offset] = value >>> 24;
  8642. this[offset + 1] = value >>> 16;
  8643. this[offset + 2] = value >>> 8;
  8644. this[offset + 3] = value & 255;
  8645. return offset + 4;
  8646. };
  8647. Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
  8648. value = +value;
  8649. offset = offset >>> 0;
  8650. if (!noAssert) {
  8651. var limit = Math.pow(2, 8 * byteLength2 - 1);
  8652. checkInt(this, value, offset, byteLength2, limit - 1, -limit);
  8653. }
  8654. var i = 0;
  8655. var mul = 1;
  8656. var sub = 0;
  8657. this[offset] = value & 255;
  8658. while (++i < byteLength2 && (mul *= 256)) {
  8659. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  8660. sub = 1;
  8661. }
  8662. this[offset + i] = (value / mul >> 0) - sub & 255;
  8663. }
  8664. return offset + byteLength2;
  8665. };
  8666. Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
  8667. value = +value;
  8668. offset = offset >>> 0;
  8669. if (!noAssert) {
  8670. var limit = Math.pow(2, 8 * byteLength2 - 1);
  8671. checkInt(this, value, offset, byteLength2, limit - 1, -limit);
  8672. }
  8673. var i = byteLength2 - 1;
  8674. var mul = 1;
  8675. var sub = 0;
  8676. this[offset + i] = value & 255;
  8677. while (--i >= 0 && (mul *= 256)) {
  8678. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  8679. sub = 1;
  8680. }
  8681. this[offset + i] = (value / mul >> 0) - sub & 255;
  8682. }
  8683. return offset + byteLength2;
  8684. };
  8685. Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
  8686. value = +value;
  8687. offset = offset >>> 0;
  8688. if (!noAssert)
  8689. checkInt(this, value, offset, 1, 127, -128);
  8690. if (value < 0)
  8691. value = 255 + value + 1;
  8692. this[offset] = value & 255;
  8693. return offset + 1;
  8694. };
  8695. Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
  8696. value = +value;
  8697. offset = offset >>> 0;
  8698. if (!noAssert)
  8699. checkInt(this, value, offset, 2, 32767, -32768);
  8700. this[offset] = value & 255;
  8701. this[offset + 1] = value >>> 8;
  8702. return offset + 2;
  8703. };
  8704. Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
  8705. value = +value;
  8706. offset = offset >>> 0;
  8707. if (!noAssert)
  8708. checkInt(this, value, offset, 2, 32767, -32768);
  8709. this[offset] = value >>> 8;
  8710. this[offset + 1] = value & 255;
  8711. return offset + 2;
  8712. };
  8713. Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
  8714. value = +value;
  8715. offset = offset >>> 0;
  8716. if (!noAssert)
  8717. checkInt(this, value, offset, 4, 2147483647, -2147483648);
  8718. this[offset] = value & 255;
  8719. this[offset + 1] = value >>> 8;
  8720. this[offset + 2] = value >>> 16;
  8721. this[offset + 3] = value >>> 24;
  8722. return offset + 4;
  8723. };
  8724. Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
  8725. value = +value;
  8726. offset = offset >>> 0;
  8727. if (!noAssert)
  8728. checkInt(this, value, offset, 4, 2147483647, -2147483648);
  8729. if (value < 0)
  8730. value = 4294967295 + value + 1;
  8731. this[offset] = value >>> 24;
  8732. this[offset + 1] = value >>> 16;
  8733. this[offset + 2] = value >>> 8;
  8734. this[offset + 3] = value & 255;
  8735. return offset + 4;
  8736. };
  8737. function checkIEEE754(buf, value, offset, ext, max, min) {
  8738. if (offset + ext > buf.length)
  8739. throw new RangeError("Index out of range");
  8740. if (offset < 0)
  8741. throw new RangeError("Index out of range");
  8742. }
  8743. function writeFloat(buf, value, offset, littleEndian, noAssert) {
  8744. value = +value;
  8745. offset = offset >>> 0;
  8746. if (!noAssert) {
  8747. checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);
  8748. }
  8749. ieee754.write(buf, value, offset, littleEndian, 23, 4);
  8750. return offset + 4;
  8751. }
  8752. Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
  8753. return writeFloat(this, value, offset, true, noAssert);
  8754. };
  8755. Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
  8756. return writeFloat(this, value, offset, false, noAssert);
  8757. };
  8758. function writeDouble(buf, value, offset, littleEndian, noAssert) {
  8759. value = +value;
  8760. offset = offset >>> 0;
  8761. if (!noAssert) {
  8762. checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);
  8763. }
  8764. ieee754.write(buf, value, offset, littleEndian, 52, 8);
  8765. return offset + 8;
  8766. }
  8767. Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
  8768. return writeDouble(this, value, offset, true, noAssert);
  8769. };
  8770. Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
  8771. return writeDouble(this, value, offset, false, noAssert);
  8772. };
  8773. Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
  8774. if (!Buffer2.isBuffer(target))
  8775. throw new TypeError("argument should be a Buffer");
  8776. if (!start)
  8777. start = 0;
  8778. if (!end && end !== 0)
  8779. end = this.length;
  8780. if (targetStart >= target.length)
  8781. targetStart = target.length;
  8782. if (!targetStart)
  8783. targetStart = 0;
  8784. if (end > 0 && end < start)
  8785. end = start;
  8786. if (end === start)
  8787. return 0;
  8788. if (target.length === 0 || this.length === 0)
  8789. return 0;
  8790. if (targetStart < 0) {
  8791. throw new RangeError("targetStart out of bounds");
  8792. }
  8793. if (start < 0 || start >= this.length)
  8794. throw new RangeError("Index out of range");
  8795. if (end < 0)
  8796. throw new RangeError("sourceEnd out of bounds");
  8797. if (end > this.length)
  8798. end = this.length;
  8799. if (target.length - targetStart < end - start) {
  8800. end = target.length - targetStart + start;
  8801. }
  8802. var len = end - start;
  8803. if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {
  8804. this.copyWithin(targetStart, start, end);
  8805. } else if (this === target && start < targetStart && targetStart < end) {
  8806. for (var i = len - 1; i >= 0; --i) {
  8807. target[i + targetStart] = this[i + start];
  8808. }
  8809. } else {
  8810. Uint8Array.prototype.set.call(
  8811. target,
  8812. this.subarray(start, end),
  8813. targetStart
  8814. );
  8815. }
  8816. return len;
  8817. };
  8818. Buffer2.prototype.fill = function fill(val, start, end, encoding) {
  8819. if (typeof val === "string") {
  8820. if (typeof start === "string") {
  8821. encoding = start;
  8822. start = 0;
  8823. end = this.length;
  8824. } else if (typeof end === "string") {
  8825. encoding = end;
  8826. end = this.length;
  8827. }
  8828. if (encoding !== void 0 && typeof encoding !== "string") {
  8829. throw new TypeError("encoding must be a string");
  8830. }
  8831. if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
  8832. throw new TypeError("Unknown encoding: " + encoding);
  8833. }
  8834. if (val.length === 1) {
  8835. var code = val.charCodeAt(0);
  8836. if (encoding === "utf8" && code < 128 || encoding === "latin1") {
  8837. val = code;
  8838. }
  8839. }
  8840. } else if (typeof val === "number") {
  8841. val = val & 255;
  8842. }
  8843. if (start < 0 || this.length < start || this.length < end) {
  8844. throw new RangeError("Out of range index");
  8845. }
  8846. if (end <= start) {
  8847. return this;
  8848. }
  8849. start = start >>> 0;
  8850. end = end === void 0 ? this.length : end >>> 0;
  8851. if (!val)
  8852. val = 0;
  8853. var i;
  8854. if (typeof val === "number") {
  8855. for (i = start; i < end; ++i) {
  8856. this[i] = val;
  8857. }
  8858. } else {
  8859. var bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding);
  8860. var len = bytes.length;
  8861. if (len === 0) {
  8862. throw new TypeError('The value "' + val + '" is invalid for argument "value"');
  8863. }
  8864. for (i = 0; i < end - start; ++i) {
  8865. this[i + start] = bytes[i % len];
  8866. }
  8867. }
  8868. return this;
  8869. };
  8870. var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
  8871. function base64clean(str) {
  8872. str = str.split("=")[0];
  8873. str = str.trim().replace(INVALID_BASE64_RE, "");
  8874. if (str.length < 2)
  8875. return "";
  8876. while (str.length % 4 !== 0) {
  8877. str = str + "=";
  8878. }
  8879. return str;
  8880. }
  8881. function toHex(n) {
  8882. if (n < 16)
  8883. return "0" + n.toString(16);
  8884. return n.toString(16);
  8885. }
  8886. function utf8ToBytes(string, units) {
  8887. units = units || Infinity;
  8888. var codePoint;
  8889. var length = string.length;
  8890. var leadSurrogate = null;
  8891. var bytes = [];
  8892. for (var i = 0; i < length; ++i) {
  8893. codePoint = string.charCodeAt(i);
  8894. if (codePoint > 55295 && codePoint < 57344) {
  8895. if (!leadSurrogate) {
  8896. if (codePoint > 56319) {
  8897. if ((units -= 3) > -1)
  8898. bytes.push(239, 191, 189);
  8899. continue;
  8900. } else if (i + 1 === length) {
  8901. if ((units -= 3) > -1)
  8902. bytes.push(239, 191, 189);
  8903. continue;
  8904. }
  8905. leadSurrogate = codePoint;
  8906. continue;
  8907. }
  8908. if (codePoint < 56320) {
  8909. if ((units -= 3) > -1)
  8910. bytes.push(239, 191, 189);
  8911. leadSurrogate = codePoint;
  8912. continue;
  8913. }
  8914. codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
  8915. } else if (leadSurrogate) {
  8916. if ((units -= 3) > -1)
  8917. bytes.push(239, 191, 189);
  8918. }
  8919. leadSurrogate = null;
  8920. if (codePoint < 128) {
  8921. if ((units -= 1) < 0)
  8922. break;
  8923. bytes.push(codePoint);
  8924. } else if (codePoint < 2048) {
  8925. if ((units -= 2) < 0)
  8926. break;
  8927. bytes.push(
  8928. codePoint >> 6 | 192,
  8929. codePoint & 63 | 128
  8930. );
  8931. } else if (codePoint < 65536) {
  8932. if ((units -= 3) < 0)
  8933. break;
  8934. bytes.push(
  8935. codePoint >> 12 | 224,
  8936. codePoint >> 6 & 63 | 128,
  8937. codePoint & 63 | 128
  8938. );
  8939. } else if (codePoint < 1114112) {
  8940. if ((units -= 4) < 0)
  8941. break;
  8942. bytes.push(
  8943. codePoint >> 18 | 240,
  8944. codePoint >> 12 & 63 | 128,
  8945. codePoint >> 6 & 63 | 128,
  8946. codePoint & 63 | 128
  8947. );
  8948. } else {
  8949. throw new Error("Invalid code point");
  8950. }
  8951. }
  8952. return bytes;
  8953. }
  8954. function asciiToBytes(str) {
  8955. var byteArray = [];
  8956. for (var i = 0; i < str.length; ++i) {
  8957. byteArray.push(str.charCodeAt(i) & 255);
  8958. }
  8959. return byteArray;
  8960. }
  8961. function utf16leToBytes(str, units) {
  8962. var c, hi, lo;
  8963. var byteArray = [];
  8964. for (var i = 0; i < str.length; ++i) {
  8965. if ((units -= 2) < 0)
  8966. break;
  8967. c = str.charCodeAt(i);
  8968. hi = c >> 8;
  8969. lo = c % 256;
  8970. byteArray.push(lo);
  8971. byteArray.push(hi);
  8972. }
  8973. return byteArray;
  8974. }
  8975. function base64ToBytes(str) {
  8976. return base64.toByteArray(base64clean(str));
  8977. }
  8978. function blitBuffer(src, dst, offset, length) {
  8979. for (var i = 0; i < length; ++i) {
  8980. if (i + offset >= dst.length || i >= src.length)
  8981. break;
  8982. dst[i + offset] = src[i];
  8983. }
  8984. return i;
  8985. }
  8986. function isInstance(obj, type) {
  8987. return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
  8988. }
  8989. function numberIsNaN(obj) {
  8990. return obj !== obj;
  8991. }
  8992. }).call(this);
  8993. }).call(this, require2("buffer").Buffer);
  8994. }, { "base64-js": 87, "buffer": 90, "ieee754": 357 }], 91: [function(require2, module3, exports3) {
  8995. module3.exports = {
  8996. "100": "Continue",
  8997. "101": "Switching Protocols",
  8998. "102": "Processing",
  8999. "200": "OK",
  9000. "201": "Created",
  9001. "202": "Accepted",
  9002. "203": "Non-Authoritative Information",
  9003. "204": "No Content",
  9004. "205": "Reset Content",
  9005. "206": "Partial Content",
  9006. "207": "Multi-Status",
  9007. "208": "Already Reported",
  9008. "226": "IM Used",
  9009. "300": "Multiple Choices",
  9010. "301": "Moved Permanently",
  9011. "302": "Found",
  9012. "303": "See Other",
  9013. "304": "Not Modified",
  9014. "305": "Use Proxy",
  9015. "307": "Temporary Redirect",
  9016. "308": "Permanent Redirect",
  9017. "400": "Bad Request",
  9018. "401": "Unauthorized",
  9019. "402": "Payment Required",
  9020. "403": "Forbidden",
  9021. "404": "Not Found",
  9022. "405": "Method Not Allowed",
  9023. "406": "Not Acceptable",
  9024. "407": "Proxy Authentication Required",
  9025. "408": "Request Timeout",
  9026. "409": "Conflict",
  9027. "410": "Gone",
  9028. "411": "Length Required",
  9029. "412": "Precondition Failed",
  9030. "413": "Payload Too Large",
  9031. "414": "URI Too Long",
  9032. "415": "Unsupported Media Type",
  9033. "416": "Range Not Satisfiable",
  9034. "417": "Expectation Failed",
  9035. "418": "I'm a teapot",
  9036. "421": "Misdirected Request",
  9037. "422": "Unprocessable Entity",
  9038. "423": "Locked",
  9039. "424": "Failed Dependency",
  9040. "425": "Unordered Collection",
  9041. "426": "Upgrade Required",
  9042. "428": "Precondition Required",
  9043. "429": "Too Many Requests",
  9044. "431": "Request Header Fields Too Large",
  9045. "451": "Unavailable For Legal Reasons",
  9046. "500": "Internal Server Error",
  9047. "501": "Not Implemented",
  9048. "502": "Bad Gateway",
  9049. "503": "Service Unavailable",
  9050. "504": "Gateway Timeout",
  9051. "505": "HTTP Version Not Supported",
  9052. "506": "Variant Also Negotiates",
  9053. "507": "Insufficient Storage",
  9054. "508": "Loop Detected",
  9055. "509": "Bandwidth Limit Exceeded",
  9056. "510": "Not Extended",
  9057. "511": "Network Authentication Required"
  9058. };
  9059. }, {}], 92: [function(require2, module3, exports3) {
  9060. "use strict";
  9061. var GetIntrinsic = require2("get-intrinsic");
  9062. var callBind = require2("./");
  9063. var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
  9064. module3.exports = function callBoundIntrinsic(name, allowMissing) {
  9065. var intrinsic = GetIntrinsic(name, !!allowMissing);
  9066. if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
  9067. return callBind(intrinsic);
  9068. }
  9069. return intrinsic;
  9070. };
  9071. }, { "./": 93, "get-intrinsic": 348 }], 93: [function(require2, module3, exports3) {
  9072. "use strict";
  9073. var bind = require2("function-bind");
  9074. var GetIntrinsic = require2("get-intrinsic");
  9075. var $apply = GetIntrinsic("%Function.prototype.apply%");
  9076. var $call = GetIntrinsic("%Function.prototype.call%");
  9077. var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
  9078. var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
  9079. var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
  9080. var $max = GetIntrinsic("%Math.max%");
  9081. if ($defineProperty) {
  9082. try {
  9083. $defineProperty({}, "a", { value: 1 });
  9084. } catch (e) {
  9085. $defineProperty = null;
  9086. }
  9087. }
  9088. module3.exports = function callBind(originalFunction) {
  9089. var func = $reflectApply(bind, $call, arguments);
  9090. if ($gOPD && $defineProperty) {
  9091. var desc = $gOPD(func, "length");
  9092. if (desc.configurable) {
  9093. $defineProperty(
  9094. func,
  9095. "length",
  9096. { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
  9097. );
  9098. }
  9099. }
  9100. return func;
  9101. };
  9102. var applyBind = function applyBind2() {
  9103. return $reflectApply(bind, $apply, arguments);
  9104. };
  9105. if ($defineProperty) {
  9106. $defineProperty(module3.exports, "apply", { value: applyBind });
  9107. } else {
  9108. module3.exports.apply = applyBind;
  9109. }
  9110. }, { "function-bind": 347, "get-intrinsic": 348 }], 94: [function(require2, module3, exports3) {
  9111. "use strict";
  9112. var slice = Array.prototype.slice;
  9113. module3.exports = Copy;
  9114. function Copy(src, withAccess) {
  9115. if (!(this instanceof Copy))
  9116. return new Copy(src, withAccess);
  9117. this.src = src;
  9118. this._withAccess = withAccess;
  9119. }
  9120. Copy.prototype.withAccess = function(w) {
  9121. this._withAccess = w !== false;
  9122. return this;
  9123. };
  9124. Copy.prototype.pick = function(keys) {
  9125. if (!Array.isArray(keys)) {
  9126. keys = slice.call(arguments);
  9127. }
  9128. if (keys.length) {
  9129. this.keys = keys;
  9130. }
  9131. return this;
  9132. };
  9133. Copy.prototype.to = function(to) {
  9134. to = to || {};
  9135. if (!this.src)
  9136. return to;
  9137. var keys = this.keys || Object.keys(this.src);
  9138. if (!this._withAccess) {
  9139. for (var i = 0; i < keys.length; i++) {
  9140. key = keys[i];
  9141. if (to[key] !== void 0)
  9142. continue;
  9143. to[key] = this.src[key];
  9144. }
  9145. return to;
  9146. }
  9147. for (var i = 0; i < keys.length; i++) {
  9148. var key = keys[i];
  9149. if (!notDefined(to, key))
  9150. continue;
  9151. var getter = this.src.__lookupGetter__(key);
  9152. var setter = this.src.__lookupSetter__(key);
  9153. if (getter)
  9154. to.__defineGetter__(key, getter);
  9155. if (setter)
  9156. to.__defineSetter__(key, setter);
  9157. if (!getter && !setter) {
  9158. to[key] = this.src[key];
  9159. }
  9160. }
  9161. return to;
  9162. };
  9163. Copy.prototype.toCover = function(to) {
  9164. var keys = this.keys || Object.keys(this.src);
  9165. for (var i = 0; i < keys.length; i++) {
  9166. var key = keys[i];
  9167. delete to[key];
  9168. var getter = this.src.__lookupGetter__(key);
  9169. var setter = this.src.__lookupSetter__(key);
  9170. if (getter)
  9171. to.__defineGetter__(key, getter);
  9172. if (setter)
  9173. to.__defineSetter__(key, setter);
  9174. if (!getter && !setter) {
  9175. to[key] = this.src[key];
  9176. }
  9177. }
  9178. };
  9179. Copy.prototype.override = Copy.prototype.toCover;
  9180. Copy.prototype.and = function(obj) {
  9181. var src = {};
  9182. this.to(src);
  9183. this.src = obj;
  9184. this.to(src);
  9185. this.src = src;
  9186. return this;
  9187. };
  9188. function notDefined(obj, key) {
  9189. return obj[key] === void 0 && obj.__lookupGetter__(key) === void 0 && obj.__lookupSetter__(key) === void 0;
  9190. }
  9191. }, {}], 95: [function(require2, module3, exports3) {
  9192. var global2 = require2("../internals/global");
  9193. var isCallable = require2("../internals/is-callable");
  9194. var tryToString = require2("../internals/try-to-string");
  9195. var TypeError2 = global2.TypeError;
  9196. module3.exports = function(argument) {
  9197. if (isCallable(argument))
  9198. return argument;
  9199. throw TypeError2(tryToString(argument) + " is not a function");
  9200. };
  9201. }, { "../internals/global": 163, "../internals/is-callable": 176, "../internals/try-to-string": 257 }], 96: [function(require2, module3, exports3) {
  9202. var global2 = require2("../internals/global");
  9203. var isConstructor = require2("../internals/is-constructor");
  9204. var tryToString = require2("../internals/try-to-string");
  9205. var TypeError2 = global2.TypeError;
  9206. module3.exports = function(argument) {
  9207. if (isConstructor(argument))
  9208. return argument;
  9209. throw TypeError2(tryToString(argument) + " is not a constructor");
  9210. };
  9211. }, { "../internals/global": 163, "../internals/is-constructor": 177, "../internals/try-to-string": 257 }], 97: [function(require2, module3, exports3) {
  9212. var global2 = require2("../internals/global");
  9213. var isCallable = require2("../internals/is-callable");
  9214. var String2 = global2.String;
  9215. var TypeError2 = global2.TypeError;
  9216. module3.exports = function(argument) {
  9217. if (typeof argument == "object" || isCallable(argument))
  9218. return argument;
  9219. throw TypeError2("Can't set " + String2(argument) + " as a prototype");
  9220. };
  9221. }, { "../internals/global": 163, "../internals/is-callable": 176 }], 98: [function(require2, module3, exports3) {
  9222. var wellKnownSymbol = require2("../internals/well-known-symbol");
  9223. var create = require2("../internals/object-create");
  9224. var definePropertyModule = require2("../internals/object-define-property");
  9225. var UNSCOPABLES = wellKnownSymbol("unscopables");
  9226. var ArrayPrototype = Array.prototype;
  9227. if (ArrayPrototype[UNSCOPABLES] == void 0) {
  9228. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  9229. configurable: true,
  9230. value: create(null)
  9231. });
  9232. }
  9233. module3.exports = function(key) {
  9234. ArrayPrototype[UNSCOPABLES][key] = true;
  9235. };
  9236. }, { "../internals/object-create": 196, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 99: [function(require2, module3, exports3) {
  9237. "use strict";
  9238. var charAt = require2("../internals/string-multibyte").charAt;
  9239. module3.exports = function(S, index, unicode) {
  9240. return index + (unicode ? charAt(S, index).length : 1);
  9241. };
  9242. }, { "../internals/string-multibyte": 239 }], 100: [function(require2, module3, exports3) {
  9243. var global2 = require2("../internals/global");
  9244. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  9245. var TypeError2 = global2.TypeError;
  9246. module3.exports = function(it, Prototype) {
  9247. if (isPrototypeOf(Prototype, it))
  9248. return it;
  9249. throw TypeError2("Incorrect invocation");
  9250. };
  9251. }, { "../internals/global": 163, "../internals/object-is-prototype-of": 204 }], 101: [function(require2, module3, exports3) {
  9252. var global2 = require2("../internals/global");
  9253. var isObject = require2("../internals/is-object");
  9254. var String2 = global2.String;
  9255. var TypeError2 = global2.TypeError;
  9256. module3.exports = function(argument) {
  9257. if (isObject(argument))
  9258. return argument;
  9259. throw TypeError2(String2(argument) + " is not an object");
  9260. };
  9261. }, { "../internals/global": 163, "../internals/is-object": 180 }], 102: [function(require2, module3, exports3) {
  9262. module3.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
  9263. }, {}], 103: [function(require2, module3, exports3) {
  9264. "use strict";
  9265. var NATIVE_ARRAY_BUFFER = require2("../internals/array-buffer-native");
  9266. var DESCRIPTORS = require2("../internals/descriptors");
  9267. var global2 = require2("../internals/global");
  9268. var isCallable = require2("../internals/is-callable");
  9269. var isObject = require2("../internals/is-object");
  9270. var hasOwn = require2("../internals/has-own-property");
  9271. var classof = require2("../internals/classof");
  9272. var tryToString = require2("../internals/try-to-string");
  9273. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  9274. var redefine = require2("../internals/redefine");
  9275. var defineProperty = require2("../internals/object-define-property").f;
  9276. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  9277. var getPrototypeOf = require2("../internals/object-get-prototype-of");
  9278. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  9279. var wellKnownSymbol = require2("../internals/well-known-symbol");
  9280. var uid = require2("../internals/uid");
  9281. var Int8Array2 = global2.Int8Array;
  9282. var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
  9283. var Uint8ClampedArray2 = global2.Uint8ClampedArray;
  9284. var Uint8ClampedArrayPrototype = Uint8ClampedArray2 && Uint8ClampedArray2.prototype;
  9285. var TypedArray = Int8Array2 && getPrototypeOf(Int8Array2);
  9286. var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
  9287. var ObjectPrototype = Object.prototype;
  9288. var TypeError2 = global2.TypeError;
  9289. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  9290. var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG");
  9291. var TYPED_ARRAY_CONSTRUCTOR = uid("TYPED_ARRAY_CONSTRUCTOR");
  9292. var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global2.opera) !== "Opera";
  9293. var TYPED_ARRAY_TAG_REQUIRED = false;
  9294. var NAME, Constructor, Prototype;
  9295. var TypedArrayConstructorsList = {
  9296. Int8Array: 1,
  9297. Uint8Array: 1,
  9298. Uint8ClampedArray: 1,
  9299. Int16Array: 2,
  9300. Uint16Array: 2,
  9301. Int32Array: 4,
  9302. Uint32Array: 4,
  9303. Float32Array: 4,
  9304. Float64Array: 8
  9305. };
  9306. var BigIntArrayConstructorsList = {
  9307. BigInt64Array: 8,
  9308. BigUint64Array: 8
  9309. };
  9310. var isView = function isView2(it) {
  9311. if (!isObject(it))
  9312. return false;
  9313. var klass = classof(it);
  9314. return klass === "DataView" || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
  9315. };
  9316. var isTypedArray = function(it) {
  9317. if (!isObject(it))
  9318. return false;
  9319. var klass = classof(it);
  9320. return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
  9321. };
  9322. var aTypedArray = function(it) {
  9323. if (isTypedArray(it))
  9324. return it;
  9325. throw TypeError2("Target is not a typed array");
  9326. };
  9327. var aTypedArrayConstructor = function(C) {
  9328. if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C)))
  9329. return C;
  9330. throw TypeError2(tryToString(C) + " is not a typed array constructor");
  9331. };
  9332. var exportTypedArrayMethod = function(KEY, property, forced, options) {
  9333. if (!DESCRIPTORS)
  9334. return;
  9335. if (forced)
  9336. for (var ARRAY in TypedArrayConstructorsList) {
  9337. var TypedArrayConstructor = global2[ARRAY];
  9338. if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY))
  9339. try {
  9340. delete TypedArrayConstructor.prototype[KEY];
  9341. } catch (error) {
  9342. try {
  9343. TypedArrayConstructor.prototype[KEY] = property;
  9344. } catch (error2) {
  9345. }
  9346. }
  9347. }
  9348. if (!TypedArrayPrototype[KEY] || forced) {
  9349. redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
  9350. }
  9351. };
  9352. var exportTypedArrayStaticMethod = function(KEY, property, forced) {
  9353. var ARRAY, TypedArrayConstructor;
  9354. if (!DESCRIPTORS)
  9355. return;
  9356. if (setPrototypeOf) {
  9357. if (forced)
  9358. for (ARRAY in TypedArrayConstructorsList) {
  9359. TypedArrayConstructor = global2[ARRAY];
  9360. if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY))
  9361. try {
  9362. delete TypedArrayConstructor[KEY];
  9363. } catch (error) {
  9364. }
  9365. }
  9366. if (!TypedArray[KEY] || forced) {
  9367. try {
  9368. return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
  9369. } catch (error) {
  9370. }
  9371. } else
  9372. return;
  9373. }
  9374. for (ARRAY in TypedArrayConstructorsList) {
  9375. TypedArrayConstructor = global2[ARRAY];
  9376. if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
  9377. redefine(TypedArrayConstructor, KEY, property);
  9378. }
  9379. }
  9380. };
  9381. for (NAME in TypedArrayConstructorsList) {
  9382. Constructor = global2[NAME];
  9383. Prototype = Constructor && Constructor.prototype;
  9384. if (Prototype)
  9385. createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
  9386. else
  9387. NATIVE_ARRAY_BUFFER_VIEWS = false;
  9388. }
  9389. for (NAME in BigIntArrayConstructorsList) {
  9390. Constructor = global2[NAME];
  9391. Prototype = Constructor && Constructor.prototype;
  9392. if (Prototype)
  9393. createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
  9394. }
  9395. if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
  9396. TypedArray = function TypedArray2() {
  9397. throw TypeError2("Incorrect invocation");
  9398. };
  9399. if (NATIVE_ARRAY_BUFFER_VIEWS)
  9400. for (NAME in TypedArrayConstructorsList) {
  9401. if (global2[NAME])
  9402. setPrototypeOf(global2[NAME], TypedArray);
  9403. }
  9404. }
  9405. if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
  9406. TypedArrayPrototype = TypedArray.prototype;
  9407. if (NATIVE_ARRAY_BUFFER_VIEWS)
  9408. for (NAME in TypedArrayConstructorsList) {
  9409. if (global2[NAME])
  9410. setPrototypeOf(global2[NAME].prototype, TypedArrayPrototype);
  9411. }
  9412. }
  9413. if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
  9414. setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
  9415. }
  9416. if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
  9417. TYPED_ARRAY_TAG_REQUIRED = true;
  9418. defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function() {
  9419. return isObject(this) ? this[TYPED_ARRAY_TAG] : void 0;
  9420. } });
  9421. for (NAME in TypedArrayConstructorsList)
  9422. if (global2[NAME]) {
  9423. createNonEnumerableProperty(global2[NAME], TYPED_ARRAY_TAG, NAME);
  9424. }
  9425. }
  9426. module3.exports = {
  9427. NATIVE_ARRAY_BUFFER_VIEWS,
  9428. TYPED_ARRAY_CONSTRUCTOR,
  9429. TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
  9430. aTypedArray,
  9431. aTypedArrayConstructor,
  9432. exportTypedArrayMethod,
  9433. exportTypedArrayStaticMethod,
  9434. isView,
  9435. isTypedArray,
  9436. TypedArray,
  9437. TypedArrayPrototype
  9438. };
  9439. }, { "../internals/array-buffer-native": 102, "../internals/classof": 124, "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/object-define-property": 198, "../internals/object-get-prototype-of": 203, "../internals/object-is-prototype-of": 204, "../internals/object-set-prototype-of": 208, "../internals/redefine": 222, "../internals/try-to-string": 257, "../internals/uid": 263, "../internals/well-known-symbol": 268 }], 104: [function(require2, module3, exports3) {
  9440. "use strict";
  9441. var global2 = require2("../internals/global");
  9442. var uncurryThis = require2("../internals/function-uncurry-this");
  9443. var DESCRIPTORS = require2("../internals/descriptors");
  9444. var NATIVE_ARRAY_BUFFER = require2("../internals/array-buffer-native");
  9445. var FunctionName = require2("../internals/function-name");
  9446. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  9447. var redefineAll = require2("../internals/redefine-all");
  9448. var fails = require2("../internals/fails");
  9449. var anInstance = require2("../internals/an-instance");
  9450. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  9451. var toLength = require2("../internals/to-length");
  9452. var toIndex = require2("../internals/to-index");
  9453. var IEEE754 = require2("../internals/ieee754");
  9454. var getPrototypeOf = require2("../internals/object-get-prototype-of");
  9455. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  9456. var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
  9457. var defineProperty = require2("../internals/object-define-property").f;
  9458. var arrayFill = require2("../internals/array-fill");
  9459. var arraySlice = require2("../internals/array-slice-simple");
  9460. var setToStringTag = require2("../internals/set-to-string-tag");
  9461. var InternalStateModule = require2("../internals/internal-state");
  9462. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  9463. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  9464. var getInternalState = InternalStateModule.get;
  9465. var setInternalState = InternalStateModule.set;
  9466. var ARRAY_BUFFER = "ArrayBuffer";
  9467. var DATA_VIEW = "DataView";
  9468. var PROTOTYPE = "prototype";
  9469. var WRONG_LENGTH = "Wrong length";
  9470. var WRONG_INDEX = "Wrong index";
  9471. var NativeArrayBuffer = global2[ARRAY_BUFFER];
  9472. var $ArrayBuffer = NativeArrayBuffer;
  9473. var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
  9474. var $DataView = global2[DATA_VIEW];
  9475. var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
  9476. var ObjectPrototype = Object.prototype;
  9477. var Array2 = global2.Array;
  9478. var RangeError2 = global2.RangeError;
  9479. var fill = uncurryThis(arrayFill);
  9480. var reverse = uncurryThis([].reverse);
  9481. var packIEEE754 = IEEE754.pack;
  9482. var unpackIEEE754 = IEEE754.unpack;
  9483. var packInt8 = function(number) {
  9484. return [number & 255];
  9485. };
  9486. var packInt16 = function(number) {
  9487. return [number & 255, number >> 8 & 255];
  9488. };
  9489. var packInt32 = function(number) {
  9490. return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255];
  9491. };
  9492. var unpackInt32 = function(buffer) {
  9493. return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
  9494. };
  9495. var packFloat32 = function(number) {
  9496. return packIEEE754(number, 23, 4);
  9497. };
  9498. var packFloat64 = function(number) {
  9499. return packIEEE754(number, 52, 8);
  9500. };
  9501. var addGetter = function(Constructor, key2) {
  9502. defineProperty(Constructor[PROTOTYPE], key2, { get: function() {
  9503. return getInternalState(this)[key2];
  9504. } });
  9505. };
  9506. var get = function(view, count, index, isLittleEndian) {
  9507. var intIndex = toIndex(index);
  9508. var store = getInternalState(view);
  9509. if (intIndex + count > store.byteLength)
  9510. throw RangeError2(WRONG_INDEX);
  9511. var bytes = getInternalState(store.buffer).bytes;
  9512. var start = intIndex + store.byteOffset;
  9513. var pack = arraySlice(bytes, start, start + count);
  9514. return isLittleEndian ? pack : reverse(pack);
  9515. };
  9516. var set = function(view, count, index, conversion, value, isLittleEndian) {
  9517. var intIndex = toIndex(index);
  9518. var store = getInternalState(view);
  9519. if (intIndex + count > store.byteLength)
  9520. throw RangeError2(WRONG_INDEX);
  9521. var bytes = getInternalState(store.buffer).bytes;
  9522. var start = intIndex + store.byteOffset;
  9523. var pack = conversion(+value);
  9524. for (var i = 0; i < count; i++)
  9525. bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
  9526. };
  9527. if (!NATIVE_ARRAY_BUFFER) {
  9528. $ArrayBuffer = function ArrayBuffer2(length) {
  9529. anInstance(this, ArrayBufferPrototype);
  9530. var byteLength = toIndex(length);
  9531. setInternalState(this, {
  9532. bytes: fill(Array2(byteLength), 0),
  9533. byteLength
  9534. });
  9535. if (!DESCRIPTORS)
  9536. this.byteLength = byteLength;
  9537. };
  9538. ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
  9539. $DataView = function DataView2(buffer, byteOffset, byteLength) {
  9540. anInstance(this, DataViewPrototype);
  9541. anInstance(buffer, ArrayBufferPrototype);
  9542. var bufferLength = getInternalState(buffer).byteLength;
  9543. var offset = toIntegerOrInfinity(byteOffset);
  9544. if (offset < 0 || offset > bufferLength)
  9545. throw RangeError2("Wrong offset");
  9546. byteLength = byteLength === void 0 ? bufferLength - offset : toLength(byteLength);
  9547. if (offset + byteLength > bufferLength)
  9548. throw RangeError2(WRONG_LENGTH);
  9549. setInternalState(this, {
  9550. buffer,
  9551. byteLength,
  9552. byteOffset: offset
  9553. });
  9554. if (!DESCRIPTORS) {
  9555. this.buffer = buffer;
  9556. this.byteLength = byteLength;
  9557. this.byteOffset = offset;
  9558. }
  9559. };
  9560. DataViewPrototype = $DataView[PROTOTYPE];
  9561. if (DESCRIPTORS) {
  9562. addGetter($ArrayBuffer, "byteLength");
  9563. addGetter($DataView, "buffer");
  9564. addGetter($DataView, "byteLength");
  9565. addGetter($DataView, "byteOffset");
  9566. }
  9567. redefineAll(DataViewPrototype, {
  9568. getInt8: function getInt8(byteOffset) {
  9569. return get(this, 1, byteOffset)[0] << 24 >> 24;
  9570. },
  9571. getUint8: function getUint8(byteOffset) {
  9572. return get(this, 1, byteOffset)[0];
  9573. },
  9574. getInt16: function getInt16(byteOffset) {
  9575. var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
  9576. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  9577. },
  9578. getUint16: function getUint16(byteOffset) {
  9579. var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
  9580. return bytes[1] << 8 | bytes[0];
  9581. },
  9582. getInt32: function getInt32(byteOffset) {
  9583. return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0));
  9584. },
  9585. getUint32: function getUint32(byteOffset) {
  9586. return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)) >>> 0;
  9587. },
  9588. getFloat32: function getFloat32(byteOffset) {
  9589. return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 23);
  9590. },
  9591. getFloat64: function getFloat64(byteOffset) {
  9592. return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 52);
  9593. },
  9594. setInt8: function setInt8(byteOffset, value) {
  9595. set(this, 1, byteOffset, packInt8, value);
  9596. },
  9597. setUint8: function setUint8(byteOffset, value) {
  9598. set(this, 1, byteOffset, packInt8, value);
  9599. },
  9600. setInt16: function setInt16(byteOffset, value) {
  9601. set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
  9602. },
  9603. setUint16: function setUint16(byteOffset, value) {
  9604. set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
  9605. },
  9606. setInt32: function setInt32(byteOffset, value) {
  9607. set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
  9608. },
  9609. setUint32: function setUint32(byteOffset, value) {
  9610. set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
  9611. },
  9612. setFloat32: function setFloat32(byteOffset, value) {
  9613. set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : void 0);
  9614. },
  9615. setFloat64: function setFloat64(byteOffset, value) {
  9616. set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : void 0);
  9617. }
  9618. });
  9619. } else {
  9620. var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
  9621. if (!fails(function() {
  9622. NativeArrayBuffer(1);
  9623. }) || !fails(function() {
  9624. new NativeArrayBuffer(-1);
  9625. }) || fails(function() {
  9626. new NativeArrayBuffer();
  9627. new NativeArrayBuffer(1.5);
  9628. new NativeArrayBuffer(NaN);
  9629. return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
  9630. })) {
  9631. $ArrayBuffer = function ArrayBuffer2(length) {
  9632. anInstance(this, ArrayBufferPrototype);
  9633. return new NativeArrayBuffer(toIndex(length));
  9634. };
  9635. $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
  9636. for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j; ) {
  9637. if (!((key = keys[j++]) in $ArrayBuffer)) {
  9638. createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
  9639. }
  9640. }
  9641. ArrayBufferPrototype.constructor = $ArrayBuffer;
  9642. } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
  9643. createNonEnumerableProperty(NativeArrayBuffer, "name", ARRAY_BUFFER);
  9644. }
  9645. if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
  9646. setPrototypeOf(DataViewPrototype, ObjectPrototype);
  9647. }
  9648. var testView = new $DataView(new $ArrayBuffer(2));
  9649. var $setInt8 = uncurryThis(DataViewPrototype.setInt8);
  9650. testView.setInt8(0, 2147483648);
  9651. testView.setInt8(1, 2147483649);
  9652. if (testView.getInt8(0) || !testView.getInt8(1))
  9653. redefineAll(DataViewPrototype, {
  9654. setInt8: function setInt8(byteOffset, value) {
  9655. $setInt8(this, byteOffset, value << 24 >> 24);
  9656. },
  9657. setUint8: function setUint8(byteOffset, value) {
  9658. $setInt8(this, byteOffset, value << 24 >> 24);
  9659. }
  9660. }, { unsafe: true });
  9661. }
  9662. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  9663. setToStringTag($DataView, DATA_VIEW);
  9664. module3.exports = {
  9665. ArrayBuffer: $ArrayBuffer,
  9666. DataView: $DataView
  9667. };
  9668. }, { "../internals/an-instance": 100, "../internals/array-buffer-native": 102, "../internals/array-fill": 106, "../internals/array-slice-simple": 116, "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-name": 156, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/ieee754": 169, "../internals/internal-state": 173, "../internals/object-define-property": 198, "../internals/object-get-own-property-names": 201, "../internals/object-get-prototype-of": 203, "../internals/object-set-prototype-of": 208, "../internals/redefine-all": 221, "../internals/set-to-string-tag": 234, "../internals/to-index": 246, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249 }], 105: [function(require2, module3, exports3) {
  9669. "use strict";
  9670. var toObject = require2("../internals/to-object");
  9671. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  9672. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9673. var min = Math.min;
  9674. module3.exports = [].copyWithin || function copyWithin(target, start) {
  9675. var O = toObject(this);
  9676. var len = lengthOfArrayLike(O);
  9677. var to = toAbsoluteIndex(target, len);
  9678. var from = toAbsoluteIndex(start, len);
  9679. var end = arguments.length > 2 ? arguments[2] : void 0;
  9680. var count = min((end === void 0 ? len : toAbsoluteIndex(end, len)) - from, len - to);
  9681. var inc = 1;
  9682. if (from < to && to < from + count) {
  9683. inc = -1;
  9684. from += count - 1;
  9685. to += count - 1;
  9686. }
  9687. while (count-- > 0) {
  9688. if (from in O)
  9689. O[to] = O[from];
  9690. else
  9691. delete O[to];
  9692. to += inc;
  9693. from += inc;
  9694. }
  9695. return O;
  9696. };
  9697. }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-object": 250 }], 106: [function(require2, module3, exports3) {
  9698. "use strict";
  9699. var toObject = require2("../internals/to-object");
  9700. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  9701. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9702. module3.exports = function fill(value) {
  9703. var O = toObject(this);
  9704. var length = lengthOfArrayLike(O);
  9705. var argumentsLength = arguments.length;
  9706. var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : void 0, length);
  9707. var end = argumentsLength > 2 ? arguments[2] : void 0;
  9708. var endPos = end === void 0 ? length : toAbsoluteIndex(end, length);
  9709. while (endPos > index)
  9710. O[index++] = value;
  9711. return O;
  9712. };
  9713. }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-object": 250 }], 107: [function(require2, module3, exports3) {
  9714. "use strict";
  9715. var $forEach = require2("../internals/array-iteration").forEach;
  9716. var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
  9717. var STRICT_METHOD = arrayMethodIsStrict("forEach");
  9718. module3.exports = !STRICT_METHOD ? function forEach(callbackfn) {
  9719. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  9720. } : [].forEach;
  9721. }, { "../internals/array-iteration": 111, "../internals/array-method-is-strict": 114 }], 108: [function(require2, module3, exports3) {
  9722. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9723. module3.exports = function(Constructor, list) {
  9724. var index = 0;
  9725. var length = lengthOfArrayLike(list);
  9726. var result = new Constructor(length);
  9727. while (length > index)
  9728. result[index] = list[index++];
  9729. return result;
  9730. };
  9731. }, { "../internals/length-of-array-like": 188 }], 109: [function(require2, module3, exports3) {
  9732. "use strict";
  9733. var global2 = require2("../internals/global");
  9734. var bind = require2("../internals/function-bind-context");
  9735. var call = require2("../internals/function-call");
  9736. var toObject = require2("../internals/to-object");
  9737. var callWithSafeIterationClosing = require2("../internals/call-with-safe-iteration-closing");
  9738. var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
  9739. var isConstructor = require2("../internals/is-constructor");
  9740. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9741. var createProperty = require2("../internals/create-property");
  9742. var getIterator = require2("../internals/get-iterator");
  9743. var getIteratorMethod = require2("../internals/get-iterator-method");
  9744. var Array2 = global2.Array;
  9745. module3.exports = function from(arrayLike) {
  9746. var O = toObject(arrayLike);
  9747. var IS_CONSTRUCTOR = isConstructor(this);
  9748. var argumentsLength = arguments.length;
  9749. var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
  9750. var mapping = mapfn !== void 0;
  9751. if (mapping)
  9752. mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
  9753. var iteratorMethod = getIteratorMethod(O);
  9754. var index = 0;
  9755. var length, result, step, iterator, next, value;
  9756. if (iteratorMethod && !(this == Array2 && isArrayIteratorMethod(iteratorMethod))) {
  9757. iterator = getIterator(O, iteratorMethod);
  9758. next = iterator.next;
  9759. result = IS_CONSTRUCTOR ? new this() : [];
  9760. for (; !(step = call(next, iterator)).done; index++) {
  9761. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  9762. createProperty(result, index, value);
  9763. }
  9764. } else {
  9765. length = lengthOfArrayLike(O);
  9766. result = IS_CONSTRUCTOR ? new this(length) : Array2(length);
  9767. for (; length > index; index++) {
  9768. value = mapping ? mapfn(O[index], index) : O[index];
  9769. createProperty(result, index, value);
  9770. }
  9771. }
  9772. result.length = index;
  9773. return result;
  9774. };
  9775. }, { "../internals/call-with-safe-iteration-closing": 121, "../internals/create-property": 131, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/is-array-iterator-method": 174, "../internals/is-constructor": 177, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 110: [function(require2, module3, exports3) {
  9776. var toIndexedObject = require2("../internals/to-indexed-object");
  9777. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  9778. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9779. var createMethod = function(IS_INCLUDES) {
  9780. return function($this, el, fromIndex) {
  9781. var O = toIndexedObject($this);
  9782. var length = lengthOfArrayLike(O);
  9783. var index = toAbsoluteIndex(fromIndex, length);
  9784. var value;
  9785. if (IS_INCLUDES && el != el)
  9786. while (length > index) {
  9787. value = O[index++];
  9788. if (value != value)
  9789. return true;
  9790. }
  9791. else
  9792. for (; length > index; index++) {
  9793. if ((IS_INCLUDES || index in O) && O[index] === el)
  9794. return IS_INCLUDES || index || 0;
  9795. }
  9796. return !IS_INCLUDES && -1;
  9797. };
  9798. };
  9799. module3.exports = {
  9800. // `Array.prototype.includes` method
  9801. // https://tc39.es/ecma262/#sec-array.prototype.includes
  9802. includes: createMethod(true),
  9803. // `Array.prototype.indexOf` method
  9804. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  9805. indexOf: createMethod(false)
  9806. };
  9807. }, { "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-indexed-object": 247 }], 111: [function(require2, module3, exports3) {
  9808. var bind = require2("../internals/function-bind-context");
  9809. var uncurryThis = require2("../internals/function-uncurry-this");
  9810. var IndexedObject = require2("../internals/indexed-object");
  9811. var toObject = require2("../internals/to-object");
  9812. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9813. var arraySpeciesCreate = require2("../internals/array-species-create");
  9814. var push = uncurryThis([].push);
  9815. var createMethod = function(TYPE) {
  9816. var IS_MAP = TYPE == 1;
  9817. var IS_FILTER = TYPE == 2;
  9818. var IS_SOME = TYPE == 3;
  9819. var IS_EVERY = TYPE == 4;
  9820. var IS_FIND_INDEX = TYPE == 6;
  9821. var IS_FILTER_REJECT = TYPE == 7;
  9822. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  9823. return function($this, callbackfn, that, specificCreate) {
  9824. var O = toObject($this);
  9825. var self2 = IndexedObject(O);
  9826. var boundFunction = bind(callbackfn, that);
  9827. var length = lengthOfArrayLike(self2);
  9828. var index = 0;
  9829. var create = specificCreate || arraySpeciesCreate;
  9830. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : void 0;
  9831. var value, result;
  9832. for (; length > index; index++)
  9833. if (NO_HOLES || index in self2) {
  9834. value = self2[index];
  9835. result = boundFunction(value, index, O);
  9836. if (TYPE) {
  9837. if (IS_MAP)
  9838. target[index] = result;
  9839. else if (result)
  9840. switch (TYPE) {
  9841. case 3:
  9842. return true;
  9843. case 5:
  9844. return value;
  9845. case 6:
  9846. return index;
  9847. case 2:
  9848. push(target, value);
  9849. }
  9850. else
  9851. switch (TYPE) {
  9852. case 4:
  9853. return false;
  9854. case 7:
  9855. push(target, value);
  9856. }
  9857. }
  9858. }
  9859. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  9860. };
  9861. };
  9862. module3.exports = {
  9863. // `Array.prototype.forEach` method
  9864. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  9865. forEach: createMethod(0),
  9866. // `Array.prototype.map` method
  9867. // https://tc39.es/ecma262/#sec-array.prototype.map
  9868. map: createMethod(1),
  9869. // `Array.prototype.filter` method
  9870. // https://tc39.es/ecma262/#sec-array.prototype.filter
  9871. filter: createMethod(2),
  9872. // `Array.prototype.some` method
  9873. // https://tc39.es/ecma262/#sec-array.prototype.some
  9874. some: createMethod(3),
  9875. // `Array.prototype.every` method
  9876. // https://tc39.es/ecma262/#sec-array.prototype.every
  9877. every: createMethod(4),
  9878. // `Array.prototype.find` method
  9879. // https://tc39.es/ecma262/#sec-array.prototype.find
  9880. find: createMethod(5),
  9881. // `Array.prototype.findIndex` method
  9882. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  9883. findIndex: createMethod(6),
  9884. // `Array.prototype.filterReject` method
  9885. // https://github.com/tc39/proposal-array-filtering
  9886. filterReject: createMethod(7)
  9887. };
  9888. }, { "../internals/array-species-create": 120, "../internals/function-bind-context": 153, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 112: [function(require2, module3, exports3) {
  9889. "use strict";
  9890. var apply = require2("../internals/function-apply");
  9891. var toIndexedObject = require2("../internals/to-indexed-object");
  9892. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  9893. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9894. var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
  9895. var min = Math.min;
  9896. var $lastIndexOf = [].lastIndexOf;
  9897. var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
  9898. var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf");
  9899. var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
  9900. module3.exports = FORCED ? function lastIndexOf(searchElement) {
  9901. if (NEGATIVE_ZERO)
  9902. return apply($lastIndexOf, this, arguments) || 0;
  9903. var O = toIndexedObject(this);
  9904. var length = lengthOfArrayLike(O);
  9905. var index = length - 1;
  9906. if (arguments.length > 1)
  9907. index = min(index, toIntegerOrInfinity(arguments[1]));
  9908. if (index < 0)
  9909. index = length + index;
  9910. for (; index >= 0; index--)
  9911. if (index in O && O[index] === searchElement)
  9912. return index || 0;
  9913. return -1;
  9914. } : $lastIndexOf;
  9915. }, { "../internals/array-method-is-strict": 114, "../internals/function-apply": 152, "../internals/length-of-array-like": 188, "../internals/to-indexed-object": 247, "../internals/to-integer-or-infinity": 248 }], 113: [function(require2, module3, exports3) {
  9916. var fails = require2("../internals/fails");
  9917. var wellKnownSymbol = require2("../internals/well-known-symbol");
  9918. var V8_VERSION = require2("../internals/engine-v8-version");
  9919. var SPECIES = wellKnownSymbol("species");
  9920. module3.exports = function(METHOD_NAME) {
  9921. return V8_VERSION >= 51 || !fails(function() {
  9922. var array = [];
  9923. var constructor = array.constructor = {};
  9924. constructor[SPECIES] = function() {
  9925. return { foo: 1 };
  9926. };
  9927. return array[METHOD_NAME](Boolean).foo !== 1;
  9928. });
  9929. };
  9930. }, { "../internals/engine-v8-version": 146, "../internals/fails": 150, "../internals/well-known-symbol": 268 }], 114: [function(require2, module3, exports3) {
  9931. "use strict";
  9932. var fails = require2("../internals/fails");
  9933. module3.exports = function(METHOD_NAME, argument) {
  9934. var method = [][METHOD_NAME];
  9935. return !!method && fails(function() {
  9936. method.call(null, argument || function() {
  9937. return 1;
  9938. }, 1);
  9939. });
  9940. };
  9941. }, { "../internals/fails": 150 }], 115: [function(require2, module3, exports3) {
  9942. var global2 = require2("../internals/global");
  9943. var aCallable = require2("../internals/a-callable");
  9944. var toObject = require2("../internals/to-object");
  9945. var IndexedObject = require2("../internals/indexed-object");
  9946. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9947. var TypeError2 = global2.TypeError;
  9948. var createMethod = function(IS_RIGHT) {
  9949. return function(that, callbackfn, argumentsLength, memo) {
  9950. aCallable(callbackfn);
  9951. var O = toObject(that);
  9952. var self2 = IndexedObject(O);
  9953. var length = lengthOfArrayLike(O);
  9954. var index = IS_RIGHT ? length - 1 : 0;
  9955. var i = IS_RIGHT ? -1 : 1;
  9956. if (argumentsLength < 2)
  9957. while (true) {
  9958. if (index in self2) {
  9959. memo = self2[index];
  9960. index += i;
  9961. break;
  9962. }
  9963. index += i;
  9964. if (IS_RIGHT ? index < 0 : length <= index) {
  9965. throw TypeError2("Reduce of empty array with no initial value");
  9966. }
  9967. }
  9968. for (; IS_RIGHT ? index >= 0 : length > index; index += i)
  9969. if (index in self2) {
  9970. memo = callbackfn(memo, self2[index], index, O);
  9971. }
  9972. return memo;
  9973. };
  9974. };
  9975. module3.exports = {
  9976. // `Array.prototype.reduce` method
  9977. // https://tc39.es/ecma262/#sec-array.prototype.reduce
  9978. left: createMethod(false),
  9979. // `Array.prototype.reduceRight` method
  9980. // https://tc39.es/ecma262/#sec-array.prototype.reduceright
  9981. right: createMethod(true)
  9982. };
  9983. }, { "../internals/a-callable": 95, "../internals/global": 163, "../internals/indexed-object": 170, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 116: [function(require2, module3, exports3) {
  9984. var global2 = require2("../internals/global");
  9985. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  9986. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  9987. var createProperty = require2("../internals/create-property");
  9988. var Array2 = global2.Array;
  9989. var max = Math.max;
  9990. module3.exports = function(O, start, end) {
  9991. var length = lengthOfArrayLike(O);
  9992. var k = toAbsoluteIndex(start, length);
  9993. var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
  9994. var result = Array2(max(fin - k, 0));
  9995. for (var n = 0; k < fin; k++, n++)
  9996. createProperty(result, n, O[k]);
  9997. result.length = n;
  9998. return result;
  9999. };
  10000. }, { "../internals/create-property": 131, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245 }], 117: [function(require2, module3, exports3) {
  10001. var uncurryThis = require2("../internals/function-uncurry-this");
  10002. module3.exports = uncurryThis([].slice);
  10003. }, { "../internals/function-uncurry-this": 157 }], 118: [function(require2, module3, exports3) {
  10004. var arraySlice = require2("../internals/array-slice-simple");
  10005. var floor = Math.floor;
  10006. var mergeSort = function(array, comparefn) {
  10007. var length = array.length;
  10008. var middle = floor(length / 2);
  10009. return length < 8 ? insertionSort(array, comparefn) : merge(
  10010. array,
  10011. mergeSort(arraySlice(array, 0, middle), comparefn),
  10012. mergeSort(arraySlice(array, middle), comparefn),
  10013. comparefn
  10014. );
  10015. };
  10016. var insertionSort = function(array, comparefn) {
  10017. var length = array.length;
  10018. var i = 1;
  10019. var element, j;
  10020. while (i < length) {
  10021. j = i;
  10022. element = array[i];
  10023. while (j && comparefn(array[j - 1], element) > 0) {
  10024. array[j] = array[--j];
  10025. }
  10026. if (j !== i++)
  10027. array[j] = element;
  10028. }
  10029. return array;
  10030. };
  10031. var merge = function(array, left, right, comparefn) {
  10032. var llength = left.length;
  10033. var rlength = right.length;
  10034. var lindex = 0;
  10035. var rindex = 0;
  10036. while (lindex < llength || rindex < rlength) {
  10037. array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
  10038. }
  10039. return array;
  10040. };
  10041. module3.exports = mergeSort;
  10042. }, { "../internals/array-slice-simple": 116 }], 119: [function(require2, module3, exports3) {
  10043. var global2 = require2("../internals/global");
  10044. var isArray = require2("../internals/is-array");
  10045. var isConstructor = require2("../internals/is-constructor");
  10046. var isObject = require2("../internals/is-object");
  10047. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10048. var SPECIES = wellKnownSymbol("species");
  10049. var Array2 = global2.Array;
  10050. module3.exports = function(originalArray) {
  10051. var C;
  10052. if (isArray(originalArray)) {
  10053. C = originalArray.constructor;
  10054. if (isConstructor(C) && (C === Array2 || isArray(C.prototype)))
  10055. C = void 0;
  10056. else if (isObject(C)) {
  10057. C = C[SPECIES];
  10058. if (C === null)
  10059. C = void 0;
  10060. }
  10061. }
  10062. return C === void 0 ? Array2 : C;
  10063. };
  10064. }, { "../internals/global": 163, "../internals/is-array": 175, "../internals/is-constructor": 177, "../internals/is-object": 180, "../internals/well-known-symbol": 268 }], 120: [function(require2, module3, exports3) {
  10065. var arraySpeciesConstructor = require2("../internals/array-species-constructor");
  10066. module3.exports = function(originalArray, length) {
  10067. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  10068. };
  10069. }, { "../internals/array-species-constructor": 119 }], 121: [function(require2, module3, exports3) {
  10070. var anObject = require2("../internals/an-object");
  10071. var iteratorClose = require2("../internals/iterator-close");
  10072. module3.exports = function(iterator, fn, value, ENTRIES) {
  10073. try {
  10074. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  10075. } catch (error) {
  10076. iteratorClose(iterator, "throw", error);
  10077. }
  10078. };
  10079. }, { "../internals/an-object": 101, "../internals/iterator-close": 185 }], 122: [function(require2, module3, exports3) {
  10080. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10081. var ITERATOR = wellKnownSymbol("iterator");
  10082. var SAFE_CLOSING = false;
  10083. try {
  10084. var called = 0;
  10085. var iteratorWithReturn = {
  10086. next: function() {
  10087. return { done: !!called++ };
  10088. },
  10089. "return": function() {
  10090. SAFE_CLOSING = true;
  10091. }
  10092. };
  10093. iteratorWithReturn[ITERATOR] = function() {
  10094. return this;
  10095. };
  10096. Array.from(iteratorWithReturn, function() {
  10097. throw 2;
  10098. });
  10099. } catch (error) {
  10100. }
  10101. module3.exports = function(exec, SKIP_CLOSING) {
  10102. if (!SKIP_CLOSING && !SAFE_CLOSING)
  10103. return false;
  10104. var ITERATION_SUPPORT = false;
  10105. try {
  10106. var object = {};
  10107. object[ITERATOR] = function() {
  10108. return {
  10109. next: function() {
  10110. return { done: ITERATION_SUPPORT = true };
  10111. }
  10112. };
  10113. };
  10114. exec(object);
  10115. } catch (error) {
  10116. }
  10117. return ITERATION_SUPPORT;
  10118. };
  10119. }, { "../internals/well-known-symbol": 268 }], 123: [function(require2, module3, exports3) {
  10120. var uncurryThis = require2("../internals/function-uncurry-this");
  10121. var toString = uncurryThis({}.toString);
  10122. var stringSlice = uncurryThis("".slice);
  10123. module3.exports = function(it) {
  10124. return stringSlice(toString(it), 8, -1);
  10125. };
  10126. }, { "../internals/function-uncurry-this": 157 }], 124: [function(require2, module3, exports3) {
  10127. var global2 = require2("../internals/global");
  10128. var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
  10129. var isCallable = require2("../internals/is-callable");
  10130. var classofRaw = require2("../internals/classof-raw");
  10131. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10132. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  10133. var Object2 = global2.Object;
  10134. var CORRECT_ARGUMENTS = classofRaw(function() {
  10135. return arguments;
  10136. }()) == "Arguments";
  10137. var tryGet = function(it, key) {
  10138. try {
  10139. return it[key];
  10140. } catch (error) {
  10141. }
  10142. };
  10143. module3.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
  10144. var O, tag, result;
  10145. return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object2(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
  10146. };
  10147. }, { "../internals/classof-raw": 123, "../internals/global": 163, "../internals/is-callable": 176, "../internals/to-string-tag-support": 255, "../internals/well-known-symbol": 268 }], 125: [function(require2, module3, exports3) {
  10148. var hasOwn = require2("../internals/has-own-property");
  10149. var ownKeys = require2("../internals/own-keys");
  10150. var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
  10151. var definePropertyModule = require2("../internals/object-define-property");
  10152. module3.exports = function(target, source, exceptions) {
  10153. var keys = ownKeys(source);
  10154. var defineProperty = definePropertyModule.f;
  10155. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  10156. for (var i = 0; i < keys.length; i++) {
  10157. var key = keys[i];
  10158. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  10159. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  10160. }
  10161. }
  10162. };
  10163. }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/own-keys": 212 }], 126: [function(require2, module3, exports3) {
  10164. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10165. var MATCH = wellKnownSymbol("match");
  10166. module3.exports = function(METHOD_NAME) {
  10167. var regexp = /./;
  10168. try {
  10169. "/./"[METHOD_NAME](regexp);
  10170. } catch (error1) {
  10171. try {
  10172. regexp[MATCH] = false;
  10173. return "/./"[METHOD_NAME](regexp);
  10174. } catch (error2) {
  10175. }
  10176. }
  10177. return false;
  10178. };
  10179. }, { "../internals/well-known-symbol": 268 }], 127: [function(require2, module3, exports3) {
  10180. var fails = require2("../internals/fails");
  10181. module3.exports = !fails(function() {
  10182. function F() {
  10183. }
  10184. F.prototype.constructor = null;
  10185. return Object.getPrototypeOf(new F()) !== F.prototype;
  10186. });
  10187. }, { "../internals/fails": 150 }], 128: [function(require2, module3, exports3) {
  10188. "use strict";
  10189. var IteratorPrototype = require2("../internals/iterators-core").IteratorPrototype;
  10190. var create = require2("../internals/object-create");
  10191. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  10192. var setToStringTag = require2("../internals/set-to-string-tag");
  10193. var Iterators = require2("../internals/iterators");
  10194. var returnThis = function() {
  10195. return this;
  10196. };
  10197. module3.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  10198. var TO_STRING_TAG = NAME + " Iterator";
  10199. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  10200. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  10201. Iterators[TO_STRING_TAG] = returnThis;
  10202. return IteratorConstructor;
  10203. };
  10204. }, { "../internals/create-property-descriptor": 130, "../internals/iterators": 187, "../internals/iterators-core": 186, "../internals/object-create": 196, "../internals/set-to-string-tag": 234 }], 129: [function(require2, module3, exports3) {
  10205. var DESCRIPTORS = require2("../internals/descriptors");
  10206. var definePropertyModule = require2("../internals/object-define-property");
  10207. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  10208. module3.exports = DESCRIPTORS ? function(object, key, value) {
  10209. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  10210. } : function(object, key, value) {
  10211. object[key] = value;
  10212. return object;
  10213. };
  10214. }, { "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/object-define-property": 198 }], 130: [function(require2, module3, exports3) {
  10215. module3.exports = function(bitmap, value) {
  10216. return {
  10217. enumerable: !(bitmap & 1),
  10218. configurable: !(bitmap & 2),
  10219. writable: !(bitmap & 4),
  10220. value
  10221. };
  10222. };
  10223. }, {}], 131: [function(require2, module3, exports3) {
  10224. "use strict";
  10225. var toPropertyKey = require2("../internals/to-property-key");
  10226. var definePropertyModule = require2("../internals/object-define-property");
  10227. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  10228. module3.exports = function(object, key, value) {
  10229. var propertyKey = toPropertyKey(key);
  10230. if (propertyKey in object)
  10231. definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  10232. else
  10233. object[propertyKey] = value;
  10234. };
  10235. }, { "../internals/create-property-descriptor": 130, "../internals/object-define-property": 198, "../internals/to-property-key": 254 }], 132: [function(require2, module3, exports3) {
  10236. "use strict";
  10237. var $ = require2("../internals/export");
  10238. var call = require2("../internals/function-call");
  10239. var IS_PURE = require2("../internals/is-pure");
  10240. var FunctionName = require2("../internals/function-name");
  10241. var isCallable = require2("../internals/is-callable");
  10242. var createIteratorConstructor = require2("../internals/create-iterator-constructor");
  10243. var getPrototypeOf = require2("../internals/object-get-prototype-of");
  10244. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  10245. var setToStringTag = require2("../internals/set-to-string-tag");
  10246. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  10247. var redefine = require2("../internals/redefine");
  10248. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10249. var Iterators = require2("../internals/iterators");
  10250. var IteratorsCore = require2("../internals/iterators-core");
  10251. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  10252. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  10253. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  10254. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  10255. var ITERATOR = wellKnownSymbol("iterator");
  10256. var KEYS = "keys";
  10257. var VALUES = "values";
  10258. var ENTRIES = "entries";
  10259. var returnThis = function() {
  10260. return this;
  10261. };
  10262. module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  10263. createIteratorConstructor(IteratorConstructor, NAME, next);
  10264. var getIterationMethod = function(KIND) {
  10265. if (KIND === DEFAULT && defaultIterator)
  10266. return defaultIterator;
  10267. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
  10268. return IterablePrototype[KIND];
  10269. switch (KIND) {
  10270. case KEYS:
  10271. return function keys() {
  10272. return new IteratorConstructor(this, KIND);
  10273. };
  10274. case VALUES:
  10275. return function values() {
  10276. return new IteratorConstructor(this, KIND);
  10277. };
  10278. case ENTRIES:
  10279. return function entries() {
  10280. return new IteratorConstructor(this, KIND);
  10281. };
  10282. }
  10283. return function() {
  10284. return new IteratorConstructor(this);
  10285. };
  10286. };
  10287. var TO_STRING_TAG = NAME + " Iterator";
  10288. var INCORRECT_VALUES_NAME = false;
  10289. var IterablePrototype = Iterable.prototype;
  10290. var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
  10291. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  10292. var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
  10293. var CurrentIteratorPrototype, methods, KEY;
  10294. if (anyNativeIterator) {
  10295. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  10296. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  10297. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  10298. if (setPrototypeOf) {
  10299. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  10300. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
  10301. redefine(CurrentIteratorPrototype, ITERATOR, returnThis);
  10302. }
  10303. }
  10304. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  10305. if (IS_PURE)
  10306. Iterators[TO_STRING_TAG] = returnThis;
  10307. }
  10308. }
  10309. if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  10310. if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
  10311. createNonEnumerableProperty(IterablePrototype, "name", VALUES);
  10312. } else {
  10313. INCORRECT_VALUES_NAME = true;
  10314. defaultIterator = function values() {
  10315. return call(nativeIterator, this);
  10316. };
  10317. }
  10318. }
  10319. if (DEFAULT) {
  10320. methods = {
  10321. values: getIterationMethod(VALUES),
  10322. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  10323. entries: getIterationMethod(ENTRIES)
  10324. };
  10325. if (FORCED)
  10326. for (KEY in methods) {
  10327. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  10328. redefine(IterablePrototype, KEY, methods[KEY]);
  10329. }
  10330. }
  10331. else
  10332. $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  10333. }
  10334. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  10335. redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
  10336. }
  10337. Iterators[NAME] = defaultIterator;
  10338. return methods;
  10339. };
  10340. }, { "../internals/create-iterator-constructor": 128, "../internals/create-non-enumerable-property": 129, "../internals/export": 149, "../internals/function-call": 155, "../internals/function-name": 156, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/iterators": 187, "../internals/iterators-core": 186, "../internals/object-get-prototype-of": 203, "../internals/object-set-prototype-of": 208, "../internals/redefine": 222, "../internals/set-to-string-tag": 234, "../internals/well-known-symbol": 268 }], 133: [function(require2, module3, exports3) {
  10341. var path = require2("../internals/path");
  10342. var hasOwn = require2("../internals/has-own-property");
  10343. var wrappedWellKnownSymbolModule = require2("../internals/well-known-symbol-wrapped");
  10344. var defineProperty = require2("../internals/object-define-property").f;
  10345. module3.exports = function(NAME) {
  10346. var Symbol2 = path.Symbol || (path.Symbol = {});
  10347. if (!hasOwn(Symbol2, NAME))
  10348. defineProperty(Symbol2, NAME, {
  10349. value: wrappedWellKnownSymbolModule.f(NAME)
  10350. });
  10351. };
  10352. }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/path": 213, "../internals/well-known-symbol-wrapped": 267 }], 134: [function(require2, module3, exports3) {
  10353. var fails = require2("../internals/fails");
  10354. module3.exports = !fails(function() {
  10355. return Object.defineProperty({}, 1, { get: function() {
  10356. return 7;
  10357. } })[1] != 7;
  10358. });
  10359. }, { "../internals/fails": 150 }], 135: [function(require2, module3, exports3) {
  10360. var global2 = require2("../internals/global");
  10361. var isObject = require2("../internals/is-object");
  10362. var document2 = global2.document;
  10363. var EXISTS = isObject(document2) && isObject(document2.createElement);
  10364. module3.exports = function(it) {
  10365. return EXISTS ? document2.createElement(it) : {};
  10366. };
  10367. }, { "../internals/global": 163, "../internals/is-object": 180 }], 136: [function(require2, module3, exports3) {
  10368. module3.exports = {
  10369. CSSRuleList: 0,
  10370. CSSStyleDeclaration: 0,
  10371. CSSValueList: 0,
  10372. ClientRectList: 0,
  10373. DOMRectList: 0,
  10374. DOMStringList: 0,
  10375. DOMTokenList: 1,
  10376. DataTransferItemList: 0,
  10377. FileList: 0,
  10378. HTMLAllCollection: 0,
  10379. HTMLCollection: 0,
  10380. HTMLFormElement: 0,
  10381. HTMLSelectElement: 0,
  10382. MediaList: 0,
  10383. MimeTypeArray: 0,
  10384. NamedNodeMap: 0,
  10385. NodeList: 1,
  10386. PaintRequestList: 0,
  10387. Plugin: 0,
  10388. PluginArray: 0,
  10389. SVGLengthList: 0,
  10390. SVGNumberList: 0,
  10391. SVGPathSegList: 0,
  10392. SVGPointList: 0,
  10393. SVGStringList: 0,
  10394. SVGTransformList: 0,
  10395. SourceBufferList: 0,
  10396. StyleSheetList: 0,
  10397. TextTrackCueList: 0,
  10398. TextTrackList: 0,
  10399. TouchList: 0
  10400. };
  10401. }, {}], 137: [function(require2, module3, exports3) {
  10402. var documentCreateElement = require2("../internals/document-create-element");
  10403. var classList = documentCreateElement("span").classList;
  10404. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  10405. module3.exports = DOMTokenListPrototype === Object.prototype ? void 0 : DOMTokenListPrototype;
  10406. }, { "../internals/document-create-element": 135 }], 138: [function(require2, module3, exports3) {
  10407. var userAgent = require2("../internals/engine-user-agent");
  10408. var firefox = userAgent.match(/firefox\/(\d+)/i);
  10409. module3.exports = !!firefox && +firefox[1];
  10410. }, { "../internals/engine-user-agent": 145 }], 139: [function(require2, module3, exports3) {
  10411. module3.exports = typeof window == "object" && typeof Deno != "object";
  10412. }, {}], 140: [function(require2, module3, exports3) {
  10413. var UA = require2("../internals/engine-user-agent");
  10414. module3.exports = /MSIE|Trident/.test(UA);
  10415. }, { "../internals/engine-user-agent": 145 }], 141: [function(require2, module3, exports3) {
  10416. var userAgent = require2("../internals/engine-user-agent");
  10417. var global2 = require2("../internals/global");
  10418. module3.exports = /ipad|iphone|ipod/i.test(userAgent) && global2.Pebble !== void 0;
  10419. }, { "../internals/engine-user-agent": 145, "../internals/global": 163 }], 142: [function(require2, module3, exports3) {
  10420. var userAgent = require2("../internals/engine-user-agent");
  10421. module3.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
  10422. }, { "../internals/engine-user-agent": 145 }], 143: [function(require2, module3, exports3) {
  10423. var classof = require2("../internals/classof-raw");
  10424. var global2 = require2("../internals/global");
  10425. module3.exports = classof(global2.process) == "process";
  10426. }, { "../internals/classof-raw": 123, "../internals/global": 163 }], 144: [function(require2, module3, exports3) {
  10427. var userAgent = require2("../internals/engine-user-agent");
  10428. module3.exports = /web0s(?!.*chrome)/i.test(userAgent);
  10429. }, { "../internals/engine-user-agent": 145 }], 145: [function(require2, module3, exports3) {
  10430. var getBuiltIn = require2("../internals/get-built-in");
  10431. module3.exports = getBuiltIn("navigator", "userAgent") || "";
  10432. }, { "../internals/get-built-in": 158 }], 146: [function(require2, module3, exports3) {
  10433. var global2 = require2("../internals/global");
  10434. var userAgent = require2("../internals/engine-user-agent");
  10435. var process = global2.process;
  10436. var Deno2 = global2.Deno;
  10437. var versions = process && process.versions || Deno2 && Deno2.version;
  10438. var v8 = versions && versions.v8;
  10439. var match, version;
  10440. if (v8) {
  10441. match = v8.split(".");
  10442. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  10443. }
  10444. if (!version && userAgent) {
  10445. match = userAgent.match(/Edge\/(\d+)/);
  10446. if (!match || match[1] >= 74) {
  10447. match = userAgent.match(/Chrome\/(\d+)/);
  10448. if (match)
  10449. version = +match[1];
  10450. }
  10451. }
  10452. module3.exports = version;
  10453. }, { "../internals/engine-user-agent": 145, "../internals/global": 163 }], 147: [function(require2, module3, exports3) {
  10454. var userAgent = require2("../internals/engine-user-agent");
  10455. var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
  10456. module3.exports = !!webkit && +webkit[1];
  10457. }, { "../internals/engine-user-agent": 145 }], 148: [function(require2, module3, exports3) {
  10458. module3.exports = [
  10459. "constructor",
  10460. "hasOwnProperty",
  10461. "isPrototypeOf",
  10462. "propertyIsEnumerable",
  10463. "toLocaleString",
  10464. "toString",
  10465. "valueOf"
  10466. ];
  10467. }, {}], 149: [function(require2, module3, exports3) {
  10468. var global2 = require2("../internals/global");
  10469. var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
  10470. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  10471. var redefine = require2("../internals/redefine");
  10472. var setGlobal = require2("../internals/set-global");
  10473. var copyConstructorProperties = require2("../internals/copy-constructor-properties");
  10474. var isForced = require2("../internals/is-forced");
  10475. module3.exports = function(options, source) {
  10476. var TARGET = options.target;
  10477. var GLOBAL = options.global;
  10478. var STATIC = options.stat;
  10479. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  10480. if (GLOBAL) {
  10481. target = global2;
  10482. } else if (STATIC) {
  10483. target = global2[TARGET] || setGlobal(TARGET, {});
  10484. } else {
  10485. target = (global2[TARGET] || {}).prototype;
  10486. }
  10487. if (target)
  10488. for (key in source) {
  10489. sourceProperty = source[key];
  10490. if (options.noTargetGet) {
  10491. descriptor = getOwnPropertyDescriptor(target, key);
  10492. targetProperty = descriptor && descriptor.value;
  10493. } else
  10494. targetProperty = target[key];
  10495. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
  10496. if (!FORCED && targetProperty !== void 0) {
  10497. if (typeof sourceProperty == typeof targetProperty)
  10498. continue;
  10499. copyConstructorProperties(sourceProperty, targetProperty);
  10500. }
  10501. if (options.sham || targetProperty && targetProperty.sham) {
  10502. createNonEnumerableProperty(sourceProperty, "sham", true);
  10503. }
  10504. redefine(target, key, sourceProperty, options);
  10505. }
  10506. };
  10507. }, { "../internals/copy-constructor-properties": 125, "../internals/create-non-enumerable-property": 129, "../internals/global": 163, "../internals/is-forced": 178, "../internals/object-get-own-property-descriptor": 199, "../internals/redefine": 222, "../internals/set-global": 232 }], 150: [function(require2, module3, exports3) {
  10508. module3.exports = function(exec) {
  10509. try {
  10510. return !!exec();
  10511. } catch (error) {
  10512. return true;
  10513. }
  10514. };
  10515. }, {}], 151: [function(require2, module3, exports3) {
  10516. "use strict";
  10517. require2("../modules/es.regexp.exec");
  10518. var uncurryThis = require2("../internals/function-uncurry-this");
  10519. var redefine = require2("../internals/redefine");
  10520. var regexpExec = require2("../internals/regexp-exec");
  10521. var fails = require2("../internals/fails");
  10522. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10523. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  10524. var SPECIES = wellKnownSymbol("species");
  10525. var RegExpPrototype = RegExp.prototype;
  10526. module3.exports = function(KEY, exec, FORCED, SHAM) {
  10527. var SYMBOL = wellKnownSymbol(KEY);
  10528. var DELEGATES_TO_SYMBOL = !fails(function() {
  10529. var O = {};
  10530. O[SYMBOL] = function() {
  10531. return 7;
  10532. };
  10533. return ""[KEY](O) != 7;
  10534. });
  10535. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() {
  10536. var execCalled = false;
  10537. var re = /a/;
  10538. if (KEY === "split") {
  10539. re = {};
  10540. re.constructor = {};
  10541. re.constructor[SPECIES] = function() {
  10542. return re;
  10543. };
  10544. re.flags = "";
  10545. re[SYMBOL] = /./[SYMBOL];
  10546. }
  10547. re.exec = function() {
  10548. execCalled = true;
  10549. return null;
  10550. };
  10551. re[SYMBOL]("");
  10552. return !execCalled;
  10553. });
  10554. if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) {
  10555. var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);
  10556. var methods = exec(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
  10557. var uncurriedNativeMethod = uncurryThis(nativeMethod);
  10558. var $exec = regexp.exec;
  10559. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  10560. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  10561. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  10562. }
  10563. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  10564. }
  10565. return { done: false };
  10566. });
  10567. redefine(String.prototype, KEY, methods[0]);
  10568. redefine(RegExpPrototype, SYMBOL, methods[1]);
  10569. }
  10570. if (SHAM)
  10571. createNonEnumerableProperty(RegExpPrototype[SYMBOL], "sham", true);
  10572. };
  10573. }, { "../internals/create-non-enumerable-property": 129, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/redefine": 222, "../internals/regexp-exec": 224, "../internals/well-known-symbol": 268, "../modules/es.regexp.exec": 300 }], 152: [function(require2, module3, exports3) {
  10574. var NATIVE_BIND = require2("../internals/function-bind-native");
  10575. var FunctionPrototype = Function.prototype;
  10576. var apply = FunctionPrototype.apply;
  10577. var call = FunctionPrototype.call;
  10578. module3.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
  10579. return call.apply(apply, arguments);
  10580. });
  10581. }, { "../internals/function-bind-native": 154 }], 153: [function(require2, module3, exports3) {
  10582. var uncurryThis = require2("../internals/function-uncurry-this");
  10583. var aCallable = require2("../internals/a-callable");
  10584. var NATIVE_BIND = require2("../internals/function-bind-native");
  10585. var bind = uncurryThis(uncurryThis.bind);
  10586. module3.exports = function(fn, that) {
  10587. aCallable(fn);
  10588. return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
  10589. return fn.apply(that, arguments);
  10590. };
  10591. };
  10592. }, { "../internals/a-callable": 95, "../internals/function-bind-native": 154, "../internals/function-uncurry-this": 157 }], 154: [function(require2, module3, exports3) {
  10593. var fails = require2("../internals/fails");
  10594. module3.exports = !fails(function() {
  10595. var test = function() {
  10596. }.bind();
  10597. return typeof test != "function" || test.hasOwnProperty("prototype");
  10598. });
  10599. }, { "../internals/fails": 150 }], 155: [function(require2, module3, exports3) {
  10600. var NATIVE_BIND = require2("../internals/function-bind-native");
  10601. var call = Function.prototype.call;
  10602. module3.exports = NATIVE_BIND ? call.bind(call) : function() {
  10603. return call.apply(call, arguments);
  10604. };
  10605. }, { "../internals/function-bind-native": 154 }], 156: [function(require2, module3, exports3) {
  10606. var DESCRIPTORS = require2("../internals/descriptors");
  10607. var hasOwn = require2("../internals/has-own-property");
  10608. var FunctionPrototype = Function.prototype;
  10609. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  10610. var EXISTS = hasOwn(FunctionPrototype, "name");
  10611. var PROPER = EXISTS && function something() {
  10612. }.name === "something";
  10613. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
  10614. module3.exports = {
  10615. EXISTS,
  10616. PROPER,
  10617. CONFIGURABLE
  10618. };
  10619. }, { "../internals/descriptors": 134, "../internals/has-own-property": 164 }], 157: [function(require2, module3, exports3) {
  10620. var NATIVE_BIND = require2("../internals/function-bind-native");
  10621. var FunctionPrototype = Function.prototype;
  10622. var bind = FunctionPrototype.bind;
  10623. var call = FunctionPrototype.call;
  10624. var uncurryThis = NATIVE_BIND && bind.bind(call, call);
  10625. module3.exports = NATIVE_BIND ? function(fn) {
  10626. return fn && uncurryThis(fn);
  10627. } : function(fn) {
  10628. return fn && function() {
  10629. return call.apply(fn, arguments);
  10630. };
  10631. };
  10632. }, { "../internals/function-bind-native": 154 }], 158: [function(require2, module3, exports3) {
  10633. var global2 = require2("../internals/global");
  10634. var isCallable = require2("../internals/is-callable");
  10635. var aFunction = function(argument) {
  10636. return isCallable(argument) ? argument : void 0;
  10637. };
  10638. module3.exports = function(namespace, method) {
  10639. return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
  10640. };
  10641. }, { "../internals/global": 163, "../internals/is-callable": 176 }], 159: [function(require2, module3, exports3) {
  10642. var classof = require2("../internals/classof");
  10643. var getMethod = require2("../internals/get-method");
  10644. var Iterators = require2("../internals/iterators");
  10645. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10646. var ITERATOR = wellKnownSymbol("iterator");
  10647. module3.exports = function(it) {
  10648. if (it != void 0)
  10649. return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
  10650. };
  10651. }, { "../internals/classof": 124, "../internals/get-method": 161, "../internals/iterators": 187, "../internals/well-known-symbol": 268 }], 160: [function(require2, module3, exports3) {
  10652. var global2 = require2("../internals/global");
  10653. var call = require2("../internals/function-call");
  10654. var aCallable = require2("../internals/a-callable");
  10655. var anObject = require2("../internals/an-object");
  10656. var tryToString = require2("../internals/try-to-string");
  10657. var getIteratorMethod = require2("../internals/get-iterator-method");
  10658. var TypeError2 = global2.TypeError;
  10659. module3.exports = function(argument, usingIterator) {
  10660. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  10661. if (aCallable(iteratorMethod))
  10662. return anObject(call(iteratorMethod, argument));
  10663. throw TypeError2(tryToString(argument) + " is not iterable");
  10664. };
  10665. }, { "../internals/a-callable": 95, "../internals/an-object": 101, "../internals/function-call": 155, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/try-to-string": 257 }], 161: [function(require2, module3, exports3) {
  10666. var aCallable = require2("../internals/a-callable");
  10667. module3.exports = function(V, P) {
  10668. var func = V[P];
  10669. return func == null ? void 0 : aCallable(func);
  10670. };
  10671. }, { "../internals/a-callable": 95 }], 162: [function(require2, module3, exports3) {
  10672. var uncurryThis = require2("../internals/function-uncurry-this");
  10673. var toObject = require2("../internals/to-object");
  10674. var floor = Math.floor;
  10675. var charAt = uncurryThis("".charAt);
  10676. var replace = uncurryThis("".replace);
  10677. var stringSlice = uncurryThis("".slice);
  10678. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  10679. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  10680. module3.exports = function(matched, str, position, captures, namedCaptures, replacement) {
  10681. var tailPos = position + matched.length;
  10682. var m = captures.length;
  10683. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  10684. if (namedCaptures !== void 0) {
  10685. namedCaptures = toObject(namedCaptures);
  10686. symbols = SUBSTITUTION_SYMBOLS;
  10687. }
  10688. return replace(replacement, symbols, function(match, ch) {
  10689. var capture;
  10690. switch (charAt(ch, 0)) {
  10691. case "$":
  10692. return "$";
  10693. case "&":
  10694. return matched;
  10695. case "`":
  10696. return stringSlice(str, 0, position);
  10697. case "'":
  10698. return stringSlice(str, tailPos);
  10699. case "<":
  10700. capture = namedCaptures[stringSlice(ch, 1, -1)];
  10701. break;
  10702. default:
  10703. var n = +ch;
  10704. if (n === 0)
  10705. return match;
  10706. if (n > m) {
  10707. var f = floor(n / 10);
  10708. if (f === 0)
  10709. return match;
  10710. if (f <= m)
  10711. return captures[f - 1] === void 0 ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  10712. return match;
  10713. }
  10714. capture = captures[n - 1];
  10715. }
  10716. return capture === void 0 ? "" : capture;
  10717. });
  10718. };
  10719. }, { "../internals/function-uncurry-this": 157, "../internals/to-object": 250 }], 163: [function(require2, module3, exports3) {
  10720. (function(global2) {
  10721. (function() {
  10722. var check = function(it) {
  10723. return it && it.Math == Math && it;
  10724. };
  10725. module3.exports = // eslint-disable-next-line es-x/no-global-this -- safe
  10726. check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
  10727. check(typeof self == "object" && self) || check(typeof global2 == "object" && global2) || // eslint-disable-next-line no-new-func -- fallback
  10728. function() {
  10729. return this;
  10730. }() || Function("return this")();
  10731. }).call(this);
  10732. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  10733. }, {}], 164: [function(require2, module3, exports3) {
  10734. var uncurryThis = require2("../internals/function-uncurry-this");
  10735. var toObject = require2("../internals/to-object");
  10736. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  10737. module3.exports = Object.hasOwn || function hasOwn(it, key) {
  10738. return hasOwnProperty(toObject(it), key);
  10739. };
  10740. }, { "../internals/function-uncurry-this": 157, "../internals/to-object": 250 }], 165: [function(require2, module3, exports3) {
  10741. module3.exports = {};
  10742. }, {}], 166: [function(require2, module3, exports3) {
  10743. var global2 = require2("../internals/global");
  10744. module3.exports = function(a, b) {
  10745. var console2 = global2.console;
  10746. if (console2 && console2.error) {
  10747. arguments.length == 1 ? console2.error(a) : console2.error(a, b);
  10748. }
  10749. };
  10750. }, { "../internals/global": 163 }], 167: [function(require2, module3, exports3) {
  10751. var getBuiltIn = require2("../internals/get-built-in");
  10752. module3.exports = getBuiltIn("document", "documentElement");
  10753. }, { "../internals/get-built-in": 158 }], 168: [function(require2, module3, exports3) {
  10754. var DESCRIPTORS = require2("../internals/descriptors");
  10755. var fails = require2("../internals/fails");
  10756. var createElement = require2("../internals/document-create-element");
  10757. module3.exports = !DESCRIPTORS && !fails(function() {
  10758. return Object.defineProperty(createElement("div"), "a", {
  10759. get: function() {
  10760. return 7;
  10761. }
  10762. }).a != 7;
  10763. });
  10764. }, { "../internals/descriptors": 134, "../internals/document-create-element": 135, "../internals/fails": 150 }], 169: [function(require2, module3, exports3) {
  10765. var global2 = require2("../internals/global");
  10766. var Array2 = global2.Array;
  10767. var abs = Math.abs;
  10768. var pow = Math.pow;
  10769. var floor = Math.floor;
  10770. var log = Math.log;
  10771. var LN2 = Math.LN2;
  10772. var pack = function(number, mantissaLength, bytes) {
  10773. var buffer = Array2(bytes);
  10774. var exponentLength = bytes * 8 - mantissaLength - 1;
  10775. var eMax = (1 << exponentLength) - 1;
  10776. var eBias = eMax >> 1;
  10777. var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
  10778. var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
  10779. var index = 0;
  10780. var exponent, mantissa, c;
  10781. number = abs(number);
  10782. if (number != number || number === Infinity) {
  10783. mantissa = number != number ? 1 : 0;
  10784. exponent = eMax;
  10785. } else {
  10786. exponent = floor(log(number) / LN2);
  10787. c = pow(2, -exponent);
  10788. if (number * c < 1) {
  10789. exponent--;
  10790. c *= 2;
  10791. }
  10792. if (exponent + eBias >= 1) {
  10793. number += rt / c;
  10794. } else {
  10795. number += rt * pow(2, 1 - eBias);
  10796. }
  10797. if (number * c >= 2) {
  10798. exponent++;
  10799. c /= 2;
  10800. }
  10801. if (exponent + eBias >= eMax) {
  10802. mantissa = 0;
  10803. exponent = eMax;
  10804. } else if (exponent + eBias >= 1) {
  10805. mantissa = (number * c - 1) * pow(2, mantissaLength);
  10806. exponent = exponent + eBias;
  10807. } else {
  10808. mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
  10809. exponent = 0;
  10810. }
  10811. }
  10812. while (mantissaLength >= 8) {
  10813. buffer[index++] = mantissa & 255;
  10814. mantissa /= 256;
  10815. mantissaLength -= 8;
  10816. }
  10817. exponent = exponent << mantissaLength | mantissa;
  10818. exponentLength += mantissaLength;
  10819. while (exponentLength > 0) {
  10820. buffer[index++] = exponent & 255;
  10821. exponent /= 256;
  10822. exponentLength -= 8;
  10823. }
  10824. buffer[--index] |= sign * 128;
  10825. return buffer;
  10826. };
  10827. var unpack = function(buffer, mantissaLength) {
  10828. var bytes = buffer.length;
  10829. var exponentLength = bytes * 8 - mantissaLength - 1;
  10830. var eMax = (1 << exponentLength) - 1;
  10831. var eBias = eMax >> 1;
  10832. var nBits = exponentLength - 7;
  10833. var index = bytes - 1;
  10834. var sign = buffer[index--];
  10835. var exponent = sign & 127;
  10836. var mantissa;
  10837. sign >>= 7;
  10838. while (nBits > 0) {
  10839. exponent = exponent * 256 + buffer[index--];
  10840. nBits -= 8;
  10841. }
  10842. mantissa = exponent & (1 << -nBits) - 1;
  10843. exponent >>= -nBits;
  10844. nBits += mantissaLength;
  10845. while (nBits > 0) {
  10846. mantissa = mantissa * 256 + buffer[index--];
  10847. nBits -= 8;
  10848. }
  10849. if (exponent === 0) {
  10850. exponent = 1 - eBias;
  10851. } else if (exponent === eMax) {
  10852. return mantissa ? NaN : sign ? -Infinity : Infinity;
  10853. } else {
  10854. mantissa = mantissa + pow(2, mantissaLength);
  10855. exponent = exponent - eBias;
  10856. }
  10857. return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
  10858. };
  10859. module3.exports = {
  10860. pack,
  10861. unpack
  10862. };
  10863. }, { "../internals/global": 163 }], 170: [function(require2, module3, exports3) {
  10864. var global2 = require2("../internals/global");
  10865. var uncurryThis = require2("../internals/function-uncurry-this");
  10866. var fails = require2("../internals/fails");
  10867. var classof = require2("../internals/classof-raw");
  10868. var Object2 = global2.Object;
  10869. var split = uncurryThis("".split);
  10870. module3.exports = fails(function() {
  10871. return !Object2("z").propertyIsEnumerable(0);
  10872. }) ? function(it) {
  10873. return classof(it) == "String" ? split(it, "") : Object2(it);
  10874. } : Object2;
  10875. }, { "../internals/classof-raw": 123, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 171: [function(require2, module3, exports3) {
  10876. var isCallable = require2("../internals/is-callable");
  10877. var isObject = require2("../internals/is-object");
  10878. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  10879. module3.exports = function($this, dummy, Wrapper) {
  10880. var NewTarget, NewTargetPrototype;
  10881. if (
  10882. // it can work only with native `setPrototypeOf`
  10883. setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  10884. isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype
  10885. )
  10886. setPrototypeOf($this, NewTargetPrototype);
  10887. return $this;
  10888. };
  10889. }, { "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/object-set-prototype-of": 208 }], 172: [function(require2, module3, exports3) {
  10890. var uncurryThis = require2("../internals/function-uncurry-this");
  10891. var isCallable = require2("../internals/is-callable");
  10892. var store = require2("../internals/shared-store");
  10893. var functionToString = uncurryThis(Function.toString);
  10894. if (!isCallable(store.inspectSource)) {
  10895. store.inspectSource = function(it) {
  10896. return functionToString(it);
  10897. };
  10898. }
  10899. module3.exports = store.inspectSource;
  10900. }, { "../internals/function-uncurry-this": 157, "../internals/is-callable": 176, "../internals/shared-store": 236 }], 173: [function(require2, module3, exports3) {
  10901. var NATIVE_WEAK_MAP = require2("../internals/native-weak-map");
  10902. var global2 = require2("../internals/global");
  10903. var uncurryThis = require2("../internals/function-uncurry-this");
  10904. var isObject = require2("../internals/is-object");
  10905. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  10906. var hasOwn = require2("../internals/has-own-property");
  10907. var shared = require2("../internals/shared-store");
  10908. var sharedKey = require2("../internals/shared-key");
  10909. var hiddenKeys = require2("../internals/hidden-keys");
  10910. var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
  10911. var TypeError2 = global2.TypeError;
  10912. var WeakMap2 = global2.WeakMap;
  10913. var set, get, has;
  10914. var enforce = function(it) {
  10915. return has(it) ? get(it) : set(it, {});
  10916. };
  10917. var getterFor = function(TYPE) {
  10918. return function(it) {
  10919. var state;
  10920. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  10921. throw TypeError2("Incompatible receiver, " + TYPE + " required");
  10922. }
  10923. return state;
  10924. };
  10925. };
  10926. if (NATIVE_WEAK_MAP || shared.state) {
  10927. var store = shared.state || (shared.state = new WeakMap2());
  10928. var wmget = uncurryThis(store.get);
  10929. var wmhas = uncurryThis(store.has);
  10930. var wmset = uncurryThis(store.set);
  10931. set = function(it, metadata) {
  10932. if (wmhas(store, it))
  10933. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  10934. metadata.facade = it;
  10935. wmset(store, it, metadata);
  10936. return metadata;
  10937. };
  10938. get = function(it) {
  10939. return wmget(store, it) || {};
  10940. };
  10941. has = function(it) {
  10942. return wmhas(store, it);
  10943. };
  10944. } else {
  10945. var STATE = sharedKey("state");
  10946. hiddenKeys[STATE] = true;
  10947. set = function(it, metadata) {
  10948. if (hasOwn(it, STATE))
  10949. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  10950. metadata.facade = it;
  10951. createNonEnumerableProperty(it, STATE, metadata);
  10952. return metadata;
  10953. };
  10954. get = function(it) {
  10955. return hasOwn(it, STATE) ? it[STATE] : {};
  10956. };
  10957. has = function(it) {
  10958. return hasOwn(it, STATE);
  10959. };
  10960. }
  10961. module3.exports = {
  10962. set,
  10963. get,
  10964. has,
  10965. enforce,
  10966. getterFor
  10967. };
  10968. }, { "../internals/create-non-enumerable-property": 129, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/is-object": 180, "../internals/native-weak-map": 192, "../internals/shared-key": 235, "../internals/shared-store": 236 }], 174: [function(require2, module3, exports3) {
  10969. var wellKnownSymbol = require2("../internals/well-known-symbol");
  10970. var Iterators = require2("../internals/iterators");
  10971. var ITERATOR = wellKnownSymbol("iterator");
  10972. var ArrayPrototype = Array.prototype;
  10973. module3.exports = function(it) {
  10974. return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  10975. };
  10976. }, { "../internals/iterators": 187, "../internals/well-known-symbol": 268 }], 175: [function(require2, module3, exports3) {
  10977. var classof = require2("../internals/classof-raw");
  10978. module3.exports = Array.isArray || function isArray(argument) {
  10979. return classof(argument) == "Array";
  10980. };
  10981. }, { "../internals/classof-raw": 123 }], 176: [function(require2, module3, exports3) {
  10982. module3.exports = function(argument) {
  10983. return typeof argument == "function";
  10984. };
  10985. }, {}], 177: [function(require2, module3, exports3) {
  10986. var uncurryThis = require2("../internals/function-uncurry-this");
  10987. var fails = require2("../internals/fails");
  10988. var isCallable = require2("../internals/is-callable");
  10989. var classof = require2("../internals/classof");
  10990. var getBuiltIn = require2("../internals/get-built-in");
  10991. var inspectSource = require2("../internals/inspect-source");
  10992. var noop = function() {
  10993. };
  10994. var empty = [];
  10995. var construct = getBuiltIn("Reflect", "construct");
  10996. var constructorRegExp = /^\s*(?:class|function)\b/;
  10997. var exec = uncurryThis(constructorRegExp.exec);
  10998. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  10999. var isConstructorModern = function isConstructor(argument) {
  11000. if (!isCallable(argument))
  11001. return false;
  11002. try {
  11003. construct(noop, empty, argument);
  11004. return true;
  11005. } catch (error) {
  11006. return false;
  11007. }
  11008. };
  11009. var isConstructorLegacy = function isConstructor(argument) {
  11010. if (!isCallable(argument))
  11011. return false;
  11012. switch (classof(argument)) {
  11013. case "AsyncFunction":
  11014. case "GeneratorFunction":
  11015. case "AsyncGeneratorFunction":
  11016. return false;
  11017. }
  11018. try {
  11019. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  11020. } catch (error) {
  11021. return true;
  11022. }
  11023. };
  11024. isConstructorLegacy.sham = true;
  11025. module3.exports = !construct || fails(function() {
  11026. var called;
  11027. return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
  11028. called = true;
  11029. }) || called;
  11030. }) ? isConstructorLegacy : isConstructorModern;
  11031. }, { "../internals/classof": 124, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/inspect-source": 172, "../internals/is-callable": 176 }], 178: [function(require2, module3, exports3) {
  11032. var fails = require2("../internals/fails");
  11033. var isCallable = require2("../internals/is-callable");
  11034. var replacement = /#|\.prototype\./;
  11035. var isForced = function(feature, detection) {
  11036. var value = data[normalize(feature)];
  11037. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  11038. };
  11039. var normalize = isForced.normalize = function(string) {
  11040. return String(string).replace(replacement, ".").toLowerCase();
  11041. };
  11042. var data = isForced.data = {};
  11043. var NATIVE = isForced.NATIVE = "N";
  11044. var POLYFILL = isForced.POLYFILL = "P";
  11045. module3.exports = isForced;
  11046. }, { "../internals/fails": 150, "../internals/is-callable": 176 }], 179: [function(require2, module3, exports3) {
  11047. var isObject = require2("../internals/is-object");
  11048. var floor = Math.floor;
  11049. module3.exports = Number.isInteger || function isInteger(it) {
  11050. return !isObject(it) && isFinite(it) && floor(it) === it;
  11051. };
  11052. }, { "../internals/is-object": 180 }], 180: [function(require2, module3, exports3) {
  11053. var isCallable = require2("../internals/is-callable");
  11054. module3.exports = function(it) {
  11055. return typeof it == "object" ? it !== null : isCallable(it);
  11056. };
  11057. }, { "../internals/is-callable": 176 }], 181: [function(require2, module3, exports3) {
  11058. module3.exports = false;
  11059. }, {}], 182: [function(require2, module3, exports3) {
  11060. var isObject = require2("../internals/is-object");
  11061. var classof = require2("../internals/classof-raw");
  11062. var wellKnownSymbol = require2("../internals/well-known-symbol");
  11063. var MATCH = wellKnownSymbol("match");
  11064. module3.exports = function(it) {
  11065. var isRegExp;
  11066. return isObject(it) && ((isRegExp = it[MATCH]) !== void 0 ? !!isRegExp : classof(it) == "RegExp");
  11067. };
  11068. }, { "../internals/classof-raw": 123, "../internals/is-object": 180, "../internals/well-known-symbol": 268 }], 183: [function(require2, module3, exports3) {
  11069. var global2 = require2("../internals/global");
  11070. var getBuiltIn = require2("../internals/get-built-in");
  11071. var isCallable = require2("../internals/is-callable");
  11072. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  11073. var USE_SYMBOL_AS_UID = require2("../internals/use-symbol-as-uid");
  11074. var Object2 = global2.Object;
  11075. module3.exports = USE_SYMBOL_AS_UID ? function(it) {
  11076. return typeof it == "symbol";
  11077. } : function(it) {
  11078. var $Symbol = getBuiltIn("Symbol");
  11079. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object2(it));
  11080. };
  11081. }, { "../internals/get-built-in": 158, "../internals/global": 163, "../internals/is-callable": 176, "../internals/object-is-prototype-of": 204, "../internals/use-symbol-as-uid": 264 }], 184: [function(require2, module3, exports3) {
  11082. var global2 = require2("../internals/global");
  11083. var bind = require2("../internals/function-bind-context");
  11084. var call = require2("../internals/function-call");
  11085. var anObject = require2("../internals/an-object");
  11086. var tryToString = require2("../internals/try-to-string");
  11087. var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
  11088. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  11089. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  11090. var getIterator = require2("../internals/get-iterator");
  11091. var getIteratorMethod = require2("../internals/get-iterator-method");
  11092. var iteratorClose = require2("../internals/iterator-close");
  11093. var TypeError2 = global2.TypeError;
  11094. var Result = function(stopped, result) {
  11095. this.stopped = stopped;
  11096. this.result = result;
  11097. };
  11098. var ResultPrototype = Result.prototype;
  11099. module3.exports = function(iterable, unboundFunction, options) {
  11100. var that = options && options.that;
  11101. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  11102. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  11103. var INTERRUPTED = !!(options && options.INTERRUPTED);
  11104. var fn = bind(unboundFunction, that);
  11105. var iterator, iterFn, index, length, result, next, step;
  11106. var stop = function(condition) {
  11107. if (iterator)
  11108. iteratorClose(iterator, "normal", condition);
  11109. return new Result(true, condition);
  11110. };
  11111. var callFn = function(value) {
  11112. if (AS_ENTRIES) {
  11113. anObject(value);
  11114. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  11115. }
  11116. return INTERRUPTED ? fn(value, stop) : fn(value);
  11117. };
  11118. if (IS_ITERATOR) {
  11119. iterator = iterable;
  11120. } else {
  11121. iterFn = getIteratorMethod(iterable);
  11122. if (!iterFn)
  11123. throw TypeError2(tryToString(iterable) + " is not iterable");
  11124. if (isArrayIteratorMethod(iterFn)) {
  11125. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  11126. result = callFn(iterable[index]);
  11127. if (result && isPrototypeOf(ResultPrototype, result))
  11128. return result;
  11129. }
  11130. return new Result(false);
  11131. }
  11132. iterator = getIterator(iterable, iterFn);
  11133. }
  11134. next = iterator.next;
  11135. while (!(step = call(next, iterator)).done) {
  11136. try {
  11137. result = callFn(step.value);
  11138. } catch (error) {
  11139. iteratorClose(iterator, "throw", error);
  11140. }
  11141. if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
  11142. return result;
  11143. }
  11144. return new Result(false);
  11145. };
  11146. }, { "../internals/an-object": 101, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/global": 163, "../internals/is-array-iterator-method": 174, "../internals/iterator-close": 185, "../internals/length-of-array-like": 188, "../internals/object-is-prototype-of": 204, "../internals/try-to-string": 257 }], 185: [function(require2, module3, exports3) {
  11147. var call = require2("../internals/function-call");
  11148. var anObject = require2("../internals/an-object");
  11149. var getMethod = require2("../internals/get-method");
  11150. module3.exports = function(iterator, kind, value) {
  11151. var innerResult, innerError;
  11152. anObject(iterator);
  11153. try {
  11154. innerResult = getMethod(iterator, "return");
  11155. if (!innerResult) {
  11156. if (kind === "throw")
  11157. throw value;
  11158. return value;
  11159. }
  11160. innerResult = call(innerResult, iterator);
  11161. } catch (error) {
  11162. innerError = true;
  11163. innerResult = error;
  11164. }
  11165. if (kind === "throw")
  11166. throw value;
  11167. if (innerError)
  11168. throw innerResult;
  11169. anObject(innerResult);
  11170. return value;
  11171. };
  11172. }, { "../internals/an-object": 101, "../internals/function-call": 155, "../internals/get-method": 161 }], 186: [function(require2, module3, exports3) {
  11173. "use strict";
  11174. var fails = require2("../internals/fails");
  11175. var isCallable = require2("../internals/is-callable");
  11176. var create = require2("../internals/object-create");
  11177. var getPrototypeOf = require2("../internals/object-get-prototype-of");
  11178. var redefine = require2("../internals/redefine");
  11179. var wellKnownSymbol = require2("../internals/well-known-symbol");
  11180. var IS_PURE = require2("../internals/is-pure");
  11181. var ITERATOR = wellKnownSymbol("iterator");
  11182. var BUGGY_SAFARI_ITERATORS = false;
  11183. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  11184. if ([].keys) {
  11185. arrayIterator = [].keys();
  11186. if (!("next" in arrayIterator))
  11187. BUGGY_SAFARI_ITERATORS = true;
  11188. else {
  11189. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  11190. if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
  11191. IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  11192. }
  11193. }
  11194. var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == void 0 || fails(function() {
  11195. var test = {};
  11196. return IteratorPrototype[ITERATOR].call(test) !== test;
  11197. });
  11198. if (NEW_ITERATOR_PROTOTYPE)
  11199. IteratorPrototype = {};
  11200. else if (IS_PURE)
  11201. IteratorPrototype = create(IteratorPrototype);
  11202. if (!isCallable(IteratorPrototype[ITERATOR])) {
  11203. redefine(IteratorPrototype, ITERATOR, function() {
  11204. return this;
  11205. });
  11206. }
  11207. module3.exports = {
  11208. IteratorPrototype,
  11209. BUGGY_SAFARI_ITERATORS
  11210. };
  11211. }, { "../internals/fails": 150, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/object-create": 196, "../internals/object-get-prototype-of": 203, "../internals/redefine": 222, "../internals/well-known-symbol": 268 }], 187: [function(require2, module3, exports3) {
  11212. arguments[4][165][0].apply(exports3, arguments);
  11213. }, { "dup": 165 }], 188: [function(require2, module3, exports3) {
  11214. var toLength = require2("../internals/to-length");
  11215. module3.exports = function(obj) {
  11216. return toLength(obj.length);
  11217. };
  11218. }, { "../internals/to-length": 249 }], 189: [function(require2, module3, exports3) {
  11219. var global2 = require2("../internals/global");
  11220. var bind = require2("../internals/function-bind-context");
  11221. var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
  11222. var macrotask = require2("../internals/task").set;
  11223. var IS_IOS = require2("../internals/engine-is-ios");
  11224. var IS_IOS_PEBBLE = require2("../internals/engine-is-ios-pebble");
  11225. var IS_WEBOS_WEBKIT = require2("../internals/engine-is-webos-webkit");
  11226. var IS_NODE = require2("../internals/engine-is-node");
  11227. var MutationObserver = global2.MutationObserver || global2.WebKitMutationObserver;
  11228. var document2 = global2.document;
  11229. var process = global2.process;
  11230. var Promise2 = global2.Promise;
  11231. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global2, "queueMicrotask");
  11232. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  11233. var flush, head, last, notify, toggle, node, promise, then;
  11234. if (!queueMicrotask) {
  11235. flush = function() {
  11236. var parent, fn;
  11237. if (IS_NODE && (parent = process.domain))
  11238. parent.exit();
  11239. while (head) {
  11240. fn = head.fn;
  11241. head = head.next;
  11242. try {
  11243. fn();
  11244. } catch (error) {
  11245. if (head)
  11246. notify();
  11247. else
  11248. last = void 0;
  11249. throw error;
  11250. }
  11251. }
  11252. last = void 0;
  11253. if (parent)
  11254. parent.enter();
  11255. };
  11256. if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document2) {
  11257. toggle = true;
  11258. node = document2.createTextNode("");
  11259. new MutationObserver(flush).observe(node, { characterData: true });
  11260. notify = function() {
  11261. node.data = toggle = !toggle;
  11262. };
  11263. } else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
  11264. promise = Promise2.resolve(void 0);
  11265. promise.constructor = Promise2;
  11266. then = bind(promise.then, promise);
  11267. notify = function() {
  11268. then(flush);
  11269. };
  11270. } else if (IS_NODE) {
  11271. notify = function() {
  11272. process.nextTick(flush);
  11273. };
  11274. } else {
  11275. macrotask = bind(macrotask, global2);
  11276. notify = function() {
  11277. macrotask(flush);
  11278. };
  11279. }
  11280. }
  11281. module3.exports = queueMicrotask || function(fn) {
  11282. var task = { fn, next: void 0 };
  11283. if (last)
  11284. last.next = task;
  11285. if (!head) {
  11286. head = task;
  11287. notify();
  11288. }
  11289. last = task;
  11290. };
  11291. }, { "../internals/engine-is-ios": 142, "../internals/engine-is-ios-pebble": 141, "../internals/engine-is-node": 143, "../internals/engine-is-webos-webkit": 144, "../internals/function-bind-context": 153, "../internals/global": 163, "../internals/object-get-own-property-descriptor": 199, "../internals/task": 243 }], 190: [function(require2, module3, exports3) {
  11292. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  11293. module3.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor;
  11294. }, { "../internals/native-symbol": 191 }], 191: [function(require2, module3, exports3) {
  11295. var V8_VERSION = require2("../internals/engine-v8-version");
  11296. var fails = require2("../internals/fails");
  11297. module3.exports = !!Object.getOwnPropertySymbols && !fails(function() {
  11298. var symbol = Symbol();
  11299. return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  11300. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  11301. });
  11302. }, { "../internals/engine-v8-version": 146, "../internals/fails": 150 }], 192: [function(require2, module3, exports3) {
  11303. var global2 = require2("../internals/global");
  11304. var isCallable = require2("../internals/is-callable");
  11305. var inspectSource = require2("../internals/inspect-source");
  11306. var WeakMap2 = global2.WeakMap;
  11307. module3.exports = isCallable(WeakMap2) && /native code/.test(inspectSource(WeakMap2));
  11308. }, { "../internals/global": 163, "../internals/inspect-source": 172, "../internals/is-callable": 176 }], 193: [function(require2, module3, exports3) {
  11309. "use strict";
  11310. var aCallable = require2("../internals/a-callable");
  11311. var PromiseCapability = function(C) {
  11312. var resolve, reject;
  11313. this.promise = new C(function($$resolve, $$reject) {
  11314. if (resolve !== void 0 || reject !== void 0)
  11315. throw TypeError("Bad Promise constructor");
  11316. resolve = $$resolve;
  11317. reject = $$reject;
  11318. });
  11319. this.resolve = aCallable(resolve);
  11320. this.reject = aCallable(reject);
  11321. };
  11322. module3.exports.f = function(C) {
  11323. return new PromiseCapability(C);
  11324. };
  11325. }, { "../internals/a-callable": 95 }], 194: [function(require2, module3, exports3) {
  11326. var global2 = require2("../internals/global");
  11327. var isRegExp = require2("../internals/is-regexp");
  11328. var TypeError2 = global2.TypeError;
  11329. module3.exports = function(it) {
  11330. if (isRegExp(it)) {
  11331. throw TypeError2("The method doesn't accept regular expressions");
  11332. }
  11333. return it;
  11334. };
  11335. }, { "../internals/global": 163, "../internals/is-regexp": 182 }], 195: [function(require2, module3, exports3) {
  11336. "use strict";
  11337. var DESCRIPTORS = require2("../internals/descriptors");
  11338. var uncurryThis = require2("../internals/function-uncurry-this");
  11339. var call = require2("../internals/function-call");
  11340. var fails = require2("../internals/fails");
  11341. var objectKeys = require2("../internals/object-keys");
  11342. var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
  11343. var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
  11344. var toObject = require2("../internals/to-object");
  11345. var IndexedObject = require2("../internals/indexed-object");
  11346. var $assign = Object.assign;
  11347. var defineProperty = Object.defineProperty;
  11348. var concat = uncurryThis([].concat);
  11349. module3.exports = !$assign || fails(function() {
  11350. if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, "a", {
  11351. enumerable: true,
  11352. get: function() {
  11353. defineProperty(this, "b", {
  11354. value: 3,
  11355. enumerable: false
  11356. });
  11357. }
  11358. }), { b: 2 })).b !== 1)
  11359. return true;
  11360. var A = {};
  11361. var B = {};
  11362. var symbol = Symbol();
  11363. var alphabet = "abcdefghijklmnopqrst";
  11364. A[symbol] = 7;
  11365. alphabet.split("").forEach(function(chr) {
  11366. B[chr] = chr;
  11367. });
  11368. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join("") != alphabet;
  11369. }) ? function assign(target, source) {
  11370. var T = toObject(target);
  11371. var argumentsLength = arguments.length;
  11372. var index = 1;
  11373. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  11374. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  11375. while (argumentsLength > index) {
  11376. var S = IndexedObject(arguments[index++]);
  11377. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  11378. var length = keys.length;
  11379. var j = 0;
  11380. var key;
  11381. while (length > j) {
  11382. key = keys[j++];
  11383. if (!DESCRIPTORS || call(propertyIsEnumerable, S, key))
  11384. T[key] = S[key];
  11385. }
  11386. }
  11387. return T;
  11388. } : $assign;
  11389. }, { "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/object-get-own-property-symbols": 202, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/to-object": 250 }], 196: [function(require2, module3, exports3) {
  11390. var anObject = require2("../internals/an-object");
  11391. var definePropertiesModule = require2("../internals/object-define-properties");
  11392. var enumBugKeys = require2("../internals/enum-bug-keys");
  11393. var hiddenKeys = require2("../internals/hidden-keys");
  11394. var html = require2("../internals/html");
  11395. var documentCreateElement = require2("../internals/document-create-element");
  11396. var sharedKey = require2("../internals/shared-key");
  11397. var GT = ">";
  11398. var LT = "<";
  11399. var PROTOTYPE = "prototype";
  11400. var SCRIPT = "script";
  11401. var IE_PROTO = sharedKey("IE_PROTO");
  11402. var EmptyConstructor = function() {
  11403. };
  11404. var scriptTag = function(content) {
  11405. return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
  11406. };
  11407. var NullProtoObjectViaActiveX = function(activeXDocument2) {
  11408. activeXDocument2.write(scriptTag(""));
  11409. activeXDocument2.close();
  11410. var temp = activeXDocument2.parentWindow.Object;
  11411. activeXDocument2 = null;
  11412. return temp;
  11413. };
  11414. var NullProtoObjectViaIFrame = function() {
  11415. var iframe = documentCreateElement("iframe");
  11416. var JS = "java" + SCRIPT + ":";
  11417. var iframeDocument;
  11418. iframe.style.display = "none";
  11419. html.appendChild(iframe);
  11420. iframe.src = String(JS);
  11421. iframeDocument = iframe.contentWindow.document;
  11422. iframeDocument.open();
  11423. iframeDocument.write(scriptTag("document.F=Object"));
  11424. iframeDocument.close();
  11425. return iframeDocument.F;
  11426. };
  11427. var activeXDocument;
  11428. var NullProtoObject = function() {
  11429. try {
  11430. activeXDocument = new ActiveXObject("htmlfile");
  11431. } catch (error) {
  11432. }
  11433. NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
  11434. var length = enumBugKeys.length;
  11435. while (length--)
  11436. delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  11437. return NullProtoObject();
  11438. };
  11439. hiddenKeys[IE_PROTO] = true;
  11440. module3.exports = Object.create || function create(O, Properties) {
  11441. var result;
  11442. if (O !== null) {
  11443. EmptyConstructor[PROTOTYPE] = anObject(O);
  11444. result = new EmptyConstructor();
  11445. EmptyConstructor[PROTOTYPE] = null;
  11446. result[IE_PROTO] = O;
  11447. } else
  11448. result = NullProtoObject();
  11449. return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
  11450. };
  11451. }, { "../internals/an-object": 101, "../internals/document-create-element": 135, "../internals/enum-bug-keys": 148, "../internals/hidden-keys": 165, "../internals/html": 167, "../internals/object-define-properties": 197, "../internals/shared-key": 235 }], 197: [function(require2, module3, exports3) {
  11452. var DESCRIPTORS = require2("../internals/descriptors");
  11453. var V8_PROTOTYPE_DEFINE_BUG = require2("../internals/v8-prototype-define-bug");
  11454. var definePropertyModule = require2("../internals/object-define-property");
  11455. var anObject = require2("../internals/an-object");
  11456. var toIndexedObject = require2("../internals/to-indexed-object");
  11457. var objectKeys = require2("../internals/object-keys");
  11458. exports3.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  11459. anObject(O);
  11460. var props = toIndexedObject(Properties);
  11461. var keys = objectKeys(Properties);
  11462. var length = keys.length;
  11463. var index = 0;
  11464. var key;
  11465. while (length > index)
  11466. definePropertyModule.f(O, key = keys[index++], props[key]);
  11467. return O;
  11468. };
  11469. }, { "../internals/an-object": 101, "../internals/descriptors": 134, "../internals/object-define-property": 198, "../internals/object-keys": 206, "../internals/to-indexed-object": 247, "../internals/v8-prototype-define-bug": 265 }], 198: [function(require2, module3, exports3) {
  11470. var global2 = require2("../internals/global");
  11471. var DESCRIPTORS = require2("../internals/descriptors");
  11472. var IE8_DOM_DEFINE = require2("../internals/ie8-dom-define");
  11473. var V8_PROTOTYPE_DEFINE_BUG = require2("../internals/v8-prototype-define-bug");
  11474. var anObject = require2("../internals/an-object");
  11475. var toPropertyKey = require2("../internals/to-property-key");
  11476. var TypeError2 = global2.TypeError;
  11477. var $defineProperty = Object.defineProperty;
  11478. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  11479. var ENUMERABLE = "enumerable";
  11480. var CONFIGURABLE = "configurable";
  11481. var WRITABLE = "writable";
  11482. exports3.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  11483. anObject(O);
  11484. P = toPropertyKey(P);
  11485. anObject(Attributes);
  11486. if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  11487. var current = $getOwnPropertyDescriptor(O, P);
  11488. if (current && current[WRITABLE]) {
  11489. O[P] = Attributes.value;
  11490. Attributes = {
  11491. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  11492. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  11493. writable: false
  11494. };
  11495. }
  11496. }
  11497. return $defineProperty(O, P, Attributes);
  11498. } : $defineProperty : function defineProperty(O, P, Attributes) {
  11499. anObject(O);
  11500. P = toPropertyKey(P);
  11501. anObject(Attributes);
  11502. if (IE8_DOM_DEFINE)
  11503. try {
  11504. return $defineProperty(O, P, Attributes);
  11505. } catch (error) {
  11506. }
  11507. if ("get" in Attributes || "set" in Attributes)
  11508. throw TypeError2("Accessors not supported");
  11509. if ("value" in Attributes)
  11510. O[P] = Attributes.value;
  11511. return O;
  11512. };
  11513. }, { "../internals/an-object": 101, "../internals/descriptors": 134, "../internals/global": 163, "../internals/ie8-dom-define": 168, "../internals/to-property-key": 254, "../internals/v8-prototype-define-bug": 265 }], 199: [function(require2, module3, exports3) {
  11514. var DESCRIPTORS = require2("../internals/descriptors");
  11515. var call = require2("../internals/function-call");
  11516. var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
  11517. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  11518. var toIndexedObject = require2("../internals/to-indexed-object");
  11519. var toPropertyKey = require2("../internals/to-property-key");
  11520. var hasOwn = require2("../internals/has-own-property");
  11521. var IE8_DOM_DEFINE = require2("../internals/ie8-dom-define");
  11522. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  11523. exports3.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  11524. O = toIndexedObject(O);
  11525. P = toPropertyKey(P);
  11526. if (IE8_DOM_DEFINE)
  11527. try {
  11528. return $getOwnPropertyDescriptor(O, P);
  11529. } catch (error) {
  11530. }
  11531. if (hasOwn(O, P))
  11532. return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  11533. };
  11534. }, { "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/function-call": 155, "../internals/has-own-property": 164, "../internals/ie8-dom-define": 168, "../internals/object-property-is-enumerable": 207, "../internals/to-indexed-object": 247, "../internals/to-property-key": 254 }], 200: [function(require2, module3, exports3) {
  11535. var classof = require2("../internals/classof-raw");
  11536. var toIndexedObject = require2("../internals/to-indexed-object");
  11537. var $getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
  11538. var arraySlice = require2("../internals/array-slice-simple");
  11539. var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
  11540. var getWindowNames = function(it) {
  11541. try {
  11542. return $getOwnPropertyNames(it);
  11543. } catch (error) {
  11544. return arraySlice(windowNames);
  11545. }
  11546. };
  11547. module3.exports.f = function getOwnPropertyNames(it) {
  11548. return windowNames && classof(it) == "Window" ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it));
  11549. };
  11550. }, { "../internals/array-slice-simple": 116, "../internals/classof-raw": 123, "../internals/object-get-own-property-names": 201, "../internals/to-indexed-object": 247 }], 201: [function(require2, module3, exports3) {
  11551. var internalObjectKeys = require2("../internals/object-keys-internal");
  11552. var enumBugKeys = require2("../internals/enum-bug-keys");
  11553. var hiddenKeys = enumBugKeys.concat("length", "prototype");
  11554. exports3.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  11555. return internalObjectKeys(O, hiddenKeys);
  11556. };
  11557. }, { "../internals/enum-bug-keys": 148, "../internals/object-keys-internal": 205 }], 202: [function(require2, module3, exports3) {
  11558. exports3.f = Object.getOwnPropertySymbols;
  11559. }, {}], 203: [function(require2, module3, exports3) {
  11560. var global2 = require2("../internals/global");
  11561. var hasOwn = require2("../internals/has-own-property");
  11562. var isCallable = require2("../internals/is-callable");
  11563. var toObject = require2("../internals/to-object");
  11564. var sharedKey = require2("../internals/shared-key");
  11565. var CORRECT_PROTOTYPE_GETTER = require2("../internals/correct-prototype-getter");
  11566. var IE_PROTO = sharedKey("IE_PROTO");
  11567. var Object2 = global2.Object;
  11568. var ObjectPrototype = Object2.prototype;
  11569. module3.exports = CORRECT_PROTOTYPE_GETTER ? Object2.getPrototypeOf : function(O) {
  11570. var object = toObject(O);
  11571. if (hasOwn(object, IE_PROTO))
  11572. return object[IE_PROTO];
  11573. var constructor = object.constructor;
  11574. if (isCallable(constructor) && object instanceof constructor) {
  11575. return constructor.prototype;
  11576. }
  11577. return object instanceof Object2 ? ObjectPrototype : null;
  11578. };
  11579. }, { "../internals/correct-prototype-getter": 127, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/shared-key": 235, "../internals/to-object": 250 }], 204: [function(require2, module3, exports3) {
  11580. var uncurryThis = require2("../internals/function-uncurry-this");
  11581. module3.exports = uncurryThis({}.isPrototypeOf);
  11582. }, { "../internals/function-uncurry-this": 157 }], 205: [function(require2, module3, exports3) {
  11583. var uncurryThis = require2("../internals/function-uncurry-this");
  11584. var hasOwn = require2("../internals/has-own-property");
  11585. var toIndexedObject = require2("../internals/to-indexed-object");
  11586. var indexOf = require2("../internals/array-includes").indexOf;
  11587. var hiddenKeys = require2("../internals/hidden-keys");
  11588. var push = uncurryThis([].push);
  11589. module3.exports = function(object, names) {
  11590. var O = toIndexedObject(object);
  11591. var i = 0;
  11592. var result = [];
  11593. var key;
  11594. for (key in O)
  11595. !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  11596. while (names.length > i)
  11597. if (hasOwn(O, key = names[i++])) {
  11598. ~indexOf(result, key) || push(result, key);
  11599. }
  11600. return result;
  11601. };
  11602. }, { "../internals/array-includes": 110, "../internals/function-uncurry-this": 157, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/to-indexed-object": 247 }], 206: [function(require2, module3, exports3) {
  11603. var internalObjectKeys = require2("../internals/object-keys-internal");
  11604. var enumBugKeys = require2("../internals/enum-bug-keys");
  11605. module3.exports = Object.keys || function keys(O) {
  11606. return internalObjectKeys(O, enumBugKeys);
  11607. };
  11608. }, { "../internals/enum-bug-keys": 148, "../internals/object-keys-internal": 205 }], 207: [function(require2, module3, exports3) {
  11609. "use strict";
  11610. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  11611. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  11612. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  11613. exports3.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  11614. var descriptor = getOwnPropertyDescriptor(this, V);
  11615. return !!descriptor && descriptor.enumerable;
  11616. } : $propertyIsEnumerable;
  11617. }, {}], 208: [function(require2, module3, exports3) {
  11618. var uncurryThis = require2("../internals/function-uncurry-this");
  11619. var anObject = require2("../internals/an-object");
  11620. var aPossiblePrototype = require2("../internals/a-possible-prototype");
  11621. module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
  11622. var CORRECT_SETTER = false;
  11623. var test = {};
  11624. var setter;
  11625. try {
  11626. setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set);
  11627. setter(test, []);
  11628. CORRECT_SETTER = test instanceof Array;
  11629. } catch (error) {
  11630. }
  11631. return function setPrototypeOf(O, proto) {
  11632. anObject(O);
  11633. aPossiblePrototype(proto);
  11634. if (CORRECT_SETTER)
  11635. setter(O, proto);
  11636. else
  11637. O.__proto__ = proto;
  11638. return O;
  11639. };
  11640. }() : void 0);
  11641. }, { "../internals/a-possible-prototype": 97, "../internals/an-object": 101, "../internals/function-uncurry-this": 157 }], 209: [function(require2, module3, exports3) {
  11642. var DESCRIPTORS = require2("../internals/descriptors");
  11643. var uncurryThis = require2("../internals/function-uncurry-this");
  11644. var objectKeys = require2("../internals/object-keys");
  11645. var toIndexedObject = require2("../internals/to-indexed-object");
  11646. var $propertyIsEnumerable = require2("../internals/object-property-is-enumerable").f;
  11647. var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
  11648. var push = uncurryThis([].push);
  11649. var createMethod = function(TO_ENTRIES) {
  11650. return function(it) {
  11651. var O = toIndexedObject(it);
  11652. var keys = objectKeys(O);
  11653. var length = keys.length;
  11654. var i = 0;
  11655. var result = [];
  11656. var key;
  11657. while (length > i) {
  11658. key = keys[i++];
  11659. if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
  11660. push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
  11661. }
  11662. }
  11663. return result;
  11664. };
  11665. };
  11666. module3.exports = {
  11667. // `Object.entries` method
  11668. // https://tc39.es/ecma262/#sec-object.entries
  11669. entries: createMethod(true),
  11670. // `Object.values` method
  11671. // https://tc39.es/ecma262/#sec-object.values
  11672. values: createMethod(false)
  11673. };
  11674. }, { "../internals/descriptors": 134, "../internals/function-uncurry-this": 157, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/to-indexed-object": 247 }], 210: [function(require2, module3, exports3) {
  11675. "use strict";
  11676. var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
  11677. var classof = require2("../internals/classof");
  11678. module3.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  11679. return "[object " + classof(this) + "]";
  11680. };
  11681. }, { "../internals/classof": 124, "../internals/to-string-tag-support": 255 }], 211: [function(require2, module3, exports3) {
  11682. var global2 = require2("../internals/global");
  11683. var call = require2("../internals/function-call");
  11684. var isCallable = require2("../internals/is-callable");
  11685. var isObject = require2("../internals/is-object");
  11686. var TypeError2 = global2.TypeError;
  11687. module3.exports = function(input, pref) {
  11688. var fn, val;
  11689. if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  11690. return val;
  11691. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
  11692. return val;
  11693. if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  11694. return val;
  11695. throw TypeError2("Can't convert object to primitive value");
  11696. };
  11697. }, { "../internals/function-call": 155, "../internals/global": 163, "../internals/is-callable": 176, "../internals/is-object": 180 }], 212: [function(require2, module3, exports3) {
  11698. var getBuiltIn = require2("../internals/get-built-in");
  11699. var uncurryThis = require2("../internals/function-uncurry-this");
  11700. var getOwnPropertyNamesModule = require2("../internals/object-get-own-property-names");
  11701. var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
  11702. var anObject = require2("../internals/an-object");
  11703. var concat = uncurryThis([].concat);
  11704. module3.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
  11705. var keys = getOwnPropertyNamesModule.f(anObject(it));
  11706. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  11707. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  11708. };
  11709. }, { "../internals/an-object": 101, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/object-get-own-property-names": 201, "../internals/object-get-own-property-symbols": 202 }], 213: [function(require2, module3, exports3) {
  11710. var global2 = require2("../internals/global");
  11711. module3.exports = global2;
  11712. }, { "../internals/global": 163 }], 214: [function(require2, module3, exports3) {
  11713. module3.exports = function(exec) {
  11714. try {
  11715. return { error: false, value: exec() };
  11716. } catch (error) {
  11717. return { error: true, value: error };
  11718. }
  11719. };
  11720. }, {}], 215: [function(require2, module3, exports3) {
  11721. var global2 = require2("../internals/global");
  11722. var NativePromiseConstructor = require2("../internals/promise-native-constructor");
  11723. var isCallable = require2("../internals/is-callable");
  11724. var isForced = require2("../internals/is-forced");
  11725. var inspectSource = require2("../internals/inspect-source");
  11726. var wellKnownSymbol = require2("../internals/well-known-symbol");
  11727. var IS_BROWSER = require2("../internals/engine-is-browser");
  11728. var IS_PURE = require2("../internals/is-pure");
  11729. var V8_VERSION = require2("../internals/engine-v8-version");
  11730. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  11731. var SPECIES = wellKnownSymbol("species");
  11732. var SUBCLASSING = false;
  11733. var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global2.PromiseRejectionEvent);
  11734. var FORCED_PROMISE_CONSTRUCTOR = isForced("Promise", function() {
  11735. var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
  11736. var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
  11737. if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
  11738. return true;
  11739. if (IS_PURE && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"]))
  11740. return true;
  11741. if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE))
  11742. return false;
  11743. var promise = new NativePromiseConstructor(function(resolve) {
  11744. resolve(1);
  11745. });
  11746. var FakePromise = function(exec) {
  11747. exec(function() {
  11748. }, function() {
  11749. });
  11750. };
  11751. var constructor = promise.constructor = {};
  11752. constructor[SPECIES] = FakePromise;
  11753. SUBCLASSING = promise.then(function() {
  11754. }) instanceof FakePromise;
  11755. if (!SUBCLASSING)
  11756. return true;
  11757. return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
  11758. });
  11759. module3.exports = {
  11760. CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
  11761. REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
  11762. SUBCLASSING
  11763. };
  11764. }, { "../internals/engine-is-browser": 139, "../internals/engine-v8-version": 146, "../internals/global": 163, "../internals/inspect-source": 172, "../internals/is-callable": 176, "../internals/is-forced": 178, "../internals/is-pure": 181, "../internals/promise-native-constructor": 216, "../internals/well-known-symbol": 268 }], 216: [function(require2, module3, exports3) {
  11765. var global2 = require2("../internals/global");
  11766. module3.exports = global2.Promise;
  11767. }, { "../internals/global": 163 }], 217: [function(require2, module3, exports3) {
  11768. var anObject = require2("../internals/an-object");
  11769. var isObject = require2("../internals/is-object");
  11770. var newPromiseCapability = require2("../internals/new-promise-capability");
  11771. module3.exports = function(C, x) {
  11772. anObject(C);
  11773. if (isObject(x) && x.constructor === C)
  11774. return x;
  11775. var promiseCapability = newPromiseCapability.f(C);
  11776. var resolve = promiseCapability.resolve;
  11777. resolve(x);
  11778. return promiseCapability.promise;
  11779. };
  11780. }, { "../internals/an-object": 101, "../internals/is-object": 180, "../internals/new-promise-capability": 193 }], 218: [function(require2, module3, exports3) {
  11781. var NativePromiseConstructor = require2("../internals/promise-native-constructor");
  11782. var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
  11783. var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
  11784. module3.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function(iterable) {
  11785. NativePromiseConstructor.all(iterable).then(void 0, function() {
  11786. });
  11787. });
  11788. }, { "../internals/check-correctness-of-iteration": 122, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216 }], 219: [function(require2, module3, exports3) {
  11789. var defineProperty = require2("../internals/object-define-property").f;
  11790. module3.exports = function(Target, Source, key) {
  11791. key in Target || defineProperty(Target, key, {
  11792. configurable: true,
  11793. get: function() {
  11794. return Source[key];
  11795. },
  11796. set: function(it) {
  11797. Source[key] = it;
  11798. }
  11799. });
  11800. };
  11801. }, { "../internals/object-define-property": 198 }], 220: [function(require2, module3, exports3) {
  11802. var Queue = function() {
  11803. this.head = null;
  11804. this.tail = null;
  11805. };
  11806. Queue.prototype = {
  11807. add: function(item) {
  11808. var entry = { item, next: null };
  11809. if (this.head)
  11810. this.tail.next = entry;
  11811. else
  11812. this.head = entry;
  11813. this.tail = entry;
  11814. },
  11815. get: function() {
  11816. var entry = this.head;
  11817. if (entry) {
  11818. this.head = entry.next;
  11819. if (this.tail === entry)
  11820. this.tail = null;
  11821. return entry.item;
  11822. }
  11823. }
  11824. };
  11825. module3.exports = Queue;
  11826. }, {}], 221: [function(require2, module3, exports3) {
  11827. var redefine = require2("../internals/redefine");
  11828. module3.exports = function(target, src, options) {
  11829. for (var key in src)
  11830. redefine(target, key, src[key], options);
  11831. return target;
  11832. };
  11833. }, { "../internals/redefine": 222 }], 222: [function(require2, module3, exports3) {
  11834. var global2 = require2("../internals/global");
  11835. var isCallable = require2("../internals/is-callable");
  11836. var hasOwn = require2("../internals/has-own-property");
  11837. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  11838. var setGlobal = require2("../internals/set-global");
  11839. var inspectSource = require2("../internals/inspect-source");
  11840. var InternalStateModule = require2("../internals/internal-state");
  11841. var CONFIGURABLE_FUNCTION_NAME = require2("../internals/function-name").CONFIGURABLE;
  11842. var getInternalState = InternalStateModule.get;
  11843. var enforceInternalState = InternalStateModule.enforce;
  11844. var TEMPLATE = String(String).split("String");
  11845. (module3.exports = function(O, key, value, options) {
  11846. var unsafe = options ? !!options.unsafe : false;
  11847. var simple = options ? !!options.enumerable : false;
  11848. var noTargetGet = options ? !!options.noTargetGet : false;
  11849. var name = options && options.name !== void 0 ? options.name : key;
  11850. var state;
  11851. if (isCallable(value)) {
  11852. if (String(name).slice(0, 7) === "Symbol(") {
  11853. name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
  11854. }
  11855. if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  11856. createNonEnumerableProperty(value, "name", name);
  11857. }
  11858. state = enforceInternalState(value);
  11859. if (!state.source) {
  11860. state.source = TEMPLATE.join(typeof name == "string" ? name : "");
  11861. }
  11862. }
  11863. if (O === global2) {
  11864. if (simple)
  11865. O[key] = value;
  11866. else
  11867. setGlobal(key, value);
  11868. return;
  11869. } else if (!unsafe) {
  11870. delete O[key];
  11871. } else if (!noTargetGet && O[key]) {
  11872. simple = true;
  11873. }
  11874. if (simple)
  11875. O[key] = value;
  11876. else
  11877. createNonEnumerableProperty(O, key, value);
  11878. })(Function.prototype, "toString", function toString() {
  11879. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  11880. });
  11881. }, { "../internals/create-non-enumerable-property": 129, "../internals/function-name": 156, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inspect-source": 172, "../internals/internal-state": 173, "../internals/is-callable": 176, "../internals/set-global": 232 }], 223: [function(require2, module3, exports3) {
  11882. var global2 = require2("../internals/global");
  11883. var call = require2("../internals/function-call");
  11884. var anObject = require2("../internals/an-object");
  11885. var isCallable = require2("../internals/is-callable");
  11886. var classof = require2("../internals/classof-raw");
  11887. var regexpExec = require2("../internals/regexp-exec");
  11888. var TypeError2 = global2.TypeError;
  11889. module3.exports = function(R, S) {
  11890. var exec = R.exec;
  11891. if (isCallable(exec)) {
  11892. var result = call(exec, R, S);
  11893. if (result !== null)
  11894. anObject(result);
  11895. return result;
  11896. }
  11897. if (classof(R) === "RegExp")
  11898. return call(regexpExec, R, S);
  11899. throw TypeError2("RegExp#exec called on incompatible receiver");
  11900. };
  11901. }, { "../internals/an-object": 101, "../internals/classof-raw": 123, "../internals/function-call": 155, "../internals/global": 163, "../internals/is-callable": 176, "../internals/regexp-exec": 224 }], 224: [function(require2, module3, exports3) {
  11902. "use strict";
  11903. var call = require2("../internals/function-call");
  11904. var uncurryThis = require2("../internals/function-uncurry-this");
  11905. var toString = require2("../internals/to-string");
  11906. var regexpFlags = require2("../internals/regexp-flags");
  11907. var stickyHelpers = require2("../internals/regexp-sticky-helpers");
  11908. var shared = require2("../internals/shared");
  11909. var create = require2("../internals/object-create");
  11910. var getInternalState = require2("../internals/internal-state").get;
  11911. var UNSUPPORTED_DOT_ALL = require2("../internals/regexp-unsupported-dot-all");
  11912. var UNSUPPORTED_NCG = require2("../internals/regexp-unsupported-ncg");
  11913. var nativeReplace = shared("native-string-replace", String.prototype.replace);
  11914. var nativeExec = RegExp.prototype.exec;
  11915. var patchedExec = nativeExec;
  11916. var charAt = uncurryThis("".charAt);
  11917. var indexOf = uncurryThis("".indexOf);
  11918. var replace = uncurryThis("".replace);
  11919. var stringSlice = uncurryThis("".slice);
  11920. var UPDATES_LAST_INDEX_WRONG = function() {
  11921. var re1 = /a/;
  11922. var re2 = /b*/g;
  11923. call(nativeExec, re1, "a");
  11924. call(nativeExec, re2, "a");
  11925. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  11926. }();
  11927. var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
  11928. var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
  11929. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
  11930. if (PATCH) {
  11931. patchedExec = function exec(string) {
  11932. var re = this;
  11933. var state = getInternalState(re);
  11934. var str = toString(string);
  11935. var raw = state.raw;
  11936. var result, reCopy, lastIndex, match, i, object, group;
  11937. if (raw) {
  11938. raw.lastIndex = re.lastIndex;
  11939. result = call(patchedExec, raw, str);
  11940. re.lastIndex = raw.lastIndex;
  11941. return result;
  11942. }
  11943. var groups = state.groups;
  11944. var sticky = UNSUPPORTED_Y && re.sticky;
  11945. var flags = call(regexpFlags, re);
  11946. var source = re.source;
  11947. var charsAdded = 0;
  11948. var strCopy = str;
  11949. if (sticky) {
  11950. flags = replace(flags, "y", "");
  11951. if (indexOf(flags, "g") === -1) {
  11952. flags += "g";
  11953. }
  11954. strCopy = stringSlice(str, re.lastIndex);
  11955. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== "\n")) {
  11956. source = "(?: " + source + ")";
  11957. strCopy = " " + strCopy;
  11958. charsAdded++;
  11959. }
  11960. reCopy = new RegExp("^(?:" + source + ")", flags);
  11961. }
  11962. if (NPCG_INCLUDED) {
  11963. reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
  11964. }
  11965. if (UPDATES_LAST_INDEX_WRONG)
  11966. lastIndex = re.lastIndex;
  11967. match = call(nativeExec, sticky ? reCopy : re, strCopy);
  11968. if (sticky) {
  11969. if (match) {
  11970. match.input = stringSlice(match.input, charsAdded);
  11971. match[0] = stringSlice(match[0], charsAdded);
  11972. match.index = re.lastIndex;
  11973. re.lastIndex += match[0].length;
  11974. } else
  11975. re.lastIndex = 0;
  11976. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  11977. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  11978. }
  11979. if (NPCG_INCLUDED && match && match.length > 1) {
  11980. call(nativeReplace, match[0], reCopy, function() {
  11981. for (i = 1; i < arguments.length - 2; i++) {
  11982. if (arguments[i] === void 0)
  11983. match[i] = void 0;
  11984. }
  11985. });
  11986. }
  11987. if (match && groups) {
  11988. match.groups = object = create(null);
  11989. for (i = 0; i < groups.length; i++) {
  11990. group = groups[i];
  11991. object[group[0]] = match[group[1]];
  11992. }
  11993. }
  11994. return match;
  11995. };
  11996. }
  11997. module3.exports = patchedExec;
  11998. }, { "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/internal-state": 173, "../internals/object-create": 196, "../internals/regexp-flags": 225, "../internals/regexp-sticky-helpers": 227, "../internals/regexp-unsupported-dot-all": 228, "../internals/regexp-unsupported-ncg": 229, "../internals/shared": 237, "../internals/to-string": 256 }], 225: [function(require2, module3, exports3) {
  11999. "use strict";
  12000. var anObject = require2("../internals/an-object");
  12001. module3.exports = function() {
  12002. var that = anObject(this);
  12003. var result = "";
  12004. if (that.hasIndices)
  12005. result += "d";
  12006. if (that.global)
  12007. result += "g";
  12008. if (that.ignoreCase)
  12009. result += "i";
  12010. if (that.multiline)
  12011. result += "m";
  12012. if (that.dotAll)
  12013. result += "s";
  12014. if (that.unicode)
  12015. result += "u";
  12016. if (that.sticky)
  12017. result += "y";
  12018. return result;
  12019. };
  12020. }, { "../internals/an-object": 101 }], 226: [function(require2, module3, exports3) {
  12021. var call = require2("../internals/function-call");
  12022. var hasOwn = require2("../internals/has-own-property");
  12023. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  12024. var regExpFlags = require2("../internals/regexp-flags");
  12025. var RegExpPrototype = RegExp.prototype;
  12026. module3.exports = function(R) {
  12027. var flags = R.flags;
  12028. return flags === void 0 && !("flags" in RegExpPrototype) && !hasOwn(R, "flags") && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags;
  12029. };
  12030. }, { "../internals/function-call": 155, "../internals/has-own-property": 164, "../internals/object-is-prototype-of": 204, "../internals/regexp-flags": 225 }], 227: [function(require2, module3, exports3) {
  12031. var fails = require2("../internals/fails");
  12032. var global2 = require2("../internals/global");
  12033. var $RegExp = global2.RegExp;
  12034. var UNSUPPORTED_Y = fails(function() {
  12035. var re = $RegExp("a", "y");
  12036. re.lastIndex = 2;
  12037. return re.exec("abcd") != null;
  12038. });
  12039. var MISSED_STICKY = UNSUPPORTED_Y || fails(function() {
  12040. return !$RegExp("a", "y").sticky;
  12041. });
  12042. var BROKEN_CARET = UNSUPPORTED_Y || fails(function() {
  12043. var re = $RegExp("^r", "gy");
  12044. re.lastIndex = 2;
  12045. return re.exec("str") != null;
  12046. });
  12047. module3.exports = {
  12048. BROKEN_CARET,
  12049. MISSED_STICKY,
  12050. UNSUPPORTED_Y
  12051. };
  12052. }, { "../internals/fails": 150, "../internals/global": 163 }], 228: [function(require2, module3, exports3) {
  12053. var fails = require2("../internals/fails");
  12054. var global2 = require2("../internals/global");
  12055. var $RegExp = global2.RegExp;
  12056. module3.exports = fails(function() {
  12057. var re = $RegExp(".", "s");
  12058. return !(re.dotAll && re.exec("\n") && re.flags === "s");
  12059. });
  12060. }, { "../internals/fails": 150, "../internals/global": 163 }], 229: [function(require2, module3, exports3) {
  12061. var fails = require2("../internals/fails");
  12062. var global2 = require2("../internals/global");
  12063. var $RegExp = global2.RegExp;
  12064. module3.exports = fails(function() {
  12065. var re = $RegExp("(?<a>b)", "g");
  12066. return re.exec("b").groups.a !== "b" || "b".replace(re, "$<a>c") !== "bc";
  12067. });
  12068. }, { "../internals/fails": 150, "../internals/global": 163 }], 230: [function(require2, module3, exports3) {
  12069. var global2 = require2("../internals/global");
  12070. var TypeError2 = global2.TypeError;
  12071. module3.exports = function(it) {
  12072. if (it == void 0)
  12073. throw TypeError2("Can't call method on " + it);
  12074. return it;
  12075. };
  12076. }, { "../internals/global": 163 }], 231: [function(require2, module3, exports3) {
  12077. module3.exports = Object.is || function is(x, y) {
  12078. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  12079. };
  12080. }, {}], 232: [function(require2, module3, exports3) {
  12081. var global2 = require2("../internals/global");
  12082. var defineProperty = Object.defineProperty;
  12083. module3.exports = function(key, value) {
  12084. try {
  12085. defineProperty(global2, key, { value, configurable: true, writable: true });
  12086. } catch (error) {
  12087. global2[key] = value;
  12088. }
  12089. return value;
  12090. };
  12091. }, { "../internals/global": 163 }], 233: [function(require2, module3, exports3) {
  12092. "use strict";
  12093. var getBuiltIn = require2("../internals/get-built-in");
  12094. var definePropertyModule = require2("../internals/object-define-property");
  12095. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12096. var DESCRIPTORS = require2("../internals/descriptors");
  12097. var SPECIES = wellKnownSymbol("species");
  12098. module3.exports = function(CONSTRUCTOR_NAME) {
  12099. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  12100. var defineProperty = definePropertyModule.f;
  12101. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  12102. defineProperty(Constructor, SPECIES, {
  12103. configurable: true,
  12104. get: function() {
  12105. return this;
  12106. }
  12107. });
  12108. }
  12109. };
  12110. }, { "../internals/descriptors": 134, "../internals/get-built-in": 158, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 234: [function(require2, module3, exports3) {
  12111. var defineProperty = require2("../internals/object-define-property").f;
  12112. var hasOwn = require2("../internals/has-own-property");
  12113. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12114. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  12115. module3.exports = function(target, TAG, STATIC) {
  12116. if (target && !STATIC)
  12117. target = target.prototype;
  12118. if (target && !hasOwn(target, TO_STRING_TAG)) {
  12119. defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
  12120. }
  12121. };
  12122. }, { "../internals/has-own-property": 164, "../internals/object-define-property": 198, "../internals/well-known-symbol": 268 }], 235: [function(require2, module3, exports3) {
  12123. var shared = require2("../internals/shared");
  12124. var uid = require2("../internals/uid");
  12125. var keys = shared("keys");
  12126. module3.exports = function(key) {
  12127. return keys[key] || (keys[key] = uid(key));
  12128. };
  12129. }, { "../internals/shared": 237, "../internals/uid": 263 }], 236: [function(require2, module3, exports3) {
  12130. var global2 = require2("../internals/global");
  12131. var setGlobal = require2("../internals/set-global");
  12132. var SHARED = "__core-js_shared__";
  12133. var store = global2[SHARED] || setGlobal(SHARED, {});
  12134. module3.exports = store;
  12135. }, { "../internals/global": 163, "../internals/set-global": 232 }], 237: [function(require2, module3, exports3) {
  12136. var IS_PURE = require2("../internals/is-pure");
  12137. var store = require2("../internals/shared-store");
  12138. (module3.exports = function(key, value) {
  12139. return store[key] || (store[key] = value !== void 0 ? value : {});
  12140. })("versions", []).push({
  12141. version: "3.22.1",
  12142. mode: IS_PURE ? "pure" : "global",
  12143. copyright: "© 2014-2022 Denis Pushkarev (zloirock.ru)",
  12144. license: "https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE",
  12145. source: "https://github.com/zloirock/core-js"
  12146. });
  12147. }, { "../internals/is-pure": 181, "../internals/shared-store": 236 }], 238: [function(require2, module3, exports3) {
  12148. var anObject = require2("../internals/an-object");
  12149. var aConstructor = require2("../internals/a-constructor");
  12150. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12151. var SPECIES = wellKnownSymbol("species");
  12152. module3.exports = function(O, defaultConstructor) {
  12153. var C = anObject(O).constructor;
  12154. var S;
  12155. return C === void 0 || (S = anObject(C)[SPECIES]) == void 0 ? defaultConstructor : aConstructor(S);
  12156. };
  12157. }, { "../internals/a-constructor": 96, "../internals/an-object": 101, "../internals/well-known-symbol": 268 }], 239: [function(require2, module3, exports3) {
  12158. var uncurryThis = require2("../internals/function-uncurry-this");
  12159. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  12160. var toString = require2("../internals/to-string");
  12161. var requireObjectCoercible = require2("../internals/require-object-coercible");
  12162. var charAt = uncurryThis("".charAt);
  12163. var charCodeAt = uncurryThis("".charCodeAt);
  12164. var stringSlice = uncurryThis("".slice);
  12165. var createMethod = function(CONVERT_TO_STRING) {
  12166. return function($this, pos) {
  12167. var S = toString(requireObjectCoercible($this));
  12168. var position = toIntegerOrInfinity(pos);
  12169. var size = S.length;
  12170. var first, second;
  12171. if (position < 0 || position >= size)
  12172. return CONVERT_TO_STRING ? "" : void 0;
  12173. first = charCodeAt(S, position);
  12174. return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
  12175. };
  12176. };
  12177. module3.exports = {
  12178. // `String.prototype.codePointAt` method
  12179. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  12180. codeAt: createMethod(false),
  12181. // `String.prototype.at` method
  12182. // https://github.com/mathiasbynens/String.prototype.at
  12183. charAt: createMethod(true)
  12184. };
  12185. }, { "../internals/function-uncurry-this": 157, "../internals/require-object-coercible": 230, "../internals/to-integer-or-infinity": 248, "../internals/to-string": 256 }], 240: [function(require2, module3, exports3) {
  12186. var PROPER_FUNCTION_NAME = require2("../internals/function-name").PROPER;
  12187. var fails = require2("../internals/fails");
  12188. var whitespaces = require2("../internals/whitespaces");
  12189. var non = "​…᠎";
  12190. module3.exports = function(METHOD_NAME) {
  12191. return fails(function() {
  12192. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
  12193. });
  12194. };
  12195. }, { "../internals/fails": 150, "../internals/function-name": 156, "../internals/whitespaces": 269 }], 241: [function(require2, module3, exports3) {
  12196. var uncurryThis = require2("../internals/function-uncurry-this");
  12197. var requireObjectCoercible = require2("../internals/require-object-coercible");
  12198. var toString = require2("../internals/to-string");
  12199. var whitespaces = require2("../internals/whitespaces");
  12200. var replace = uncurryThis("".replace);
  12201. var whitespace = "[" + whitespaces + "]";
  12202. var ltrim = RegExp("^" + whitespace + whitespace + "*");
  12203. var rtrim = RegExp(whitespace + whitespace + "*$");
  12204. var createMethod = function(TYPE) {
  12205. return function($this) {
  12206. var string = toString(requireObjectCoercible($this));
  12207. if (TYPE & 1)
  12208. string = replace(string, ltrim, "");
  12209. if (TYPE & 2)
  12210. string = replace(string, rtrim, "");
  12211. return string;
  12212. };
  12213. };
  12214. module3.exports = {
  12215. // `String.prototype.{ trimLeft, trimStart }` methods
  12216. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  12217. start: createMethod(1),
  12218. // `String.prototype.{ trimRight, trimEnd }` methods
  12219. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  12220. end: createMethod(2),
  12221. // `String.prototype.trim` method
  12222. // https://tc39.es/ecma262/#sec-string.prototype.trim
  12223. trim: createMethod(3)
  12224. };
  12225. }, { "../internals/function-uncurry-this": 157, "../internals/require-object-coercible": 230, "../internals/to-string": 256, "../internals/whitespaces": 269 }], 242: [function(require2, module3, exports3) {
  12226. var call = require2("../internals/function-call");
  12227. var getBuiltIn = require2("../internals/get-built-in");
  12228. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12229. var redefine = require2("../internals/redefine");
  12230. module3.exports = function() {
  12231. var Symbol2 = getBuiltIn("Symbol");
  12232. var SymbolPrototype = Symbol2 && Symbol2.prototype;
  12233. var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
  12234. var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
  12235. if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
  12236. redefine(SymbolPrototype, TO_PRIMITIVE, function(hint) {
  12237. return call(valueOf, this);
  12238. });
  12239. }
  12240. };
  12241. }, { "../internals/function-call": 155, "../internals/get-built-in": 158, "../internals/redefine": 222, "../internals/well-known-symbol": 268 }], 243: [function(require2, module3, exports3) {
  12242. var global2 = require2("../internals/global");
  12243. var apply = require2("../internals/function-apply");
  12244. var bind = require2("../internals/function-bind-context");
  12245. var isCallable = require2("../internals/is-callable");
  12246. var hasOwn = require2("../internals/has-own-property");
  12247. var fails = require2("../internals/fails");
  12248. var html = require2("../internals/html");
  12249. var arraySlice = require2("../internals/array-slice");
  12250. var createElement = require2("../internals/document-create-element");
  12251. var validateArgumentsLength = require2("../internals/validate-arguments-length");
  12252. var IS_IOS = require2("../internals/engine-is-ios");
  12253. var IS_NODE = require2("../internals/engine-is-node");
  12254. var set = global2.setImmediate;
  12255. var clear = global2.clearImmediate;
  12256. var process = global2.process;
  12257. var Dispatch = global2.Dispatch;
  12258. var Function2 = global2.Function;
  12259. var MessageChannel = global2.MessageChannel;
  12260. var String2 = global2.String;
  12261. var counter = 0;
  12262. var queue = {};
  12263. var ONREADYSTATECHANGE = "onreadystatechange";
  12264. var location2, defer, channel, port;
  12265. try {
  12266. location2 = global2.location;
  12267. } catch (error) {
  12268. }
  12269. var run = function(id) {
  12270. if (hasOwn(queue, id)) {
  12271. var fn = queue[id];
  12272. delete queue[id];
  12273. fn();
  12274. }
  12275. };
  12276. var runner = function(id) {
  12277. return function() {
  12278. run(id);
  12279. };
  12280. };
  12281. var listener = function(event) {
  12282. run(event.data);
  12283. };
  12284. var post = function(id) {
  12285. global2.postMessage(String2(id), location2.protocol + "//" + location2.host);
  12286. };
  12287. if (!set || !clear) {
  12288. set = function setImmediate(handler) {
  12289. validateArgumentsLength(arguments.length, 1);
  12290. var fn = isCallable(handler) ? handler : Function2(handler);
  12291. var args = arraySlice(arguments, 1);
  12292. queue[++counter] = function() {
  12293. apply(fn, void 0, args);
  12294. };
  12295. defer(counter);
  12296. return counter;
  12297. };
  12298. clear = function clearImmediate(id) {
  12299. delete queue[id];
  12300. };
  12301. if (IS_NODE) {
  12302. defer = function(id) {
  12303. process.nextTick(runner(id));
  12304. };
  12305. } else if (Dispatch && Dispatch.now) {
  12306. defer = function(id) {
  12307. Dispatch.now(runner(id));
  12308. };
  12309. } else if (MessageChannel && !IS_IOS) {
  12310. channel = new MessageChannel();
  12311. port = channel.port2;
  12312. channel.port1.onmessage = listener;
  12313. defer = bind(port.postMessage, port);
  12314. } else if (global2.addEventListener && isCallable(global2.postMessage) && !global2.importScripts && location2 && location2.protocol !== "file:" && !fails(post)) {
  12315. defer = post;
  12316. global2.addEventListener("message", listener, false);
  12317. } else if (ONREADYSTATECHANGE in createElement("script")) {
  12318. defer = function(id) {
  12319. html.appendChild(createElement("script"))[ONREADYSTATECHANGE] = function() {
  12320. html.removeChild(this);
  12321. run(id);
  12322. };
  12323. };
  12324. } else {
  12325. defer = function(id) {
  12326. setTimeout(runner(id), 0);
  12327. };
  12328. }
  12329. }
  12330. module3.exports = {
  12331. set,
  12332. clear
  12333. };
  12334. }, { "../internals/array-slice": 117, "../internals/document-create-element": 135, "../internals/engine-is-ios": 142, "../internals/engine-is-node": 143, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/function-bind-context": 153, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/html": 167, "../internals/is-callable": 176, "../internals/validate-arguments-length": 266 }], 244: [function(require2, module3, exports3) {
  12335. var uncurryThis = require2("../internals/function-uncurry-this");
  12336. module3.exports = uncurryThis(1 .valueOf);
  12337. }, { "../internals/function-uncurry-this": 157 }], 245: [function(require2, module3, exports3) {
  12338. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  12339. var max = Math.max;
  12340. var min = Math.min;
  12341. module3.exports = function(index, length) {
  12342. var integer = toIntegerOrInfinity(index);
  12343. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  12344. };
  12345. }, { "../internals/to-integer-or-infinity": 248 }], 246: [function(require2, module3, exports3) {
  12346. var global2 = require2("../internals/global");
  12347. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  12348. var toLength = require2("../internals/to-length");
  12349. var RangeError2 = global2.RangeError;
  12350. module3.exports = function(it) {
  12351. if (it === void 0)
  12352. return 0;
  12353. var number = toIntegerOrInfinity(it);
  12354. var length = toLength(number);
  12355. if (number !== length)
  12356. throw RangeError2("Wrong length or index");
  12357. return length;
  12358. };
  12359. }, { "../internals/global": 163, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249 }], 247: [function(require2, module3, exports3) {
  12360. var IndexedObject = require2("../internals/indexed-object");
  12361. var requireObjectCoercible = require2("../internals/require-object-coercible");
  12362. module3.exports = function(it) {
  12363. return IndexedObject(requireObjectCoercible(it));
  12364. };
  12365. }, { "../internals/indexed-object": 170, "../internals/require-object-coercible": 230 }], 248: [function(require2, module3, exports3) {
  12366. var ceil = Math.ceil;
  12367. var floor = Math.floor;
  12368. module3.exports = function(argument) {
  12369. var number = +argument;
  12370. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  12371. };
  12372. }, {}], 249: [function(require2, module3, exports3) {
  12373. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  12374. var min = Math.min;
  12375. module3.exports = function(argument) {
  12376. return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
  12377. };
  12378. }, { "../internals/to-integer-or-infinity": 248 }], 250: [function(require2, module3, exports3) {
  12379. var global2 = require2("../internals/global");
  12380. var requireObjectCoercible = require2("../internals/require-object-coercible");
  12381. var Object2 = global2.Object;
  12382. module3.exports = function(argument) {
  12383. return Object2(requireObjectCoercible(argument));
  12384. };
  12385. }, { "../internals/global": 163, "../internals/require-object-coercible": 230 }], 251: [function(require2, module3, exports3) {
  12386. var global2 = require2("../internals/global");
  12387. var toPositiveInteger = require2("../internals/to-positive-integer");
  12388. var RangeError2 = global2.RangeError;
  12389. module3.exports = function(it, BYTES) {
  12390. var offset = toPositiveInteger(it);
  12391. if (offset % BYTES)
  12392. throw RangeError2("Wrong offset");
  12393. return offset;
  12394. };
  12395. }, { "../internals/global": 163, "../internals/to-positive-integer": 252 }], 252: [function(require2, module3, exports3) {
  12396. var global2 = require2("../internals/global");
  12397. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  12398. var RangeError2 = global2.RangeError;
  12399. module3.exports = function(it) {
  12400. var result = toIntegerOrInfinity(it);
  12401. if (result < 0)
  12402. throw RangeError2("The argument can't be less than 0");
  12403. return result;
  12404. };
  12405. }, { "../internals/global": 163, "../internals/to-integer-or-infinity": 248 }], 253: [function(require2, module3, exports3) {
  12406. var global2 = require2("../internals/global");
  12407. var call = require2("../internals/function-call");
  12408. var isObject = require2("../internals/is-object");
  12409. var isSymbol = require2("../internals/is-symbol");
  12410. var getMethod = require2("../internals/get-method");
  12411. var ordinaryToPrimitive = require2("../internals/ordinary-to-primitive");
  12412. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12413. var TypeError2 = global2.TypeError;
  12414. var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
  12415. module3.exports = function(input, pref) {
  12416. if (!isObject(input) || isSymbol(input))
  12417. return input;
  12418. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  12419. var result;
  12420. if (exoticToPrim) {
  12421. if (pref === void 0)
  12422. pref = "default";
  12423. result = call(exoticToPrim, input, pref);
  12424. if (!isObject(result) || isSymbol(result))
  12425. return result;
  12426. throw TypeError2("Can't convert object to primitive value");
  12427. }
  12428. if (pref === void 0)
  12429. pref = "number";
  12430. return ordinaryToPrimitive(input, pref);
  12431. };
  12432. }, { "../internals/function-call": 155, "../internals/get-method": 161, "../internals/global": 163, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/ordinary-to-primitive": 211, "../internals/well-known-symbol": 268 }], 254: [function(require2, module3, exports3) {
  12433. var toPrimitive = require2("../internals/to-primitive");
  12434. var isSymbol = require2("../internals/is-symbol");
  12435. module3.exports = function(argument) {
  12436. var key = toPrimitive(argument, "string");
  12437. return isSymbol(key) ? key : key + "";
  12438. };
  12439. }, { "../internals/is-symbol": 183, "../internals/to-primitive": 253 }], 255: [function(require2, module3, exports3) {
  12440. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12441. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  12442. var test = {};
  12443. test[TO_STRING_TAG] = "z";
  12444. module3.exports = String(test) === "[object z]";
  12445. }, { "../internals/well-known-symbol": 268 }], 256: [function(require2, module3, exports3) {
  12446. var global2 = require2("../internals/global");
  12447. var classof = require2("../internals/classof");
  12448. var String2 = global2.String;
  12449. module3.exports = function(argument) {
  12450. if (classof(argument) === "Symbol")
  12451. throw TypeError("Cannot convert a Symbol value to a string");
  12452. return String2(argument);
  12453. };
  12454. }, { "../internals/classof": 124, "../internals/global": 163 }], 257: [function(require2, module3, exports3) {
  12455. var global2 = require2("../internals/global");
  12456. var String2 = global2.String;
  12457. module3.exports = function(argument) {
  12458. try {
  12459. return String2(argument);
  12460. } catch (error) {
  12461. return "Object";
  12462. }
  12463. };
  12464. }, { "../internals/global": 163 }], 258: [function(require2, module3, exports3) {
  12465. "use strict";
  12466. var $ = require2("../internals/export");
  12467. var global2 = require2("../internals/global");
  12468. var call = require2("../internals/function-call");
  12469. var DESCRIPTORS = require2("../internals/descriptors");
  12470. var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require2("../internals/typed-array-constructors-require-wrappers");
  12471. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  12472. var ArrayBufferModule = require2("../internals/array-buffer");
  12473. var anInstance = require2("../internals/an-instance");
  12474. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  12475. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  12476. var isIntegralNumber = require2("../internals/is-integral-number");
  12477. var toLength = require2("../internals/to-length");
  12478. var toIndex = require2("../internals/to-index");
  12479. var toOffset = require2("../internals/to-offset");
  12480. var toPropertyKey = require2("../internals/to-property-key");
  12481. var hasOwn = require2("../internals/has-own-property");
  12482. var classof = require2("../internals/classof");
  12483. var isObject = require2("../internals/is-object");
  12484. var isSymbol = require2("../internals/is-symbol");
  12485. var create = require2("../internals/object-create");
  12486. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  12487. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  12488. var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
  12489. var typedArrayFrom = require2("../internals/typed-array-from");
  12490. var forEach = require2("../internals/array-iteration").forEach;
  12491. var setSpecies = require2("../internals/set-species");
  12492. var definePropertyModule = require2("../internals/object-define-property");
  12493. var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
  12494. var InternalStateModule = require2("../internals/internal-state");
  12495. var inheritIfRequired = require2("../internals/inherit-if-required");
  12496. var getInternalState = InternalStateModule.get;
  12497. var setInternalState = InternalStateModule.set;
  12498. var nativeDefineProperty = definePropertyModule.f;
  12499. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  12500. var round = Math.round;
  12501. var RangeError2 = global2.RangeError;
  12502. var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
  12503. var ArrayBufferPrototype = ArrayBuffer2.prototype;
  12504. var DataView2 = ArrayBufferModule.DataView;
  12505. var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
  12506. var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
  12507. var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
  12508. var TypedArray = ArrayBufferViewCore.TypedArray;
  12509. var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
  12510. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  12511. var isTypedArray = ArrayBufferViewCore.isTypedArray;
  12512. var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
  12513. var WRONG_LENGTH = "Wrong length";
  12514. var fromList = function(C, list) {
  12515. aTypedArrayConstructor(C);
  12516. var index = 0;
  12517. var length = list.length;
  12518. var result = new C(length);
  12519. while (length > index)
  12520. result[index] = list[index++];
  12521. return result;
  12522. };
  12523. var addGetter = function(it, key) {
  12524. nativeDefineProperty(it, key, { get: function() {
  12525. return getInternalState(this)[key];
  12526. } });
  12527. };
  12528. var isArrayBuffer = function(it) {
  12529. var klass;
  12530. return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == "ArrayBuffer" || klass == "SharedArrayBuffer";
  12531. };
  12532. var isTypedArrayIndex = function(target, key) {
  12533. return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
  12534. };
  12535. var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
  12536. key = toPropertyKey(key);
  12537. return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
  12538. };
  12539. var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
  12540. key = toPropertyKey(key);
  12541. if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, "value") && !hasOwn(descriptor, "get") && !hasOwn(descriptor, "set") && !descriptor.configurable && (!hasOwn(descriptor, "writable") || descriptor.writable) && (!hasOwn(descriptor, "enumerable") || descriptor.enumerable)) {
  12542. target[key] = descriptor.value;
  12543. return target;
  12544. }
  12545. return nativeDefineProperty(target, key, descriptor);
  12546. };
  12547. if (DESCRIPTORS) {
  12548. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  12549. getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
  12550. definePropertyModule.f = wrappedDefineProperty;
  12551. addGetter(TypedArrayPrototype, "buffer");
  12552. addGetter(TypedArrayPrototype, "byteOffset");
  12553. addGetter(TypedArrayPrototype, "byteLength");
  12554. addGetter(TypedArrayPrototype, "length");
  12555. }
  12556. $({ target: "Object", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
  12557. getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
  12558. defineProperty: wrappedDefineProperty
  12559. });
  12560. module3.exports = function(TYPE, wrapper, CLAMPED) {
  12561. var BYTES = TYPE.match(/\d+$/)[0] / 8;
  12562. var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
  12563. var GETTER = "get" + TYPE;
  12564. var SETTER = "set" + TYPE;
  12565. var NativeTypedArrayConstructor = global2[CONSTRUCTOR_NAME];
  12566. var TypedArrayConstructor = NativeTypedArrayConstructor;
  12567. var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
  12568. var exported = {};
  12569. var getter = function(that, index) {
  12570. var data = getInternalState(that);
  12571. return data.view[GETTER](index * BYTES + data.byteOffset, true);
  12572. };
  12573. var setter = function(that, index, value) {
  12574. var data = getInternalState(that);
  12575. if (CLAMPED)
  12576. value = (value = round(value)) < 0 ? 0 : value > 255 ? 255 : value & 255;
  12577. data.view[SETTER](index * BYTES + data.byteOffset, value, true);
  12578. };
  12579. var addElement = function(that, index) {
  12580. nativeDefineProperty(that, index, {
  12581. get: function() {
  12582. return getter(this, index);
  12583. },
  12584. set: function(value) {
  12585. return setter(this, index, value);
  12586. },
  12587. enumerable: true
  12588. });
  12589. };
  12590. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  12591. TypedArrayConstructor = wrapper(function(that, data, offset, $length) {
  12592. anInstance(that, TypedArrayConstructorPrototype);
  12593. var index = 0;
  12594. var byteOffset = 0;
  12595. var buffer, byteLength, length;
  12596. if (!isObject(data)) {
  12597. length = toIndex(data);
  12598. byteLength = length * BYTES;
  12599. buffer = new ArrayBuffer2(byteLength);
  12600. } else if (isArrayBuffer(data)) {
  12601. buffer = data;
  12602. byteOffset = toOffset(offset, BYTES);
  12603. var $len = data.byteLength;
  12604. if ($length === void 0) {
  12605. if ($len % BYTES)
  12606. throw RangeError2(WRONG_LENGTH);
  12607. byteLength = $len - byteOffset;
  12608. if (byteLength < 0)
  12609. throw RangeError2(WRONG_LENGTH);
  12610. } else {
  12611. byteLength = toLength($length) * BYTES;
  12612. if (byteLength + byteOffset > $len)
  12613. throw RangeError2(WRONG_LENGTH);
  12614. }
  12615. length = byteLength / BYTES;
  12616. } else if (isTypedArray(data)) {
  12617. return fromList(TypedArrayConstructor, data);
  12618. } else {
  12619. return call(typedArrayFrom, TypedArrayConstructor, data);
  12620. }
  12621. setInternalState(that, {
  12622. buffer,
  12623. byteOffset,
  12624. byteLength,
  12625. length,
  12626. view: new DataView2(buffer)
  12627. });
  12628. while (index < length)
  12629. addElement(that, index++);
  12630. });
  12631. if (setPrototypeOf)
  12632. setPrototypeOf(TypedArrayConstructor, TypedArray);
  12633. TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
  12634. } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
  12635. TypedArrayConstructor = wrapper(function(dummy, data, typedArrayOffset, $length) {
  12636. anInstance(dummy, TypedArrayConstructorPrototype);
  12637. return inheritIfRequired(function() {
  12638. if (!isObject(data))
  12639. return new NativeTypedArrayConstructor(toIndex(data));
  12640. if (isArrayBuffer(data))
  12641. return $length !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
  12642. if (isTypedArray(data))
  12643. return fromList(TypedArrayConstructor, data);
  12644. return call(typedArrayFrom, TypedArrayConstructor, data);
  12645. }(), dummy, TypedArrayConstructor);
  12646. });
  12647. if (setPrototypeOf)
  12648. setPrototypeOf(TypedArrayConstructor, TypedArray);
  12649. forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function(key) {
  12650. if (!(key in TypedArrayConstructor)) {
  12651. createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
  12652. }
  12653. });
  12654. TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
  12655. }
  12656. if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
  12657. createNonEnumerableProperty(TypedArrayConstructorPrototype, "constructor", TypedArrayConstructor);
  12658. }
  12659. createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);
  12660. if (TYPED_ARRAY_TAG) {
  12661. createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
  12662. }
  12663. exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
  12664. $({
  12665. global: true,
  12666. forced: TypedArrayConstructor != NativeTypedArrayConstructor,
  12667. sham: !NATIVE_ARRAY_BUFFER_VIEWS
  12668. }, exported);
  12669. if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
  12670. createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
  12671. }
  12672. if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
  12673. createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
  12674. }
  12675. setSpecies(CONSTRUCTOR_NAME);
  12676. };
  12677. } else
  12678. module3.exports = function() {
  12679. };
  12680. }, { "../internals/an-instance": 100, "../internals/array-buffer": 104, "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/classof": 124, "../internals/create-non-enumerable-property": 129, "../internals/create-property-descriptor": 130, "../internals/descriptors": 134, "../internals/export": 149, "../internals/function-call": 155, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/internal-state": 173, "../internals/is-integral-number": 179, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/object-create": 196, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/object-set-prototype-of": 208, "../internals/set-species": 233, "../internals/to-index": 246, "../internals/to-length": 249, "../internals/to-offset": 251, "../internals/to-property-key": 254, "../internals/typed-array-constructors-require-wrappers": 259, "../internals/typed-array-from": 261 }], 259: [function(require2, module3, exports3) {
  12681. var global2 = require2("../internals/global");
  12682. var fails = require2("../internals/fails");
  12683. var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
  12684. var NATIVE_ARRAY_BUFFER_VIEWS = require2("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS;
  12685. var ArrayBuffer2 = global2.ArrayBuffer;
  12686. var Int8Array2 = global2.Int8Array;
  12687. module3.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function() {
  12688. Int8Array2(1);
  12689. }) || !fails(function() {
  12690. new Int8Array2(-1);
  12691. }) || !checkCorrectnessOfIteration(function(iterable) {
  12692. new Int8Array2();
  12693. new Int8Array2(null);
  12694. new Int8Array2(1.5);
  12695. new Int8Array2(iterable);
  12696. }, true) || fails(function() {
  12697. return new Int8Array2(new ArrayBuffer2(2), 1, void 0).length !== 1;
  12698. });
  12699. }, { "../internals/array-buffer-view-core": 103, "../internals/check-correctness-of-iteration": 122, "../internals/fails": 150, "../internals/global": 163 }], 260: [function(require2, module3, exports3) {
  12700. var arrayFromConstructorAndList = require2("../internals/array-from-constructor-and-list");
  12701. var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
  12702. module3.exports = function(instance, list) {
  12703. return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);
  12704. };
  12705. }, { "../internals/array-from-constructor-and-list": 108, "../internals/typed-array-species-constructor": 262 }], 261: [function(require2, module3, exports3) {
  12706. var bind = require2("../internals/function-bind-context");
  12707. var call = require2("../internals/function-call");
  12708. var aConstructor = require2("../internals/a-constructor");
  12709. var toObject = require2("../internals/to-object");
  12710. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  12711. var getIterator = require2("../internals/get-iterator");
  12712. var getIteratorMethod = require2("../internals/get-iterator-method");
  12713. var isArrayIteratorMethod = require2("../internals/is-array-iterator-method");
  12714. var aTypedArrayConstructor = require2("../internals/array-buffer-view-core").aTypedArrayConstructor;
  12715. module3.exports = function from(source) {
  12716. var C = aConstructor(this);
  12717. var O = toObject(source);
  12718. var argumentsLength = arguments.length;
  12719. var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
  12720. var mapping = mapfn !== void 0;
  12721. var iteratorMethod = getIteratorMethod(O);
  12722. var i, length, result, step, iterator, next;
  12723. if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
  12724. iterator = getIterator(O, iteratorMethod);
  12725. next = iterator.next;
  12726. O = [];
  12727. while (!(step = call(next, iterator)).done) {
  12728. O.push(step.value);
  12729. }
  12730. }
  12731. if (mapping && argumentsLength > 2) {
  12732. mapfn = bind(mapfn, arguments[2]);
  12733. }
  12734. length = lengthOfArrayLike(O);
  12735. result = new (aTypedArrayConstructor(C))(length);
  12736. for (i = 0; length > i; i++) {
  12737. result[i] = mapping ? mapfn(O[i], i) : O[i];
  12738. }
  12739. return result;
  12740. };
  12741. }, { "../internals/a-constructor": 96, "../internals/array-buffer-view-core": 103, "../internals/function-bind-context": 153, "../internals/function-call": 155, "../internals/get-iterator": 160, "../internals/get-iterator-method": 159, "../internals/is-array-iterator-method": 174, "../internals/length-of-array-like": 188, "../internals/to-object": 250 }], 262: [function(require2, module3, exports3) {
  12742. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  12743. var speciesConstructor = require2("../internals/species-constructor");
  12744. var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
  12745. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  12746. module3.exports = function(originalArray) {
  12747. return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));
  12748. };
  12749. }, { "../internals/array-buffer-view-core": 103, "../internals/species-constructor": 238 }], 263: [function(require2, module3, exports3) {
  12750. var uncurryThis = require2("../internals/function-uncurry-this");
  12751. var id = 0;
  12752. var postfix = Math.random();
  12753. var toString = uncurryThis(1 .toString);
  12754. module3.exports = function(key) {
  12755. return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
  12756. };
  12757. }, { "../internals/function-uncurry-this": 157 }], 264: [function(require2, module3, exports3) {
  12758. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  12759. module3.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
  12760. }, { "../internals/native-symbol": 191 }], 265: [function(require2, module3, exports3) {
  12761. var DESCRIPTORS = require2("../internals/descriptors");
  12762. var fails = require2("../internals/fails");
  12763. module3.exports = DESCRIPTORS && fails(function() {
  12764. return Object.defineProperty(function() {
  12765. }, "prototype", {
  12766. value: 42,
  12767. writable: false
  12768. }).prototype != 42;
  12769. });
  12770. }, { "../internals/descriptors": 134, "../internals/fails": 150 }], 266: [function(require2, module3, exports3) {
  12771. var global2 = require2("../internals/global");
  12772. var TypeError2 = global2.TypeError;
  12773. module3.exports = function(passed, required) {
  12774. if (passed < required)
  12775. throw TypeError2("Not enough arguments");
  12776. return passed;
  12777. };
  12778. }, { "../internals/global": 163 }], 267: [function(require2, module3, exports3) {
  12779. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12780. exports3.f = wellKnownSymbol;
  12781. }, { "../internals/well-known-symbol": 268 }], 268: [function(require2, module3, exports3) {
  12782. var global2 = require2("../internals/global");
  12783. var shared = require2("../internals/shared");
  12784. var hasOwn = require2("../internals/has-own-property");
  12785. var uid = require2("../internals/uid");
  12786. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  12787. var USE_SYMBOL_AS_UID = require2("../internals/use-symbol-as-uid");
  12788. var WellKnownSymbolsStore = shared("wks");
  12789. var Symbol2 = global2.Symbol;
  12790. var symbolFor = Symbol2 && Symbol2["for"];
  12791. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
  12792. module3.exports = function(name) {
  12793. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
  12794. var description = "Symbol." + name;
  12795. if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
  12796. WellKnownSymbolsStore[name] = Symbol2[name];
  12797. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  12798. WellKnownSymbolsStore[name] = symbolFor(description);
  12799. } else {
  12800. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  12801. }
  12802. }
  12803. return WellKnownSymbolsStore[name];
  12804. };
  12805. }, { "../internals/global": 163, "../internals/has-own-property": 164, "../internals/native-symbol": 191, "../internals/shared": 237, "../internals/uid": 263, "../internals/use-symbol-as-uid": 264 }], 269: [function(require2, module3, exports3) {
  12806. module3.exports = " \n\v\f\r                 \u2028\u2029\uFEFF";
  12807. }, {}], 270: [function(require2, module3, exports3) {
  12808. "use strict";
  12809. var $ = require2("../internals/export");
  12810. var global2 = require2("../internals/global");
  12811. var arrayBufferModule = require2("../internals/array-buffer");
  12812. var setSpecies = require2("../internals/set-species");
  12813. var ARRAY_BUFFER = "ArrayBuffer";
  12814. var ArrayBuffer2 = arrayBufferModule[ARRAY_BUFFER];
  12815. var NativeArrayBuffer = global2[ARRAY_BUFFER];
  12816. $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer2 }, {
  12817. ArrayBuffer: ArrayBuffer2
  12818. });
  12819. setSpecies(ARRAY_BUFFER);
  12820. }, { "../internals/array-buffer": 104, "../internals/export": 149, "../internals/global": 163, "../internals/set-species": 233 }], 271: [function(require2, module3, exports3) {
  12821. "use strict";
  12822. var $ = require2("../internals/export");
  12823. var uncurryThis = require2("../internals/function-uncurry-this");
  12824. var fails = require2("../internals/fails");
  12825. var ArrayBufferModule = require2("../internals/array-buffer");
  12826. var anObject = require2("../internals/an-object");
  12827. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  12828. var toLength = require2("../internals/to-length");
  12829. var speciesConstructor = require2("../internals/species-constructor");
  12830. var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
  12831. var DataView2 = ArrayBufferModule.DataView;
  12832. var DataViewPrototype = DataView2.prototype;
  12833. var un$ArrayBufferSlice = uncurryThis(ArrayBuffer2.prototype.slice);
  12834. var getUint8 = uncurryThis(DataViewPrototype.getUint8);
  12835. var setUint8 = uncurryThis(DataViewPrototype.setUint8);
  12836. var INCORRECT_SLICE = fails(function() {
  12837. return !new ArrayBuffer2(2).slice(1, void 0).byteLength;
  12838. });
  12839. $({ target: "ArrayBuffer", proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
  12840. slice: function slice(start, end) {
  12841. if (un$ArrayBufferSlice && end === void 0) {
  12842. return un$ArrayBufferSlice(anObject(this), start);
  12843. }
  12844. var length = anObject(this).byteLength;
  12845. var first = toAbsoluteIndex(start, length);
  12846. var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
  12847. var result = new (speciesConstructor(this, ArrayBuffer2))(toLength(fin - first));
  12848. var viewSource = new DataView2(this);
  12849. var viewTarget = new DataView2(result);
  12850. var index = 0;
  12851. while (first < fin) {
  12852. setUint8(viewTarget, index++, getUint8(viewSource, first++));
  12853. }
  12854. return result;
  12855. }
  12856. });
  12857. }, { "../internals/an-object": 101, "../internals/array-buffer": 104, "../internals/export": 149, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/species-constructor": 238, "../internals/to-absolute-index": 245, "../internals/to-length": 249 }], 272: [function(require2, module3, exports3) {
  12858. "use strict";
  12859. var $ = require2("../internals/export");
  12860. var global2 = require2("../internals/global");
  12861. var fails = require2("../internals/fails");
  12862. var isArray = require2("../internals/is-array");
  12863. var isObject = require2("../internals/is-object");
  12864. var toObject = require2("../internals/to-object");
  12865. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  12866. var createProperty = require2("../internals/create-property");
  12867. var arraySpeciesCreate = require2("../internals/array-species-create");
  12868. var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
  12869. var wellKnownSymbol = require2("../internals/well-known-symbol");
  12870. var V8_VERSION = require2("../internals/engine-v8-version");
  12871. var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable");
  12872. var MAX_SAFE_INTEGER = 9007199254740991;
  12873. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded";
  12874. var TypeError2 = global2.TypeError;
  12875. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() {
  12876. var array = [];
  12877. array[IS_CONCAT_SPREADABLE] = false;
  12878. return array.concat()[0] !== array;
  12879. });
  12880. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat");
  12881. var isConcatSpreadable = function(O) {
  12882. if (!isObject(O))
  12883. return false;
  12884. var spreadable = O[IS_CONCAT_SPREADABLE];
  12885. return spreadable !== void 0 ? !!spreadable : isArray(O);
  12886. };
  12887. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  12888. $({ target: "Array", proto: true, forced: FORCED }, {
  12889. // eslint-disable-next-line no-unused-vars -- required for `.length`
  12890. concat: function concat(arg) {
  12891. var O = toObject(this);
  12892. var A = arraySpeciesCreate(O, 0);
  12893. var n = 0;
  12894. var i, k, length, len, E;
  12895. for (i = -1, length = arguments.length; i < length; i++) {
  12896. E = i === -1 ? O : arguments[i];
  12897. if (isConcatSpreadable(E)) {
  12898. len = lengthOfArrayLike(E);
  12899. if (n + len > MAX_SAFE_INTEGER)
  12900. throw TypeError2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  12901. for (k = 0; k < len; k++, n++)
  12902. if (k in E)
  12903. createProperty(A, n, E[k]);
  12904. } else {
  12905. if (n >= MAX_SAFE_INTEGER)
  12906. throw TypeError2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  12907. createProperty(A, n++, E);
  12908. }
  12909. }
  12910. A.length = n;
  12911. return A;
  12912. }
  12913. });
  12914. }, { "../internals/array-method-has-species-support": 113, "../internals/array-species-create": 120, "../internals/create-property": 131, "../internals/engine-v8-version": 146, "../internals/export": 149, "../internals/fails": 150, "../internals/global": 163, "../internals/is-array": 175, "../internals/is-object": 180, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/well-known-symbol": 268 }], 273: [function(require2, module3, exports3) {
  12915. var $ = require2("../internals/export");
  12916. var fill = require2("../internals/array-fill");
  12917. var addToUnscopables = require2("../internals/add-to-unscopables");
  12918. $({ target: "Array", proto: true }, {
  12919. fill
  12920. });
  12921. addToUnscopables("fill");
  12922. }, { "../internals/add-to-unscopables": 98, "../internals/array-fill": 106, "../internals/export": 149 }], 274: [function(require2, module3, exports3) {
  12923. "use strict";
  12924. var $ = require2("../internals/export");
  12925. var $filter = require2("../internals/array-iteration").filter;
  12926. var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
  12927. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
  12928. $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  12929. filter: function filter(callbackfn) {
  12930. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  12931. }
  12932. });
  12933. }, { "../internals/array-iteration": 111, "../internals/array-method-has-species-support": 113, "../internals/export": 149 }], 275: [function(require2, module3, exports3) {
  12934. "use strict";
  12935. var $ = require2("../internals/export");
  12936. var $find = require2("../internals/array-iteration").find;
  12937. var addToUnscopables = require2("../internals/add-to-unscopables");
  12938. var FIND = "find";
  12939. var SKIPS_HOLES = true;
  12940. if (FIND in [])
  12941. Array(1)[FIND](function() {
  12942. SKIPS_HOLES = false;
  12943. });
  12944. $({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
  12945. find: function find(callbackfn) {
  12946. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  12947. }
  12948. });
  12949. addToUnscopables(FIND);
  12950. }, { "../internals/add-to-unscopables": 98, "../internals/array-iteration": 111, "../internals/export": 149 }], 276: [function(require2, module3, exports3) {
  12951. var $ = require2("../internals/export");
  12952. var from = require2("../internals/array-from");
  12953. var checkCorrectnessOfIteration = require2("../internals/check-correctness-of-iteration");
  12954. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
  12955. Array.from(iterable);
  12956. });
  12957. $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
  12958. from
  12959. });
  12960. }, { "../internals/array-from": 109, "../internals/check-correctness-of-iteration": 122, "../internals/export": 149 }], 277: [function(require2, module3, exports3) {
  12961. "use strict";
  12962. var $ = require2("../internals/export");
  12963. var $includes = require2("../internals/array-includes").includes;
  12964. var addToUnscopables = require2("../internals/add-to-unscopables");
  12965. $({ target: "Array", proto: true }, {
  12966. includes: function includes(el) {
  12967. return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
  12968. }
  12969. });
  12970. addToUnscopables("includes");
  12971. }, { "../internals/add-to-unscopables": 98, "../internals/array-includes": 110, "../internals/export": 149 }], 278: [function(require2, module3, exports3) {
  12972. "use strict";
  12973. var toIndexedObject = require2("../internals/to-indexed-object");
  12974. var addToUnscopables = require2("../internals/add-to-unscopables");
  12975. var Iterators = require2("../internals/iterators");
  12976. var InternalStateModule = require2("../internals/internal-state");
  12977. var defineProperty = require2("../internals/object-define-property").f;
  12978. var defineIterator = require2("../internals/define-iterator");
  12979. var IS_PURE = require2("../internals/is-pure");
  12980. var DESCRIPTORS = require2("../internals/descriptors");
  12981. var ARRAY_ITERATOR = "Array Iterator";
  12982. var setInternalState = InternalStateModule.set;
  12983. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  12984. module3.exports = defineIterator(Array, "Array", function(iterated, kind) {
  12985. setInternalState(this, {
  12986. type: ARRAY_ITERATOR,
  12987. target: toIndexedObject(iterated),
  12988. // target
  12989. index: 0,
  12990. // next index
  12991. kind
  12992. // kind
  12993. });
  12994. }, function() {
  12995. var state = getInternalState(this);
  12996. var target = state.target;
  12997. var kind = state.kind;
  12998. var index = state.index++;
  12999. if (!target || index >= target.length) {
  13000. state.target = void 0;
  13001. return { value: void 0, done: true };
  13002. }
  13003. if (kind == "keys")
  13004. return { value: index, done: false };
  13005. if (kind == "values")
  13006. return { value: target[index], done: false };
  13007. return { value: [index, target[index]], done: false };
  13008. }, "values");
  13009. var values = Iterators.Arguments = Iterators.Array;
  13010. addToUnscopables("keys");
  13011. addToUnscopables("values");
  13012. addToUnscopables("entries");
  13013. if (!IS_PURE && DESCRIPTORS && values.name !== "values")
  13014. try {
  13015. defineProperty(values, "name", { value: "values" });
  13016. } catch (error) {
  13017. }
  13018. }, { "../internals/add-to-unscopables": 98, "../internals/define-iterator": 132, "../internals/descriptors": 134, "../internals/internal-state": 173, "../internals/is-pure": 181, "../internals/iterators": 187, "../internals/object-define-property": 198, "../internals/to-indexed-object": 247 }], 279: [function(require2, module3, exports3) {
  13019. "use strict";
  13020. var $ = require2("../internals/export");
  13021. var uncurryThis = require2("../internals/function-uncurry-this");
  13022. var IndexedObject = require2("../internals/indexed-object");
  13023. var toIndexedObject = require2("../internals/to-indexed-object");
  13024. var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
  13025. var un$Join = uncurryThis([].join);
  13026. var ES3_STRINGS = IndexedObject != Object;
  13027. var STRICT_METHOD = arrayMethodIsStrict("join", ",");
  13028. $({ target: "Array", proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  13029. join: function join(separator) {
  13030. return un$Join(toIndexedObject(this), separator === void 0 ? "," : separator);
  13031. }
  13032. });
  13033. }, { "../internals/array-method-is-strict": 114, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/indexed-object": 170, "../internals/to-indexed-object": 247 }], 280: [function(require2, module3, exports3) {
  13034. "use strict";
  13035. var $ = require2("../internals/export");
  13036. var $map = require2("../internals/array-iteration").map;
  13037. var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
  13038. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map");
  13039. $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  13040. map: function map(callbackfn) {
  13041. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  13042. }
  13043. });
  13044. }, { "../internals/array-iteration": 111, "../internals/array-method-has-species-support": 113, "../internals/export": 149 }], 281: [function(require2, module3, exports3) {
  13045. "use strict";
  13046. var $ = require2("../internals/export");
  13047. var global2 = require2("../internals/global");
  13048. var isArray = require2("../internals/is-array");
  13049. var isConstructor = require2("../internals/is-constructor");
  13050. var isObject = require2("../internals/is-object");
  13051. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  13052. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  13053. var toIndexedObject = require2("../internals/to-indexed-object");
  13054. var createProperty = require2("../internals/create-property");
  13055. var wellKnownSymbol = require2("../internals/well-known-symbol");
  13056. var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
  13057. var un$Slice = require2("../internals/array-slice");
  13058. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
  13059. var SPECIES = wellKnownSymbol("species");
  13060. var Array2 = global2.Array;
  13061. var max = Math.max;
  13062. $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  13063. slice: function slice(start, end) {
  13064. var O = toIndexedObject(this);
  13065. var length = lengthOfArrayLike(O);
  13066. var k = toAbsoluteIndex(start, length);
  13067. var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
  13068. var Constructor, result, n;
  13069. if (isArray(O)) {
  13070. Constructor = O.constructor;
  13071. if (isConstructor(Constructor) && (Constructor === Array2 || isArray(Constructor.prototype))) {
  13072. Constructor = void 0;
  13073. } else if (isObject(Constructor)) {
  13074. Constructor = Constructor[SPECIES];
  13075. if (Constructor === null)
  13076. Constructor = void 0;
  13077. }
  13078. if (Constructor === Array2 || Constructor === void 0) {
  13079. return un$Slice(O, k, fin);
  13080. }
  13081. }
  13082. result = new (Constructor === void 0 ? Array2 : Constructor)(max(fin - k, 0));
  13083. for (n = 0; k < fin; k++, n++)
  13084. if (k in O)
  13085. createProperty(result, n, O[k]);
  13086. result.length = n;
  13087. return result;
  13088. }
  13089. });
  13090. }, { "../internals/array-method-has-species-support": 113, "../internals/array-slice": 117, "../internals/create-property": 131, "../internals/export": 149, "../internals/global": 163, "../internals/is-array": 175, "../internals/is-constructor": 177, "../internals/is-object": 180, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-indexed-object": 247, "../internals/well-known-symbol": 268 }], 282: [function(require2, module3, exports3) {
  13091. "use strict";
  13092. var $ = require2("../internals/export");
  13093. var uncurryThis = require2("../internals/function-uncurry-this");
  13094. var aCallable = require2("../internals/a-callable");
  13095. var toObject = require2("../internals/to-object");
  13096. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  13097. var toString = require2("../internals/to-string");
  13098. var fails = require2("../internals/fails");
  13099. var internalSort = require2("../internals/array-sort");
  13100. var arrayMethodIsStrict = require2("../internals/array-method-is-strict");
  13101. var FF = require2("../internals/engine-ff-version");
  13102. var IE_OR_EDGE = require2("../internals/engine-is-ie-or-edge");
  13103. var V8 = require2("../internals/engine-v8-version");
  13104. var WEBKIT = require2("../internals/engine-webkit-version");
  13105. var test = [];
  13106. var un$Sort = uncurryThis(test.sort);
  13107. var push = uncurryThis(test.push);
  13108. var FAILS_ON_UNDEFINED = fails(function() {
  13109. test.sort(void 0);
  13110. });
  13111. var FAILS_ON_NULL = fails(function() {
  13112. test.sort(null);
  13113. });
  13114. var STRICT_METHOD = arrayMethodIsStrict("sort");
  13115. var STABLE_SORT = !fails(function() {
  13116. if (V8)
  13117. return V8 < 70;
  13118. if (FF && FF > 3)
  13119. return;
  13120. if (IE_OR_EDGE)
  13121. return true;
  13122. if (WEBKIT)
  13123. return WEBKIT < 603;
  13124. var result = "";
  13125. var code, chr, value, index;
  13126. for (code = 65; code < 76; code++) {
  13127. chr = String.fromCharCode(code);
  13128. switch (code) {
  13129. case 66:
  13130. case 69:
  13131. case 70:
  13132. case 72:
  13133. value = 3;
  13134. break;
  13135. case 68:
  13136. case 71:
  13137. value = 4;
  13138. break;
  13139. default:
  13140. value = 2;
  13141. }
  13142. for (index = 0; index < 47; index++) {
  13143. test.push({ k: chr + index, v: value });
  13144. }
  13145. }
  13146. test.sort(function(a, b) {
  13147. return b.v - a.v;
  13148. });
  13149. for (index = 0; index < test.length; index++) {
  13150. chr = test[index].k.charAt(0);
  13151. if (result.charAt(result.length - 1) !== chr)
  13152. result += chr;
  13153. }
  13154. return result !== "DGBEFHACIJK";
  13155. });
  13156. var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
  13157. var getSortCompare = function(comparefn) {
  13158. return function(x, y) {
  13159. if (y === void 0)
  13160. return -1;
  13161. if (x === void 0)
  13162. return 1;
  13163. if (comparefn !== void 0)
  13164. return +comparefn(x, y) || 0;
  13165. return toString(x) > toString(y) ? 1 : -1;
  13166. };
  13167. };
  13168. $({ target: "Array", proto: true, forced: FORCED }, {
  13169. sort: function sort(comparefn) {
  13170. if (comparefn !== void 0)
  13171. aCallable(comparefn);
  13172. var array = toObject(this);
  13173. if (STABLE_SORT)
  13174. return comparefn === void 0 ? un$Sort(array) : un$Sort(array, comparefn);
  13175. var items = [];
  13176. var arrayLength = lengthOfArrayLike(array);
  13177. var itemsLength, index;
  13178. for (index = 0; index < arrayLength; index++) {
  13179. if (index in array)
  13180. push(items, array[index]);
  13181. }
  13182. internalSort(items, getSortCompare(comparefn));
  13183. itemsLength = items.length;
  13184. index = 0;
  13185. while (index < itemsLength)
  13186. array[index] = items[index++];
  13187. while (index < arrayLength)
  13188. delete array[index++];
  13189. return array;
  13190. }
  13191. });
  13192. }, { "../internals/a-callable": 95, "../internals/array-method-is-strict": 114, "../internals/array-sort": 118, "../internals/engine-ff-version": 138, "../internals/engine-is-ie-or-edge": 140, "../internals/engine-v8-version": 146, "../internals/engine-webkit-version": 147, "../internals/export": 149, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/to-string": 256 }], 283: [function(require2, module3, exports3) {
  13193. "use strict";
  13194. var $ = require2("../internals/export");
  13195. var global2 = require2("../internals/global");
  13196. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  13197. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  13198. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  13199. var toObject = require2("../internals/to-object");
  13200. var arraySpeciesCreate = require2("../internals/array-species-create");
  13201. var createProperty = require2("../internals/create-property");
  13202. var arrayMethodHasSpeciesSupport = require2("../internals/array-method-has-species-support");
  13203. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice");
  13204. var TypeError2 = global2.TypeError;
  13205. var max = Math.max;
  13206. var min = Math.min;
  13207. var MAX_SAFE_INTEGER = 9007199254740991;
  13208. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = "Maximum allowed length exceeded";
  13209. $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  13210. splice: function splice(start, deleteCount) {
  13211. var O = toObject(this);
  13212. var len = lengthOfArrayLike(O);
  13213. var actualStart = toAbsoluteIndex(start, len);
  13214. var argumentsLength = arguments.length;
  13215. var insertCount, actualDeleteCount, A, k, from, to;
  13216. if (argumentsLength === 0) {
  13217. insertCount = actualDeleteCount = 0;
  13218. } else if (argumentsLength === 1) {
  13219. insertCount = 0;
  13220. actualDeleteCount = len - actualStart;
  13221. } else {
  13222. insertCount = argumentsLength - 2;
  13223. actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  13224. }
  13225. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  13226. throw TypeError2(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  13227. }
  13228. A = arraySpeciesCreate(O, actualDeleteCount);
  13229. for (k = 0; k < actualDeleteCount; k++) {
  13230. from = actualStart + k;
  13231. if (from in O)
  13232. createProperty(A, k, O[from]);
  13233. }
  13234. A.length = actualDeleteCount;
  13235. if (insertCount < actualDeleteCount) {
  13236. for (k = actualStart; k < len - actualDeleteCount; k++) {
  13237. from = k + actualDeleteCount;
  13238. to = k + insertCount;
  13239. if (from in O)
  13240. O[to] = O[from];
  13241. else
  13242. delete O[to];
  13243. }
  13244. for (k = len; k > len - actualDeleteCount + insertCount; k--)
  13245. delete O[k - 1];
  13246. } else if (insertCount > actualDeleteCount) {
  13247. for (k = len - actualDeleteCount; k > actualStart; k--) {
  13248. from = k + actualDeleteCount - 1;
  13249. to = k + insertCount - 1;
  13250. if (from in O)
  13251. O[to] = O[from];
  13252. else
  13253. delete O[to];
  13254. }
  13255. }
  13256. for (k = 0; k < insertCount; k++) {
  13257. O[k + actualStart] = arguments[k + 2];
  13258. }
  13259. O.length = len - actualDeleteCount + insertCount;
  13260. return A;
  13261. }
  13262. });
  13263. }, { "../internals/array-method-has-species-support": 113, "../internals/array-species-create": 120, "../internals/create-property": 131, "../internals/export": 149, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-absolute-index": 245, "../internals/to-integer-or-infinity": 248, "../internals/to-object": 250 }], 284: [function(require2, module3, exports3) {
  13264. var DESCRIPTORS = require2("../internals/descriptors");
  13265. var FUNCTION_NAME_EXISTS = require2("../internals/function-name").EXISTS;
  13266. var uncurryThis = require2("../internals/function-uncurry-this");
  13267. var defineProperty = require2("../internals/object-define-property").f;
  13268. var FunctionPrototype = Function.prototype;
  13269. var functionToString = uncurryThis(FunctionPrototype.toString);
  13270. var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
  13271. var regExpExec = uncurryThis(nameRE.exec);
  13272. var NAME = "name";
  13273. if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
  13274. defineProperty(FunctionPrototype, NAME, {
  13275. configurable: true,
  13276. get: function() {
  13277. try {
  13278. return regExpExec(nameRE, functionToString(this))[1];
  13279. } catch (error) {
  13280. return "";
  13281. }
  13282. }
  13283. });
  13284. }
  13285. }, { "../internals/descriptors": 134, "../internals/function-name": 156, "../internals/function-uncurry-this": 157, "../internals/object-define-property": 198 }], 285: [function(require2, module3, exports3) {
  13286. var $ = require2("../internals/export");
  13287. var getBuiltIn = require2("../internals/get-built-in");
  13288. var apply = require2("../internals/function-apply");
  13289. var call = require2("../internals/function-call");
  13290. var uncurryThis = require2("../internals/function-uncurry-this");
  13291. var fails = require2("../internals/fails");
  13292. var isArray = require2("../internals/is-array");
  13293. var isCallable = require2("../internals/is-callable");
  13294. var isObject = require2("../internals/is-object");
  13295. var isSymbol = require2("../internals/is-symbol");
  13296. var arraySlice = require2("../internals/array-slice");
  13297. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  13298. var $stringify = getBuiltIn("JSON", "stringify");
  13299. var exec = uncurryThis(/./.exec);
  13300. var charAt = uncurryThis("".charAt);
  13301. var charCodeAt = uncurryThis("".charCodeAt);
  13302. var replace = uncurryThis("".replace);
  13303. var numberToString = uncurryThis(1 .toString);
  13304. var tester = /[\uD800-\uDFFF]/g;
  13305. var low = /^[\uD800-\uDBFF]$/;
  13306. var hi = /^[\uDC00-\uDFFF]$/;
  13307. var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
  13308. var symbol = getBuiltIn("Symbol")();
  13309. return $stringify([symbol]) != "[null]" || $stringify({ a: symbol }) != "{}" || $stringify(Object(symbol)) != "{}";
  13310. });
  13311. var ILL_FORMED_UNICODE = fails(function() {
  13312. return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
  13313. });
  13314. var stringifyWithSymbolsFix = function(it, replacer) {
  13315. var args = arraySlice(arguments);
  13316. var $replacer = replacer;
  13317. if (!isObject(replacer) && it === void 0 || isSymbol(it))
  13318. return;
  13319. if (!isArray(replacer))
  13320. replacer = function(key, value) {
  13321. if (isCallable($replacer))
  13322. value = call($replacer, this, key, value);
  13323. if (!isSymbol(value))
  13324. return value;
  13325. };
  13326. args[1] = replacer;
  13327. return apply($stringify, null, args);
  13328. };
  13329. var fixIllFormed = function(match, offset, string) {
  13330. var prev = charAt(string, offset - 1);
  13331. var next = charAt(string, offset + 1);
  13332. if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) {
  13333. return "\\u" + numberToString(charCodeAt(match, 0), 16);
  13334. }
  13335. return match;
  13336. };
  13337. if ($stringify) {
  13338. $({ target: "JSON", stat: true, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
  13339. // eslint-disable-next-line no-unused-vars -- required for `.length`
  13340. stringify: function stringify(it, replacer, space) {
  13341. var args = arraySlice(arguments);
  13342. var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
  13343. return ILL_FORMED_UNICODE && typeof result == "string" ? replace(result, tester, fixIllFormed) : result;
  13344. }
  13345. });
  13346. }
  13347. }, { "../internals/array-slice": 117, "../internals/export": 149, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-built-in": 158, "../internals/is-array": 175, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/is-symbol": 183, "../internals/native-symbol": 191 }], 286: [function(require2, module3, exports3) {
  13348. "use strict";
  13349. var DESCRIPTORS = require2("../internals/descriptors");
  13350. var global2 = require2("../internals/global");
  13351. var uncurryThis = require2("../internals/function-uncurry-this");
  13352. var isForced = require2("../internals/is-forced");
  13353. var redefine = require2("../internals/redefine");
  13354. var hasOwn = require2("../internals/has-own-property");
  13355. var inheritIfRequired = require2("../internals/inherit-if-required");
  13356. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  13357. var isSymbol = require2("../internals/is-symbol");
  13358. var toPrimitive = require2("../internals/to-primitive");
  13359. var fails = require2("../internals/fails");
  13360. var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
  13361. var getOwnPropertyDescriptor = require2("../internals/object-get-own-property-descriptor").f;
  13362. var defineProperty = require2("../internals/object-define-property").f;
  13363. var thisNumberValue = require2("../internals/this-number-value");
  13364. var trim = require2("../internals/string-trim").trim;
  13365. var NUMBER = "Number";
  13366. var NativeNumber = global2[NUMBER];
  13367. var NumberPrototype = NativeNumber.prototype;
  13368. var TypeError2 = global2.TypeError;
  13369. var arraySlice = uncurryThis("".slice);
  13370. var charCodeAt = uncurryThis("".charCodeAt);
  13371. var toNumeric = function(value) {
  13372. var primValue = toPrimitive(value, "number");
  13373. return typeof primValue == "bigint" ? primValue : toNumber(primValue);
  13374. };
  13375. var toNumber = function(argument) {
  13376. var it = toPrimitive(argument, "number");
  13377. var first, third, radix, maxCode, digits, length, index, code;
  13378. if (isSymbol(it))
  13379. throw TypeError2("Cannot convert a Symbol value to a number");
  13380. if (typeof it == "string" && it.length > 2) {
  13381. it = trim(it);
  13382. first = charCodeAt(it, 0);
  13383. if (first === 43 || first === 45) {
  13384. third = charCodeAt(it, 2);
  13385. if (third === 88 || third === 120)
  13386. return NaN;
  13387. } else if (first === 48) {
  13388. switch (charCodeAt(it, 1)) {
  13389. case 66:
  13390. case 98:
  13391. radix = 2;
  13392. maxCode = 49;
  13393. break;
  13394. case 79:
  13395. case 111:
  13396. radix = 8;
  13397. maxCode = 55;
  13398. break;
  13399. default:
  13400. return +it;
  13401. }
  13402. digits = arraySlice(it, 2);
  13403. length = digits.length;
  13404. for (index = 0; index < length; index++) {
  13405. code = charCodeAt(digits, index);
  13406. if (code < 48 || code > maxCode)
  13407. return NaN;
  13408. }
  13409. return parseInt(digits, radix);
  13410. }
  13411. }
  13412. return +it;
  13413. };
  13414. if (isForced(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"))) {
  13415. var NumberWrapper = function Number2(value) {
  13416. var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  13417. var dummy = this;
  13418. return isPrototypeOf(NumberPrototype, dummy) && fails(function() {
  13419. thisNumberValue(dummy);
  13420. }) ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
  13421. };
  13422. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  13423. // ES3:
  13424. "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(",")
  13425. ), j = 0, key; keys.length > j; j++) {
  13426. if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
  13427. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  13428. }
  13429. }
  13430. NumberWrapper.prototype = NumberPrototype;
  13431. NumberPrototype.constructor = NumberWrapper;
  13432. redefine(global2, NUMBER, NumberWrapper);
  13433. }
  13434. }, { "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/is-forced": 178, "../internals/is-symbol": 183, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/redefine": 222, "../internals/string-trim": 241, "../internals/this-number-value": 244, "../internals/to-primitive": 253 }], 287: [function(require2, module3, exports3) {
  13435. var $ = require2("../internals/export");
  13436. var assign = require2("../internals/object-assign");
  13437. $({ target: "Object", stat: true, forced: Object.assign !== assign }, {
  13438. assign
  13439. });
  13440. }, { "../internals/export": 149, "../internals/object-assign": 195 }], 288: [function(require2, module3, exports3) {
  13441. var $ = require2("../internals/export");
  13442. var $entries = require2("../internals/object-to-array").entries;
  13443. $({ target: "Object", stat: true }, {
  13444. entries: function entries(O) {
  13445. return $entries(O);
  13446. }
  13447. });
  13448. }, { "../internals/export": 149, "../internals/object-to-array": 209 }], 289: [function(require2, module3, exports3) {
  13449. var $ = require2("../internals/export");
  13450. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  13451. var fails = require2("../internals/fails");
  13452. var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
  13453. var toObject = require2("../internals/to-object");
  13454. var FORCED = !NATIVE_SYMBOL || fails(function() {
  13455. getOwnPropertySymbolsModule.f(1);
  13456. });
  13457. $({ target: "Object", stat: true, forced: FORCED }, {
  13458. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  13459. var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  13460. return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
  13461. }
  13462. });
  13463. }, { "../internals/export": 149, "../internals/fails": 150, "../internals/native-symbol": 191, "../internals/object-get-own-property-symbols": 202, "../internals/to-object": 250 }], 290: [function(require2, module3, exports3) {
  13464. var $ = require2("../internals/export");
  13465. var toObject = require2("../internals/to-object");
  13466. var nativeKeys = require2("../internals/object-keys");
  13467. var fails = require2("../internals/fails");
  13468. var FAILS_ON_PRIMITIVES = fails(function() {
  13469. nativeKeys(1);
  13470. });
  13471. $({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
  13472. keys: function keys(it) {
  13473. return nativeKeys(toObject(it));
  13474. }
  13475. });
  13476. }, { "../internals/export": 149, "../internals/fails": 150, "../internals/object-keys": 206, "../internals/to-object": 250 }], 291: [function(require2, module3, exports3) {
  13477. var TO_STRING_TAG_SUPPORT = require2("../internals/to-string-tag-support");
  13478. var redefine = require2("../internals/redefine");
  13479. var toString = require2("../internals/object-to-string");
  13480. if (!TO_STRING_TAG_SUPPORT) {
  13481. redefine(Object.prototype, "toString", toString, { unsafe: true });
  13482. }
  13483. }, { "../internals/object-to-string": 210, "../internals/redefine": 222, "../internals/to-string-tag-support": 255 }], 292: [function(require2, module3, exports3) {
  13484. "use strict";
  13485. var $ = require2("../internals/export");
  13486. var call = require2("../internals/function-call");
  13487. var aCallable = require2("../internals/a-callable");
  13488. var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
  13489. var perform = require2("../internals/perform");
  13490. var iterate = require2("../internals/iterate");
  13491. var PROMISE_STATICS_INCORRECT_ITERATION = require2("../internals/promise-statics-incorrect-iteration");
  13492. $({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  13493. all: function all(iterable) {
  13494. var C = this;
  13495. var capability = newPromiseCapabilityModule.f(C);
  13496. var resolve = capability.resolve;
  13497. var reject = capability.reject;
  13498. var result = perform(function() {
  13499. var $promiseResolve = aCallable(C.resolve);
  13500. var values = [];
  13501. var counter = 0;
  13502. var remaining = 1;
  13503. iterate(iterable, function(promise) {
  13504. var index = counter++;
  13505. var alreadyCalled = false;
  13506. remaining++;
  13507. call($promiseResolve, C, promise).then(function(value) {
  13508. if (alreadyCalled)
  13509. return;
  13510. alreadyCalled = true;
  13511. values[index] = value;
  13512. --remaining || resolve(values);
  13513. }, reject);
  13514. });
  13515. --remaining || resolve(values);
  13516. });
  13517. if (result.error)
  13518. reject(result.value);
  13519. return capability.promise;
  13520. }
  13521. });
  13522. }, { "../internals/a-callable": 95, "../internals/export": 149, "../internals/function-call": 155, "../internals/iterate": 184, "../internals/new-promise-capability": 193, "../internals/perform": 214, "../internals/promise-statics-incorrect-iteration": 218 }], 293: [function(require2, module3, exports3) {
  13523. "use strict";
  13524. var $ = require2("../internals/export");
  13525. var IS_PURE = require2("../internals/is-pure");
  13526. var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
  13527. var NativePromiseConstructor = require2("../internals/promise-native-constructor");
  13528. var getBuiltIn = require2("../internals/get-built-in");
  13529. var isCallable = require2("../internals/is-callable");
  13530. var redefine = require2("../internals/redefine");
  13531. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  13532. $({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
  13533. "catch": function(onRejected) {
  13534. return this.then(void 0, onRejected);
  13535. }
  13536. });
  13537. if (!IS_PURE && isCallable(NativePromiseConstructor)) {
  13538. var method = getBuiltIn("Promise").prototype["catch"];
  13539. if (NativePromisePrototype["catch"] !== method) {
  13540. redefine(NativePromisePrototype, "catch", method, { unsafe: true });
  13541. }
  13542. }
  13543. }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/is-callable": 176, "../internals/is-pure": 181, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/redefine": 222 }], 294: [function(require2, module3, exports3) {
  13544. "use strict";
  13545. var $ = require2("../internals/export");
  13546. var IS_PURE = require2("../internals/is-pure");
  13547. var IS_NODE = require2("../internals/engine-is-node");
  13548. var global2 = require2("../internals/global");
  13549. var call = require2("../internals/function-call");
  13550. var redefine = require2("../internals/redefine");
  13551. var redefineAll = require2("../internals/redefine-all");
  13552. var setPrototypeOf = require2("../internals/object-set-prototype-of");
  13553. var setToStringTag = require2("../internals/set-to-string-tag");
  13554. var setSpecies = require2("../internals/set-species");
  13555. var aCallable = require2("../internals/a-callable");
  13556. var isCallable = require2("../internals/is-callable");
  13557. var isObject = require2("../internals/is-object");
  13558. var anInstance = require2("../internals/an-instance");
  13559. var speciesConstructor = require2("../internals/species-constructor");
  13560. var task = require2("../internals/task").set;
  13561. var microtask = require2("../internals/microtask");
  13562. var hostReportErrors = require2("../internals/host-report-errors");
  13563. var perform = require2("../internals/perform");
  13564. var Queue = require2("../internals/queue");
  13565. var InternalStateModule = require2("../internals/internal-state");
  13566. var NativePromiseConstructor = require2("../internals/promise-native-constructor");
  13567. var PromiseConstructorDetection = require2("../internals/promise-constructor-detection");
  13568. var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
  13569. var PROMISE = "Promise";
  13570. var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
  13571. var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
  13572. var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
  13573. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  13574. var setInternalState = InternalStateModule.set;
  13575. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  13576. var PromiseConstructor = NativePromiseConstructor;
  13577. var PromisePrototype = NativePromisePrototype;
  13578. var TypeError2 = global2.TypeError;
  13579. var document2 = global2.document;
  13580. var process = global2.process;
  13581. var newPromiseCapability = newPromiseCapabilityModule.f;
  13582. var newGenericPromiseCapability = newPromiseCapability;
  13583. var DISPATCH_EVENT = !!(document2 && document2.createEvent && global2.dispatchEvent);
  13584. var UNHANDLED_REJECTION = "unhandledrejection";
  13585. var REJECTION_HANDLED = "rejectionhandled";
  13586. var PENDING = 0;
  13587. var FULFILLED = 1;
  13588. var REJECTED = 2;
  13589. var HANDLED = 1;
  13590. var UNHANDLED = 2;
  13591. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  13592. var isThenable = function(it) {
  13593. var then;
  13594. return isObject(it) && isCallable(then = it.then) ? then : false;
  13595. };
  13596. var callReaction = function(reaction, state) {
  13597. var value = state.value;
  13598. var ok = state.state == FULFILLED;
  13599. var handler = ok ? reaction.ok : reaction.fail;
  13600. var resolve = reaction.resolve;
  13601. var reject = reaction.reject;
  13602. var domain = reaction.domain;
  13603. var result, then, exited;
  13604. try {
  13605. if (handler) {
  13606. if (!ok) {
  13607. if (state.rejection === UNHANDLED)
  13608. onHandleUnhandled(state);
  13609. state.rejection = HANDLED;
  13610. }
  13611. if (handler === true)
  13612. result = value;
  13613. else {
  13614. if (domain)
  13615. domain.enter();
  13616. result = handler(value);
  13617. if (domain) {
  13618. domain.exit();
  13619. exited = true;
  13620. }
  13621. }
  13622. if (result === reaction.promise) {
  13623. reject(TypeError2("Promise-chain cycle"));
  13624. } else if (then = isThenable(result)) {
  13625. call(then, result, resolve, reject);
  13626. } else
  13627. resolve(result);
  13628. } else
  13629. reject(value);
  13630. } catch (error) {
  13631. if (domain && !exited)
  13632. domain.exit();
  13633. reject(error);
  13634. }
  13635. };
  13636. var notify = function(state, isReject) {
  13637. if (state.notified)
  13638. return;
  13639. state.notified = true;
  13640. microtask(function() {
  13641. var reactions = state.reactions;
  13642. var reaction;
  13643. while (reaction = reactions.get()) {
  13644. callReaction(reaction, state);
  13645. }
  13646. state.notified = false;
  13647. if (isReject && !state.rejection)
  13648. onUnhandled(state);
  13649. });
  13650. };
  13651. var dispatchEvent = function(name, promise, reason) {
  13652. var event, handler;
  13653. if (DISPATCH_EVENT) {
  13654. event = document2.createEvent("Event");
  13655. event.promise = promise;
  13656. event.reason = reason;
  13657. event.initEvent(name, false, true);
  13658. global2.dispatchEvent(event);
  13659. } else
  13660. event = { promise, reason };
  13661. if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global2["on" + name]))
  13662. handler(event);
  13663. else if (name === UNHANDLED_REJECTION)
  13664. hostReportErrors("Unhandled promise rejection", reason);
  13665. };
  13666. var onUnhandled = function(state) {
  13667. call(task, global2, function() {
  13668. var promise = state.facade;
  13669. var value = state.value;
  13670. var IS_UNHANDLED = isUnhandled(state);
  13671. var result;
  13672. if (IS_UNHANDLED) {
  13673. result = perform(function() {
  13674. if (IS_NODE) {
  13675. process.emit("unhandledRejection", value, promise);
  13676. } else
  13677. dispatchEvent(UNHANDLED_REJECTION, promise, value);
  13678. });
  13679. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  13680. if (result.error)
  13681. throw result.value;
  13682. }
  13683. });
  13684. };
  13685. var isUnhandled = function(state) {
  13686. return state.rejection !== HANDLED && !state.parent;
  13687. };
  13688. var onHandleUnhandled = function(state) {
  13689. call(task, global2, function() {
  13690. var promise = state.facade;
  13691. if (IS_NODE) {
  13692. process.emit("rejectionHandled", promise);
  13693. } else
  13694. dispatchEvent(REJECTION_HANDLED, promise, state.value);
  13695. });
  13696. };
  13697. var bind = function(fn, state, unwrap) {
  13698. return function(value) {
  13699. fn(state, value, unwrap);
  13700. };
  13701. };
  13702. var internalReject = function(state, value, unwrap) {
  13703. if (state.done)
  13704. return;
  13705. state.done = true;
  13706. if (unwrap)
  13707. state = unwrap;
  13708. state.value = value;
  13709. state.state = REJECTED;
  13710. notify(state, true);
  13711. };
  13712. var internalResolve = function(state, value, unwrap) {
  13713. if (state.done)
  13714. return;
  13715. state.done = true;
  13716. if (unwrap)
  13717. state = unwrap;
  13718. try {
  13719. if (state.facade === value)
  13720. throw TypeError2("Promise can't be resolved itself");
  13721. var then = isThenable(value);
  13722. if (then) {
  13723. microtask(function() {
  13724. var wrapper = { done: false };
  13725. try {
  13726. call(
  13727. then,
  13728. value,
  13729. bind(internalResolve, wrapper, state),
  13730. bind(internalReject, wrapper, state)
  13731. );
  13732. } catch (error) {
  13733. internalReject(wrapper, error, state);
  13734. }
  13735. });
  13736. } else {
  13737. state.value = value;
  13738. state.state = FULFILLED;
  13739. notify(state, false);
  13740. }
  13741. } catch (error) {
  13742. internalReject({ done: false }, error, state);
  13743. }
  13744. };
  13745. if (FORCED_PROMISE_CONSTRUCTOR) {
  13746. PromiseConstructor = function Promise2(executor) {
  13747. anInstance(this, PromisePrototype);
  13748. aCallable(executor);
  13749. call(Internal, this);
  13750. var state = getInternalPromiseState(this);
  13751. try {
  13752. executor(bind(internalResolve, state), bind(internalReject, state));
  13753. } catch (error) {
  13754. internalReject(state, error);
  13755. }
  13756. };
  13757. PromisePrototype = PromiseConstructor.prototype;
  13758. Internal = function Promise2(executor) {
  13759. setInternalState(this, {
  13760. type: PROMISE,
  13761. done: false,
  13762. notified: false,
  13763. parent: false,
  13764. reactions: new Queue(),
  13765. rejection: false,
  13766. state: PENDING,
  13767. value: void 0
  13768. });
  13769. };
  13770. Internal.prototype = redefineAll(PromisePrototype, {
  13771. // `Promise.prototype.then` method
  13772. // https://tc39.es/ecma262/#sec-promise.prototype.then
  13773. // eslint-disable-next-line unicorn/no-thenable -- safe
  13774. then: function then(onFulfilled, onRejected) {
  13775. var state = getInternalPromiseState(this);
  13776. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  13777. state.parent = true;
  13778. reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
  13779. reaction.fail = isCallable(onRejected) && onRejected;
  13780. reaction.domain = IS_NODE ? process.domain : void 0;
  13781. if (state.state == PENDING)
  13782. state.reactions.add(reaction);
  13783. else
  13784. microtask(function() {
  13785. callReaction(reaction, state);
  13786. });
  13787. return reaction.promise;
  13788. }
  13789. });
  13790. OwnPromiseCapability = function() {
  13791. var promise = new Internal();
  13792. var state = getInternalPromiseState(promise);
  13793. this.promise = promise;
  13794. this.resolve = bind(internalResolve, state);
  13795. this.reject = bind(internalReject, state);
  13796. };
  13797. newPromiseCapabilityModule.f = newPromiseCapability = function(C) {
  13798. return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C);
  13799. };
  13800. if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
  13801. nativeThen = NativePromisePrototype.then;
  13802. if (!NATIVE_PROMISE_SUBCLASSING) {
  13803. redefine(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
  13804. var that = this;
  13805. return new PromiseConstructor(function(resolve, reject) {
  13806. call(nativeThen, that, resolve, reject);
  13807. }).then(onFulfilled, onRejected);
  13808. }, { unsafe: true });
  13809. }
  13810. try {
  13811. delete NativePromisePrototype.constructor;
  13812. } catch (error) {
  13813. }
  13814. if (setPrototypeOf) {
  13815. setPrototypeOf(NativePromisePrototype, PromisePrototype);
  13816. }
  13817. }
  13818. }
  13819. $({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  13820. Promise: PromiseConstructor
  13821. });
  13822. setToStringTag(PromiseConstructor, PROMISE, false, true);
  13823. setSpecies(PROMISE);
  13824. }, { "../internals/a-callable": 95, "../internals/an-instance": 100, "../internals/engine-is-node": 143, "../internals/export": 149, "../internals/function-call": 155, "../internals/global": 163, "../internals/host-report-errors": 166, "../internals/internal-state": 173, "../internals/is-callable": 176, "../internals/is-object": 180, "../internals/is-pure": 181, "../internals/microtask": 189, "../internals/new-promise-capability": 193, "../internals/object-set-prototype-of": 208, "../internals/perform": 214, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/queue": 220, "../internals/redefine": 222, "../internals/redefine-all": 221, "../internals/set-species": 233, "../internals/set-to-string-tag": 234, "../internals/species-constructor": 238, "../internals/task": 243 }], 295: [function(require2, module3, exports3) {
  13825. require2("../modules/es.promise.constructor");
  13826. require2("../modules/es.promise.all");
  13827. require2("../modules/es.promise.catch");
  13828. require2("../modules/es.promise.race");
  13829. require2("../modules/es.promise.reject");
  13830. require2("../modules/es.promise.resolve");
  13831. }, { "../modules/es.promise.all": 292, "../modules/es.promise.catch": 293, "../modules/es.promise.constructor": 294, "../modules/es.promise.race": 296, "../modules/es.promise.reject": 297, "../modules/es.promise.resolve": 298 }], 296: [function(require2, module3, exports3) {
  13832. "use strict";
  13833. var $ = require2("../internals/export");
  13834. var call = require2("../internals/function-call");
  13835. var aCallable = require2("../internals/a-callable");
  13836. var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
  13837. var perform = require2("../internals/perform");
  13838. var iterate = require2("../internals/iterate");
  13839. var PROMISE_STATICS_INCORRECT_ITERATION = require2("../internals/promise-statics-incorrect-iteration");
  13840. $({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  13841. race: function race(iterable) {
  13842. var C = this;
  13843. var capability = newPromiseCapabilityModule.f(C);
  13844. var reject = capability.reject;
  13845. var result = perform(function() {
  13846. var $promiseResolve = aCallable(C.resolve);
  13847. iterate(iterable, function(promise) {
  13848. call($promiseResolve, C, promise).then(capability.resolve, reject);
  13849. });
  13850. });
  13851. if (result.error)
  13852. reject(result.value);
  13853. return capability.promise;
  13854. }
  13855. });
  13856. }, { "../internals/a-callable": 95, "../internals/export": 149, "../internals/function-call": 155, "../internals/iterate": 184, "../internals/new-promise-capability": 193, "../internals/perform": 214, "../internals/promise-statics-incorrect-iteration": 218 }], 297: [function(require2, module3, exports3) {
  13857. "use strict";
  13858. var $ = require2("../internals/export");
  13859. var call = require2("../internals/function-call");
  13860. var newPromiseCapabilityModule = require2("../internals/new-promise-capability");
  13861. var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
  13862. $({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  13863. reject: function reject(r) {
  13864. var capability = newPromiseCapabilityModule.f(this);
  13865. call(capability.reject, void 0, r);
  13866. return capability.promise;
  13867. }
  13868. });
  13869. }, { "../internals/export": 149, "../internals/function-call": 155, "../internals/new-promise-capability": 193, "../internals/promise-constructor-detection": 215 }], 298: [function(require2, module3, exports3) {
  13870. "use strict";
  13871. var $ = require2("../internals/export");
  13872. var getBuiltIn = require2("../internals/get-built-in");
  13873. var IS_PURE = require2("../internals/is-pure");
  13874. var NativePromiseConstructor = require2("../internals/promise-native-constructor");
  13875. var FORCED_PROMISE_CONSTRUCTOR = require2("../internals/promise-constructor-detection").CONSTRUCTOR;
  13876. var promiseResolve = require2("../internals/promise-resolve");
  13877. var PromiseConstructorWrapper = getBuiltIn("Promise");
  13878. var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
  13879. $({ target: "Promise", stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
  13880. resolve: function resolve(x) {
  13881. return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
  13882. }
  13883. });
  13884. }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/is-pure": 181, "../internals/promise-constructor-detection": 215, "../internals/promise-native-constructor": 216, "../internals/promise-resolve": 217 }], 299: [function(require2, module3, exports3) {
  13885. var DESCRIPTORS = require2("../internals/descriptors");
  13886. var global2 = require2("../internals/global");
  13887. var uncurryThis = require2("../internals/function-uncurry-this");
  13888. var isForced = require2("../internals/is-forced");
  13889. var inheritIfRequired = require2("../internals/inherit-if-required");
  13890. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  13891. var getOwnPropertyNames = require2("../internals/object-get-own-property-names").f;
  13892. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  13893. var isRegExp = require2("../internals/is-regexp");
  13894. var toString = require2("../internals/to-string");
  13895. var getRegExpFlags = require2("../internals/regexp-get-flags");
  13896. var stickyHelpers = require2("../internals/regexp-sticky-helpers");
  13897. var proxyAccessor = require2("../internals/proxy-accessor");
  13898. var redefine = require2("../internals/redefine");
  13899. var fails = require2("../internals/fails");
  13900. var hasOwn = require2("../internals/has-own-property");
  13901. var enforceInternalState = require2("../internals/internal-state").enforce;
  13902. var setSpecies = require2("../internals/set-species");
  13903. var wellKnownSymbol = require2("../internals/well-known-symbol");
  13904. var UNSUPPORTED_DOT_ALL = require2("../internals/regexp-unsupported-dot-all");
  13905. var UNSUPPORTED_NCG = require2("../internals/regexp-unsupported-ncg");
  13906. var MATCH = wellKnownSymbol("match");
  13907. var NativeRegExp = global2.RegExp;
  13908. var RegExpPrototype = NativeRegExp.prototype;
  13909. var SyntaxError2 = global2.SyntaxError;
  13910. var exec = uncurryThis(RegExpPrototype.exec);
  13911. var charAt = uncurryThis("".charAt);
  13912. var replace = uncurryThis("".replace);
  13913. var stringIndexOf = uncurryThis("".indexOf);
  13914. var stringSlice = uncurryThis("".slice);
  13915. var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  13916. var re1 = /a/g;
  13917. var re2 = /a/g;
  13918. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  13919. var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
  13920. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  13921. var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function() {
  13922. re2[MATCH] = false;
  13923. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, "i") != "/a/i";
  13924. }));
  13925. var handleDotAll = function(string) {
  13926. var length = string.length;
  13927. var index2 = 0;
  13928. var result = "";
  13929. var brackets = false;
  13930. var chr;
  13931. for (; index2 <= length; index2++) {
  13932. chr = charAt(string, index2);
  13933. if (chr === "\\") {
  13934. result += chr + charAt(string, ++index2);
  13935. continue;
  13936. }
  13937. if (!brackets && chr === ".") {
  13938. result += "[\\s\\S]";
  13939. } else {
  13940. if (chr === "[") {
  13941. brackets = true;
  13942. } else if (chr === "]") {
  13943. brackets = false;
  13944. }
  13945. result += chr;
  13946. }
  13947. }
  13948. return result;
  13949. };
  13950. var handleNCG = function(string) {
  13951. var length = string.length;
  13952. var index2 = 0;
  13953. var result = "";
  13954. var named = [];
  13955. var names = {};
  13956. var brackets = false;
  13957. var ncg = false;
  13958. var groupid = 0;
  13959. var groupname = "";
  13960. var chr;
  13961. for (; index2 <= length; index2++) {
  13962. chr = charAt(string, index2);
  13963. if (chr === "\\") {
  13964. chr = chr + charAt(string, ++index2);
  13965. } else if (chr === "]") {
  13966. brackets = false;
  13967. } else if (!brackets)
  13968. switch (true) {
  13969. case chr === "[":
  13970. brackets = true;
  13971. break;
  13972. case chr === "(":
  13973. if (exec(IS_NCG, stringSlice(string, index2 + 1))) {
  13974. index2 += 2;
  13975. ncg = true;
  13976. }
  13977. result += chr;
  13978. groupid++;
  13979. continue;
  13980. case (chr === ">" && ncg):
  13981. if (groupname === "" || hasOwn(names, groupname)) {
  13982. throw new SyntaxError2("Invalid capture group name");
  13983. }
  13984. names[groupname] = true;
  13985. named[named.length] = [groupname, groupid];
  13986. ncg = false;
  13987. groupname = "";
  13988. continue;
  13989. }
  13990. if (ncg)
  13991. groupname += chr;
  13992. else
  13993. result += chr;
  13994. }
  13995. return [result, named];
  13996. };
  13997. if (isForced("RegExp", BASE_FORCED)) {
  13998. var RegExpWrapper = function RegExp2(pattern, flags) {
  13999. var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
  14000. var patternIsRegExp = isRegExp(pattern);
  14001. var flagsAreUndefined = flags === void 0;
  14002. var groups = [];
  14003. var rawPattern = pattern;
  14004. var rawFlags, dotAll, sticky, handled, result, state;
  14005. if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
  14006. return pattern;
  14007. }
  14008. if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
  14009. pattern = pattern.source;
  14010. if (flagsAreUndefined)
  14011. flags = getRegExpFlags(rawPattern);
  14012. }
  14013. pattern = pattern === void 0 ? "" : toString(pattern);
  14014. flags = flags === void 0 ? "" : toString(flags);
  14015. rawPattern = pattern;
  14016. if (UNSUPPORTED_DOT_ALL && "dotAll" in re1) {
  14017. dotAll = !!flags && stringIndexOf(flags, "s") > -1;
  14018. if (dotAll)
  14019. flags = replace(flags, /s/g, "");
  14020. }
  14021. rawFlags = flags;
  14022. if (MISSED_STICKY && "sticky" in re1) {
  14023. sticky = !!flags && stringIndexOf(flags, "y") > -1;
  14024. if (sticky && UNSUPPORTED_Y)
  14025. flags = replace(flags, /y/g, "");
  14026. }
  14027. if (UNSUPPORTED_NCG) {
  14028. handled = handleNCG(pattern);
  14029. pattern = handled[0];
  14030. groups = handled[1];
  14031. }
  14032. result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
  14033. if (dotAll || sticky || groups.length) {
  14034. state = enforceInternalState(result);
  14035. if (dotAll) {
  14036. state.dotAll = true;
  14037. state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
  14038. }
  14039. if (sticky)
  14040. state.sticky = true;
  14041. if (groups.length)
  14042. state.groups = groups;
  14043. }
  14044. if (pattern !== rawPattern)
  14045. try {
  14046. createNonEnumerableProperty(result, "source", rawPattern === "" ? "(?:)" : rawPattern);
  14047. } catch (error) {
  14048. }
  14049. return result;
  14050. };
  14051. for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index; ) {
  14052. proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
  14053. }
  14054. RegExpPrototype.constructor = RegExpWrapper;
  14055. RegExpWrapper.prototype = RegExpPrototype;
  14056. redefine(global2, "RegExp", RegExpWrapper);
  14057. }
  14058. setSpecies("RegExp");
  14059. }, { "../internals/create-non-enumerable-property": 129, "../internals/descriptors": 134, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/inherit-if-required": 171, "../internals/internal-state": 173, "../internals/is-forced": 178, "../internals/is-regexp": 182, "../internals/object-get-own-property-names": 201, "../internals/object-is-prototype-of": 204, "../internals/proxy-accessor": 219, "../internals/redefine": 222, "../internals/regexp-get-flags": 226, "../internals/regexp-sticky-helpers": 227, "../internals/regexp-unsupported-dot-all": 228, "../internals/regexp-unsupported-ncg": 229, "../internals/set-species": 233, "../internals/to-string": 256, "../internals/well-known-symbol": 268 }], 300: [function(require2, module3, exports3) {
  14060. "use strict";
  14061. var $ = require2("../internals/export");
  14062. var exec = require2("../internals/regexp-exec");
  14063. $({ target: "RegExp", proto: true, forced: /./.exec !== exec }, {
  14064. exec
  14065. });
  14066. }, { "../internals/export": 149, "../internals/regexp-exec": 224 }], 301: [function(require2, module3, exports3) {
  14067. "use strict";
  14068. var PROPER_FUNCTION_NAME = require2("../internals/function-name").PROPER;
  14069. var redefine = require2("../internals/redefine");
  14070. var anObject = require2("../internals/an-object");
  14071. var $toString = require2("../internals/to-string");
  14072. var fails = require2("../internals/fails");
  14073. var getRegExpFlags = require2("../internals/regexp-get-flags");
  14074. var TO_STRING = "toString";
  14075. var RegExpPrototype = RegExp.prototype;
  14076. var n$ToString = RegExpPrototype[TO_STRING];
  14077. var NOT_GENERIC = fails(function() {
  14078. return n$ToString.call({ source: "a", flags: "b" }) != "/a/b";
  14079. });
  14080. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  14081. if (NOT_GENERIC || INCORRECT_NAME) {
  14082. redefine(RegExp.prototype, TO_STRING, function toString() {
  14083. var R = anObject(this);
  14084. var pattern = $toString(R.source);
  14085. var flags = $toString(getRegExpFlags(R));
  14086. return "/" + pattern + "/" + flags;
  14087. }, { unsafe: true });
  14088. }
  14089. }, { "../internals/an-object": 101, "../internals/fails": 150, "../internals/function-name": 156, "../internals/redefine": 222, "../internals/regexp-get-flags": 226, "../internals/to-string": 256 }], 302: [function(require2, module3, exports3) {
  14090. "use strict";
  14091. var $ = require2("../internals/export");
  14092. var uncurryThis = require2("../internals/function-uncurry-this");
  14093. var notARegExp = require2("../internals/not-a-regexp");
  14094. var requireObjectCoercible = require2("../internals/require-object-coercible");
  14095. var toString = require2("../internals/to-string");
  14096. var correctIsRegExpLogic = require2("../internals/correct-is-regexp-logic");
  14097. var stringIndexOf = uncurryThis("".indexOf);
  14098. $({ target: "String", proto: true, forced: !correctIsRegExpLogic("includes") }, {
  14099. includes: function includes(searchString) {
  14100. return !!~stringIndexOf(
  14101. toString(requireObjectCoercible(this)),
  14102. toString(notARegExp(searchString)),
  14103. arguments.length > 1 ? arguments[1] : void 0
  14104. );
  14105. }
  14106. });
  14107. }, { "../internals/correct-is-regexp-logic": 126, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/not-a-regexp": 194, "../internals/require-object-coercible": 230, "../internals/to-string": 256 }], 303: [function(require2, module3, exports3) {
  14108. "use strict";
  14109. var charAt = require2("../internals/string-multibyte").charAt;
  14110. var toString = require2("../internals/to-string");
  14111. var InternalStateModule = require2("../internals/internal-state");
  14112. var defineIterator = require2("../internals/define-iterator");
  14113. var STRING_ITERATOR = "String Iterator";
  14114. var setInternalState = InternalStateModule.set;
  14115. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  14116. defineIterator(String, "String", function(iterated) {
  14117. setInternalState(this, {
  14118. type: STRING_ITERATOR,
  14119. string: toString(iterated),
  14120. index: 0
  14121. });
  14122. }, function next() {
  14123. var state = getInternalState(this);
  14124. var string = state.string;
  14125. var index = state.index;
  14126. var point;
  14127. if (index >= string.length)
  14128. return { value: void 0, done: true };
  14129. point = charAt(string, index);
  14130. state.index += point.length;
  14131. return { value: point, done: false };
  14132. });
  14133. }, { "../internals/define-iterator": 132, "../internals/internal-state": 173, "../internals/string-multibyte": 239, "../internals/to-string": 256 }], 304: [function(require2, module3, exports3) {
  14134. "use strict";
  14135. var call = require2("../internals/function-call");
  14136. var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
  14137. var anObject = require2("../internals/an-object");
  14138. var toLength = require2("../internals/to-length");
  14139. var toString = require2("../internals/to-string");
  14140. var requireObjectCoercible = require2("../internals/require-object-coercible");
  14141. var getMethod = require2("../internals/get-method");
  14142. var advanceStringIndex = require2("../internals/advance-string-index");
  14143. var regExpExec = require2("../internals/regexp-exec-abstract");
  14144. fixRegExpWellKnownSymbolLogic("match", function(MATCH, nativeMatch, maybeCallNative) {
  14145. return [
  14146. // `String.prototype.match` method
  14147. // https://tc39.es/ecma262/#sec-string.prototype.match
  14148. function match(regexp) {
  14149. var O = requireObjectCoercible(this);
  14150. var matcher = regexp == void 0 ? void 0 : getMethod(regexp, MATCH);
  14151. return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
  14152. },
  14153. // `RegExp.prototype[@@match]` method
  14154. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  14155. function(string) {
  14156. var rx = anObject(this);
  14157. var S = toString(string);
  14158. var res = maybeCallNative(nativeMatch, rx, S);
  14159. if (res.done)
  14160. return res.value;
  14161. if (!rx.global)
  14162. return regExpExec(rx, S);
  14163. var fullUnicode = rx.unicode;
  14164. rx.lastIndex = 0;
  14165. var A = [];
  14166. var n = 0;
  14167. var result;
  14168. while ((result = regExpExec(rx, S)) !== null) {
  14169. var matchStr = toString(result[0]);
  14170. A[n] = matchStr;
  14171. if (matchStr === "")
  14172. rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  14173. n++;
  14174. }
  14175. return n === 0 ? null : A;
  14176. }
  14177. ];
  14178. });
  14179. }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-call": 155, "../internals/get-method": 161, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/to-length": 249, "../internals/to-string": 256 }], 305: [function(require2, module3, exports3) {
  14180. "use strict";
  14181. var apply = require2("../internals/function-apply");
  14182. var call = require2("../internals/function-call");
  14183. var uncurryThis = require2("../internals/function-uncurry-this");
  14184. var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
  14185. var fails = require2("../internals/fails");
  14186. var anObject = require2("../internals/an-object");
  14187. var isCallable = require2("../internals/is-callable");
  14188. var toIntegerOrInfinity = require2("../internals/to-integer-or-infinity");
  14189. var toLength = require2("../internals/to-length");
  14190. var toString = require2("../internals/to-string");
  14191. var requireObjectCoercible = require2("../internals/require-object-coercible");
  14192. var advanceStringIndex = require2("../internals/advance-string-index");
  14193. var getMethod = require2("../internals/get-method");
  14194. var getSubstitution = require2("../internals/get-substitution");
  14195. var regExpExec = require2("../internals/regexp-exec-abstract");
  14196. var wellKnownSymbol = require2("../internals/well-known-symbol");
  14197. var REPLACE = wellKnownSymbol("replace");
  14198. var max = Math.max;
  14199. var min = Math.min;
  14200. var concat = uncurryThis([].concat);
  14201. var push = uncurryThis([].push);
  14202. var stringIndexOf = uncurryThis("".indexOf);
  14203. var stringSlice = uncurryThis("".slice);
  14204. var maybeToString = function(it) {
  14205. return it === void 0 ? it : String(it);
  14206. };
  14207. var REPLACE_KEEPS_$0 = function() {
  14208. return "a".replace(/./, "$0") === "$0";
  14209. }();
  14210. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
  14211. if (/./[REPLACE]) {
  14212. return /./[REPLACE]("a", "$0") === "";
  14213. }
  14214. return false;
  14215. }();
  14216. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
  14217. var re = /./;
  14218. re.exec = function() {
  14219. var result = [];
  14220. result.groups = { a: "7" };
  14221. return result;
  14222. };
  14223. return "".replace(re, "$<a>") !== "7";
  14224. });
  14225. fixRegExpWellKnownSymbolLogic("replace", function(_, nativeReplace, maybeCallNative) {
  14226. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
  14227. return [
  14228. // `String.prototype.replace` method
  14229. // https://tc39.es/ecma262/#sec-string.prototype.replace
  14230. function replace(searchValue, replaceValue) {
  14231. var O = requireObjectCoercible(this);
  14232. var replacer = searchValue == void 0 ? void 0 : getMethod(searchValue, REPLACE);
  14233. return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue);
  14234. },
  14235. // `RegExp.prototype[@@replace]` method
  14236. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  14237. function(string, replaceValue) {
  14238. var rx = anObject(this);
  14239. var S = toString(string);
  14240. if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
  14241. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  14242. if (res.done)
  14243. return res.value;
  14244. }
  14245. var functionalReplace = isCallable(replaceValue);
  14246. if (!functionalReplace)
  14247. replaceValue = toString(replaceValue);
  14248. var global2 = rx.global;
  14249. if (global2) {
  14250. var fullUnicode = rx.unicode;
  14251. rx.lastIndex = 0;
  14252. }
  14253. var results = [];
  14254. while (true) {
  14255. var result = regExpExec(rx, S);
  14256. if (result === null)
  14257. break;
  14258. push(results, result);
  14259. if (!global2)
  14260. break;
  14261. var matchStr = toString(result[0]);
  14262. if (matchStr === "")
  14263. rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  14264. }
  14265. var accumulatedResult = "";
  14266. var nextSourcePosition = 0;
  14267. for (var i = 0; i < results.length; i++) {
  14268. result = results[i];
  14269. var matched = toString(result[0]);
  14270. var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
  14271. var captures = [];
  14272. for (var j = 1; j < result.length; j++)
  14273. push(captures, maybeToString(result[j]));
  14274. var namedCaptures = result.groups;
  14275. if (functionalReplace) {
  14276. var replacerArgs = concat([matched], captures, position, S);
  14277. if (namedCaptures !== void 0)
  14278. push(replacerArgs, namedCaptures);
  14279. var replacement = toString(apply(replaceValue, void 0, replacerArgs));
  14280. } else {
  14281. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  14282. }
  14283. if (position >= nextSourcePosition) {
  14284. accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
  14285. nextSourcePosition = position + matched.length;
  14286. }
  14287. }
  14288. return accumulatedResult + stringSlice(S, nextSourcePosition);
  14289. }
  14290. ];
  14291. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  14292. }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/fails": 150, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-method": 161, "../internals/get-substitution": 162, "../internals/is-callable": 176, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/to-integer-or-infinity": 248, "../internals/to-length": 249, "../internals/to-string": 256, "../internals/well-known-symbol": 268 }], 306: [function(require2, module3, exports3) {
  14293. "use strict";
  14294. var call = require2("../internals/function-call");
  14295. var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
  14296. var anObject = require2("../internals/an-object");
  14297. var requireObjectCoercible = require2("../internals/require-object-coercible");
  14298. var sameValue = require2("../internals/same-value");
  14299. var toString = require2("../internals/to-string");
  14300. var getMethod = require2("../internals/get-method");
  14301. var regExpExec = require2("../internals/regexp-exec-abstract");
  14302. fixRegExpWellKnownSymbolLogic("search", function(SEARCH, nativeSearch, maybeCallNative) {
  14303. return [
  14304. // `String.prototype.search` method
  14305. // https://tc39.es/ecma262/#sec-string.prototype.search
  14306. function search(regexp) {
  14307. var O = requireObjectCoercible(this);
  14308. var searcher = regexp == void 0 ? void 0 : getMethod(regexp, SEARCH);
  14309. return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
  14310. },
  14311. // `RegExp.prototype[@@search]` method
  14312. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  14313. function(string) {
  14314. var rx = anObject(this);
  14315. var S = toString(string);
  14316. var res = maybeCallNative(nativeSearch, rx, S);
  14317. if (res.done)
  14318. return res.value;
  14319. var previousLastIndex = rx.lastIndex;
  14320. if (!sameValue(previousLastIndex, 0))
  14321. rx.lastIndex = 0;
  14322. var result = regExpExec(rx, S);
  14323. if (!sameValue(rx.lastIndex, previousLastIndex))
  14324. rx.lastIndex = previousLastIndex;
  14325. return result === null ? -1 : result.index;
  14326. }
  14327. ];
  14328. });
  14329. }, { "../internals/an-object": 101, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-call": 155, "../internals/get-method": 161, "../internals/regexp-exec-abstract": 223, "../internals/require-object-coercible": 230, "../internals/same-value": 231, "../internals/to-string": 256 }], 307: [function(require2, module3, exports3) {
  14330. "use strict";
  14331. var apply = require2("../internals/function-apply");
  14332. var call = require2("../internals/function-call");
  14333. var uncurryThis = require2("../internals/function-uncurry-this");
  14334. var fixRegExpWellKnownSymbolLogic = require2("../internals/fix-regexp-well-known-symbol-logic");
  14335. var isRegExp = require2("../internals/is-regexp");
  14336. var anObject = require2("../internals/an-object");
  14337. var requireObjectCoercible = require2("../internals/require-object-coercible");
  14338. var speciesConstructor = require2("../internals/species-constructor");
  14339. var advanceStringIndex = require2("../internals/advance-string-index");
  14340. var toLength = require2("../internals/to-length");
  14341. var toString = require2("../internals/to-string");
  14342. var getMethod = require2("../internals/get-method");
  14343. var arraySlice = require2("../internals/array-slice-simple");
  14344. var callRegExpExec = require2("../internals/regexp-exec-abstract");
  14345. var regexpExec = require2("../internals/regexp-exec");
  14346. var stickyHelpers = require2("../internals/regexp-sticky-helpers");
  14347. var fails = require2("../internals/fails");
  14348. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  14349. var MAX_UINT32 = 4294967295;
  14350. var min = Math.min;
  14351. var $push = [].push;
  14352. var exec = uncurryThis(/./.exec);
  14353. var push = uncurryThis($push);
  14354. var stringSlice = uncurryThis("".slice);
  14355. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function() {
  14356. var re = /(?:)/;
  14357. var originalExec = re.exec;
  14358. re.exec = function() {
  14359. return originalExec.apply(this, arguments);
  14360. };
  14361. var result = "ab".split(re);
  14362. return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
  14363. });
  14364. fixRegExpWellKnownSymbolLogic("split", function(SPLIT, nativeSplit, maybeCallNative) {
  14365. var internalSplit;
  14366. if ("abbc".split(/(b)*/)[1] == "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
  14367. "test".split(/(?:)/, -1).length != 4 || "ab".split(/(?:ab)*/).length != 2 || ".".split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  14368. ".".split(/()()/).length > 1 || "".split(/.?/).length) {
  14369. internalSplit = function(separator, limit) {
  14370. var string = toString(requireObjectCoercible(this));
  14371. var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
  14372. if (lim === 0)
  14373. return [];
  14374. if (separator === void 0)
  14375. return [string];
  14376. if (!isRegExp(separator)) {
  14377. return call(nativeSplit, string, separator, lim);
  14378. }
  14379. var output = [];
  14380. var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : "");
  14381. var lastLastIndex = 0;
  14382. var separatorCopy = new RegExp(separator.source, flags + "g");
  14383. var match, lastIndex, lastLength;
  14384. while (match = call(regexpExec, separatorCopy, string)) {
  14385. lastIndex = separatorCopy.lastIndex;
  14386. if (lastIndex > lastLastIndex) {
  14387. push(output, stringSlice(string, lastLastIndex, match.index));
  14388. if (match.length > 1 && match.index < string.length)
  14389. apply($push, output, arraySlice(match, 1));
  14390. lastLength = match[0].length;
  14391. lastLastIndex = lastIndex;
  14392. if (output.length >= lim)
  14393. break;
  14394. }
  14395. if (separatorCopy.lastIndex === match.index)
  14396. separatorCopy.lastIndex++;
  14397. }
  14398. if (lastLastIndex === string.length) {
  14399. if (lastLength || !exec(separatorCopy, ""))
  14400. push(output, "");
  14401. } else
  14402. push(output, stringSlice(string, lastLastIndex));
  14403. return output.length > lim ? arraySlice(output, 0, lim) : output;
  14404. };
  14405. } else if ("0".split(void 0, 0).length) {
  14406. internalSplit = function(separator, limit) {
  14407. return separator === void 0 && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
  14408. };
  14409. } else
  14410. internalSplit = nativeSplit;
  14411. return [
  14412. // `String.prototype.split` method
  14413. // https://tc39.es/ecma262/#sec-string.prototype.split
  14414. function split(separator, limit) {
  14415. var O = requireObjectCoercible(this);
  14416. var splitter = separator == void 0 ? void 0 : getMethod(separator, SPLIT);
  14417. return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit);
  14418. },
  14419. // `RegExp.prototype[@@split]` method
  14420. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  14421. //
  14422. // NOTE: This cannot be properly polyfilled in engines that don't support
  14423. // the 'y' flag.
  14424. function(string, limit) {
  14425. var rx = anObject(this);
  14426. var S = toString(string);
  14427. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  14428. if (res.done)
  14429. return res.value;
  14430. var C = speciesConstructor(rx, RegExp);
  14431. var unicodeMatching = rx.unicode;
  14432. var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
  14433. var splitter = new C(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
  14434. var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
  14435. if (lim === 0)
  14436. return [];
  14437. if (S.length === 0)
  14438. return callRegExpExec(splitter, S) === null ? [S] : [];
  14439. var p = 0;
  14440. var q = 0;
  14441. var A = [];
  14442. while (q < S.length) {
  14443. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  14444. var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  14445. var e;
  14446. if (z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p) {
  14447. q = advanceStringIndex(S, q, unicodeMatching);
  14448. } else {
  14449. push(A, stringSlice(S, p, q));
  14450. if (A.length === lim)
  14451. return A;
  14452. for (var i = 1; i <= z.length - 1; i++) {
  14453. push(A, z[i]);
  14454. if (A.length === lim)
  14455. return A;
  14456. }
  14457. q = p = e;
  14458. }
  14459. }
  14460. push(A, stringSlice(S, p));
  14461. return A;
  14462. }
  14463. ];
  14464. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  14465. }, { "../internals/advance-string-index": 99, "../internals/an-object": 101, "../internals/array-slice-simple": 116, "../internals/fails": 150, "../internals/fix-regexp-well-known-symbol-logic": 151, "../internals/function-apply": 152, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/get-method": 161, "../internals/is-regexp": 182, "../internals/regexp-exec": 224, "../internals/regexp-exec-abstract": 223, "../internals/regexp-sticky-helpers": 227, "../internals/require-object-coercible": 230, "../internals/species-constructor": 238, "../internals/to-length": 249, "../internals/to-string": 256 }], 308: [function(require2, module3, exports3) {
  14466. "use strict";
  14467. var $ = require2("../internals/export");
  14468. var $trim = require2("../internals/string-trim").trim;
  14469. var forcedStringTrimMethod = require2("../internals/string-trim-forced");
  14470. $({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
  14471. trim: function trim() {
  14472. return $trim(this);
  14473. }
  14474. });
  14475. }, { "../internals/export": 149, "../internals/string-trim": 241, "../internals/string-trim-forced": 240 }], 309: [function(require2, module3, exports3) {
  14476. "use strict";
  14477. var $ = require2("../internals/export");
  14478. var global2 = require2("../internals/global");
  14479. var call = require2("../internals/function-call");
  14480. var uncurryThis = require2("../internals/function-uncurry-this");
  14481. var IS_PURE = require2("../internals/is-pure");
  14482. var DESCRIPTORS = require2("../internals/descriptors");
  14483. var NATIVE_SYMBOL = require2("../internals/native-symbol");
  14484. var fails = require2("../internals/fails");
  14485. var hasOwn = require2("../internals/has-own-property");
  14486. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  14487. var anObject = require2("../internals/an-object");
  14488. var toIndexedObject = require2("../internals/to-indexed-object");
  14489. var toPropertyKey = require2("../internals/to-property-key");
  14490. var $toString = require2("../internals/to-string");
  14491. var createPropertyDescriptor = require2("../internals/create-property-descriptor");
  14492. var nativeObjectCreate = require2("../internals/object-create");
  14493. var objectKeys = require2("../internals/object-keys");
  14494. var getOwnPropertyNamesModule = require2("../internals/object-get-own-property-names");
  14495. var getOwnPropertyNamesExternal = require2("../internals/object-get-own-property-names-external");
  14496. var getOwnPropertySymbolsModule = require2("../internals/object-get-own-property-symbols");
  14497. var getOwnPropertyDescriptorModule = require2("../internals/object-get-own-property-descriptor");
  14498. var definePropertyModule = require2("../internals/object-define-property");
  14499. var definePropertiesModule = require2("../internals/object-define-properties");
  14500. var propertyIsEnumerableModule = require2("../internals/object-property-is-enumerable");
  14501. var redefine = require2("../internals/redefine");
  14502. var shared = require2("../internals/shared");
  14503. var sharedKey = require2("../internals/shared-key");
  14504. var hiddenKeys = require2("../internals/hidden-keys");
  14505. var uid = require2("../internals/uid");
  14506. var wellKnownSymbol = require2("../internals/well-known-symbol");
  14507. var wrappedWellKnownSymbolModule = require2("../internals/well-known-symbol-wrapped");
  14508. var defineWellKnownSymbol = require2("../internals/define-well-known-symbol");
  14509. var defineSymbolToPrimitive = require2("../internals/symbol-define-to-primitive");
  14510. var setToStringTag = require2("../internals/set-to-string-tag");
  14511. var InternalStateModule = require2("../internals/internal-state");
  14512. var $forEach = require2("../internals/array-iteration").forEach;
  14513. var HIDDEN = sharedKey("hidden");
  14514. var SYMBOL = "Symbol";
  14515. var PROTOTYPE = "prototype";
  14516. var setInternalState = InternalStateModule.set;
  14517. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  14518. var ObjectPrototype = Object[PROTOTYPE];
  14519. var $Symbol = global2.Symbol;
  14520. var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
  14521. var TypeError2 = global2.TypeError;
  14522. var QObject = global2.QObject;
  14523. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  14524. var nativeDefineProperty = definePropertyModule.f;
  14525. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  14526. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  14527. var push = uncurryThis([].push);
  14528. var AllSymbols = shared("symbols");
  14529. var ObjectPrototypeSymbols = shared("op-symbols");
  14530. var WellKnownSymbolsStore = shared("wks");
  14531. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  14532. var setSymbolDescriptor = DESCRIPTORS && fails(function() {
  14533. return nativeObjectCreate(nativeDefineProperty({}, "a", {
  14534. get: function() {
  14535. return nativeDefineProperty(this, "a", { value: 7 }).a;
  14536. }
  14537. })).a != 7;
  14538. }) ? function(O, P, Attributes) {
  14539. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  14540. if (ObjectPrototypeDescriptor)
  14541. delete ObjectPrototype[P];
  14542. nativeDefineProperty(O, P, Attributes);
  14543. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  14544. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  14545. }
  14546. } : nativeDefineProperty;
  14547. var wrap = function(tag, description) {
  14548. var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
  14549. setInternalState(symbol, {
  14550. type: SYMBOL,
  14551. tag,
  14552. description
  14553. });
  14554. if (!DESCRIPTORS)
  14555. symbol.description = description;
  14556. return symbol;
  14557. };
  14558. var $defineProperty = function defineProperty(O, P, Attributes) {
  14559. if (O === ObjectPrototype)
  14560. $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  14561. anObject(O);
  14562. var key = toPropertyKey(P);
  14563. anObject(Attributes);
  14564. if (hasOwn(AllSymbols, key)) {
  14565. if (!Attributes.enumerable) {
  14566. if (!hasOwn(O, HIDDEN))
  14567. nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  14568. O[HIDDEN][key] = true;
  14569. } else {
  14570. if (hasOwn(O, HIDDEN) && O[HIDDEN][key])
  14571. O[HIDDEN][key] = false;
  14572. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  14573. }
  14574. return setSymbolDescriptor(O, key, Attributes);
  14575. }
  14576. return nativeDefineProperty(O, key, Attributes);
  14577. };
  14578. var $defineProperties = function defineProperties(O, Properties) {
  14579. anObject(O);
  14580. var properties = toIndexedObject(Properties);
  14581. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  14582. $forEach(keys, function(key) {
  14583. if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key))
  14584. $defineProperty(O, key, properties[key]);
  14585. });
  14586. return O;
  14587. };
  14588. var $create = function create(O, Properties) {
  14589. return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  14590. };
  14591. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  14592. var P = toPropertyKey(V);
  14593. var enumerable = call(nativePropertyIsEnumerable, this, P);
  14594. if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P))
  14595. return false;
  14596. return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  14597. };
  14598. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  14599. var it = toIndexedObject(O);
  14600. var key = toPropertyKey(P);
  14601. if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key))
  14602. return;
  14603. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  14604. if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
  14605. descriptor.enumerable = true;
  14606. }
  14607. return descriptor;
  14608. };
  14609. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  14610. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  14611. var result = [];
  14612. $forEach(names, function(key) {
  14613. if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key))
  14614. push(result, key);
  14615. });
  14616. return result;
  14617. };
  14618. var $getOwnPropertySymbols = function(O) {
  14619. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  14620. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  14621. var result = [];
  14622. $forEach(names, function(key) {
  14623. if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
  14624. push(result, AllSymbols[key]);
  14625. }
  14626. });
  14627. return result;
  14628. };
  14629. if (!NATIVE_SYMBOL) {
  14630. $Symbol = function Symbol2() {
  14631. if (isPrototypeOf(SymbolPrototype, this))
  14632. throw TypeError2("Symbol is not a constructor");
  14633. var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]);
  14634. var tag = uid(description);
  14635. var setter = function(value) {
  14636. if (this === ObjectPrototype)
  14637. call(setter, ObjectPrototypeSymbols, value);
  14638. if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag))
  14639. this[HIDDEN][tag] = false;
  14640. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  14641. };
  14642. if (DESCRIPTORS && USE_SETTER)
  14643. setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  14644. return wrap(tag, description);
  14645. };
  14646. SymbolPrototype = $Symbol[PROTOTYPE];
  14647. redefine(SymbolPrototype, "toString", function toString() {
  14648. return getInternalState(this).tag;
  14649. });
  14650. redefine($Symbol, "withoutSetter", function(description) {
  14651. return wrap(uid(description), description);
  14652. });
  14653. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  14654. definePropertyModule.f = $defineProperty;
  14655. definePropertiesModule.f = $defineProperties;
  14656. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  14657. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  14658. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  14659. wrappedWellKnownSymbolModule.f = function(name) {
  14660. return wrap(wellKnownSymbol(name), name);
  14661. };
  14662. if (DESCRIPTORS) {
  14663. nativeDefineProperty(SymbolPrototype, "description", {
  14664. configurable: true,
  14665. get: function description() {
  14666. return getInternalState(this).description;
  14667. }
  14668. });
  14669. if (!IS_PURE) {
  14670. redefine(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
  14671. }
  14672. }
  14673. }
  14674. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  14675. Symbol: $Symbol
  14676. });
  14677. $forEach(objectKeys(WellKnownSymbolsStore), function(name) {
  14678. defineWellKnownSymbol(name);
  14679. });
  14680. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  14681. useSetter: function() {
  14682. USE_SETTER = true;
  14683. },
  14684. useSimple: function() {
  14685. USE_SETTER = false;
  14686. }
  14687. });
  14688. $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  14689. // `Object.create` method
  14690. // https://tc39.es/ecma262/#sec-object.create
  14691. create: $create,
  14692. // `Object.defineProperty` method
  14693. // https://tc39.es/ecma262/#sec-object.defineproperty
  14694. defineProperty: $defineProperty,
  14695. // `Object.defineProperties` method
  14696. // https://tc39.es/ecma262/#sec-object.defineproperties
  14697. defineProperties: $defineProperties,
  14698. // `Object.getOwnPropertyDescriptor` method
  14699. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  14700. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  14701. });
  14702. $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
  14703. // `Object.getOwnPropertyNames` method
  14704. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  14705. getOwnPropertyNames: $getOwnPropertyNames
  14706. });
  14707. defineSymbolToPrimitive();
  14708. setToStringTag($Symbol, SYMBOL);
  14709. hiddenKeys[HIDDEN] = true;
  14710. }, { "../internals/an-object": 101, "../internals/array-iteration": 111, "../internals/create-property-descriptor": 130, "../internals/define-well-known-symbol": 133, "../internals/descriptors": 134, "../internals/export": 149, "../internals/fails": 150, "../internals/function-call": 155, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/hidden-keys": 165, "../internals/internal-state": 173, "../internals/is-pure": 181, "../internals/native-symbol": 191, "../internals/object-create": 196, "../internals/object-define-properties": 197, "../internals/object-define-property": 198, "../internals/object-get-own-property-descriptor": 199, "../internals/object-get-own-property-names": 201, "../internals/object-get-own-property-names-external": 200, "../internals/object-get-own-property-symbols": 202, "../internals/object-is-prototype-of": 204, "../internals/object-keys": 206, "../internals/object-property-is-enumerable": 207, "../internals/redefine": 222, "../internals/set-to-string-tag": 234, "../internals/shared": 237, "../internals/shared-key": 235, "../internals/symbol-define-to-primitive": 242, "../internals/to-indexed-object": 247, "../internals/to-property-key": 254, "../internals/to-string": 256, "../internals/uid": 263, "../internals/well-known-symbol": 268, "../internals/well-known-symbol-wrapped": 267 }], 310: [function(require2, module3, exports3) {
  14711. "use strict";
  14712. var $ = require2("../internals/export");
  14713. var DESCRIPTORS = require2("../internals/descriptors");
  14714. var global2 = require2("../internals/global");
  14715. var uncurryThis = require2("../internals/function-uncurry-this");
  14716. var hasOwn = require2("../internals/has-own-property");
  14717. var isCallable = require2("../internals/is-callable");
  14718. var isPrototypeOf = require2("../internals/object-is-prototype-of");
  14719. var toString = require2("../internals/to-string");
  14720. var defineProperty = require2("../internals/object-define-property").f;
  14721. var copyConstructorProperties = require2("../internals/copy-constructor-properties");
  14722. var NativeSymbol = global2.Symbol;
  14723. var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
  14724. if (DESCRIPTORS && isCallable(NativeSymbol) && (!("description" in SymbolPrototype) || // Safari 12 bug
  14725. NativeSymbol().description !== void 0)) {
  14726. var EmptyStringDescriptionStore = {};
  14727. var SymbolWrapper = function Symbol2() {
  14728. var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : toString(arguments[0]);
  14729. var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
  14730. if (description === "")
  14731. EmptyStringDescriptionStore[result] = true;
  14732. return result;
  14733. };
  14734. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  14735. SymbolWrapper.prototype = SymbolPrototype;
  14736. SymbolPrototype.constructor = SymbolWrapper;
  14737. var NATIVE_SYMBOL = String(NativeSymbol("test")) == "Symbol(test)";
  14738. var symbolToString = uncurryThis(SymbolPrototype.toString);
  14739. var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
  14740. var regexp = /^Symbol\((.*)\)[^)]+$/;
  14741. var replace = uncurryThis("".replace);
  14742. var stringSlice = uncurryThis("".slice);
  14743. defineProperty(SymbolPrototype, "description", {
  14744. configurable: true,
  14745. get: function description() {
  14746. var symbol = symbolValueOf(this);
  14747. var string = symbolToString(symbol);
  14748. if (hasOwn(EmptyStringDescriptionStore, symbol))
  14749. return "";
  14750. var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, "$1");
  14751. return desc === "" ? void 0 : desc;
  14752. }
  14753. });
  14754. $({ global: true, forced: true }, {
  14755. Symbol: SymbolWrapper
  14756. });
  14757. }
  14758. }, { "../internals/copy-constructor-properties": 125, "../internals/descriptors": 134, "../internals/export": 149, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/has-own-property": 164, "../internals/is-callable": 176, "../internals/object-define-property": 198, "../internals/object-is-prototype-of": 204, "../internals/to-string": 256 }], 311: [function(require2, module3, exports3) {
  14759. var $ = require2("../internals/export");
  14760. var getBuiltIn = require2("../internals/get-built-in");
  14761. var hasOwn = require2("../internals/has-own-property");
  14762. var toString = require2("../internals/to-string");
  14763. var shared = require2("../internals/shared");
  14764. var NATIVE_SYMBOL_REGISTRY = require2("../internals/native-symbol-registry");
  14765. var StringToSymbolRegistry = shared("string-to-symbol-registry");
  14766. var SymbolToStringRegistry = shared("symbol-to-string-registry");
  14767. $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
  14768. "for": function(key) {
  14769. var string = toString(key);
  14770. if (hasOwn(StringToSymbolRegistry, string))
  14771. return StringToSymbolRegistry[string];
  14772. var symbol = getBuiltIn("Symbol")(string);
  14773. StringToSymbolRegistry[string] = symbol;
  14774. SymbolToStringRegistry[symbol] = string;
  14775. return symbol;
  14776. }
  14777. });
  14778. }, { "../internals/export": 149, "../internals/get-built-in": 158, "../internals/has-own-property": 164, "../internals/native-symbol-registry": 190, "../internals/shared": 237, "../internals/to-string": 256 }], 312: [function(require2, module3, exports3) {
  14779. var defineWellKnownSymbol = require2("../internals/define-well-known-symbol");
  14780. defineWellKnownSymbol("iterator");
  14781. }, { "../internals/define-well-known-symbol": 133 }], 313: [function(require2, module3, exports3) {
  14782. require2("../modules/es.symbol.constructor");
  14783. require2("../modules/es.symbol.for");
  14784. require2("../modules/es.symbol.key-for");
  14785. require2("../modules/es.json.stringify");
  14786. require2("../modules/es.object.get-own-property-symbols");
  14787. }, { "../modules/es.json.stringify": 285, "../modules/es.object.get-own-property-symbols": 289, "../modules/es.symbol.constructor": 309, "../modules/es.symbol.for": 311, "../modules/es.symbol.key-for": 314 }], 314: [function(require2, module3, exports3) {
  14788. var $ = require2("../internals/export");
  14789. var hasOwn = require2("../internals/has-own-property");
  14790. var isSymbol = require2("../internals/is-symbol");
  14791. var tryToString = require2("../internals/try-to-string");
  14792. var shared = require2("../internals/shared");
  14793. var NATIVE_SYMBOL_REGISTRY = require2("../internals/native-symbol-registry");
  14794. var SymbolToStringRegistry = shared("symbol-to-string-registry");
  14795. $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
  14796. keyFor: function keyFor(sym) {
  14797. if (!isSymbol(sym))
  14798. throw TypeError(tryToString(sym) + " is not a symbol");
  14799. if (hasOwn(SymbolToStringRegistry, sym))
  14800. return SymbolToStringRegistry[sym];
  14801. }
  14802. });
  14803. }, { "../internals/export": 149, "../internals/has-own-property": 164, "../internals/is-symbol": 183, "../internals/native-symbol-registry": 190, "../internals/shared": 237, "../internals/try-to-string": 257 }], 315: [function(require2, module3, exports3) {
  14804. "use strict";
  14805. var uncurryThis = require2("../internals/function-uncurry-this");
  14806. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14807. var $ArrayCopyWithin = require2("../internals/array-copy-within");
  14808. var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
  14809. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14810. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14811. exportTypedArrayMethod("copyWithin", function copyWithin(target, start) {
  14812. return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : void 0);
  14813. });
  14814. }, { "../internals/array-buffer-view-core": 103, "../internals/array-copy-within": 105, "../internals/function-uncurry-this": 157 }], 316: [function(require2, module3, exports3) {
  14815. "use strict";
  14816. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14817. var $every = require2("../internals/array-iteration").every;
  14818. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14819. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14820. exportTypedArrayMethod("every", function every(callbackfn) {
  14821. return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  14822. });
  14823. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 317: [function(require2, module3, exports3) {
  14824. "use strict";
  14825. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14826. var call = require2("../internals/function-call");
  14827. var $fill = require2("../internals/array-fill");
  14828. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14829. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14830. exportTypedArrayMethod("fill", function fill(value) {
  14831. var length = arguments.length;
  14832. return call(
  14833. $fill,
  14834. aTypedArray(this),
  14835. value,
  14836. length > 1 ? arguments[1] : void 0,
  14837. length > 2 ? arguments[2] : void 0
  14838. );
  14839. });
  14840. }, { "../internals/array-buffer-view-core": 103, "../internals/array-fill": 106, "../internals/function-call": 155 }], 318: [function(require2, module3, exports3) {
  14841. "use strict";
  14842. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14843. var $filter = require2("../internals/array-iteration").filter;
  14844. var fromSpeciesAndList = require2("../internals/typed-array-from-species-and-list");
  14845. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14846. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14847. exportTypedArrayMethod("filter", function filter(callbackfn) {
  14848. var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  14849. return fromSpeciesAndList(this, list);
  14850. });
  14851. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/typed-array-from-species-and-list": 260 }], 319: [function(require2, module3, exports3) {
  14852. "use strict";
  14853. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14854. var $findIndex = require2("../internals/array-iteration").findIndex;
  14855. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14856. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14857. exportTypedArrayMethod("findIndex", function findIndex(predicate) {
  14858. return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
  14859. });
  14860. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 320: [function(require2, module3, exports3) {
  14861. "use strict";
  14862. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14863. var $find = require2("../internals/array-iteration").find;
  14864. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14865. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14866. exportTypedArrayMethod("find", function find(predicate) {
  14867. return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
  14868. });
  14869. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 321: [function(require2, module3, exports3) {
  14870. "use strict";
  14871. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14872. var $forEach = require2("../internals/array-iteration").forEach;
  14873. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14874. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14875. exportTypedArrayMethod("forEach", function forEach(callbackfn) {
  14876. $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  14877. });
  14878. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 322: [function(require2, module3, exports3) {
  14879. "use strict";
  14880. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14881. var $includes = require2("../internals/array-includes").includes;
  14882. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14883. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14884. exportTypedArrayMethod("includes", function includes(searchElement) {
  14885. return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
  14886. });
  14887. }, { "../internals/array-buffer-view-core": 103, "../internals/array-includes": 110 }], 323: [function(require2, module3, exports3) {
  14888. "use strict";
  14889. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14890. var $indexOf = require2("../internals/array-includes").indexOf;
  14891. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14892. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14893. exportTypedArrayMethod("indexOf", function indexOf(searchElement) {
  14894. return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
  14895. });
  14896. }, { "../internals/array-buffer-view-core": 103, "../internals/array-includes": 110 }], 324: [function(require2, module3, exports3) {
  14897. "use strict";
  14898. var global2 = require2("../internals/global");
  14899. var fails = require2("../internals/fails");
  14900. var uncurryThis = require2("../internals/function-uncurry-this");
  14901. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14902. var ArrayIterators = require2("../modules/es.array.iterator");
  14903. var wellKnownSymbol = require2("../internals/well-known-symbol");
  14904. var ITERATOR = wellKnownSymbol("iterator");
  14905. var Uint8Array2 = global2.Uint8Array;
  14906. var arrayValues = uncurryThis(ArrayIterators.values);
  14907. var arrayKeys = uncurryThis(ArrayIterators.keys);
  14908. var arrayEntries = uncurryThis(ArrayIterators.entries);
  14909. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14910. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14911. var TypedArrayPrototype = Uint8Array2 && Uint8Array2.prototype;
  14912. var GENERIC = !fails(function() {
  14913. TypedArrayPrototype[ITERATOR].call([1]);
  14914. });
  14915. var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === "values";
  14916. var typedArrayValues = function values() {
  14917. return arrayValues(aTypedArray(this));
  14918. };
  14919. exportTypedArrayMethod("entries", function entries() {
  14920. return arrayEntries(aTypedArray(this));
  14921. }, GENERIC);
  14922. exportTypedArrayMethod("keys", function keys() {
  14923. return arrayKeys(aTypedArray(this));
  14924. }, GENERIC);
  14925. exportTypedArrayMethod("values", typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
  14926. exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
  14927. }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163, "../internals/well-known-symbol": 268, "../modules/es.array.iterator": 278 }], 325: [function(require2, module3, exports3) {
  14928. "use strict";
  14929. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14930. var uncurryThis = require2("../internals/function-uncurry-this");
  14931. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14932. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14933. var $join = uncurryThis([].join);
  14934. exportTypedArrayMethod("join", function join(separator) {
  14935. return $join(aTypedArray(this), separator);
  14936. });
  14937. }, { "../internals/array-buffer-view-core": 103, "../internals/function-uncurry-this": 157 }], 326: [function(require2, module3, exports3) {
  14938. "use strict";
  14939. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14940. var apply = require2("../internals/function-apply");
  14941. var $lastIndexOf = require2("../internals/array-last-index-of");
  14942. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14943. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14944. exportTypedArrayMethod("lastIndexOf", function lastIndexOf(searchElement) {
  14945. var length = arguments.length;
  14946. return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
  14947. });
  14948. }, { "../internals/array-buffer-view-core": 103, "../internals/array-last-index-of": 112, "../internals/function-apply": 152 }], 327: [function(require2, module3, exports3) {
  14949. "use strict";
  14950. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14951. var $map = require2("../internals/array-iteration").map;
  14952. var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
  14953. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14954. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14955. exportTypedArrayMethod("map", function map(mapfn) {
  14956. return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : void 0, function(O, length) {
  14957. return new (typedArraySpeciesConstructor(O))(length);
  14958. });
  14959. });
  14960. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111, "../internals/typed-array-species-constructor": 262 }], 328: [function(require2, module3, exports3) {
  14961. "use strict";
  14962. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14963. var $reduceRight = require2("../internals/array-reduce").right;
  14964. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14965. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14966. exportTypedArrayMethod("reduceRight", function reduceRight(callbackfn) {
  14967. var length = arguments.length;
  14968. return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
  14969. });
  14970. }, { "../internals/array-buffer-view-core": 103, "../internals/array-reduce": 115 }], 329: [function(require2, module3, exports3) {
  14971. "use strict";
  14972. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14973. var $reduce = require2("../internals/array-reduce").left;
  14974. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14975. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14976. exportTypedArrayMethod("reduce", function reduce(callbackfn) {
  14977. var length = arguments.length;
  14978. return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
  14979. });
  14980. }, { "../internals/array-buffer-view-core": 103, "../internals/array-reduce": 115 }], 330: [function(require2, module3, exports3) {
  14981. "use strict";
  14982. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  14983. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  14984. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  14985. var floor = Math.floor;
  14986. exportTypedArrayMethod("reverse", function reverse() {
  14987. var that = this;
  14988. var length = aTypedArray(that).length;
  14989. var middle = floor(length / 2);
  14990. var index = 0;
  14991. var value;
  14992. while (index < middle) {
  14993. value = that[index];
  14994. that[index++] = that[--length];
  14995. that[length] = value;
  14996. }
  14997. return that;
  14998. });
  14999. }, { "../internals/array-buffer-view-core": 103 }], 331: [function(require2, module3, exports3) {
  15000. "use strict";
  15001. var global2 = require2("../internals/global");
  15002. var call = require2("../internals/function-call");
  15003. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15004. var lengthOfArrayLike = require2("../internals/length-of-array-like");
  15005. var toOffset = require2("../internals/to-offset");
  15006. var toIndexedObject = require2("../internals/to-object");
  15007. var fails = require2("../internals/fails");
  15008. var RangeError2 = global2.RangeError;
  15009. var Int8Array2 = global2.Int8Array;
  15010. var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
  15011. var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
  15012. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15013. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15014. var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function() {
  15015. var array = new Uint8ClampedArray(2);
  15016. call($set, array, { length: 1, 0: 3 }, 1);
  15017. return array[1] !== 3;
  15018. });
  15019. var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function() {
  15020. var array = new Int8Array2(2);
  15021. array.set(1);
  15022. array.set("2", 1);
  15023. return array[0] !== 0 || array[1] !== 2;
  15024. });
  15025. exportTypedArrayMethod("set", function set(arrayLike) {
  15026. aTypedArray(this);
  15027. var offset = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1);
  15028. var src = toIndexedObject(arrayLike);
  15029. if (WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS)
  15030. return call($set, this, src, offset);
  15031. var length = this.length;
  15032. var len = lengthOfArrayLike(src);
  15033. var index = 0;
  15034. if (len + offset > length)
  15035. throw RangeError2("Wrong length");
  15036. while (index < len)
  15037. this[offset + index] = src[index++];
  15038. }, !WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
  15039. }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-call": 155, "../internals/global": 163, "../internals/length-of-array-like": 188, "../internals/to-object": 250, "../internals/to-offset": 251 }], 332: [function(require2, module3, exports3) {
  15040. "use strict";
  15041. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15042. var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
  15043. var fails = require2("../internals/fails");
  15044. var arraySlice = require2("../internals/array-slice");
  15045. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15046. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15047. var FORCED = fails(function() {
  15048. new Int8Array(1).slice();
  15049. });
  15050. exportTypedArrayMethod("slice", function slice(start, end) {
  15051. var list = arraySlice(aTypedArray(this), start, end);
  15052. var C = typedArraySpeciesConstructor(this);
  15053. var index = 0;
  15054. var length = list.length;
  15055. var result = new C(length);
  15056. while (length > index)
  15057. result[index] = list[index++];
  15058. return result;
  15059. }, FORCED);
  15060. }, { "../internals/array-buffer-view-core": 103, "../internals/array-slice": 117, "../internals/fails": 150, "../internals/typed-array-species-constructor": 262 }], 333: [function(require2, module3, exports3) {
  15061. "use strict";
  15062. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15063. var $some = require2("../internals/array-iteration").some;
  15064. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15065. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15066. exportTypedArrayMethod("some", function some(callbackfn) {
  15067. return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  15068. });
  15069. }, { "../internals/array-buffer-view-core": 103, "../internals/array-iteration": 111 }], 334: [function(require2, module3, exports3) {
  15070. "use strict";
  15071. var global2 = require2("../internals/global");
  15072. var uncurryThis = require2("../internals/function-uncurry-this");
  15073. var fails = require2("../internals/fails");
  15074. var aCallable = require2("../internals/a-callable");
  15075. var internalSort = require2("../internals/array-sort");
  15076. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15077. var FF = require2("../internals/engine-ff-version");
  15078. var IE_OR_EDGE = require2("../internals/engine-is-ie-or-edge");
  15079. var V8 = require2("../internals/engine-v8-version");
  15080. var WEBKIT = require2("../internals/engine-webkit-version");
  15081. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15082. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15083. var Uint16Array2 = global2.Uint16Array;
  15084. var un$Sort = Uint16Array2 && uncurryThis(Uint16Array2.prototype.sort);
  15085. var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function() {
  15086. un$Sort(new Uint16Array2(2), null);
  15087. }) && fails(function() {
  15088. un$Sort(new Uint16Array2(2), {});
  15089. }));
  15090. var STABLE_SORT = !!un$Sort && !fails(function() {
  15091. if (V8)
  15092. return V8 < 74;
  15093. if (FF)
  15094. return FF < 67;
  15095. if (IE_OR_EDGE)
  15096. return true;
  15097. if (WEBKIT)
  15098. return WEBKIT < 602;
  15099. var array = new Uint16Array2(516);
  15100. var expected = Array(516);
  15101. var index, mod;
  15102. for (index = 0; index < 516; index++) {
  15103. mod = index % 4;
  15104. array[index] = 515 - index;
  15105. expected[index] = index - 2 * mod + 3;
  15106. }
  15107. un$Sort(array, function(a, b) {
  15108. return (a / 4 | 0) - (b / 4 | 0);
  15109. });
  15110. for (index = 0; index < 516; index++) {
  15111. if (array[index] !== expected[index])
  15112. return true;
  15113. }
  15114. });
  15115. var getSortCompare = function(comparefn) {
  15116. return function(x, y) {
  15117. if (comparefn !== void 0)
  15118. return +comparefn(x, y) || 0;
  15119. if (y !== y)
  15120. return -1;
  15121. if (x !== x)
  15122. return 1;
  15123. if (x === 0 && y === 0)
  15124. return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
  15125. return x > y;
  15126. };
  15127. };
  15128. exportTypedArrayMethod("sort", function sort(comparefn) {
  15129. if (comparefn !== void 0)
  15130. aCallable(comparefn);
  15131. if (STABLE_SORT)
  15132. return un$Sort(this, comparefn);
  15133. return internalSort(aTypedArray(this), getSortCompare(comparefn));
  15134. }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
  15135. }, { "../internals/a-callable": 95, "../internals/array-buffer-view-core": 103, "../internals/array-sort": 118, "../internals/engine-ff-version": 138, "../internals/engine-is-ie-or-edge": 140, "../internals/engine-v8-version": 146, "../internals/engine-webkit-version": 147, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 335: [function(require2, module3, exports3) {
  15136. "use strict";
  15137. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15138. var toLength = require2("../internals/to-length");
  15139. var toAbsoluteIndex = require2("../internals/to-absolute-index");
  15140. var typedArraySpeciesConstructor = require2("../internals/typed-array-species-constructor");
  15141. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15142. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15143. exportTypedArrayMethod("subarray", function subarray(begin, end) {
  15144. var O = aTypedArray(this);
  15145. var length = O.length;
  15146. var beginIndex = toAbsoluteIndex(begin, length);
  15147. var C = typedArraySpeciesConstructor(O);
  15148. return new C(
  15149. O.buffer,
  15150. O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
  15151. toLength((end === void 0 ? length : toAbsoluteIndex(end, length)) - beginIndex)
  15152. );
  15153. });
  15154. }, { "../internals/array-buffer-view-core": 103, "../internals/to-absolute-index": 245, "../internals/to-length": 249, "../internals/typed-array-species-constructor": 262 }], 336: [function(require2, module3, exports3) {
  15155. "use strict";
  15156. var global2 = require2("../internals/global");
  15157. var apply = require2("../internals/function-apply");
  15158. var ArrayBufferViewCore = require2("../internals/array-buffer-view-core");
  15159. var fails = require2("../internals/fails");
  15160. var arraySlice = require2("../internals/array-slice");
  15161. var Int8Array2 = global2.Int8Array;
  15162. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  15163. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  15164. var $toLocaleString = [].toLocaleString;
  15165. var TO_LOCALE_STRING_BUG = !!Int8Array2 && fails(function() {
  15166. $toLocaleString.call(new Int8Array2(1));
  15167. });
  15168. var FORCED = fails(function() {
  15169. return [1, 2].toLocaleString() != new Int8Array2([1, 2]).toLocaleString();
  15170. }) || !fails(function() {
  15171. Int8Array2.prototype.toLocaleString.call([1, 2]);
  15172. });
  15173. exportTypedArrayMethod("toLocaleString", function toLocaleString() {
  15174. return apply(
  15175. $toLocaleString,
  15176. TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),
  15177. arraySlice(arguments)
  15178. );
  15179. }, FORCED);
  15180. }, { "../internals/array-buffer-view-core": 103, "../internals/array-slice": 117, "../internals/fails": 150, "../internals/function-apply": 152, "../internals/global": 163 }], 337: [function(require2, module3, exports3) {
  15181. "use strict";
  15182. var exportTypedArrayMethod = require2("../internals/array-buffer-view-core").exportTypedArrayMethod;
  15183. var fails = require2("../internals/fails");
  15184. var global2 = require2("../internals/global");
  15185. var uncurryThis = require2("../internals/function-uncurry-this");
  15186. var Uint8Array2 = global2.Uint8Array;
  15187. var Uint8ArrayPrototype = Uint8Array2 && Uint8Array2.prototype || {};
  15188. var arrayToString = [].toString;
  15189. var join = uncurryThis([].join);
  15190. if (fails(function() {
  15191. arrayToString.call({});
  15192. })) {
  15193. arrayToString = function toString() {
  15194. return join(this);
  15195. };
  15196. }
  15197. var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
  15198. exportTypedArrayMethod("toString", arrayToString, IS_NOT_ARRAY_METHOD);
  15199. }, { "../internals/array-buffer-view-core": 103, "../internals/fails": 150, "../internals/function-uncurry-this": 157, "../internals/global": 163 }], 338: [function(require2, module3, exports3) {
  15200. var createTypedArrayConstructor = require2("../internals/typed-array-constructor");
  15201. createTypedArrayConstructor("Uint8", function(init) {
  15202. return function Uint8Array2(data, byteOffset, length) {
  15203. return init(this, data, byteOffset, length);
  15204. };
  15205. });
  15206. }, { "../internals/typed-array-constructor": 258 }], 339: [function(require2, module3, exports3) {
  15207. var global2 = require2("../internals/global");
  15208. var DOMIterables = require2("../internals/dom-iterables");
  15209. var DOMTokenListPrototype = require2("../internals/dom-token-list-prototype");
  15210. var forEach = require2("../internals/array-for-each");
  15211. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  15212. var handlePrototype = function(CollectionPrototype) {
  15213. if (CollectionPrototype && CollectionPrototype.forEach !== forEach)
  15214. try {
  15215. createNonEnumerableProperty(CollectionPrototype, "forEach", forEach);
  15216. } catch (error) {
  15217. CollectionPrototype.forEach = forEach;
  15218. }
  15219. };
  15220. for (var COLLECTION_NAME in DOMIterables) {
  15221. if (DOMIterables[COLLECTION_NAME]) {
  15222. handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype);
  15223. }
  15224. }
  15225. handlePrototype(DOMTokenListPrototype);
  15226. }, { "../internals/array-for-each": 107, "../internals/create-non-enumerable-property": 129, "../internals/dom-iterables": 136, "../internals/dom-token-list-prototype": 137, "../internals/global": 163 }], 340: [function(require2, module3, exports3) {
  15227. var global2 = require2("../internals/global");
  15228. var DOMIterables = require2("../internals/dom-iterables");
  15229. var DOMTokenListPrototype = require2("../internals/dom-token-list-prototype");
  15230. var ArrayIteratorMethods = require2("../modules/es.array.iterator");
  15231. var createNonEnumerableProperty = require2("../internals/create-non-enumerable-property");
  15232. var wellKnownSymbol = require2("../internals/well-known-symbol");
  15233. var ITERATOR = wellKnownSymbol("iterator");
  15234. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  15235. var ArrayValues = ArrayIteratorMethods.values;
  15236. var handlePrototype = function(CollectionPrototype, COLLECTION_NAME2) {
  15237. if (CollectionPrototype) {
  15238. if (CollectionPrototype[ITERATOR] !== ArrayValues)
  15239. try {
  15240. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  15241. } catch (error) {
  15242. CollectionPrototype[ITERATOR] = ArrayValues;
  15243. }
  15244. if (!CollectionPrototype[TO_STRING_TAG]) {
  15245. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME2);
  15246. }
  15247. if (DOMIterables[COLLECTION_NAME2])
  15248. for (var METHOD_NAME in ArrayIteratorMethods) {
  15249. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
  15250. try {
  15251. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  15252. } catch (error) {
  15253. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  15254. }
  15255. }
  15256. }
  15257. };
  15258. for (var COLLECTION_NAME in DOMIterables) {
  15259. handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype, COLLECTION_NAME);
  15260. }
  15261. handlePrototype(DOMTokenListPrototype, "DOMTokenList");
  15262. }, { "../internals/create-non-enumerable-property": 129, "../internals/dom-iterables": 136, "../internals/dom-token-list-prototype": 137, "../internals/global": 163, "../internals/well-known-symbol": 268, "../modules/es.array.iterator": 278 }], 341: [function(require2, module3, exports3) {
  15263. function isArray(arg) {
  15264. if (Array.isArray) {
  15265. return Array.isArray(arg);
  15266. }
  15267. return objectToString(arg) === "[object Array]";
  15268. }
  15269. exports3.isArray = isArray;
  15270. function isBoolean(arg) {
  15271. return typeof arg === "boolean";
  15272. }
  15273. exports3.isBoolean = isBoolean;
  15274. function isNull(arg) {
  15275. return arg === null;
  15276. }
  15277. exports3.isNull = isNull;
  15278. function isNullOrUndefined(arg) {
  15279. return arg == null;
  15280. }
  15281. exports3.isNullOrUndefined = isNullOrUndefined;
  15282. function isNumber(arg) {
  15283. return typeof arg === "number";
  15284. }
  15285. exports3.isNumber = isNumber;
  15286. function isString(arg) {
  15287. return typeof arg === "string";
  15288. }
  15289. exports3.isString = isString;
  15290. function isSymbol(arg) {
  15291. return typeof arg === "symbol";
  15292. }
  15293. exports3.isSymbol = isSymbol;
  15294. function isUndefined(arg) {
  15295. return arg === void 0;
  15296. }
  15297. exports3.isUndefined = isUndefined;
  15298. function isRegExp(re) {
  15299. return objectToString(re) === "[object RegExp]";
  15300. }
  15301. exports3.isRegExp = isRegExp;
  15302. function isObject(arg) {
  15303. return typeof arg === "object" && arg !== null;
  15304. }
  15305. exports3.isObject = isObject;
  15306. function isDate(d) {
  15307. return objectToString(d) === "[object Date]";
  15308. }
  15309. exports3.isDate = isDate;
  15310. function isError(e) {
  15311. return objectToString(e) === "[object Error]" || e instanceof Error;
  15312. }
  15313. exports3.isError = isError;
  15314. function isFunction(arg) {
  15315. return typeof arg === "function";
  15316. }
  15317. exports3.isFunction = isFunction;
  15318. function isPrimitive(arg) {
  15319. return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
  15320. typeof arg === "undefined";
  15321. }
  15322. exports3.isPrimitive = isPrimitive;
  15323. exports3.isBuffer = require2("buffer").Buffer.isBuffer;
  15324. function objectToString(o) {
  15325. return Object.prototype.toString.call(o);
  15326. }
  15327. }, { "buffer": 90 }], 342: [function(require2, module3, exports3) {
  15328. (function(global2) {
  15329. "use strict";
  15330. var dateFormat = function() {
  15331. var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
  15332. var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
  15333. var timezoneClip = /[^-+\dA-Z]/g;
  15334. return function(date, mask, utc, gmt) {
  15335. if (arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
  15336. mask = date;
  15337. date = void 0;
  15338. }
  15339. date = date || /* @__PURE__ */ new Date();
  15340. if (!(date instanceof Date)) {
  15341. date = new Date(date);
  15342. }
  15343. if (isNaN(date)) {
  15344. throw TypeError("Invalid date");
  15345. }
  15346. mask = String(dateFormat.masks[mask] || mask || dateFormat.masks["default"]);
  15347. var maskSlice = mask.slice(0, 4);
  15348. if (maskSlice === "UTC:" || maskSlice === "GMT:") {
  15349. mask = mask.slice(4);
  15350. utc = true;
  15351. if (maskSlice === "GMT:") {
  15352. gmt = true;
  15353. }
  15354. }
  15355. var _ = utc ? "getUTC" : "get";
  15356. var d = date[_ + "Date"]();
  15357. var D = date[_ + "Day"]();
  15358. var m = date[_ + "Month"]();
  15359. var y = date[_ + "FullYear"]();
  15360. var H = date[_ + "Hours"]();
  15361. var M = date[_ + "Minutes"]();
  15362. var s = date[_ + "Seconds"]();
  15363. var L = date[_ + "Milliseconds"]();
  15364. var o = utc ? 0 : date.getTimezoneOffset();
  15365. var W = getWeek(date);
  15366. var N = getDayOfWeek(date);
  15367. var flags = {
  15368. d,
  15369. dd: pad(d),
  15370. ddd: dateFormat.i18n.dayNames[D],
  15371. dddd: dateFormat.i18n.dayNames[D + 7],
  15372. m: m + 1,
  15373. mm: pad(m + 1),
  15374. mmm: dateFormat.i18n.monthNames[m],
  15375. mmmm: dateFormat.i18n.monthNames[m + 12],
  15376. yy: String(y).slice(2),
  15377. yyyy: y,
  15378. h: H % 12 || 12,
  15379. hh: pad(H % 12 || 12),
  15380. H,
  15381. HH: pad(H),
  15382. M,
  15383. MM: pad(M),
  15384. s,
  15385. ss: pad(s),
  15386. l: pad(L, 3),
  15387. L: pad(Math.round(L / 10)),
  15388. t: H < 12 ? "a" : "p",
  15389. tt: H < 12 ? "am" : "pm",
  15390. T: H < 12 ? "A" : "P",
  15391. TT: H < 12 ? "AM" : "PM",
  15392. Z: gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
  15393. o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
  15394. S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
  15395. W,
  15396. N
  15397. };
  15398. return mask.replace(token, function(match) {
  15399. if (match in flags) {
  15400. return flags[match];
  15401. }
  15402. return match.slice(1, match.length - 1);
  15403. });
  15404. };
  15405. }();
  15406. dateFormat.masks = {
  15407. "default": "ddd mmm dd yyyy HH:MM:ss",
  15408. "shortDate": "m/d/yy",
  15409. "mediumDate": "mmm d, yyyy",
  15410. "longDate": "mmmm d, yyyy",
  15411. "fullDate": "dddd, mmmm d, yyyy",
  15412. "shortTime": "h:MM TT",
  15413. "mediumTime": "h:MM:ss TT",
  15414. "longTime": "h:MM:ss TT Z",
  15415. "isoDate": "yyyy-mm-dd",
  15416. "isoTime": "HH:MM:ss",
  15417. "isoDateTime": "yyyy-mm-dd'T'HH:MM:sso",
  15418. "isoUtcDateTime": "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
  15419. "expiresHeaderFormat": "ddd, dd mmm yyyy HH:MM:ss Z"
  15420. };
  15421. dateFormat.i18n = {
  15422. dayNames: [
  15423. "Sun",
  15424. "Mon",
  15425. "Tue",
  15426. "Wed",
  15427. "Thu",
  15428. "Fri",
  15429. "Sat",
  15430. "Sunday",
  15431. "Monday",
  15432. "Tuesday",
  15433. "Wednesday",
  15434. "Thursday",
  15435. "Friday",
  15436. "Saturday"
  15437. ],
  15438. monthNames: [
  15439. "Jan",
  15440. "Feb",
  15441. "Mar",
  15442. "Apr",
  15443. "May",
  15444. "Jun",
  15445. "Jul",
  15446. "Aug",
  15447. "Sep",
  15448. "Oct",
  15449. "Nov",
  15450. "Dec",
  15451. "January",
  15452. "February",
  15453. "March",
  15454. "April",
  15455. "May",
  15456. "June",
  15457. "July",
  15458. "August",
  15459. "September",
  15460. "October",
  15461. "November",
  15462. "December"
  15463. ]
  15464. };
  15465. function pad(val, len) {
  15466. val = String(val);
  15467. len = len || 2;
  15468. while (val.length < len) {
  15469. val = "0" + val;
  15470. }
  15471. return val;
  15472. }
  15473. function getWeek(date) {
  15474. var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
  15475. targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3);
  15476. var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
  15477. firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3);
  15478. var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
  15479. targetThursday.setHours(targetThursday.getHours() - ds);
  15480. var weekDiff = (targetThursday - firstThursday) / (864e5 * 7);
  15481. return 1 + Math.floor(weekDiff);
  15482. }
  15483. function getDayOfWeek(date) {
  15484. var dow = date.getDay();
  15485. if (dow === 0) {
  15486. dow = 7;
  15487. }
  15488. return dow;
  15489. }
  15490. function kindOf(val) {
  15491. if (val === null) {
  15492. return "null";
  15493. }
  15494. if (val === void 0) {
  15495. return "undefined";
  15496. }
  15497. if (typeof val !== "object") {
  15498. return typeof val;
  15499. }
  15500. if (Array.isArray(val)) {
  15501. return "array";
  15502. }
  15503. return {}.toString.call(val).slice(8, -1).toLowerCase();
  15504. }
  15505. ;
  15506. if (typeof define2 === "function" && define2.amd) {
  15507. define2(function() {
  15508. return dateFormat;
  15509. });
  15510. } else if (typeof exports3 === "object") {
  15511. module3.exports = dateFormat;
  15512. } else {
  15513. global2.dateFormat = dateFormat;
  15514. }
  15515. })(this);
  15516. }, {}], 343: [function(require2, module3, exports3) {
  15517. "use strict";
  15518. var matchHtmlRegExp = /["'&<>]/;
  15519. module3.exports = escapeHtml;
  15520. function escapeHtml(string) {
  15521. var str = "" + string;
  15522. var match = matchHtmlRegExp.exec(str);
  15523. if (!match) {
  15524. return str;
  15525. }
  15526. var escape2;
  15527. var html = "";
  15528. var index = 0;
  15529. var lastIndex = 0;
  15530. for (index = match.index; index < str.length; index++) {
  15531. switch (str.charCodeAt(index)) {
  15532. case 34:
  15533. escape2 = "&quot;";
  15534. break;
  15535. case 38:
  15536. escape2 = "&amp;";
  15537. break;
  15538. case 39:
  15539. escape2 = "&#39;";
  15540. break;
  15541. case 60:
  15542. escape2 = "&lt;";
  15543. break;
  15544. case 62:
  15545. escape2 = "&gt;";
  15546. break;
  15547. default:
  15548. continue;
  15549. }
  15550. if (lastIndex !== index) {
  15551. html += str.substring(lastIndex, index);
  15552. }
  15553. lastIndex = index + 1;
  15554. html += escape2;
  15555. }
  15556. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  15557. }
  15558. }, {}], 344: [function(require2, module3, exports3) {
  15559. "use strict";
  15560. var R = typeof Reflect === "object" ? Reflect : null;
  15561. var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
  15562. return Function.prototype.apply.call(target, receiver, args);
  15563. };
  15564. var ReflectOwnKeys;
  15565. if (R && typeof R.ownKeys === "function") {
  15566. ReflectOwnKeys = R.ownKeys;
  15567. } else if (Object.getOwnPropertySymbols) {
  15568. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  15569. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  15570. };
  15571. } else {
  15572. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  15573. return Object.getOwnPropertyNames(target);
  15574. };
  15575. }
  15576. function ProcessEmitWarning(warning) {
  15577. if (console && console.warn)
  15578. console.warn(warning);
  15579. }
  15580. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  15581. return value !== value;
  15582. };
  15583. function EventEmitter() {
  15584. EventEmitter.init.call(this);
  15585. }
  15586. module3.exports = EventEmitter;
  15587. module3.exports.once = once;
  15588. EventEmitter.EventEmitter = EventEmitter;
  15589. EventEmitter.prototype._events = void 0;
  15590. EventEmitter.prototype._eventsCount = 0;
  15591. EventEmitter.prototype._maxListeners = void 0;
  15592. var defaultMaxListeners = 10;
  15593. function checkListener(listener) {
  15594. if (typeof listener !== "function") {
  15595. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  15596. }
  15597. }
  15598. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  15599. enumerable: true,
  15600. get: function() {
  15601. return defaultMaxListeners;
  15602. },
  15603. set: function(arg) {
  15604. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  15605. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  15606. }
  15607. defaultMaxListeners = arg;
  15608. }
  15609. });
  15610. EventEmitter.init = function() {
  15611. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  15612. this._events = /* @__PURE__ */ Object.create(null);
  15613. this._eventsCount = 0;
  15614. }
  15615. this._maxListeners = this._maxListeners || void 0;
  15616. };
  15617. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  15618. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  15619. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  15620. }
  15621. this._maxListeners = n;
  15622. return this;
  15623. };
  15624. function _getMaxListeners(that) {
  15625. if (that._maxListeners === void 0)
  15626. return EventEmitter.defaultMaxListeners;
  15627. return that._maxListeners;
  15628. }
  15629. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  15630. return _getMaxListeners(this);
  15631. };
  15632. EventEmitter.prototype.emit = function emit(type) {
  15633. var args = [];
  15634. for (var i = 1; i < arguments.length; i++)
  15635. args.push(arguments[i]);
  15636. var doError = type === "error";
  15637. var events = this._events;
  15638. if (events !== void 0)
  15639. doError = doError && events.error === void 0;
  15640. else if (!doError)
  15641. return false;
  15642. if (doError) {
  15643. var er;
  15644. if (args.length > 0)
  15645. er = args[0];
  15646. if (er instanceof Error) {
  15647. throw er;
  15648. }
  15649. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  15650. err.context = er;
  15651. throw err;
  15652. }
  15653. var handler = events[type];
  15654. if (handler === void 0)
  15655. return false;
  15656. if (typeof handler === "function") {
  15657. ReflectApply(handler, this, args);
  15658. } else {
  15659. var len = handler.length;
  15660. var listeners = arrayClone(handler, len);
  15661. for (var i = 0; i < len; ++i)
  15662. ReflectApply(listeners[i], this, args);
  15663. }
  15664. return true;
  15665. };
  15666. function _addListener(target, type, listener, prepend) {
  15667. var m;
  15668. var events;
  15669. var existing;
  15670. checkListener(listener);
  15671. events = target._events;
  15672. if (events === void 0) {
  15673. events = target._events = /* @__PURE__ */ Object.create(null);
  15674. target._eventsCount = 0;
  15675. } else {
  15676. if (events.newListener !== void 0) {
  15677. target.emit(
  15678. "newListener",
  15679. type,
  15680. listener.listener ? listener.listener : listener
  15681. );
  15682. events = target._events;
  15683. }
  15684. existing = events[type];
  15685. }
  15686. if (existing === void 0) {
  15687. existing = events[type] = listener;
  15688. ++target._eventsCount;
  15689. } else {
  15690. if (typeof existing === "function") {
  15691. existing = events[type] = prepend ? [listener, existing] : [existing, listener];
  15692. } else if (prepend) {
  15693. existing.unshift(listener);
  15694. } else {
  15695. existing.push(listener);
  15696. }
  15697. m = _getMaxListeners(target);
  15698. if (m > 0 && existing.length > m && !existing.warned) {
  15699. existing.warned = true;
  15700. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  15701. w.name = "MaxListenersExceededWarning";
  15702. w.emitter = target;
  15703. w.type = type;
  15704. w.count = existing.length;
  15705. ProcessEmitWarning(w);
  15706. }
  15707. }
  15708. return target;
  15709. }
  15710. EventEmitter.prototype.addListener = function addListener(type, listener) {
  15711. return _addListener(this, type, listener, false);
  15712. };
  15713. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  15714. EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  15715. return _addListener(this, type, listener, true);
  15716. };
  15717. function onceWrapper() {
  15718. if (!this.fired) {
  15719. this.target.removeListener(this.type, this.wrapFn);
  15720. this.fired = true;
  15721. if (arguments.length === 0)
  15722. return this.listener.call(this.target);
  15723. return this.listener.apply(this.target, arguments);
  15724. }
  15725. }
  15726. function _onceWrap(target, type, listener) {
  15727. var state = { fired: false, wrapFn: void 0, target, type, listener };
  15728. var wrapped = onceWrapper.bind(state);
  15729. wrapped.listener = listener;
  15730. state.wrapFn = wrapped;
  15731. return wrapped;
  15732. }
  15733. EventEmitter.prototype.once = function once2(type, listener) {
  15734. checkListener(listener);
  15735. this.on(type, _onceWrap(this, type, listener));
  15736. return this;
  15737. };
  15738. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  15739. checkListener(listener);
  15740. this.prependListener(type, _onceWrap(this, type, listener));
  15741. return this;
  15742. };
  15743. EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  15744. var list, events, position, i, originalListener;
  15745. checkListener(listener);
  15746. events = this._events;
  15747. if (events === void 0)
  15748. return this;
  15749. list = events[type];
  15750. if (list === void 0)
  15751. return this;
  15752. if (list === listener || list.listener === listener) {
  15753. if (--this._eventsCount === 0)
  15754. this._events = /* @__PURE__ */ Object.create(null);
  15755. else {
  15756. delete events[type];
  15757. if (events.removeListener)
  15758. this.emit("removeListener", type, list.listener || listener);
  15759. }
  15760. } else if (typeof list !== "function") {
  15761. position = -1;
  15762. for (i = list.length - 1; i >= 0; i--) {
  15763. if (list[i] === listener || list[i].listener === listener) {
  15764. originalListener = list[i].listener;
  15765. position = i;
  15766. break;
  15767. }
  15768. }
  15769. if (position < 0)
  15770. return this;
  15771. if (position === 0)
  15772. list.shift();
  15773. else {
  15774. spliceOne(list, position);
  15775. }
  15776. if (list.length === 1)
  15777. events[type] = list[0];
  15778. if (events.removeListener !== void 0)
  15779. this.emit("removeListener", type, originalListener || listener);
  15780. }
  15781. return this;
  15782. };
  15783. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  15784. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  15785. var listeners, events, i;
  15786. events = this._events;
  15787. if (events === void 0)
  15788. return this;
  15789. if (events.removeListener === void 0) {
  15790. if (arguments.length === 0) {
  15791. this._events = /* @__PURE__ */ Object.create(null);
  15792. this._eventsCount = 0;
  15793. } else if (events[type] !== void 0) {
  15794. if (--this._eventsCount === 0)
  15795. this._events = /* @__PURE__ */ Object.create(null);
  15796. else
  15797. delete events[type];
  15798. }
  15799. return this;
  15800. }
  15801. if (arguments.length === 0) {
  15802. var keys = Object.keys(events);
  15803. var key;
  15804. for (i = 0; i < keys.length; ++i) {
  15805. key = keys[i];
  15806. if (key === "removeListener")
  15807. continue;
  15808. this.removeAllListeners(key);
  15809. }
  15810. this.removeAllListeners("removeListener");
  15811. this._events = /* @__PURE__ */ Object.create(null);
  15812. this._eventsCount = 0;
  15813. return this;
  15814. }
  15815. listeners = events[type];
  15816. if (typeof listeners === "function") {
  15817. this.removeListener(type, listeners);
  15818. } else if (listeners !== void 0) {
  15819. for (i = listeners.length - 1; i >= 0; i--) {
  15820. this.removeListener(type, listeners[i]);
  15821. }
  15822. }
  15823. return this;
  15824. };
  15825. function _listeners(target, type, unwrap) {
  15826. var events = target._events;
  15827. if (events === void 0)
  15828. return [];
  15829. var evlistener = events[type];
  15830. if (evlistener === void 0)
  15831. return [];
  15832. if (typeof evlistener === "function")
  15833. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  15834. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  15835. }
  15836. EventEmitter.prototype.listeners = function listeners(type) {
  15837. return _listeners(this, type, true);
  15838. };
  15839. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  15840. return _listeners(this, type, false);
  15841. };
  15842. EventEmitter.listenerCount = function(emitter, type) {
  15843. if (typeof emitter.listenerCount === "function") {
  15844. return emitter.listenerCount(type);
  15845. } else {
  15846. return listenerCount.call(emitter, type);
  15847. }
  15848. };
  15849. EventEmitter.prototype.listenerCount = listenerCount;
  15850. function listenerCount(type) {
  15851. var events = this._events;
  15852. if (events !== void 0) {
  15853. var evlistener = events[type];
  15854. if (typeof evlistener === "function") {
  15855. return 1;
  15856. } else if (evlistener !== void 0) {
  15857. return evlistener.length;
  15858. }
  15859. }
  15860. return 0;
  15861. }
  15862. EventEmitter.prototype.eventNames = function eventNames() {
  15863. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  15864. };
  15865. function arrayClone(arr, n) {
  15866. var copy = new Array(n);
  15867. for (var i = 0; i < n; ++i)
  15868. copy[i] = arr[i];
  15869. return copy;
  15870. }
  15871. function spliceOne(list, index) {
  15872. for (; index + 1 < list.length; index++)
  15873. list[index] = list[index + 1];
  15874. list.pop();
  15875. }
  15876. function unwrapListeners(arr) {
  15877. var ret = new Array(arr.length);
  15878. for (var i = 0; i < ret.length; ++i) {
  15879. ret[i] = arr[i].listener || arr[i];
  15880. }
  15881. return ret;
  15882. }
  15883. function once(emitter, name) {
  15884. return new Promise(function(resolve, reject) {
  15885. function errorListener(err) {
  15886. emitter.removeListener(name, resolver);
  15887. reject(err);
  15888. }
  15889. function resolver() {
  15890. if (typeof emitter.removeListener === "function") {
  15891. emitter.removeListener("error", errorListener);
  15892. }
  15893. resolve([].slice.call(arguments));
  15894. }
  15895. ;
  15896. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  15897. if (name !== "error") {
  15898. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  15899. }
  15900. });
  15901. }
  15902. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  15903. if (typeof emitter.on === "function") {
  15904. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  15905. }
  15906. }
  15907. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  15908. if (typeof emitter.on === "function") {
  15909. if (flags.once) {
  15910. emitter.once(name, listener);
  15911. } else {
  15912. emitter.on(name, listener);
  15913. }
  15914. } else if (typeof emitter.addEventListener === "function") {
  15915. emitter.addEventListener(name, function wrapListener(arg) {
  15916. if (flags.once) {
  15917. emitter.removeEventListener(name, wrapListener);
  15918. }
  15919. listener(arg);
  15920. });
  15921. } else {
  15922. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  15923. }
  15924. }
  15925. }, {}], 345: [function(require2, module3, exports3) {
  15926. "use strict";
  15927. var isCallable = require2("is-callable");
  15928. var toStr = Object.prototype.toString;
  15929. var hasOwnProperty = Object.prototype.hasOwnProperty;
  15930. var forEachArray = function forEachArray2(array, iterator, receiver) {
  15931. for (var i = 0, len = array.length; i < len; i++) {
  15932. if (hasOwnProperty.call(array, i)) {
  15933. if (receiver == null) {
  15934. iterator(array[i], i, array);
  15935. } else {
  15936. iterator.call(receiver, array[i], i, array);
  15937. }
  15938. }
  15939. }
  15940. };
  15941. var forEachString = function forEachString2(string, iterator, receiver) {
  15942. for (var i = 0, len = string.length; i < len; i++) {
  15943. if (receiver == null) {
  15944. iterator(string.charAt(i), i, string);
  15945. } else {
  15946. iterator.call(receiver, string.charAt(i), i, string);
  15947. }
  15948. }
  15949. };
  15950. var forEachObject = function forEachObject2(object, iterator, receiver) {
  15951. for (var k in object) {
  15952. if (hasOwnProperty.call(object, k)) {
  15953. if (receiver == null) {
  15954. iterator(object[k], k, object);
  15955. } else {
  15956. iterator.call(receiver, object[k], k, object);
  15957. }
  15958. }
  15959. }
  15960. };
  15961. var forEach = function forEach2(list, iterator, thisArg) {
  15962. if (!isCallable(iterator)) {
  15963. throw new TypeError("iterator must be a function");
  15964. }
  15965. var receiver;
  15966. if (arguments.length >= 3) {
  15967. receiver = thisArg;
  15968. }
  15969. if (toStr.call(list) === "[object Array]") {
  15970. forEachArray(list, iterator, receiver);
  15971. } else if (typeof list === "string") {
  15972. forEachString(list, iterator, receiver);
  15973. } else {
  15974. forEachObject(list, iterator, receiver);
  15975. }
  15976. };
  15977. module3.exports = forEach;
  15978. }, { "is-callable": 367 }], 346: [function(require2, module3, exports3) {
  15979. "use strict";
  15980. var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
  15981. var slice = Array.prototype.slice;
  15982. var toStr = Object.prototype.toString;
  15983. var funcType = "[object Function]";
  15984. module3.exports = function bind(that) {
  15985. var target = this;
  15986. if (typeof target !== "function" || toStr.call(target) !== funcType) {
  15987. throw new TypeError(ERROR_MESSAGE + target);
  15988. }
  15989. var args = slice.call(arguments, 1);
  15990. var bound;
  15991. var binder = function() {
  15992. if (this instanceof bound) {
  15993. var result = target.apply(
  15994. this,
  15995. args.concat(slice.call(arguments))
  15996. );
  15997. if (Object(result) === result) {
  15998. return result;
  15999. }
  16000. return this;
  16001. } else {
  16002. return target.apply(
  16003. that,
  16004. args.concat(slice.call(arguments))
  16005. );
  16006. }
  16007. };
  16008. var boundLength = Math.max(0, target.length - args.length);
  16009. var boundArgs = [];
  16010. for (var i = 0; i < boundLength; i++) {
  16011. boundArgs.push("$" + i);
  16012. }
  16013. bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder);
  16014. if (target.prototype) {
  16015. var Empty = function Empty2() {
  16016. };
  16017. Empty.prototype = target.prototype;
  16018. bound.prototype = new Empty();
  16019. Empty.prototype = null;
  16020. }
  16021. return bound;
  16022. };
  16023. }, {}], 347: [function(require2, module3, exports3) {
  16024. "use strict";
  16025. var implementation = require2("./implementation");
  16026. module3.exports = Function.prototype.bind || implementation;
  16027. }, { "./implementation": 346 }], 348: [function(require2, module3, exports3) {
  16028. "use strict";
  16029. var undefined2;
  16030. var $SyntaxError = SyntaxError;
  16031. var $Function = Function;
  16032. var $TypeError = TypeError;
  16033. var getEvalledConstructor = function(expressionSyntax) {
  16034. try {
  16035. return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
  16036. } catch (e) {
  16037. }
  16038. };
  16039. var $gOPD = Object.getOwnPropertyDescriptor;
  16040. if ($gOPD) {
  16041. try {
  16042. $gOPD({}, "");
  16043. } catch (e) {
  16044. $gOPD = null;
  16045. }
  16046. }
  16047. var throwTypeError = function() {
  16048. throw new $TypeError();
  16049. };
  16050. var ThrowTypeError = $gOPD ? function() {
  16051. try {
  16052. arguments.callee;
  16053. return throwTypeError;
  16054. } catch (calleeThrows) {
  16055. try {
  16056. return $gOPD(arguments, "callee").get;
  16057. } catch (gOPDthrows) {
  16058. return throwTypeError;
  16059. }
  16060. }
  16061. }() : throwTypeError;
  16062. var hasSymbols = require2("has-symbols")();
  16063. var hasProto = require2("has-proto")();
  16064. var getProto = Object.getPrototypeOf || (hasProto ? function(x) {
  16065. return x.__proto__;
  16066. } : null);
  16067. var needsEval = {};
  16068. var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
  16069. var INTRINSICS = {
  16070. "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
  16071. "%Array%": Array,
  16072. "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
  16073. "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
  16074. "%AsyncFromSyncIteratorPrototype%": undefined2,
  16075. "%AsyncFunction%": needsEval,
  16076. "%AsyncGenerator%": needsEval,
  16077. "%AsyncGeneratorFunction%": needsEval,
  16078. "%AsyncIteratorPrototype%": needsEval,
  16079. "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
  16080. "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
  16081. "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
  16082. "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
  16083. "%Boolean%": Boolean,
  16084. "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
  16085. "%Date%": Date,
  16086. "%decodeURI%": decodeURI,
  16087. "%decodeURIComponent%": decodeURIComponent,
  16088. "%encodeURI%": encodeURI,
  16089. "%encodeURIComponent%": encodeURIComponent,
  16090. "%Error%": Error,
  16091. "%eval%": eval,
  16092. // eslint-disable-line no-eval
  16093. "%EvalError%": EvalError,
  16094. "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
  16095. "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
  16096. "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
  16097. "%Function%": $Function,
  16098. "%GeneratorFunction%": needsEval,
  16099. "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
  16100. "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
  16101. "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
  16102. "%isFinite%": isFinite,
  16103. "%isNaN%": isNaN,
  16104. "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
  16105. "%JSON%": typeof JSON === "object" ? JSON : undefined2,
  16106. "%Map%": typeof Map === "undefined" ? undefined2 : Map,
  16107. "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
  16108. "%Math%": Math,
  16109. "%Number%": Number,
  16110. "%Object%": Object,
  16111. "%parseFloat%": parseFloat,
  16112. "%parseInt%": parseInt,
  16113. "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
  16114. "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
  16115. "%RangeError%": RangeError,
  16116. "%ReferenceError%": ReferenceError,
  16117. "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
  16118. "%RegExp%": RegExp,
  16119. "%Set%": typeof Set === "undefined" ? undefined2 : Set,
  16120. "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
  16121. "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
  16122. "%String%": String,
  16123. "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
  16124. "%Symbol%": hasSymbols ? Symbol : undefined2,
  16125. "%SyntaxError%": $SyntaxError,
  16126. "%ThrowTypeError%": ThrowTypeError,
  16127. "%TypedArray%": TypedArray,
  16128. "%TypeError%": $TypeError,
  16129. "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
  16130. "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
  16131. "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
  16132. "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
  16133. "%URIError%": URIError,
  16134. "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
  16135. "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
  16136. "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
  16137. };
  16138. if (getProto) {
  16139. try {
  16140. null.error;
  16141. } catch (e) {
  16142. var errorProto = getProto(getProto(e));
  16143. INTRINSICS["%Error.prototype%"] = errorProto;
  16144. }
  16145. }
  16146. var doEval = function doEval2(name) {
  16147. var value;
  16148. if (name === "%AsyncFunction%") {
  16149. value = getEvalledConstructor("async function () {}");
  16150. } else if (name === "%GeneratorFunction%") {
  16151. value = getEvalledConstructor("function* () {}");
  16152. } else if (name === "%AsyncGeneratorFunction%") {
  16153. value = getEvalledConstructor("async function* () {}");
  16154. } else if (name === "%AsyncGenerator%") {
  16155. var fn = doEval2("%AsyncGeneratorFunction%");
  16156. if (fn) {
  16157. value = fn.prototype;
  16158. }
  16159. } else if (name === "%AsyncIteratorPrototype%") {
  16160. var gen = doEval2("%AsyncGenerator%");
  16161. if (gen && getProto) {
  16162. value = getProto(gen.prototype);
  16163. }
  16164. }
  16165. INTRINSICS[name] = value;
  16166. return value;
  16167. };
  16168. var LEGACY_ALIASES = {
  16169. "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
  16170. "%ArrayPrototype%": ["Array", "prototype"],
  16171. "%ArrayProto_entries%": ["Array", "prototype", "entries"],
  16172. "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
  16173. "%ArrayProto_keys%": ["Array", "prototype", "keys"],
  16174. "%ArrayProto_values%": ["Array", "prototype", "values"],
  16175. "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
  16176. "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
  16177. "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
  16178. "%BooleanPrototype%": ["Boolean", "prototype"],
  16179. "%DataViewPrototype%": ["DataView", "prototype"],
  16180. "%DatePrototype%": ["Date", "prototype"],
  16181. "%ErrorPrototype%": ["Error", "prototype"],
  16182. "%EvalErrorPrototype%": ["EvalError", "prototype"],
  16183. "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
  16184. "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
  16185. "%FunctionPrototype%": ["Function", "prototype"],
  16186. "%Generator%": ["GeneratorFunction", "prototype"],
  16187. "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
  16188. "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
  16189. "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
  16190. "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
  16191. "%JSONParse%": ["JSON", "parse"],
  16192. "%JSONStringify%": ["JSON", "stringify"],
  16193. "%MapPrototype%": ["Map", "prototype"],
  16194. "%NumberPrototype%": ["Number", "prototype"],
  16195. "%ObjectPrototype%": ["Object", "prototype"],
  16196. "%ObjProto_toString%": ["Object", "prototype", "toString"],
  16197. "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
  16198. "%PromisePrototype%": ["Promise", "prototype"],
  16199. "%PromiseProto_then%": ["Promise", "prototype", "then"],
  16200. "%Promise_all%": ["Promise", "all"],
  16201. "%Promise_reject%": ["Promise", "reject"],
  16202. "%Promise_resolve%": ["Promise", "resolve"],
  16203. "%RangeErrorPrototype%": ["RangeError", "prototype"],
  16204. "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
  16205. "%RegExpPrototype%": ["RegExp", "prototype"],
  16206. "%SetPrototype%": ["Set", "prototype"],
  16207. "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
  16208. "%StringPrototype%": ["String", "prototype"],
  16209. "%SymbolPrototype%": ["Symbol", "prototype"],
  16210. "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
  16211. "%TypedArrayPrototype%": ["TypedArray", "prototype"],
  16212. "%TypeErrorPrototype%": ["TypeError", "prototype"],
  16213. "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
  16214. "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
  16215. "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
  16216. "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
  16217. "%URIErrorPrototype%": ["URIError", "prototype"],
  16218. "%WeakMapPrototype%": ["WeakMap", "prototype"],
  16219. "%WeakSetPrototype%": ["WeakSet", "prototype"]
  16220. };
  16221. var bind = require2("function-bind");
  16222. var hasOwn = require2("has");
  16223. var $concat = bind.call(Function.call, Array.prototype.concat);
  16224. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  16225. var $replace = bind.call(Function.call, String.prototype.replace);
  16226. var $strSlice = bind.call(Function.call, String.prototype.slice);
  16227. var $exec = bind.call(Function.call, RegExp.prototype.exec);
  16228. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  16229. var reEscapeChar = /\\(\\)?/g;
  16230. var stringToPath = function stringToPath2(string) {
  16231. var first = $strSlice(string, 0, 1);
  16232. var last = $strSlice(string, -1);
  16233. if (first === "%" && last !== "%") {
  16234. throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
  16235. } else if (last === "%" && first !== "%") {
  16236. throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
  16237. }
  16238. var result = [];
  16239. $replace(string, rePropName, function(match, number, quote, subString) {
  16240. result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
  16241. });
  16242. return result;
  16243. };
  16244. var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
  16245. var intrinsicName = name;
  16246. var alias;
  16247. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  16248. alias = LEGACY_ALIASES[intrinsicName];
  16249. intrinsicName = "%" + alias[0] + "%";
  16250. }
  16251. if (hasOwn(INTRINSICS, intrinsicName)) {
  16252. var value = INTRINSICS[intrinsicName];
  16253. if (value === needsEval) {
  16254. value = doEval(intrinsicName);
  16255. }
  16256. if (typeof value === "undefined" && !allowMissing) {
  16257. throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
  16258. }
  16259. return {
  16260. alias,
  16261. name: intrinsicName,
  16262. value
  16263. };
  16264. }
  16265. throw new $SyntaxError("intrinsic " + name + " does not exist!");
  16266. };
  16267. module3.exports = function GetIntrinsic(name, allowMissing) {
  16268. if (typeof name !== "string" || name.length === 0) {
  16269. throw new $TypeError("intrinsic name must be a non-empty string");
  16270. }
  16271. if (arguments.length > 1 && typeof allowMissing !== "boolean") {
  16272. throw new $TypeError('"allowMissing" argument must be a boolean');
  16273. }
  16274. if ($exec(/^%?[^%]*%?$/, name) === null) {
  16275. throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
  16276. }
  16277. var parts = stringToPath(name);
  16278. var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
  16279. var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
  16280. var intrinsicRealName = intrinsic.name;
  16281. var value = intrinsic.value;
  16282. var skipFurtherCaching = false;
  16283. var alias = intrinsic.alias;
  16284. if (alias) {
  16285. intrinsicBaseName = alias[0];
  16286. $spliceApply(parts, $concat([0, 1], alias));
  16287. }
  16288. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  16289. var part = parts[i];
  16290. var first = $strSlice(part, 0, 1);
  16291. var last = $strSlice(part, -1);
  16292. if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
  16293. throw new $SyntaxError("property names with quotes must have matching quotes");
  16294. }
  16295. if (part === "constructor" || !isOwn) {
  16296. skipFurtherCaching = true;
  16297. }
  16298. intrinsicBaseName += "." + part;
  16299. intrinsicRealName = "%" + intrinsicBaseName + "%";
  16300. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  16301. value = INTRINSICS[intrinsicRealName];
  16302. } else if (value != null) {
  16303. if (!(part in value)) {
  16304. if (!allowMissing) {
  16305. throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
  16306. }
  16307. return void 0;
  16308. }
  16309. if ($gOPD && i + 1 >= parts.length) {
  16310. var desc = $gOPD(value, part);
  16311. isOwn = !!desc;
  16312. if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
  16313. value = desc.get;
  16314. } else {
  16315. value = value[part];
  16316. }
  16317. } else {
  16318. isOwn = hasOwn(value, part);
  16319. value = value[part];
  16320. }
  16321. if (isOwn && !skipFurtherCaching) {
  16322. INTRINSICS[intrinsicRealName] = value;
  16323. }
  16324. }
  16325. }
  16326. return value;
  16327. };
  16328. }, { "function-bind": 347, "has": 354, "has-proto": 350, "has-symbols": 351 }], 349: [function(require2, module3, exports3) {
  16329. "use strict";
  16330. var GetIntrinsic = require2("get-intrinsic");
  16331. var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
  16332. if ($gOPD) {
  16333. try {
  16334. $gOPD([], "length");
  16335. } catch (e) {
  16336. $gOPD = null;
  16337. }
  16338. }
  16339. module3.exports = $gOPD;
  16340. }, { "get-intrinsic": 348 }], 350: [function(require2, module3, exports3) {
  16341. "use strict";
  16342. var test = {
  16343. foo: {}
  16344. };
  16345. var $Object = Object;
  16346. module3.exports = function hasProto() {
  16347. return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
  16348. };
  16349. }, {}], 351: [function(require2, module3, exports3) {
  16350. "use strict";
  16351. var origSymbol = typeof Symbol !== "undefined" && Symbol;
  16352. var hasSymbolSham = require2("./shams");
  16353. module3.exports = function hasNativeSymbols() {
  16354. if (typeof origSymbol !== "function") {
  16355. return false;
  16356. }
  16357. if (typeof Symbol !== "function") {
  16358. return false;
  16359. }
  16360. if (typeof origSymbol("foo") !== "symbol") {
  16361. return false;
  16362. }
  16363. if (typeof Symbol("bar") !== "symbol") {
  16364. return false;
  16365. }
  16366. return hasSymbolSham();
  16367. };
  16368. }, { "./shams": 352 }], 352: [function(require2, module3, exports3) {
  16369. "use strict";
  16370. module3.exports = function hasSymbols() {
  16371. if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
  16372. return false;
  16373. }
  16374. if (typeof Symbol.iterator === "symbol") {
  16375. return true;
  16376. }
  16377. var obj = {};
  16378. var sym = Symbol("test");
  16379. var symObj = Object(sym);
  16380. if (typeof sym === "string") {
  16381. return false;
  16382. }
  16383. if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
  16384. return false;
  16385. }
  16386. if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
  16387. return false;
  16388. }
  16389. var symVal = 42;
  16390. obj[sym] = symVal;
  16391. for (sym in obj) {
  16392. return false;
  16393. }
  16394. if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
  16395. return false;
  16396. }
  16397. if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
  16398. return false;
  16399. }
  16400. var syms = Object.getOwnPropertySymbols(obj);
  16401. if (syms.length !== 1 || syms[0] !== sym) {
  16402. return false;
  16403. }
  16404. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
  16405. return false;
  16406. }
  16407. if (typeof Object.getOwnPropertyDescriptor === "function") {
  16408. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  16409. if (descriptor.value !== symVal || descriptor.enumerable !== true) {
  16410. return false;
  16411. }
  16412. }
  16413. return true;
  16414. };
  16415. }, {}], 353: [function(require2, module3, exports3) {
  16416. "use strict";
  16417. var hasSymbols = require2("has-symbols/shams");
  16418. module3.exports = function hasToStringTagShams() {
  16419. return hasSymbols() && !!Symbol.toStringTag;
  16420. };
  16421. }, { "has-symbols/shams": 352 }], 354: [function(require2, module3, exports3) {
  16422. "use strict";
  16423. var bind = require2("function-bind");
  16424. module3.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  16425. }, { "function-bind": 347 }], 355: [function(require2, module3, exports3) {
  16426. var http = require2("http");
  16427. var url = require2("url");
  16428. var https = module3.exports;
  16429. for (var key in http) {
  16430. if (http.hasOwnProperty(key))
  16431. https[key] = http[key];
  16432. }
  16433. https.request = function(params, cb) {
  16434. params = validateParams(params);
  16435. return http.request.call(this, params, cb);
  16436. };
  16437. https.get = function(params, cb) {
  16438. params = validateParams(params);
  16439. return http.get.call(this, params, cb);
  16440. };
  16441. function validateParams(params) {
  16442. if (typeof params === "string") {
  16443. params = url.parse(params);
  16444. }
  16445. if (!params.protocol) {
  16446. params.protocol = "https:";
  16447. }
  16448. if (params.protocol !== "https:") {
  16449. throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"');
  16450. }
  16451. return params;
  16452. }
  16453. }, { "http": 468, "url": 472 }], 356: [function(require2, module3, exports3) {
  16454. "use strict";
  16455. var util = require2("util");
  16456. var ms = require2("ms");
  16457. module3.exports = function(t) {
  16458. if (typeof t === "number")
  16459. return t;
  16460. var r = ms(t);
  16461. if (r === void 0) {
  16462. var err = new Error(util.format("humanize-ms(%j) result undefined", t));
  16463. console.warn(err.stack);
  16464. }
  16465. return r;
  16466. };
  16467. }, { "ms": 376, "util": 419 }], 357: [function(require2, module3, exports3) {
  16468. exports3.read = function(buffer, offset, isLE, mLen, nBytes) {
  16469. var e, m;
  16470. var eLen = nBytes * 8 - mLen - 1;
  16471. var eMax = (1 << eLen) - 1;
  16472. var eBias = eMax >> 1;
  16473. var nBits = -7;
  16474. var i = isLE ? nBytes - 1 : 0;
  16475. var d = isLE ? -1 : 1;
  16476. var s = buffer[offset + i];
  16477. i += d;
  16478. e = s & (1 << -nBits) - 1;
  16479. s >>= -nBits;
  16480. nBits += eLen;
  16481. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {
  16482. }
  16483. m = e & (1 << -nBits) - 1;
  16484. e >>= -nBits;
  16485. nBits += mLen;
  16486. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {
  16487. }
  16488. if (e === 0) {
  16489. e = 1 - eBias;
  16490. } else if (e === eMax) {
  16491. return m ? NaN : (s ? -1 : 1) * Infinity;
  16492. } else {
  16493. m = m + Math.pow(2, mLen);
  16494. e = e - eBias;
  16495. }
  16496. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  16497. };
  16498. exports3.write = function(buffer, value, offset, isLE, mLen, nBytes) {
  16499. var e, m, c;
  16500. var eLen = nBytes * 8 - mLen - 1;
  16501. var eMax = (1 << eLen) - 1;
  16502. var eBias = eMax >> 1;
  16503. var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
  16504. var i = isLE ? 0 : nBytes - 1;
  16505. var d = isLE ? 1 : -1;
  16506. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  16507. value = Math.abs(value);
  16508. if (isNaN(value) || value === Infinity) {
  16509. m = isNaN(value) ? 1 : 0;
  16510. e = eMax;
  16511. } else {
  16512. e = Math.floor(Math.log(value) / Math.LN2);
  16513. if (value * (c = Math.pow(2, -e)) < 1) {
  16514. e--;
  16515. c *= 2;
  16516. }
  16517. if (e + eBias >= 1) {
  16518. value += rt / c;
  16519. } else {
  16520. value += rt * Math.pow(2, 1 - eBias);
  16521. }
  16522. if (value * c >= 2) {
  16523. e++;
  16524. c /= 2;
  16525. }
  16526. if (e + eBias >= eMax) {
  16527. m = 0;
  16528. e = eMax;
  16529. } else if (e + eBias >= 1) {
  16530. m = (value * c - 1) * Math.pow(2, mLen);
  16531. e = e + eBias;
  16532. } else {
  16533. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  16534. e = 0;
  16535. }
  16536. }
  16537. for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
  16538. }
  16539. e = e << mLen | m;
  16540. eLen += mLen;
  16541. for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
  16542. }
  16543. buffer[offset + i - d] |= s * 128;
  16544. };
  16545. }, {}], 358: [function(require2, module3, exports3) {
  16546. "use strict";
  16547. var types = [
  16548. require2("./nextTick"),
  16549. require2("./queueMicrotask"),
  16550. require2("./mutation.js"),
  16551. require2("./messageChannel"),
  16552. require2("./stateChange"),
  16553. require2("./timeout")
  16554. ];
  16555. var draining;
  16556. var currentQueue;
  16557. var queueIndex = -1;
  16558. var queue = [];
  16559. var scheduled = false;
  16560. function cleanUpNextTick() {
  16561. if (!draining || !currentQueue) {
  16562. return;
  16563. }
  16564. draining = false;
  16565. if (currentQueue.length) {
  16566. queue = currentQueue.concat(queue);
  16567. } else {
  16568. queueIndex = -1;
  16569. }
  16570. if (queue.length) {
  16571. nextTick();
  16572. }
  16573. }
  16574. function nextTick() {
  16575. if (draining) {
  16576. return;
  16577. }
  16578. scheduled = false;
  16579. draining = true;
  16580. var len2 = queue.length;
  16581. var timeout = setTimeout(cleanUpNextTick);
  16582. while (len2) {
  16583. currentQueue = queue;
  16584. queue = [];
  16585. while (currentQueue && ++queueIndex < len2) {
  16586. currentQueue[queueIndex].run();
  16587. }
  16588. queueIndex = -1;
  16589. len2 = queue.length;
  16590. }
  16591. currentQueue = null;
  16592. queueIndex = -1;
  16593. draining = false;
  16594. clearTimeout(timeout);
  16595. }
  16596. var scheduleDrain;
  16597. var i = -1;
  16598. var len = types.length;
  16599. while (++i < len) {
  16600. if (types[i] && types[i].test && types[i].test()) {
  16601. scheduleDrain = types[i].install(nextTick);
  16602. break;
  16603. }
  16604. }
  16605. function Item(fun, array) {
  16606. this.fun = fun;
  16607. this.array = array;
  16608. }
  16609. Item.prototype.run = function() {
  16610. var fun = this.fun;
  16611. var array = this.array;
  16612. switch (array.length) {
  16613. case 0:
  16614. return fun();
  16615. case 1:
  16616. return fun(array[0]);
  16617. case 2:
  16618. return fun(array[0], array[1]);
  16619. case 3:
  16620. return fun(array[0], array[1], array[2]);
  16621. default:
  16622. return fun.apply(null, array);
  16623. }
  16624. };
  16625. module3.exports = immediate;
  16626. function immediate(task) {
  16627. var args = new Array(arguments.length - 1);
  16628. if (arguments.length > 1) {
  16629. for (var i2 = 1; i2 < arguments.length; i2++) {
  16630. args[i2 - 1] = arguments[i2];
  16631. }
  16632. }
  16633. queue.push(new Item(task, args));
  16634. if (!scheduled && !draining) {
  16635. scheduled = true;
  16636. scheduleDrain();
  16637. }
  16638. }
  16639. }, { "./messageChannel": 359, "./mutation.js": 360, "./nextTick": 89, "./queueMicrotask": 361, "./stateChange": 362, "./timeout": 363 }], 359: [function(require2, module3, exports3) {
  16640. (function(global2) {
  16641. (function() {
  16642. "use strict";
  16643. exports3.test = function() {
  16644. if (global2.setImmediate) {
  16645. return false;
  16646. }
  16647. return typeof global2.MessageChannel !== "undefined";
  16648. };
  16649. exports3.install = function(func) {
  16650. var channel = new global2.MessageChannel();
  16651. channel.port1.onmessage = func;
  16652. return function() {
  16653. channel.port2.postMessage(0);
  16654. };
  16655. };
  16656. }).call(this);
  16657. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  16658. }, {}], 360: [function(require2, module3, exports3) {
  16659. (function(global2) {
  16660. (function() {
  16661. "use strict";
  16662. var Mutation = global2.MutationObserver || global2.WebKitMutationObserver;
  16663. exports3.test = function() {
  16664. return Mutation;
  16665. };
  16666. exports3.install = function(handle) {
  16667. var called = 0;
  16668. var observer = new Mutation(handle);
  16669. var element = global2.document.createTextNode("");
  16670. observer.observe(element, {
  16671. characterData: true
  16672. });
  16673. return function() {
  16674. element.data = called = ++called % 2;
  16675. };
  16676. };
  16677. }).call(this);
  16678. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  16679. }, {}], 361: [function(require2, module3, exports3) {
  16680. (function(global2) {
  16681. (function() {
  16682. "use strict";
  16683. exports3.test = function() {
  16684. return typeof global2.queueMicrotask === "function";
  16685. };
  16686. exports3.install = function(func) {
  16687. return function() {
  16688. global2.queueMicrotask(func);
  16689. };
  16690. };
  16691. }).call(this);
  16692. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  16693. }, {}], 362: [function(require2, module3, exports3) {
  16694. (function(global2) {
  16695. (function() {
  16696. "use strict";
  16697. exports3.test = function() {
  16698. return "document" in global2 && "onreadystatechange" in global2.document.createElement("script");
  16699. };
  16700. exports3.install = function(handle) {
  16701. return function() {
  16702. var scriptEl = global2.document.createElement("script");
  16703. scriptEl.onreadystatechange = function() {
  16704. handle();
  16705. scriptEl.onreadystatechange = null;
  16706. scriptEl.parentNode.removeChild(scriptEl);
  16707. scriptEl = null;
  16708. };
  16709. global2.document.documentElement.appendChild(scriptEl);
  16710. return handle;
  16711. };
  16712. };
  16713. }).call(this);
  16714. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  16715. }, {}], 363: [function(require2, module3, exports3) {
  16716. "use strict";
  16717. exports3.test = function() {
  16718. return true;
  16719. };
  16720. exports3.install = function(t) {
  16721. return function() {
  16722. setTimeout(t, 0);
  16723. };
  16724. };
  16725. }, {}], 364: [function(require2, module3, exports3) {
  16726. if (typeof Object.create === "function") {
  16727. module3.exports = function inherits(ctor, superCtor) {
  16728. if (superCtor) {
  16729. ctor.super_ = superCtor;
  16730. ctor.prototype = Object.create(superCtor.prototype, {
  16731. constructor: {
  16732. value: ctor,
  16733. enumerable: false,
  16734. writable: true,
  16735. configurable: true
  16736. }
  16737. });
  16738. }
  16739. };
  16740. } else {
  16741. module3.exports = function inherits(ctor, superCtor) {
  16742. if (superCtor) {
  16743. ctor.super_ = superCtor;
  16744. var TempCtor = function() {
  16745. };
  16746. TempCtor.prototype = superCtor.prototype;
  16747. ctor.prototype = new TempCtor();
  16748. ctor.prototype.constructor = ctor;
  16749. }
  16750. };
  16751. }
  16752. }, {}], 365: [function(require2, module3, exports3) {
  16753. "use strict";
  16754. var hasToStringTag = require2("has-tostringtag/shams")();
  16755. var callBound = require2("call-bind/callBound");
  16756. var $toString = callBound("Object.prototype.toString");
  16757. var isStandardArguments = function isArguments(value) {
  16758. if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
  16759. return false;
  16760. }
  16761. return $toString(value) === "[object Arguments]";
  16762. };
  16763. var isLegacyArguments = function isArguments(value) {
  16764. if (isStandardArguments(value)) {
  16765. return true;
  16766. }
  16767. return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
  16768. };
  16769. var supportsStandardArguments = function() {
  16770. return isStandardArguments(arguments);
  16771. }();
  16772. isStandardArguments.isLegacyArguments = isLegacyArguments;
  16773. module3.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
  16774. }, { "call-bind/callBound": 92, "has-tostringtag/shams": 353 }], 366: [function(require2, module3, exports3) {
  16775. module3.exports = function(obj) {
  16776. return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
  16777. };
  16778. function isBuffer(obj) {
  16779. return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
  16780. }
  16781. function isSlowBuffer(obj) {
  16782. return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0));
  16783. }
  16784. }, {}], 367: [function(require2, module3, exports3) {
  16785. "use strict";
  16786. var fnToStr = Function.prototype.toString;
  16787. var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
  16788. var badArrayLike;
  16789. var isCallableMarker;
  16790. if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
  16791. try {
  16792. badArrayLike = Object.defineProperty({}, "length", {
  16793. get: function() {
  16794. throw isCallableMarker;
  16795. }
  16796. });
  16797. isCallableMarker = {};
  16798. reflectApply(function() {
  16799. throw 42;
  16800. }, null, badArrayLike);
  16801. } catch (_) {
  16802. if (_ !== isCallableMarker) {
  16803. reflectApply = null;
  16804. }
  16805. }
  16806. } else {
  16807. reflectApply = null;
  16808. }
  16809. var constructorRegex = /^\s*class\b/;
  16810. var isES6ClassFn = function isES6ClassFunction(value) {
  16811. try {
  16812. var fnStr = fnToStr.call(value);
  16813. return constructorRegex.test(fnStr);
  16814. } catch (e) {
  16815. return false;
  16816. }
  16817. };
  16818. var tryFunctionObject = function tryFunctionToStr(value) {
  16819. try {
  16820. if (isES6ClassFn(value)) {
  16821. return false;
  16822. }
  16823. fnToStr.call(value);
  16824. return true;
  16825. } catch (e) {
  16826. return false;
  16827. }
  16828. };
  16829. var toStr = Object.prototype.toString;
  16830. var objectClass = "[object Object]";
  16831. var fnClass = "[object Function]";
  16832. var genClass = "[object GeneratorFunction]";
  16833. var ddaClass = "[object HTMLAllCollection]";
  16834. var ddaClass2 = "[object HTML document.all class]";
  16835. var ddaClass3 = "[object HTMLCollection]";
  16836. var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
  16837. var isIE68 = !(0 in [,]);
  16838. var isDDA = function isDocumentDotAll() {
  16839. return false;
  16840. };
  16841. if (typeof document === "object") {
  16842. var all = document.all;
  16843. if (toStr.call(all) === toStr.call(document.all)) {
  16844. isDDA = function isDocumentDotAll(value) {
  16845. if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) {
  16846. try {
  16847. var str = toStr.call(value);
  16848. return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null;
  16849. } catch (e) {
  16850. }
  16851. }
  16852. return false;
  16853. };
  16854. }
  16855. }
  16856. module3.exports = reflectApply ? function isCallable(value) {
  16857. if (isDDA(value)) {
  16858. return true;
  16859. }
  16860. if (!value) {
  16861. return false;
  16862. }
  16863. if (typeof value !== "function" && typeof value !== "object") {
  16864. return false;
  16865. }
  16866. try {
  16867. reflectApply(value, null, badArrayLike);
  16868. } catch (e) {
  16869. if (e !== isCallableMarker) {
  16870. return false;
  16871. }
  16872. }
  16873. return !isES6ClassFn(value) && tryFunctionObject(value);
  16874. } : function isCallable(value) {
  16875. if (isDDA(value)) {
  16876. return true;
  16877. }
  16878. if (!value) {
  16879. return false;
  16880. }
  16881. if (typeof value !== "function" && typeof value !== "object") {
  16882. return false;
  16883. }
  16884. if (hasToStringTag) {
  16885. return tryFunctionObject(value);
  16886. }
  16887. if (isES6ClassFn(value)) {
  16888. return false;
  16889. }
  16890. var strClass = toStr.call(value);
  16891. if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) {
  16892. return false;
  16893. }
  16894. return tryFunctionObject(value);
  16895. };
  16896. }, {}], 368: [function(require2, module3, exports3) {
  16897. "use strict";
  16898. var toStr = Object.prototype.toString;
  16899. var fnToStr = Function.prototype.toString;
  16900. var isFnRegex = /^\s*(?:function)?\*/;
  16901. var hasToStringTag = require2("has-tostringtag/shams")();
  16902. var getProto = Object.getPrototypeOf;
  16903. var getGeneratorFunc = function() {
  16904. if (!hasToStringTag) {
  16905. return false;
  16906. }
  16907. try {
  16908. return Function("return function*() {}")();
  16909. } catch (e) {
  16910. }
  16911. };
  16912. var GeneratorFunction;
  16913. module3.exports = function isGeneratorFunction(fn) {
  16914. if (typeof fn !== "function") {
  16915. return false;
  16916. }
  16917. if (isFnRegex.test(fnToStr.call(fn))) {
  16918. return true;
  16919. }
  16920. if (!hasToStringTag) {
  16921. var str = toStr.call(fn);
  16922. return str === "[object GeneratorFunction]";
  16923. }
  16924. if (!getProto) {
  16925. return false;
  16926. }
  16927. if (typeof GeneratorFunction === "undefined") {
  16928. var generatorFunc = getGeneratorFunc();
  16929. GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
  16930. }
  16931. return getProto(fn) === GeneratorFunction;
  16932. };
  16933. }, { "has-tostringtag/shams": 353 }], 369: [function(require2, module3, exports3) {
  16934. "use strict";
  16935. var whichTypedArray = require2("which-typed-array");
  16936. module3.exports = function isTypedArray(value) {
  16937. return !!whichTypedArray(value);
  16938. };
  16939. }, { "which-typed-array": 420 }], 370: [function(require2, module3, exports3) {
  16940. var toString = {}.toString;
  16941. module3.exports = Array.isArray || function(arr) {
  16942. return toString.call(arr) == "[object Array]";
  16943. };
  16944. }, {}], 371: [function(require2, module3, exports3) {
  16945. (function(global2) {
  16946. (function() {
  16947. ;
  16948. (function(global3, factory) {
  16949. typeof exports3 === "object" && typeof module3 !== "undefined" ? module3.exports = factory(global3) : typeof define2 === "function" && define2.amd ? define2(factory) : factory(global3);
  16950. })(typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global2 !== "undefined" ? global2 : this, function(global3) {
  16951. "use strict";
  16952. global3 = global3 || {};
  16953. var _Base64 = global3.Base64;
  16954. var version = "2.6.4";
  16955. var b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  16956. var b64tab = function(bin) {
  16957. var t = {};
  16958. for (var i = 0, l = bin.length; i < l; i++)
  16959. t[bin.charAt(i)] = i;
  16960. return t;
  16961. }(b64chars);
  16962. var fromCharCode = String.fromCharCode;
  16963. var cb_utob = function(c) {
  16964. if (c.length < 2) {
  16965. var cc = c.charCodeAt(0);
  16966. return cc < 128 ? c : cc < 2048 ? fromCharCode(192 | cc >>> 6) + fromCharCode(128 | cc & 63) : fromCharCode(224 | cc >>> 12 & 15) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
  16967. } else {
  16968. var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);
  16969. return fromCharCode(240 | cc >>> 18 & 7) + fromCharCode(128 | cc >>> 12 & 63) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
  16970. }
  16971. };
  16972. var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
  16973. var utob = function(u) {
  16974. return u.replace(re_utob, cb_utob);
  16975. };
  16976. var cb_encode = function(ccc) {
  16977. var padlen = [0, 2, 1][ccc.length % 3], ord = ccc.charCodeAt(0) << 16 | (ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8 | (ccc.length > 2 ? ccc.charCodeAt(2) : 0), chars = [
  16978. b64chars.charAt(ord >>> 18),
  16979. b64chars.charAt(ord >>> 12 & 63),
  16980. padlen >= 2 ? "=" : b64chars.charAt(ord >>> 6 & 63),
  16981. padlen >= 1 ? "=" : b64chars.charAt(ord & 63)
  16982. ];
  16983. return chars.join("");
  16984. };
  16985. var btoa = global3.btoa && typeof global3.btoa == "function" ? function(b) {
  16986. return global3.btoa(b);
  16987. } : function(b) {
  16988. if (b.match(/[^\x00-\xFF]/))
  16989. throw new RangeError(
  16990. "The string contains invalid characters."
  16991. );
  16992. return b.replace(/[\s\S]{1,3}/g, cb_encode);
  16993. };
  16994. var _encode = function(u) {
  16995. return btoa(utob(String(u)));
  16996. };
  16997. var mkUriSafe = function(b64) {
  16998. return b64.replace(/[+\/]/g, function(m0) {
  16999. return m0 == "+" ? "-" : "_";
  17000. }).replace(/=/g, "");
  17001. };
  17002. var encode = function(u, urisafe) {
  17003. return urisafe ? mkUriSafe(_encode(u)) : _encode(u);
  17004. };
  17005. var encodeURI2 = function(u) {
  17006. return encode(u, true);
  17007. };
  17008. var fromUint8Array;
  17009. if (global3.Uint8Array)
  17010. fromUint8Array = function(a, urisafe) {
  17011. var b64 = "";
  17012. for (var i = 0, l = a.length; i < l; i += 3) {
  17013. var a0 = a[i], a1 = a[i + 1], a2 = a[i + 2];
  17014. var ord = a0 << 16 | a1 << 8 | a2;
  17015. b64 += b64chars.charAt(ord >>> 18) + b64chars.charAt(ord >>> 12 & 63) + (typeof a1 != "undefined" ? b64chars.charAt(ord >>> 6 & 63) : "=") + (typeof a2 != "undefined" ? b64chars.charAt(ord & 63) : "=");
  17016. }
  17017. return urisafe ? mkUriSafe(b64) : b64;
  17018. };
  17019. var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
  17020. var cb_btou = function(cccc) {
  17021. switch (cccc.length) {
  17022. case 4:
  17023. var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;
  17024. return fromCharCode((offset >>> 10) + 55296) + fromCharCode((offset & 1023) + 56320);
  17025. case 3:
  17026. return fromCharCode(
  17027. (15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2)
  17028. );
  17029. default:
  17030. return fromCharCode(
  17031. (31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1)
  17032. );
  17033. }
  17034. };
  17035. var btou = function(b) {
  17036. return b.replace(re_btou, cb_btou);
  17037. };
  17038. var cb_decode = function(cccc) {
  17039. var len = cccc.length, padlen = len % 4, n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0) | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0) | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0) | (len > 3 ? b64tab[cccc.charAt(3)] : 0), chars = [
  17040. fromCharCode(n >>> 16),
  17041. fromCharCode(n >>> 8 & 255),
  17042. fromCharCode(n & 255)
  17043. ];
  17044. chars.length -= [0, 0, 2, 1][padlen];
  17045. return chars.join("");
  17046. };
  17047. var _atob = global3.atob && typeof global3.atob == "function" ? function(a) {
  17048. return global3.atob(a);
  17049. } : function(a) {
  17050. return a.replace(/\S{1,4}/g, cb_decode);
  17051. };
  17052. var atob = function(a) {
  17053. return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, ""));
  17054. };
  17055. var _decode = function(a) {
  17056. return btou(_atob(a));
  17057. };
  17058. var _fromURI = function(a) {
  17059. return String(a).replace(/[-_]/g, function(m0) {
  17060. return m0 == "-" ? "+" : "/";
  17061. }).replace(/[^A-Za-z0-9\+\/]/g, "");
  17062. };
  17063. var decode = function(a) {
  17064. return _decode(_fromURI(a));
  17065. };
  17066. var toUint8Array;
  17067. if (global3.Uint8Array)
  17068. toUint8Array = function(a) {
  17069. return Uint8Array.from(atob(_fromURI(a)), function(c) {
  17070. return c.charCodeAt(0);
  17071. });
  17072. };
  17073. var noConflict = function() {
  17074. var Base642 = global3.Base64;
  17075. global3.Base64 = _Base64;
  17076. return Base642;
  17077. };
  17078. global3.Base64 = {
  17079. VERSION: version,
  17080. atob,
  17081. btoa,
  17082. fromBase64: decode,
  17083. toBase64: encode,
  17084. utob,
  17085. encode,
  17086. encodeURI: encodeURI2,
  17087. btou,
  17088. decode,
  17089. noConflict,
  17090. fromUint8Array,
  17091. toUint8Array
  17092. };
  17093. if (typeof Object.defineProperty === "function") {
  17094. var noEnum = function(v) {
  17095. return { value: v, enumerable: false, writable: true, configurable: true };
  17096. };
  17097. global3.Base64.extendString = function() {
  17098. Object.defineProperty(
  17099. String.prototype,
  17100. "fromBase64",
  17101. noEnum(function() {
  17102. return decode(this);
  17103. })
  17104. );
  17105. Object.defineProperty(
  17106. String.prototype,
  17107. "toBase64",
  17108. noEnum(function(urisafe) {
  17109. return encode(this, urisafe);
  17110. })
  17111. );
  17112. Object.defineProperty(
  17113. String.prototype,
  17114. "toBase64URI",
  17115. noEnum(function() {
  17116. return encode(this, true);
  17117. })
  17118. );
  17119. };
  17120. }
  17121. if (global3["Meteor"]) {
  17122. Base64 = global3.Base64;
  17123. }
  17124. if (typeof module3 !== "undefined" && module3.exports) {
  17125. module3.exports.Base64 = global3.Base64;
  17126. } else if (typeof define2 === "function" && define2.amd) {
  17127. define2([], function() {
  17128. return global3.Base64;
  17129. });
  17130. }
  17131. return { Base64: global3.Base64 };
  17132. });
  17133. }).call(this);
  17134. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  17135. }, {}], 372: [function(require2, module3, exports3) {
  17136. "use strict";
  17137. module3.exports = merge;
  17138. var hasOwnProperty = Object.prototype.hasOwnProperty;
  17139. function merge(dest, src, redefine) {
  17140. if (!dest) {
  17141. throw new TypeError("argument dest is required");
  17142. }
  17143. if (!src) {
  17144. throw new TypeError("argument src is required");
  17145. }
  17146. if (redefine === void 0) {
  17147. redefine = true;
  17148. }
  17149. Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {
  17150. if (!redefine && hasOwnProperty.call(dest, name)) {
  17151. return;
  17152. }
  17153. var descriptor = Object.getOwnPropertyDescriptor(src, name);
  17154. Object.defineProperty(dest, name, descriptor);
  17155. });
  17156. return dest;
  17157. }
  17158. }, {}], 373: [function(require2, module3, exports3) {
  17159. "use strict";
  17160. require2("core-js/modules/es.array.map.js");
  17161. require2("core-js/modules/es.regexp.exec.js");
  17162. require2("core-js/modules/es.string.replace.js");
  17163. require2("core-js/modules/es.regexp.constructor.js");
  17164. require2("core-js/modules/es.regexp.to-string.js");
  17165. function Mime() {
  17166. this._types = /* @__PURE__ */ Object.create(null);
  17167. this._extensions = /* @__PURE__ */ Object.create(null);
  17168. for (var i = 0; i < arguments.length; i++) {
  17169. this.define(arguments[i]);
  17170. }
  17171. this.define = this.define.bind(this);
  17172. this.getType = this.getType.bind(this);
  17173. this.getExtension = this.getExtension.bind(this);
  17174. }
  17175. Mime.prototype.define = function(typeMap, force) {
  17176. for (var type in typeMap) {
  17177. var extensions = typeMap[type].map(function(t) {
  17178. return t.toLowerCase();
  17179. });
  17180. type = type.toLowerCase();
  17181. for (var i = 0; i < extensions.length; i++) {
  17182. var ext = extensions[i];
  17183. if (ext[0] === "*") {
  17184. continue;
  17185. }
  17186. if (!force && ext in this._types) {
  17187. throw new Error('Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".');
  17188. }
  17189. this._types[ext] = type;
  17190. }
  17191. if (force || !this._extensions[type]) {
  17192. var _ext = extensions[0];
  17193. this._extensions[type] = _ext[0] !== "*" ? _ext : _ext.substr(1);
  17194. }
  17195. }
  17196. };
  17197. Mime.prototype.getType = function(path) {
  17198. path = String(path);
  17199. var last = path.replace(/^.*[/\\]/, "").toLowerCase();
  17200. var ext = last.replace(/^.*\./, "").toLowerCase();
  17201. var hasPath = last.length < path.length;
  17202. var hasDot = ext.length < last.length - 1;
  17203. return (hasDot || !hasPath) && this._types[ext] || null;
  17204. };
  17205. Mime.prototype.getExtension = function(type) {
  17206. type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
  17207. return type && this._extensions[type.toLowerCase()] || null;
  17208. };
  17209. module3.exports = Mime;
  17210. }, { "core-js/modules/es.array.map.js": 280, "core-js/modules/es.regexp.constructor.js": 299, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.replace.js": 305 }], 374: [function(require2, module3, exports3) {
  17211. "use strict";
  17212. var Mime = require2("./Mime");
  17213. module3.exports = new Mime(require2("./types/standard"));
  17214. }, { "./Mime": 373, "./types/standard": 375 }], 375: [function(require2, module3, exports3) {
  17215. "use strict";
  17216. module3.exports = {
  17217. "application/andrew-inset": ["ez"],
  17218. "application/applixware": ["aw"],
  17219. "application/atom+xml": ["atom"],
  17220. "application/atomcat+xml": ["atomcat"],
  17221. "application/atomdeleted+xml": ["atomdeleted"],
  17222. "application/atomsvc+xml": ["atomsvc"],
  17223. "application/atsc-dwd+xml": ["dwd"],
  17224. "application/atsc-held+xml": ["held"],
  17225. "application/atsc-rsat+xml": ["rsat"],
  17226. "application/bdoc": ["bdoc"],
  17227. "application/calendar+xml": ["xcs"],
  17228. "application/ccxml+xml": ["ccxml"],
  17229. "application/cdfx+xml": ["cdfx"],
  17230. "application/cdmi-capability": ["cdmia"],
  17231. "application/cdmi-container": ["cdmic"],
  17232. "application/cdmi-domain": ["cdmid"],
  17233. "application/cdmi-object": ["cdmio"],
  17234. "application/cdmi-queue": ["cdmiq"],
  17235. "application/cu-seeme": ["cu"],
  17236. "application/dash+xml": ["mpd"],
  17237. "application/davmount+xml": ["davmount"],
  17238. "application/docbook+xml": ["dbk"],
  17239. "application/dssc+der": ["dssc"],
  17240. "application/dssc+xml": ["xdssc"],
  17241. "application/ecmascript": ["es", "ecma"],
  17242. "application/emma+xml": ["emma"],
  17243. "application/emotionml+xml": ["emotionml"],
  17244. "application/epub+zip": ["epub"],
  17245. "application/exi": ["exi"],
  17246. "application/express": ["exp"],
  17247. "application/fdt+xml": ["fdt"],
  17248. "application/font-tdpfr": ["pfr"],
  17249. "application/geo+json": ["geojson"],
  17250. "application/gml+xml": ["gml"],
  17251. "application/gpx+xml": ["gpx"],
  17252. "application/gxf": ["gxf"],
  17253. "application/gzip": ["gz"],
  17254. "application/hjson": ["hjson"],
  17255. "application/hyperstudio": ["stk"],
  17256. "application/inkml+xml": ["ink", "inkml"],
  17257. "application/ipfix": ["ipfix"],
  17258. "application/its+xml": ["its"],
  17259. "application/java-archive": ["jar", "war", "ear"],
  17260. "application/java-serialized-object": ["ser"],
  17261. "application/java-vm": ["class"],
  17262. "application/javascript": ["js", "mjs"],
  17263. "application/json": ["json", "map"],
  17264. "application/json5": ["json5"],
  17265. "application/jsonml+json": ["jsonml"],
  17266. "application/ld+json": ["jsonld"],
  17267. "application/lgr+xml": ["lgr"],
  17268. "application/lost+xml": ["lostxml"],
  17269. "application/mac-binhex40": ["hqx"],
  17270. "application/mac-compactpro": ["cpt"],
  17271. "application/mads+xml": ["mads"],
  17272. "application/manifest+json": ["webmanifest"],
  17273. "application/marc": ["mrc"],
  17274. "application/marcxml+xml": ["mrcx"],
  17275. "application/mathematica": ["ma", "nb", "mb"],
  17276. "application/mathml+xml": ["mathml"],
  17277. "application/mbox": ["mbox"],
  17278. "application/mediaservercontrol+xml": ["mscml"],
  17279. "application/metalink+xml": ["metalink"],
  17280. "application/metalink4+xml": ["meta4"],
  17281. "application/mets+xml": ["mets"],
  17282. "application/mmt-aei+xml": ["maei"],
  17283. "application/mmt-usd+xml": ["musd"],
  17284. "application/mods+xml": ["mods"],
  17285. "application/mp21": ["m21", "mp21"],
  17286. "application/mp4": ["mp4s", "m4p"],
  17287. "application/msword": ["doc", "dot"],
  17288. "application/mxf": ["mxf"],
  17289. "application/n-quads": ["nq"],
  17290. "application/n-triples": ["nt"],
  17291. "application/node": ["cjs"],
  17292. "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"],
  17293. "application/oda": ["oda"],
  17294. "application/oebps-package+xml": ["opf"],
  17295. "application/ogg": ["ogx"],
  17296. "application/omdoc+xml": ["omdoc"],
  17297. "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"],
  17298. "application/oxps": ["oxps"],
  17299. "application/p2p-overlay+xml": ["relo"],
  17300. "application/patch-ops-error+xml": ["xer"],
  17301. "application/pdf": ["pdf"],
  17302. "application/pgp-encrypted": ["pgp"],
  17303. "application/pgp-signature": ["asc", "sig"],
  17304. "application/pics-rules": ["prf"],
  17305. "application/pkcs10": ["p10"],
  17306. "application/pkcs7-mime": ["p7m", "p7c"],
  17307. "application/pkcs7-signature": ["p7s"],
  17308. "application/pkcs8": ["p8"],
  17309. "application/pkix-attr-cert": ["ac"],
  17310. "application/pkix-cert": ["cer"],
  17311. "application/pkix-crl": ["crl"],
  17312. "application/pkix-pkipath": ["pkipath"],
  17313. "application/pkixcmp": ["pki"],
  17314. "application/pls+xml": ["pls"],
  17315. "application/postscript": ["ai", "eps", "ps"],
  17316. "application/provenance+xml": ["provx"],
  17317. "application/pskc+xml": ["pskcxml"],
  17318. "application/raml+yaml": ["raml"],
  17319. "application/rdf+xml": ["rdf", "owl"],
  17320. "application/reginfo+xml": ["rif"],
  17321. "application/relax-ng-compact-syntax": ["rnc"],
  17322. "application/resource-lists+xml": ["rl"],
  17323. "application/resource-lists-diff+xml": ["rld"],
  17324. "application/rls-services+xml": ["rs"],
  17325. "application/route-apd+xml": ["rapd"],
  17326. "application/route-s-tsid+xml": ["sls"],
  17327. "application/route-usd+xml": ["rusd"],
  17328. "application/rpki-ghostbusters": ["gbr"],
  17329. "application/rpki-manifest": ["mft"],
  17330. "application/rpki-roa": ["roa"],
  17331. "application/rsd+xml": ["rsd"],
  17332. "application/rss+xml": ["rss"],
  17333. "application/rtf": ["rtf"],
  17334. "application/sbml+xml": ["sbml"],
  17335. "application/scvp-cv-request": ["scq"],
  17336. "application/scvp-cv-response": ["scs"],
  17337. "application/scvp-vp-request": ["spq"],
  17338. "application/scvp-vp-response": ["spp"],
  17339. "application/sdp": ["sdp"],
  17340. "application/senml+xml": ["senmlx"],
  17341. "application/sensml+xml": ["sensmlx"],
  17342. "application/set-payment-initiation": ["setpay"],
  17343. "application/set-registration-initiation": ["setreg"],
  17344. "application/shf+xml": ["shf"],
  17345. "application/sieve": ["siv", "sieve"],
  17346. "application/smil+xml": ["smi", "smil"],
  17347. "application/sparql-query": ["rq"],
  17348. "application/sparql-results+xml": ["srx"],
  17349. "application/srgs": ["gram"],
  17350. "application/srgs+xml": ["grxml"],
  17351. "application/sru+xml": ["sru"],
  17352. "application/ssdl+xml": ["ssdl"],
  17353. "application/ssml+xml": ["ssml"],
  17354. "application/swid+xml": ["swidtag"],
  17355. "application/tei+xml": ["tei", "teicorpus"],
  17356. "application/thraud+xml": ["tfi"],
  17357. "application/timestamped-data": ["tsd"],
  17358. "application/toml": ["toml"],
  17359. "application/trig": ["trig"],
  17360. "application/ttml+xml": ["ttml"],
  17361. "application/ubjson": ["ubj"],
  17362. "application/urc-ressheet+xml": ["rsheet"],
  17363. "application/urc-targetdesc+xml": ["td"],
  17364. "application/voicexml+xml": ["vxml"],
  17365. "application/wasm": ["wasm"],
  17366. "application/widget": ["wgt"],
  17367. "application/winhlp": ["hlp"],
  17368. "application/wsdl+xml": ["wsdl"],
  17369. "application/wspolicy+xml": ["wspolicy"],
  17370. "application/xaml+xml": ["xaml"],
  17371. "application/xcap-att+xml": ["xav"],
  17372. "application/xcap-caps+xml": ["xca"],
  17373. "application/xcap-diff+xml": ["xdf"],
  17374. "application/xcap-el+xml": ["xel"],
  17375. "application/xcap-ns+xml": ["xns"],
  17376. "application/xenc+xml": ["xenc"],
  17377. "application/xhtml+xml": ["xhtml", "xht"],
  17378. "application/xliff+xml": ["xlf"],
  17379. "application/xml": ["xml", "xsl", "xsd", "rng"],
  17380. "application/xml-dtd": ["dtd"],
  17381. "application/xop+xml": ["xop"],
  17382. "application/xproc+xml": ["xpl"],
  17383. "application/xslt+xml": ["*xsl", "xslt"],
  17384. "application/xspf+xml": ["xspf"],
  17385. "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
  17386. "application/yang": ["yang"],
  17387. "application/yin+xml": ["yin"],
  17388. "application/zip": ["zip"],
  17389. "audio/3gpp": ["*3gpp"],
  17390. "audio/adpcm": ["adp"],
  17391. "audio/amr": ["amr"],
  17392. "audio/basic": ["au", "snd"],
  17393. "audio/midi": ["mid", "midi", "kar", "rmi"],
  17394. "audio/mobile-xmf": ["mxmf"],
  17395. "audio/mp3": ["*mp3"],
  17396. "audio/mp4": ["m4a", "mp4a"],
  17397. "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
  17398. "audio/ogg": ["oga", "ogg", "spx", "opus"],
  17399. "audio/s3m": ["s3m"],
  17400. "audio/silk": ["sil"],
  17401. "audio/wav": ["wav"],
  17402. "audio/wave": ["*wav"],
  17403. "audio/webm": ["weba"],
  17404. "audio/xm": ["xm"],
  17405. "font/collection": ["ttc"],
  17406. "font/otf": ["otf"],
  17407. "font/ttf": ["ttf"],
  17408. "font/woff": ["woff"],
  17409. "font/woff2": ["woff2"],
  17410. "image/aces": ["exr"],
  17411. "image/apng": ["apng"],
  17412. "image/avif": ["avif"],
  17413. "image/bmp": ["bmp"],
  17414. "image/cgm": ["cgm"],
  17415. "image/dicom-rle": ["drle"],
  17416. "image/emf": ["emf"],
  17417. "image/fits": ["fits"],
  17418. "image/g3fax": ["g3"],
  17419. "image/gif": ["gif"],
  17420. "image/heic": ["heic"],
  17421. "image/heic-sequence": ["heics"],
  17422. "image/heif": ["heif"],
  17423. "image/heif-sequence": ["heifs"],
  17424. "image/hej2k": ["hej2"],
  17425. "image/hsj2": ["hsj2"],
  17426. "image/ief": ["ief"],
  17427. "image/jls": ["jls"],
  17428. "image/jp2": ["jp2", "jpg2"],
  17429. "image/jpeg": ["jpeg", "jpg", "jpe"],
  17430. "image/jph": ["jph"],
  17431. "image/jphc": ["jhc"],
  17432. "image/jpm": ["jpm"],
  17433. "image/jpx": ["jpx", "jpf"],
  17434. "image/jxr": ["jxr"],
  17435. "image/jxra": ["jxra"],
  17436. "image/jxrs": ["jxrs"],
  17437. "image/jxs": ["jxs"],
  17438. "image/jxsc": ["jxsc"],
  17439. "image/jxsi": ["jxsi"],
  17440. "image/jxss": ["jxss"],
  17441. "image/ktx": ["ktx"],
  17442. "image/ktx2": ["ktx2"],
  17443. "image/png": ["png"],
  17444. "image/sgi": ["sgi"],
  17445. "image/svg+xml": ["svg", "svgz"],
  17446. "image/t38": ["t38"],
  17447. "image/tiff": ["tif", "tiff"],
  17448. "image/tiff-fx": ["tfx"],
  17449. "image/webp": ["webp"],
  17450. "image/wmf": ["wmf"],
  17451. "message/disposition-notification": ["disposition-notification"],
  17452. "message/global": ["u8msg"],
  17453. "message/global-delivery-status": ["u8dsn"],
  17454. "message/global-disposition-notification": ["u8mdn"],
  17455. "message/global-headers": ["u8hdr"],
  17456. "message/rfc822": ["eml", "mime"],
  17457. "model/3mf": ["3mf"],
  17458. "model/gltf+json": ["gltf"],
  17459. "model/gltf-binary": ["glb"],
  17460. "model/iges": ["igs", "iges"],
  17461. "model/mesh": ["msh", "mesh", "silo"],
  17462. "model/mtl": ["mtl"],
  17463. "model/obj": ["obj"],
  17464. "model/step+xml": ["stpx"],
  17465. "model/step+zip": ["stpz"],
  17466. "model/step-xml+zip": ["stpxz"],
  17467. "model/stl": ["stl"],
  17468. "model/vrml": ["wrl", "vrml"],
  17469. "model/x3d+binary": ["*x3db", "x3dbz"],
  17470. "model/x3d+fastinfoset": ["x3db"],
  17471. "model/x3d+vrml": ["*x3dv", "x3dvz"],
  17472. "model/x3d+xml": ["x3d", "x3dz"],
  17473. "model/x3d-vrml": ["x3dv"],
  17474. "text/cache-manifest": ["appcache", "manifest"],
  17475. "text/calendar": ["ics", "ifb"],
  17476. "text/coffeescript": ["coffee", "litcoffee"],
  17477. "text/css": ["css"],
  17478. "text/csv": ["csv"],
  17479. "text/html": ["html", "htm", "shtml"],
  17480. "text/jade": ["jade"],
  17481. "text/jsx": ["jsx"],
  17482. "text/less": ["less"],
  17483. "text/markdown": ["markdown", "md"],
  17484. "text/mathml": ["mml"],
  17485. "text/mdx": ["mdx"],
  17486. "text/n3": ["n3"],
  17487. "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
  17488. "text/richtext": ["rtx"],
  17489. "text/rtf": ["*rtf"],
  17490. "text/sgml": ["sgml", "sgm"],
  17491. "text/shex": ["shex"],
  17492. "text/slim": ["slim", "slm"],
  17493. "text/spdx": ["spdx"],
  17494. "text/stylus": ["stylus", "styl"],
  17495. "text/tab-separated-values": ["tsv"],
  17496. "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
  17497. "text/turtle": ["ttl"],
  17498. "text/uri-list": ["uri", "uris", "urls"],
  17499. "text/vcard": ["vcard"],
  17500. "text/vtt": ["vtt"],
  17501. "text/xml": ["*xml"],
  17502. "text/yaml": ["yaml", "yml"],
  17503. "video/3gpp": ["3gp", "3gpp"],
  17504. "video/3gpp2": ["3g2"],
  17505. "video/h261": ["h261"],
  17506. "video/h263": ["h263"],
  17507. "video/h264": ["h264"],
  17508. "video/iso.segment": ["m4s"],
  17509. "video/jpeg": ["jpgv"],
  17510. "video/jpm": ["*jpm", "jpgm"],
  17511. "video/mj2": ["mj2", "mjp2"],
  17512. "video/mp2t": ["ts"],
  17513. "video/mp4": ["mp4", "mp4v", "mpg4"],
  17514. "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
  17515. "video/ogg": ["ogv"],
  17516. "video/quicktime": ["qt", "mov"],
  17517. "video/webm": ["webm"]
  17518. };
  17519. }, {}], 376: [function(require2, module3, exports3) {
  17520. var s = 1e3;
  17521. var m = s * 60;
  17522. var h = m * 60;
  17523. var d = h * 24;
  17524. var w = d * 7;
  17525. var y = d * 365.25;
  17526. module3.exports = function(val, options) {
  17527. options = options || {};
  17528. var type = typeof val;
  17529. if (type === "string" && val.length > 0) {
  17530. return parse(val);
  17531. } else if (type === "number" && isFinite(val)) {
  17532. return options.long ? fmtLong(val) : fmtShort(val);
  17533. }
  17534. throw new Error(
  17535. "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
  17536. );
  17537. };
  17538. function parse(str) {
  17539. str = String(str);
  17540. if (str.length > 100) {
  17541. return;
  17542. }
  17543. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  17544. str
  17545. );
  17546. if (!match) {
  17547. return;
  17548. }
  17549. var n = parseFloat(match[1]);
  17550. var type = (match[2] || "ms").toLowerCase();
  17551. switch (type) {
  17552. case "years":
  17553. case "year":
  17554. case "yrs":
  17555. case "yr":
  17556. case "y":
  17557. return n * y;
  17558. case "weeks":
  17559. case "week":
  17560. case "w":
  17561. return n * w;
  17562. case "days":
  17563. case "day":
  17564. case "d":
  17565. return n * d;
  17566. case "hours":
  17567. case "hour":
  17568. case "hrs":
  17569. case "hr":
  17570. case "h":
  17571. return n * h;
  17572. case "minutes":
  17573. case "minute":
  17574. case "mins":
  17575. case "min":
  17576. case "m":
  17577. return n * m;
  17578. case "seconds":
  17579. case "second":
  17580. case "secs":
  17581. case "sec":
  17582. case "s":
  17583. return n * s;
  17584. case "milliseconds":
  17585. case "millisecond":
  17586. case "msecs":
  17587. case "msec":
  17588. case "ms":
  17589. return n;
  17590. default:
  17591. return void 0;
  17592. }
  17593. }
  17594. function fmtShort(ms) {
  17595. var msAbs = Math.abs(ms);
  17596. if (msAbs >= d) {
  17597. return Math.round(ms / d) + "d";
  17598. }
  17599. if (msAbs >= h) {
  17600. return Math.round(ms / h) + "h";
  17601. }
  17602. if (msAbs >= m) {
  17603. return Math.round(ms / m) + "m";
  17604. }
  17605. if (msAbs >= s) {
  17606. return Math.round(ms / s) + "s";
  17607. }
  17608. return ms + "ms";
  17609. }
  17610. function fmtLong(ms) {
  17611. var msAbs = Math.abs(ms);
  17612. if (msAbs >= d) {
  17613. return plural(ms, msAbs, d, "day");
  17614. }
  17615. if (msAbs >= h) {
  17616. return plural(ms, msAbs, h, "hour");
  17617. }
  17618. if (msAbs >= m) {
  17619. return plural(ms, msAbs, m, "minute");
  17620. }
  17621. if (msAbs >= s) {
  17622. return plural(ms, msAbs, s, "second");
  17623. }
  17624. return ms + " ms";
  17625. }
  17626. function plural(ms, msAbs, n, name) {
  17627. var isPlural = msAbs >= n * 1.5;
  17628. return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
  17629. }
  17630. }, {}], 377: [function(require2, module3, exports3) {
  17631. "use strict";
  17632. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  17633. var hasOwnProperty = Object.prototype.hasOwnProperty;
  17634. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  17635. function toObject(val) {
  17636. if (val === null || val === void 0) {
  17637. throw new TypeError("Object.assign cannot be called with null or undefined");
  17638. }
  17639. return Object(val);
  17640. }
  17641. function shouldUseNative() {
  17642. try {
  17643. if (!Object.assign) {
  17644. return false;
  17645. }
  17646. var test1 = new String("abc");
  17647. test1[5] = "de";
  17648. if (Object.getOwnPropertyNames(test1)[0] === "5") {
  17649. return false;
  17650. }
  17651. var test2 = {};
  17652. for (var i = 0; i < 10; i++) {
  17653. test2["_" + String.fromCharCode(i)] = i;
  17654. }
  17655. var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
  17656. return test2[n];
  17657. });
  17658. if (order2.join("") !== "0123456789") {
  17659. return false;
  17660. }
  17661. var test3 = {};
  17662. "abcdefghijklmnopqrst".split("").forEach(function(letter) {
  17663. test3[letter] = letter;
  17664. });
  17665. if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
  17666. return false;
  17667. }
  17668. return true;
  17669. } catch (err) {
  17670. return false;
  17671. }
  17672. }
  17673. module3.exports = shouldUseNative() ? Object.assign : function(target, source) {
  17674. var from;
  17675. var to = toObject(target);
  17676. var symbols;
  17677. for (var s = 1; s < arguments.length; s++) {
  17678. from = Object(arguments[s]);
  17679. for (var key in from) {
  17680. if (hasOwnProperty.call(from, key)) {
  17681. to[key] = from[key];
  17682. }
  17683. }
  17684. if (getOwnPropertySymbols) {
  17685. symbols = getOwnPropertySymbols(from);
  17686. for (var i = 0; i < symbols.length; i++) {
  17687. if (propIsEnumerable.call(from, symbols[i])) {
  17688. to[symbols[i]] = from[symbols[i]];
  17689. }
  17690. }
  17691. }
  17692. }
  17693. return to;
  17694. };
  17695. }, {}], 378: [function(require2, module3, exports3) {
  17696. (function(process) {
  17697. (function() {
  17698. "use strict";
  17699. function assertPath(path) {
  17700. if (typeof path !== "string") {
  17701. throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
  17702. }
  17703. }
  17704. function normalizeStringPosix(path, allowAboveRoot) {
  17705. var res = "";
  17706. var lastSegmentLength = 0;
  17707. var lastSlash = -1;
  17708. var dots = 0;
  17709. var code;
  17710. for (var i = 0; i <= path.length; ++i) {
  17711. if (i < path.length)
  17712. code = path.charCodeAt(i);
  17713. else if (code === 47)
  17714. break;
  17715. else
  17716. code = 47;
  17717. if (code === 47) {
  17718. if (lastSlash === i - 1 || dots === 1) {
  17719. } else if (lastSlash !== i - 1 && dots === 2) {
  17720. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
  17721. if (res.length > 2) {
  17722. var lastSlashIndex = res.lastIndexOf("/");
  17723. if (lastSlashIndex !== res.length - 1) {
  17724. if (lastSlashIndex === -1) {
  17725. res = "";
  17726. lastSegmentLength = 0;
  17727. } else {
  17728. res = res.slice(0, lastSlashIndex);
  17729. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  17730. }
  17731. lastSlash = i;
  17732. dots = 0;
  17733. continue;
  17734. }
  17735. } else if (res.length === 2 || res.length === 1) {
  17736. res = "";
  17737. lastSegmentLength = 0;
  17738. lastSlash = i;
  17739. dots = 0;
  17740. continue;
  17741. }
  17742. }
  17743. if (allowAboveRoot) {
  17744. if (res.length > 0)
  17745. res += "/..";
  17746. else
  17747. res = "..";
  17748. lastSegmentLength = 2;
  17749. }
  17750. } else {
  17751. if (res.length > 0)
  17752. res += "/" + path.slice(lastSlash + 1, i);
  17753. else
  17754. res = path.slice(lastSlash + 1, i);
  17755. lastSegmentLength = i - lastSlash - 1;
  17756. }
  17757. lastSlash = i;
  17758. dots = 0;
  17759. } else if (code === 46 && dots !== -1) {
  17760. ++dots;
  17761. } else {
  17762. dots = -1;
  17763. }
  17764. }
  17765. return res;
  17766. }
  17767. function _format(sep, pathObject) {
  17768. var dir = pathObject.dir || pathObject.root;
  17769. var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  17770. if (!dir) {
  17771. return base;
  17772. }
  17773. if (dir === pathObject.root) {
  17774. return dir + base;
  17775. }
  17776. return dir + sep + base;
  17777. }
  17778. var posix = {
  17779. // path.resolve([from ...], to)
  17780. resolve: function resolve() {
  17781. var resolvedPath = "";
  17782. var resolvedAbsolute = false;
  17783. var cwd;
  17784. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  17785. var path;
  17786. if (i >= 0)
  17787. path = arguments[i];
  17788. else {
  17789. if (cwd === void 0)
  17790. cwd = process.cwd();
  17791. path = cwd;
  17792. }
  17793. assertPath(path);
  17794. if (path.length === 0) {
  17795. continue;
  17796. }
  17797. resolvedPath = path + "/" + resolvedPath;
  17798. resolvedAbsolute = path.charCodeAt(0) === 47;
  17799. }
  17800. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  17801. if (resolvedAbsolute) {
  17802. if (resolvedPath.length > 0)
  17803. return "/" + resolvedPath;
  17804. else
  17805. return "/";
  17806. } else if (resolvedPath.length > 0) {
  17807. return resolvedPath;
  17808. } else {
  17809. return ".";
  17810. }
  17811. },
  17812. normalize: function normalize(path) {
  17813. assertPath(path);
  17814. if (path.length === 0)
  17815. return ".";
  17816. var isAbsolute = path.charCodeAt(0) === 47;
  17817. var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  17818. path = normalizeStringPosix(path, !isAbsolute);
  17819. if (path.length === 0 && !isAbsolute)
  17820. path = ".";
  17821. if (path.length > 0 && trailingSeparator)
  17822. path += "/";
  17823. if (isAbsolute)
  17824. return "/" + path;
  17825. return path;
  17826. },
  17827. isAbsolute: function isAbsolute(path) {
  17828. assertPath(path);
  17829. return path.length > 0 && path.charCodeAt(0) === 47;
  17830. },
  17831. join: function join() {
  17832. if (arguments.length === 0)
  17833. return ".";
  17834. var joined;
  17835. for (var i = 0; i < arguments.length; ++i) {
  17836. var arg = arguments[i];
  17837. assertPath(arg);
  17838. if (arg.length > 0) {
  17839. if (joined === void 0)
  17840. joined = arg;
  17841. else
  17842. joined += "/" + arg;
  17843. }
  17844. }
  17845. if (joined === void 0)
  17846. return ".";
  17847. return posix.normalize(joined);
  17848. },
  17849. relative: function relative(from, to) {
  17850. assertPath(from);
  17851. assertPath(to);
  17852. if (from === to)
  17853. return "";
  17854. from = posix.resolve(from);
  17855. to = posix.resolve(to);
  17856. if (from === to)
  17857. return "";
  17858. var fromStart = 1;
  17859. for (; fromStart < from.length; ++fromStart) {
  17860. if (from.charCodeAt(fromStart) !== 47)
  17861. break;
  17862. }
  17863. var fromEnd = from.length;
  17864. var fromLen = fromEnd - fromStart;
  17865. var toStart = 1;
  17866. for (; toStart < to.length; ++toStart) {
  17867. if (to.charCodeAt(toStart) !== 47)
  17868. break;
  17869. }
  17870. var toEnd = to.length;
  17871. var toLen = toEnd - toStart;
  17872. var length = fromLen < toLen ? fromLen : toLen;
  17873. var lastCommonSep = -1;
  17874. var i = 0;
  17875. for (; i <= length; ++i) {
  17876. if (i === length) {
  17877. if (toLen > length) {
  17878. if (to.charCodeAt(toStart + i) === 47) {
  17879. return to.slice(toStart + i + 1);
  17880. } else if (i === 0) {
  17881. return to.slice(toStart + i);
  17882. }
  17883. } else if (fromLen > length) {
  17884. if (from.charCodeAt(fromStart + i) === 47) {
  17885. lastCommonSep = i;
  17886. } else if (i === 0) {
  17887. lastCommonSep = 0;
  17888. }
  17889. }
  17890. break;
  17891. }
  17892. var fromCode = from.charCodeAt(fromStart + i);
  17893. var toCode = to.charCodeAt(toStart + i);
  17894. if (fromCode !== toCode)
  17895. break;
  17896. else if (fromCode === 47)
  17897. lastCommonSep = i;
  17898. }
  17899. var out = "";
  17900. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  17901. if (i === fromEnd || from.charCodeAt(i) === 47) {
  17902. if (out.length === 0)
  17903. out += "..";
  17904. else
  17905. out += "/..";
  17906. }
  17907. }
  17908. if (out.length > 0)
  17909. return out + to.slice(toStart + lastCommonSep);
  17910. else {
  17911. toStart += lastCommonSep;
  17912. if (to.charCodeAt(toStart) === 47)
  17913. ++toStart;
  17914. return to.slice(toStart);
  17915. }
  17916. },
  17917. _makeLong: function _makeLong(path) {
  17918. return path;
  17919. },
  17920. dirname: function dirname(path) {
  17921. assertPath(path);
  17922. if (path.length === 0)
  17923. return ".";
  17924. var code = path.charCodeAt(0);
  17925. var hasRoot = code === 47;
  17926. var end = -1;
  17927. var matchedSlash = true;
  17928. for (var i = path.length - 1; i >= 1; --i) {
  17929. code = path.charCodeAt(i);
  17930. if (code === 47) {
  17931. if (!matchedSlash) {
  17932. end = i;
  17933. break;
  17934. }
  17935. } else {
  17936. matchedSlash = false;
  17937. }
  17938. }
  17939. if (end === -1)
  17940. return hasRoot ? "/" : ".";
  17941. if (hasRoot && end === 1)
  17942. return "//";
  17943. return path.slice(0, end);
  17944. },
  17945. basename: function basename(path, ext) {
  17946. if (ext !== void 0 && typeof ext !== "string")
  17947. throw new TypeError('"ext" argument must be a string');
  17948. assertPath(path);
  17949. var start = 0;
  17950. var end = -1;
  17951. var matchedSlash = true;
  17952. var i;
  17953. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  17954. if (ext.length === path.length && ext === path)
  17955. return "";
  17956. var extIdx = ext.length - 1;
  17957. var firstNonSlashEnd = -1;
  17958. for (i = path.length - 1; i >= 0; --i) {
  17959. var code = path.charCodeAt(i);
  17960. if (code === 47) {
  17961. if (!matchedSlash) {
  17962. start = i + 1;
  17963. break;
  17964. }
  17965. } else {
  17966. if (firstNonSlashEnd === -1) {
  17967. matchedSlash = false;
  17968. firstNonSlashEnd = i + 1;
  17969. }
  17970. if (extIdx >= 0) {
  17971. if (code === ext.charCodeAt(extIdx)) {
  17972. if (--extIdx === -1) {
  17973. end = i;
  17974. }
  17975. } else {
  17976. extIdx = -1;
  17977. end = firstNonSlashEnd;
  17978. }
  17979. }
  17980. }
  17981. }
  17982. if (start === end)
  17983. end = firstNonSlashEnd;
  17984. else if (end === -1)
  17985. end = path.length;
  17986. return path.slice(start, end);
  17987. } else {
  17988. for (i = path.length - 1; i >= 0; --i) {
  17989. if (path.charCodeAt(i) === 47) {
  17990. if (!matchedSlash) {
  17991. start = i + 1;
  17992. break;
  17993. }
  17994. } else if (end === -1) {
  17995. matchedSlash = false;
  17996. end = i + 1;
  17997. }
  17998. }
  17999. if (end === -1)
  18000. return "";
  18001. return path.slice(start, end);
  18002. }
  18003. },
  18004. extname: function extname(path) {
  18005. assertPath(path);
  18006. var startDot = -1;
  18007. var startPart = 0;
  18008. var end = -1;
  18009. var matchedSlash = true;
  18010. var preDotState = 0;
  18011. for (var i = path.length - 1; i >= 0; --i) {
  18012. var code = path.charCodeAt(i);
  18013. if (code === 47) {
  18014. if (!matchedSlash) {
  18015. startPart = i + 1;
  18016. break;
  18017. }
  18018. continue;
  18019. }
  18020. if (end === -1) {
  18021. matchedSlash = false;
  18022. end = i + 1;
  18023. }
  18024. if (code === 46) {
  18025. if (startDot === -1)
  18026. startDot = i;
  18027. else if (preDotState !== 1)
  18028. preDotState = 1;
  18029. } else if (startDot !== -1) {
  18030. preDotState = -1;
  18031. }
  18032. }
  18033. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  18034. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  18035. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  18036. return "";
  18037. }
  18038. return path.slice(startDot, end);
  18039. },
  18040. format: function format(pathObject) {
  18041. if (pathObject === null || typeof pathObject !== "object") {
  18042. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  18043. }
  18044. return _format("/", pathObject);
  18045. },
  18046. parse: function parse(path) {
  18047. assertPath(path);
  18048. var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  18049. if (path.length === 0)
  18050. return ret;
  18051. var code = path.charCodeAt(0);
  18052. var isAbsolute = code === 47;
  18053. var start;
  18054. if (isAbsolute) {
  18055. ret.root = "/";
  18056. start = 1;
  18057. } else {
  18058. start = 0;
  18059. }
  18060. var startDot = -1;
  18061. var startPart = 0;
  18062. var end = -1;
  18063. var matchedSlash = true;
  18064. var i = path.length - 1;
  18065. var preDotState = 0;
  18066. for (; i >= start; --i) {
  18067. code = path.charCodeAt(i);
  18068. if (code === 47) {
  18069. if (!matchedSlash) {
  18070. startPart = i + 1;
  18071. break;
  18072. }
  18073. continue;
  18074. }
  18075. if (end === -1) {
  18076. matchedSlash = false;
  18077. end = i + 1;
  18078. }
  18079. if (code === 46) {
  18080. if (startDot === -1)
  18081. startDot = i;
  18082. else if (preDotState !== 1)
  18083. preDotState = 1;
  18084. } else if (startDot !== -1) {
  18085. preDotState = -1;
  18086. }
  18087. }
  18088. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  18089. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  18090. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  18091. if (end !== -1) {
  18092. if (startPart === 0 && isAbsolute)
  18093. ret.base = ret.name = path.slice(1, end);
  18094. else
  18095. ret.base = ret.name = path.slice(startPart, end);
  18096. }
  18097. } else {
  18098. if (startPart === 0 && isAbsolute) {
  18099. ret.name = path.slice(1, startDot);
  18100. ret.base = path.slice(1, end);
  18101. } else {
  18102. ret.name = path.slice(startPart, startDot);
  18103. ret.base = path.slice(startPart, end);
  18104. }
  18105. ret.ext = path.slice(startDot, end);
  18106. }
  18107. if (startPart > 0)
  18108. ret.dir = path.slice(0, startPart - 1);
  18109. else if (isAbsolute)
  18110. ret.dir = "/";
  18111. return ret;
  18112. },
  18113. sep: "/",
  18114. delimiter: ":",
  18115. win32: null,
  18116. posix: null
  18117. };
  18118. posix.posix = posix;
  18119. module3.exports = posix;
  18120. }).call(this);
  18121. }).call(this, require2("_process"));
  18122. }, { "_process": 467 }], 379: [function(require2, module3, exports3) {
  18123. (function(global2) {
  18124. (function() {
  18125. ;
  18126. (function() {
  18127. "use strict";
  18128. var objectTypes = {
  18129. "function": true,
  18130. "object": true
  18131. };
  18132. var root = objectTypes[typeof window] && window || this;
  18133. var oldRoot = root;
  18134. var freeExports = objectTypes[typeof exports3] && exports3;
  18135. var freeModule = objectTypes[typeof module3] && module3 && !module3.nodeType && module3;
  18136. var freeGlobal = freeExports && freeModule && typeof global2 == "object" && global2;
  18137. if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
  18138. root = freeGlobal;
  18139. }
  18140. var maxSafeInteger = Math.pow(2, 53) - 1;
  18141. var reOpera = /\bOpera/;
  18142. var thisBinding = this;
  18143. var objectProto = Object.prototype;
  18144. var hasOwnProperty = objectProto.hasOwnProperty;
  18145. var toString = objectProto.toString;
  18146. function capitalize(string) {
  18147. string = String(string);
  18148. return string.charAt(0).toUpperCase() + string.slice(1);
  18149. }
  18150. function cleanupOS(os, pattern, label) {
  18151. var data = {
  18152. "10.0": "10",
  18153. "6.4": "10 Technical Preview",
  18154. "6.3": "8.1",
  18155. "6.2": "8",
  18156. "6.1": "Server 2008 R2 / 7",
  18157. "6.0": "Server 2008 / Vista",
  18158. "5.2": "Server 2003 / XP 64-bit",
  18159. "5.1": "XP",
  18160. "5.01": "2000 SP1",
  18161. "5.0": "2000",
  18162. "4.0": "NT",
  18163. "4.90": "ME"
  18164. };
  18165. if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && (data = data[/[\d.]+$/.exec(os)])) {
  18166. os = "Windows " + data;
  18167. }
  18168. os = String(os);
  18169. if (pattern && label) {
  18170. os = os.replace(RegExp(pattern, "i"), label);
  18171. }
  18172. os = format(
  18173. os.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]
  18174. );
  18175. return os;
  18176. }
  18177. function each(object, callback) {
  18178. var index = -1, length = object ? object.length : 0;
  18179. if (typeof length == "number" && length > -1 && length <= maxSafeInteger) {
  18180. while (++index < length) {
  18181. callback(object[index], index, object);
  18182. }
  18183. } else {
  18184. forOwn(object, callback);
  18185. }
  18186. }
  18187. function format(string) {
  18188. string = trim(string);
  18189. return /^(?:webOS|i(?:OS|P))/.test(string) ? string : capitalize(string);
  18190. }
  18191. function forOwn(object, callback) {
  18192. for (var key in object) {
  18193. if (hasOwnProperty.call(object, key)) {
  18194. callback(object[key], key, object);
  18195. }
  18196. }
  18197. }
  18198. function getClassOf(value) {
  18199. return value == null ? capitalize(value) : toString.call(value).slice(8, -1);
  18200. }
  18201. function isHostType(object, property) {
  18202. var type = object != null ? typeof object[property] : "number";
  18203. return !/^(?:boolean|number|string|undefined)$/.test(type) && (type == "object" ? !!object[property] : true);
  18204. }
  18205. function qualify(string) {
  18206. return String(string).replace(/([ -])(?!$)/g, "$1?");
  18207. }
  18208. function reduce(array, callback) {
  18209. var accumulator = null;
  18210. each(array, function(value, index) {
  18211. accumulator = callback(accumulator, value, index, array);
  18212. });
  18213. return accumulator;
  18214. }
  18215. function trim(string) {
  18216. return String(string).replace(/^ +| +$/g, "");
  18217. }
  18218. function parse(ua) {
  18219. var context = root;
  18220. var isCustomContext = ua && typeof ua == "object" && getClassOf(ua) != "String";
  18221. if (isCustomContext) {
  18222. context = ua;
  18223. ua = null;
  18224. }
  18225. var nav = context.navigator || {};
  18226. var userAgent = nav.userAgent || "";
  18227. ua || (ua = userAgent);
  18228. var isModuleScope = isCustomContext || thisBinding == oldRoot;
  18229. var likeChrome = isCustomContext ? !!nav.likeChrome : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
  18230. var objectClass = "Object", airRuntimeClass = isCustomContext ? objectClass : "ScriptBridgingProxyObject", enviroClass = isCustomContext ? objectClass : "Environment", javaClass = isCustomContext && context.java ? "JavaPackage" : getClassOf(context.java), phantomClass = isCustomContext ? objectClass : "RuntimeObject";
  18231. var java = /\bJava/.test(javaClass) && context.java;
  18232. var rhino = java && getClassOf(context.environment) == enviroClass;
  18233. var alpha = java ? "a" : "α";
  18234. var beta = java ? "b" : "β";
  18235. var doc = context.document || {};
  18236. var opera = context.operamini || context.opera;
  18237. var operaClass = reOpera.test(operaClass = isCustomContext && opera ? opera["[[Class]]"] : getClassOf(opera)) ? operaClass : opera = null;
  18238. var data;
  18239. var arch = ua;
  18240. var description = [];
  18241. var prerelease = null;
  18242. var useFeatures = ua == userAgent;
  18243. var version = useFeatures && opera && typeof opera.version == "function" && opera.version();
  18244. var isSpecialCasedOS;
  18245. var layout = getLayout([
  18246. { "label": "EdgeHTML", "pattern": "Edge" },
  18247. "Trident",
  18248. { "label": "WebKit", "pattern": "AppleWebKit" },
  18249. "iCab",
  18250. "Presto",
  18251. "NetFront",
  18252. "Tasman",
  18253. "KHTML",
  18254. "Gecko"
  18255. ]);
  18256. var name = getName([
  18257. "Adobe AIR",
  18258. "Arora",
  18259. "Avant Browser",
  18260. "Breach",
  18261. "Camino",
  18262. "Electron",
  18263. "Epiphany",
  18264. "Fennec",
  18265. "Flock",
  18266. "Galeon",
  18267. "GreenBrowser",
  18268. "iCab",
  18269. "Iceweasel",
  18270. "K-Meleon",
  18271. "Konqueror",
  18272. "Lunascape",
  18273. "Maxthon",
  18274. { "label": "Microsoft Edge", "pattern": "(?:Edge|Edg|EdgA|EdgiOS)" },
  18275. "Midori",
  18276. "Nook Browser",
  18277. "PaleMoon",
  18278. "PhantomJS",
  18279. "Raven",
  18280. "Rekonq",
  18281. "RockMelt",
  18282. { "label": "Samsung Internet", "pattern": "SamsungBrowser" },
  18283. "SeaMonkey",
  18284. { "label": "Silk", "pattern": "(?:Cloud9|Silk-Accelerated)" },
  18285. "Sleipnir",
  18286. "SlimBrowser",
  18287. { "label": "SRWare Iron", "pattern": "Iron" },
  18288. "Sunrise",
  18289. "Swiftfox",
  18290. "Vivaldi",
  18291. "Waterfox",
  18292. "WebPositive",
  18293. { "label": "Yandex Browser", "pattern": "YaBrowser" },
  18294. { "label": "UC Browser", "pattern": "UCBrowser" },
  18295. "Opera Mini",
  18296. { "label": "Opera Mini", "pattern": "OPiOS" },
  18297. "Opera",
  18298. { "label": "Opera", "pattern": "OPR" },
  18299. "Chromium",
  18300. "Chrome",
  18301. { "label": "Chrome", "pattern": "(?:HeadlessChrome)" },
  18302. { "label": "Chrome Mobile", "pattern": "(?:CriOS|CrMo)" },
  18303. { "label": "Firefox", "pattern": "(?:Firefox|Minefield)" },
  18304. { "label": "Firefox for iOS", "pattern": "FxiOS" },
  18305. { "label": "IE", "pattern": "IEMobile" },
  18306. { "label": "IE", "pattern": "MSIE" },
  18307. "Safari"
  18308. ]);
  18309. var product = getProduct([
  18310. { "label": "BlackBerry", "pattern": "BB10" },
  18311. "BlackBerry",
  18312. { "label": "Galaxy S", "pattern": "GT-I9000" },
  18313. { "label": "Galaxy S2", "pattern": "GT-I9100" },
  18314. { "label": "Galaxy S3", "pattern": "GT-I9300" },
  18315. { "label": "Galaxy S4", "pattern": "GT-I9500" },
  18316. { "label": "Galaxy S5", "pattern": "SM-G900" },
  18317. { "label": "Galaxy S6", "pattern": "SM-G920" },
  18318. { "label": "Galaxy S6 Edge", "pattern": "SM-G925" },
  18319. { "label": "Galaxy S7", "pattern": "SM-G930" },
  18320. { "label": "Galaxy S7 Edge", "pattern": "SM-G935" },
  18321. "Google TV",
  18322. "Lumia",
  18323. "iPad",
  18324. "iPod",
  18325. "iPhone",
  18326. "Kindle",
  18327. { "label": "Kindle Fire", "pattern": "(?:Cloud9|Silk-Accelerated)" },
  18328. "Nexus",
  18329. "Nook",
  18330. "PlayBook",
  18331. "PlayStation Vita",
  18332. "PlayStation",
  18333. "TouchPad",
  18334. "Transformer",
  18335. { "label": "Wii U", "pattern": "WiiU" },
  18336. "Wii",
  18337. "Xbox One",
  18338. { "label": "Xbox 360", "pattern": "Xbox" },
  18339. "Xoom"
  18340. ]);
  18341. var manufacturer = getManufacturer({
  18342. "Apple": { "iPad": 1, "iPhone": 1, "iPod": 1 },
  18343. "Alcatel": {},
  18344. "Archos": {},
  18345. "Amazon": { "Kindle": 1, "Kindle Fire": 1 },
  18346. "Asus": { "Transformer": 1 },
  18347. "Barnes & Noble": { "Nook": 1 },
  18348. "BlackBerry": { "PlayBook": 1 },
  18349. "Google": { "Google TV": 1, "Nexus": 1 },
  18350. "HP": { "TouchPad": 1 },
  18351. "HTC": {},
  18352. "Huawei": {},
  18353. "Lenovo": {},
  18354. "LG": {},
  18355. "Microsoft": { "Xbox": 1, "Xbox One": 1 },
  18356. "Motorola": { "Xoom": 1 },
  18357. "Nintendo": { "Wii U": 1, "Wii": 1 },
  18358. "Nokia": { "Lumia": 1 },
  18359. "Oppo": {},
  18360. "Samsung": { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 },
  18361. "Sony": { "PlayStation": 1, "PlayStation Vita": 1 },
  18362. "Xiaomi": { "Mi": 1, "Redmi": 1 }
  18363. });
  18364. var os = getOS([
  18365. "Windows Phone",
  18366. "KaiOS",
  18367. "Android",
  18368. "CentOS",
  18369. { "label": "Chrome OS", "pattern": "CrOS" },
  18370. "Debian",
  18371. { "label": "DragonFly BSD", "pattern": "DragonFly" },
  18372. "Fedora",
  18373. "FreeBSD",
  18374. "Gentoo",
  18375. "Haiku",
  18376. "Kubuntu",
  18377. "Linux Mint",
  18378. "OpenBSD",
  18379. "Red Hat",
  18380. "SuSE",
  18381. "Ubuntu",
  18382. "Xubuntu",
  18383. "Cygwin",
  18384. "Symbian OS",
  18385. "hpwOS",
  18386. "webOS ",
  18387. "webOS",
  18388. "Tablet OS",
  18389. "Tizen",
  18390. "Linux",
  18391. "Mac OS X",
  18392. "Macintosh",
  18393. "Mac",
  18394. "Windows 98;",
  18395. "Windows "
  18396. ]);
  18397. function getLayout(guesses) {
  18398. return reduce(guesses, function(result, guess) {
  18399. return result || RegExp("\\b" + (guess.pattern || qualify(guess)) + "\\b", "i").exec(ua) && (guess.label || guess);
  18400. });
  18401. }
  18402. function getManufacturer(guesses) {
  18403. return reduce(guesses, function(result, value, key) {
  18404. return result || (value[product] || value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || RegExp("\\b" + qualify(key) + "(?:\\b|\\w*\\d)", "i").exec(ua)) && key;
  18405. });
  18406. }
  18407. function getName(guesses) {
  18408. return reduce(guesses, function(result, guess) {
  18409. return result || RegExp("\\b" + (guess.pattern || qualify(guess)) + "\\b", "i").exec(ua) && (guess.label || guess);
  18410. });
  18411. }
  18412. function getOS(guesses) {
  18413. return reduce(guesses, function(result, guess) {
  18414. var pattern = guess.pattern || qualify(guess);
  18415. if (!result && (result = RegExp("\\b" + pattern + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(ua))) {
  18416. result = cleanupOS(result, pattern, guess.label || guess);
  18417. }
  18418. return result;
  18419. });
  18420. }
  18421. function getProduct(guesses) {
  18422. return reduce(guesses, function(result, guess) {
  18423. var pattern = guess.pattern || qualify(guess);
  18424. if (!result && (result = RegExp("\\b" + pattern + " *\\d+[.\\w_]*", "i").exec(ua) || RegExp("\\b" + pattern + " *\\w+-[\\w]*", "i").exec(ua) || RegExp("\\b" + pattern + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(ua))) {
  18425. if ((result = String(guess.label && !RegExp(pattern, "i").test(guess.label) ? guess.label : result).split("/"))[1] && !/[\d.]+/.test(result[0])) {
  18426. result[0] += " " + result[1];
  18427. }
  18428. guess = guess.label || guess;
  18429. result = format(result[0].replace(RegExp(pattern, "i"), guess).replace(RegExp("; *(?:" + guess + "[_-])?", "i"), " ").replace(RegExp("(" + guess + ")[-_.]?(\\w)", "i"), "$1 $2"));
  18430. }
  18431. return result;
  18432. });
  18433. }
  18434. function getVersion(patterns) {
  18435. return reduce(patterns, function(result, pattern) {
  18436. return result || (RegExp(pattern + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(ua) || 0)[1] || null;
  18437. });
  18438. }
  18439. function toStringPlatform() {
  18440. return this.description || "";
  18441. }
  18442. layout && (layout = [layout]);
  18443. if (/\bAndroid\b/.test(os) && !product && (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
  18444. product = trim(data[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i, "") || null;
  18445. }
  18446. if (manufacturer && !product) {
  18447. product = getProduct([manufacturer]);
  18448. } else if (manufacturer && product) {
  18449. product = product.replace(RegExp("^(" + qualify(manufacturer) + ")[-_.\\s]", "i"), manufacturer + " ").replace(RegExp("^(" + qualify(manufacturer) + ")[-_.]?(\\w)", "i"), manufacturer + " $2");
  18450. }
  18451. if (data = /\bGoogle TV\b/.exec(product)) {
  18452. product = data[0];
  18453. }
  18454. if (/\bSimulator\b/i.test(ua)) {
  18455. product = (product ? product + " " : "") + "Simulator";
  18456. }
  18457. if (name == "Opera Mini" && /\bOPiOS\b/.test(ua)) {
  18458. description.push("running in Turbo/Uncompressed mode");
  18459. }
  18460. if (name == "IE" && /\blike iPhone OS\b/.test(ua)) {
  18461. data = parse(ua.replace(/like iPhone OS/, ""));
  18462. manufacturer = data.manufacturer;
  18463. product = data.product;
  18464. } else if (/^iP/.test(product)) {
  18465. name || (name = "Safari");
  18466. os = "iOS" + ((data = / OS ([\d_]+)/i.exec(ua)) ? " " + data[1].replace(/_/g, ".") : "");
  18467. } else if (name == "Konqueror" && /^Linux\b/i.test(os)) {
  18468. os = "Kubuntu";
  18469. } else if (manufacturer && manufacturer != "Google" && (/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua) || /\bVita\b/.test(product)) || /\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua)) {
  18470. name = "Android Browser";
  18471. os = /\bAndroid\b/.test(os) ? os : "Android";
  18472. } else if (name == "Silk") {
  18473. if (!/\bMobi/i.test(ua)) {
  18474. os = "Android";
  18475. description.unshift("desktop mode");
  18476. }
  18477. if (/Accelerated *= *true/i.test(ua)) {
  18478. description.unshift("accelerated");
  18479. }
  18480. } else if (name == "UC Browser" && /\bUCWEB\b/.test(ua)) {
  18481. description.push("speed mode");
  18482. } else if (name == "PaleMoon" && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
  18483. description.push("identifying as Firefox " + data[1]);
  18484. } else if (name == "Firefox" && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
  18485. os || (os = "Firefox OS");
  18486. product || (product = data[1]);
  18487. } else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
  18488. if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + "/") + 8))) {
  18489. name = null;
  18490. }
  18491. if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
  18492. name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + " Browser";
  18493. }
  18494. } else if (name == "Electron" && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
  18495. description.push("Chromium " + data);
  18496. }
  18497. if (!version) {
  18498. version = getVersion([
  18499. "(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)",
  18500. "Version",
  18501. qualify(name),
  18502. "(?:Firefox|Minefield|NetFront)"
  18503. ]);
  18504. }
  18505. if (data = layout == "iCab" && parseFloat(version) > 3 && "WebKit" || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && "WebKit" || !layout && /\bMSIE\b/i.test(ua) && (os == "Mac OS" ? "Tasman" : "Trident") || layout == "WebKit" && /\bPlayStation\b(?! Vita\b)/i.test(name) && "NetFront") {
  18506. layout = [data];
  18507. }
  18508. if (name == "IE" && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
  18509. name += " Mobile";
  18510. os = "Windows Phone " + (/\+$/.test(data) ? data : data + ".x");
  18511. description.unshift("desktop mode");
  18512. } else if (/\bWPDesktop\b/i.test(ua)) {
  18513. name = "IE Mobile";
  18514. os = "Windows Phone 8.x";
  18515. description.unshift("desktop mode");
  18516. version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
  18517. } else if (name != "IE" && layout == "Trident" && (data = /\brv:([\d.]+)/.exec(ua))) {
  18518. if (name) {
  18519. description.push("identifying as " + name + (version ? " " + version : ""));
  18520. }
  18521. name = "IE";
  18522. version = data[1];
  18523. }
  18524. if (useFeatures) {
  18525. if (isHostType(context, "global")) {
  18526. if (java) {
  18527. data = java.lang.System;
  18528. arch = data.getProperty("os.arch");
  18529. os = os || data.getProperty("os.name") + " " + data.getProperty("os.version");
  18530. }
  18531. if (rhino) {
  18532. try {
  18533. version = context.require("ringo/engine").version.join(".");
  18534. name = "RingoJS";
  18535. } catch (e) {
  18536. if ((data = context.system) && data.global.system == context.system) {
  18537. name = "Narwhal";
  18538. os || (os = data[0].os || null);
  18539. }
  18540. }
  18541. if (!name) {
  18542. name = "Rhino";
  18543. }
  18544. } else if (typeof context.process == "object" && !context.process.browser && (data = context.process)) {
  18545. if (typeof data.versions == "object") {
  18546. if (typeof data.versions.electron == "string") {
  18547. description.push("Node " + data.versions.node);
  18548. name = "Electron";
  18549. version = data.versions.electron;
  18550. } else if (typeof data.versions.nw == "string") {
  18551. description.push("Chromium " + version, "Node " + data.versions.node);
  18552. name = "NW.js";
  18553. version = data.versions.nw;
  18554. }
  18555. }
  18556. if (!name) {
  18557. name = "Node.js";
  18558. arch = data.arch;
  18559. os = data.platform;
  18560. version = /[\d.]+/.exec(data.version);
  18561. version = version ? version[0] : null;
  18562. }
  18563. }
  18564. } else if (getClassOf(data = context.runtime) == airRuntimeClass) {
  18565. name = "Adobe AIR";
  18566. os = data.flash.system.Capabilities.os;
  18567. } else if (getClassOf(data = context.phantom) == phantomClass) {
  18568. name = "PhantomJS";
  18569. version = (data = data.version || null) && data.major + "." + data.minor + "." + data.patch;
  18570. } else if (typeof doc.documentMode == "number" && (data = /\bTrident\/(\d+)/i.exec(ua))) {
  18571. version = [version, doc.documentMode];
  18572. if ((data = +data[1] + 4) != version[1]) {
  18573. description.push("IE " + version[1] + " mode");
  18574. layout && (layout[1] = "");
  18575. version[1] = data;
  18576. }
  18577. version = name == "IE" ? String(version[1].toFixed(1)) : version[0];
  18578. } else if (typeof doc.documentMode == "number" && /^(?:Chrome|Firefox)\b/.test(name)) {
  18579. description.push("masking as " + name + " " + version);
  18580. name = "IE";
  18581. version = "11.0";
  18582. layout = ["Trident"];
  18583. os = "Windows";
  18584. }
  18585. os = os && format(os);
  18586. }
  18587. if (version && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ";" + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && "a")) {
  18588. prerelease = /b/i.test(data) ? "beta" : "alpha";
  18589. version = version.replace(RegExp(data + "\\+?$"), "") + (prerelease == "beta" ? beta : alpha) + (/\d+\+?/.exec(data) || "");
  18590. }
  18591. if (name == "Fennec" || name == "Firefox" && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
  18592. name = "Firefox Mobile";
  18593. } else if (name == "Maxthon" && version) {
  18594. version = version.replace(/\.[\d.]+/, ".x");
  18595. } else if (/\bXbox\b/i.test(product)) {
  18596. if (product == "Xbox 360") {
  18597. os = null;
  18598. }
  18599. if (product == "Xbox 360" && /\bIEMobile\b/.test(ua)) {
  18600. description.unshift("mobile mode");
  18601. }
  18602. } else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == "Windows CE" || /Mobi/i.test(ua))) {
  18603. name += " Mobile";
  18604. } else if (name == "IE" && useFeatures) {
  18605. try {
  18606. if (context.external === null) {
  18607. description.unshift("platform preview");
  18608. }
  18609. } catch (e) {
  18610. description.unshift("embedded");
  18611. }
  18612. } else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(ua) || 0)[1] || version)) {
  18613. data = [data, /BB10/.test(ua)];
  18614. os = (data[1] ? (product = null, manufacturer = "BlackBerry") : "Device Software") + " " + data[0];
  18615. version = null;
  18616. } else if (this != forOwn && product != "Wii" && (useFeatures && opera || /Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua) || name == "Firefox" && /\bOS X (?:\d+\.){2,}/.test(os) || name == "IE" && (os && !/^Win/.test(os) && version > 5.5 || /\bWindows XP\b/.test(os) && version > 8 || version == 8 && !/\bTrident\b/.test(ua))) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, "") + ";")) && data.name) {
  18617. data = "ing as " + data.name + ((data = data.version) ? " " + data : "");
  18618. if (reOpera.test(name)) {
  18619. if (/\bIE\b/.test(data) && os == "Mac OS") {
  18620. os = null;
  18621. }
  18622. data = "identify" + data;
  18623. } else {
  18624. data = "mask" + data;
  18625. if (operaClass) {
  18626. name = format(operaClass.replace(/([a-z])([A-Z])/g, "$1 $2"));
  18627. } else {
  18628. name = "Opera";
  18629. }
  18630. if (/\bIE\b/.test(data)) {
  18631. os = null;
  18632. }
  18633. if (!useFeatures) {
  18634. version = null;
  18635. }
  18636. }
  18637. layout = ["Presto"];
  18638. description.push(data);
  18639. }
  18640. if (data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1]) {
  18641. data = [parseFloat(data.replace(/\.(\d)$/, ".0$1")), data];
  18642. if (name == "Safari" && data[1].slice(-1) == "+") {
  18643. name = "WebKit Nightly";
  18644. prerelease = "alpha";
  18645. version = data[1].slice(0, -1);
  18646. } else if (version == data[1] || version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
  18647. version = null;
  18648. }
  18649. data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
  18650. if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == "WebKit") {
  18651. layout = ["Blink"];
  18652. }
  18653. if (!useFeatures || !likeChrome && !data[1]) {
  18654. layout && (layout[1] = "like Safari");
  18655. data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? "4+" : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : "12");
  18656. } else {
  18657. layout && (layout[1] = "like Chrome");
  18658. data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.1 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.3 ? 11 : data < 535.01 ? 12 : data < 535.02 ? "13+" : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.1 ? 19 : data < 537.01 ? 20 : data < 537.11 ? "21+" : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != "Blink" ? "27" : "28");
  18659. }
  18660. layout && (layout[1] += " " + (data += typeof data == "number" ? ".x" : /[.+]/.test(data) ? "" : "+"));
  18661. if (name == "Safari" && (!version || parseInt(version) > 45)) {
  18662. version = data;
  18663. } else if (name == "Chrome" && /\bHeadlessChrome/i.test(ua)) {
  18664. description.unshift("headless");
  18665. }
  18666. }
  18667. if (name == "Opera" && (data = /\bzbov|zvav$/.exec(os))) {
  18668. name += " ";
  18669. description.unshift("desktop mode");
  18670. if (data == "zvav") {
  18671. name += "Mini";
  18672. version = null;
  18673. } else {
  18674. name += "Mobile";
  18675. }
  18676. os = os.replace(RegExp(" *" + data + "$"), "");
  18677. } else if (name == "Safari" && /\bChrome\b/.exec(layout && layout[1])) {
  18678. description.unshift("desktop mode");
  18679. name = "Chrome Mobile";
  18680. version = null;
  18681. if (/\bOS X\b/.test(os)) {
  18682. manufacturer = "Apple";
  18683. os = "iOS 4.3+";
  18684. } else {
  18685. os = null;
  18686. }
  18687. } else if (/\bSRWare Iron\b/.test(name) && !version) {
  18688. version = getVersion("Chrome");
  18689. }
  18690. if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && ua.indexOf("/" + data + "-") > -1) {
  18691. os = trim(os.replace(data, ""));
  18692. }
  18693. if (os && os.indexOf(name) != -1 && !RegExp(name + " OS").test(os)) {
  18694. os = os.replace(RegExp(" *" + qualify(name) + " *"), "");
  18695. }
  18696. if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (/Browser|Lunascape|Maxthon/.test(name) || name != "Safari" && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
  18697. (data = layout[layout.length - 1]) && description.push(data);
  18698. }
  18699. if (description.length) {
  18700. description = ["(" + description.join("; ") + ")"];
  18701. }
  18702. if (manufacturer && product && product.indexOf(manufacturer) < 0) {
  18703. description.push("on " + manufacturer);
  18704. }
  18705. if (product) {
  18706. description.push((/^on /.test(description[description.length - 1]) ? "" : "on ") + product);
  18707. }
  18708. if (os) {
  18709. data = / ([\d.+]+)$/.exec(os);
  18710. isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == "/";
  18711. os = {
  18712. "architecture": 32,
  18713. "family": data && !isSpecialCasedOS ? os.replace(data[0], "") : os,
  18714. "version": data ? data[1] : null,
  18715. "toString": function() {
  18716. var version2 = this.version;
  18717. return this.family + (version2 && !isSpecialCasedOS ? " " + version2 : "") + (this.architecture == 64 ? " 64-bit" : "");
  18718. }
  18719. };
  18720. }
  18721. if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
  18722. if (os) {
  18723. os.architecture = 64;
  18724. os.family = os.family.replace(RegExp(" *" + data), "");
  18725. }
  18726. if (name && (/\bWOW64\b/i.test(ua) || useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) {
  18727. description.unshift("32-bit");
  18728. }
  18729. } else if (os && /^OS X/.test(os.family) && name == "Chrome" && parseFloat(version) >= 39) {
  18730. os.architecture = 64;
  18731. }
  18732. ua || (ua = null);
  18733. var platform2 = {};
  18734. platform2.description = ua;
  18735. platform2.layout = layout && layout[0];
  18736. platform2.manufacturer = manufacturer;
  18737. platform2.name = name;
  18738. platform2.prerelease = prerelease;
  18739. platform2.product = product;
  18740. platform2.ua = ua;
  18741. platform2.version = name && version;
  18742. platform2.os = os || {
  18743. /**
  18744. * The CPU architecture the OS is built for.
  18745. *
  18746. * @memberOf platform.os
  18747. * @type number|null
  18748. */
  18749. "architecture": null,
  18750. /**
  18751. * The family of the OS.
  18752. *
  18753. * Common values include:
  18754. * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
  18755. * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
  18756. * "SuSE", "Android", "iOS" and "Windows Phone"
  18757. *
  18758. * @memberOf platform.os
  18759. * @type string|null
  18760. */
  18761. "family": null,
  18762. /**
  18763. * The version of the OS.
  18764. *
  18765. * @memberOf platform.os
  18766. * @type string|null
  18767. */
  18768. "version": null,
  18769. /**
  18770. * Returns the OS string.
  18771. *
  18772. * @memberOf platform.os
  18773. * @returns {string} The OS string.
  18774. */
  18775. "toString": function() {
  18776. return "null";
  18777. }
  18778. };
  18779. platform2.parse = parse;
  18780. platform2.toString = toStringPlatform;
  18781. if (platform2.version) {
  18782. description.unshift(version);
  18783. }
  18784. if (platform2.name) {
  18785. description.unshift(name);
  18786. }
  18787. if (os && name && !(os == String(os).split(" ")[0] && (os == name.split(" ")[0] || product))) {
  18788. description.push(product ? "(" + os + ")" : "on " + os);
  18789. }
  18790. if (description.length) {
  18791. platform2.description = description.join(" ");
  18792. }
  18793. return platform2;
  18794. }
  18795. var platform = parse();
  18796. if (typeof define2 == "function" && typeof define2.amd == "object" && define2.amd) {
  18797. root.platform = platform;
  18798. define2(function() {
  18799. return platform;
  18800. });
  18801. } else if (freeExports && freeModule) {
  18802. forOwn(platform, function(value, key) {
  18803. freeExports[key] = value;
  18804. });
  18805. } else {
  18806. root.platform = platform;
  18807. }
  18808. }).call(this);
  18809. }).call(this);
  18810. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  18811. }, {}], 380: [function(require2, module3, exports3) {
  18812. (function(process) {
  18813. (function() {
  18814. "use strict";
  18815. if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
  18816. module3.exports = { nextTick };
  18817. } else {
  18818. module3.exports = process;
  18819. }
  18820. function nextTick(fn, arg1, arg2, arg3) {
  18821. if (typeof fn !== "function") {
  18822. throw new TypeError('"callback" argument must be a function');
  18823. }
  18824. var len = arguments.length;
  18825. var args, i;
  18826. switch (len) {
  18827. case 0:
  18828. case 1:
  18829. return process.nextTick(fn);
  18830. case 2:
  18831. return process.nextTick(function afterTickOne() {
  18832. fn.call(null, arg1);
  18833. });
  18834. case 3:
  18835. return process.nextTick(function afterTickTwo() {
  18836. fn.call(null, arg1, arg2);
  18837. });
  18838. case 4:
  18839. return process.nextTick(function afterTickThree() {
  18840. fn.call(null, arg1, arg2, arg3);
  18841. });
  18842. default:
  18843. args = new Array(len - 1);
  18844. i = 0;
  18845. while (i < args.length) {
  18846. args[i++] = arguments[i];
  18847. }
  18848. return process.nextTick(function afterTick() {
  18849. fn.apply(null, args);
  18850. });
  18851. }
  18852. }
  18853. }).call(this);
  18854. }).call(this, require2("_process"));
  18855. }, { "_process": 467 }], 381: [function(require2, module3, exports3) {
  18856. var process = module3.exports = {};
  18857. var cachedSetTimeout;
  18858. var cachedClearTimeout;
  18859. function defaultSetTimout() {
  18860. throw new Error("setTimeout has not been defined");
  18861. }
  18862. function defaultClearTimeout() {
  18863. throw new Error("clearTimeout has not been defined");
  18864. }
  18865. (function() {
  18866. try {
  18867. if (typeof setTimeout === "function") {
  18868. cachedSetTimeout = setTimeout;
  18869. } else {
  18870. cachedSetTimeout = defaultSetTimout;
  18871. }
  18872. } catch (e) {
  18873. cachedSetTimeout = defaultSetTimout;
  18874. }
  18875. try {
  18876. if (typeof clearTimeout === "function") {
  18877. cachedClearTimeout = clearTimeout;
  18878. } else {
  18879. cachedClearTimeout = defaultClearTimeout;
  18880. }
  18881. } catch (e) {
  18882. cachedClearTimeout = defaultClearTimeout;
  18883. }
  18884. })();
  18885. function runTimeout(fun) {
  18886. if (cachedSetTimeout === setTimeout) {
  18887. return setTimeout(fun, 0);
  18888. }
  18889. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  18890. cachedSetTimeout = setTimeout;
  18891. return setTimeout(fun, 0);
  18892. }
  18893. try {
  18894. return cachedSetTimeout(fun, 0);
  18895. } catch (e) {
  18896. try {
  18897. return cachedSetTimeout.call(null, fun, 0);
  18898. } catch (e2) {
  18899. return cachedSetTimeout.call(this, fun, 0);
  18900. }
  18901. }
  18902. }
  18903. function runClearTimeout(marker) {
  18904. if (cachedClearTimeout === clearTimeout) {
  18905. return clearTimeout(marker);
  18906. }
  18907. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  18908. cachedClearTimeout = clearTimeout;
  18909. return clearTimeout(marker);
  18910. }
  18911. try {
  18912. return cachedClearTimeout(marker);
  18913. } catch (e) {
  18914. try {
  18915. return cachedClearTimeout.call(null, marker);
  18916. } catch (e2) {
  18917. return cachedClearTimeout.call(this, marker);
  18918. }
  18919. }
  18920. }
  18921. var queue = [];
  18922. var draining = false;
  18923. var currentQueue;
  18924. var queueIndex = -1;
  18925. function cleanUpNextTick() {
  18926. if (!draining || !currentQueue) {
  18927. return;
  18928. }
  18929. draining = false;
  18930. if (currentQueue.length) {
  18931. queue = currentQueue.concat(queue);
  18932. } else {
  18933. queueIndex = -1;
  18934. }
  18935. if (queue.length) {
  18936. drainQueue();
  18937. }
  18938. }
  18939. function drainQueue() {
  18940. if (draining) {
  18941. return;
  18942. }
  18943. var timeout = runTimeout(cleanUpNextTick);
  18944. draining = true;
  18945. var len = queue.length;
  18946. while (len) {
  18947. currentQueue = queue;
  18948. queue = [];
  18949. while (++queueIndex < len) {
  18950. if (currentQueue) {
  18951. currentQueue[queueIndex].run();
  18952. }
  18953. }
  18954. queueIndex = -1;
  18955. len = queue.length;
  18956. }
  18957. currentQueue = null;
  18958. draining = false;
  18959. runClearTimeout(timeout);
  18960. }
  18961. process.nextTick = function(fun) {
  18962. var args = new Array(arguments.length - 1);
  18963. if (arguments.length > 1) {
  18964. for (var i = 1; i < arguments.length; i++) {
  18965. args[i - 1] = arguments[i];
  18966. }
  18967. }
  18968. queue.push(new Item(fun, args));
  18969. if (queue.length === 1 && !draining) {
  18970. runTimeout(drainQueue);
  18971. }
  18972. };
  18973. function Item(fun, array) {
  18974. this.fun = fun;
  18975. this.array = array;
  18976. }
  18977. Item.prototype.run = function() {
  18978. this.fun.apply(null, this.array);
  18979. };
  18980. process.title = "browser";
  18981. process.browser = true;
  18982. process.env = {};
  18983. process.argv = [];
  18984. process.version = "";
  18985. process.versions = {};
  18986. function noop() {
  18987. }
  18988. process.on = noop;
  18989. process.addListener = noop;
  18990. process.once = noop;
  18991. process.off = noop;
  18992. process.removeListener = noop;
  18993. process.removeAllListeners = noop;
  18994. process.emit = noop;
  18995. process.prependListener = noop;
  18996. process.prependOnceListener = noop;
  18997. process.listeners = function(name) {
  18998. return [];
  18999. };
  19000. process.binding = function(name) {
  19001. throw new Error("process.binding is not supported");
  19002. };
  19003. process.cwd = function() {
  19004. return "/";
  19005. };
  19006. process.chdir = function(dir) {
  19007. throw new Error("process.chdir is not supported");
  19008. };
  19009. process.umask = function() {
  19010. return 0;
  19011. };
  19012. }, {}], 382: [function(require2, module3, exports3) {
  19013. (function(global2) {
  19014. (function() {
  19015. ;
  19016. (function(root) {
  19017. var freeExports = typeof exports3 == "object" && exports3 && !exports3.nodeType && exports3;
  19018. var freeModule = typeof module3 == "object" && module3 && !module3.nodeType && module3;
  19019. var freeGlobal = typeof global2 == "object" && global2;
  19020. if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
  19021. root = freeGlobal;
  19022. }
  19023. var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
  19024. "overflow": "Overflow: input needs wider integers to process",
  19025. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  19026. "invalid-input": "Invalid input"
  19027. }, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key;
  19028. function error(type) {
  19029. throw new RangeError(errors[type]);
  19030. }
  19031. function map(array, fn) {
  19032. var length = array.length;
  19033. var result = [];
  19034. while (length--) {
  19035. result[length] = fn(array[length]);
  19036. }
  19037. return result;
  19038. }
  19039. function mapDomain(string, fn) {
  19040. var parts = string.split("@");
  19041. var result = "";
  19042. if (parts.length > 1) {
  19043. result = parts[0] + "@";
  19044. string = parts[1];
  19045. }
  19046. string = string.replace(regexSeparators, ".");
  19047. var labels = string.split(".");
  19048. var encoded = map(labels, fn).join(".");
  19049. return result + encoded;
  19050. }
  19051. function ucs2decode(string) {
  19052. var output = [], counter = 0, length = string.length, value, extra;
  19053. while (counter < length) {
  19054. value = string.charCodeAt(counter++);
  19055. if (value >= 55296 && value <= 56319 && counter < length) {
  19056. extra = string.charCodeAt(counter++);
  19057. if ((extra & 64512) == 56320) {
  19058. output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
  19059. } else {
  19060. output.push(value);
  19061. counter--;
  19062. }
  19063. } else {
  19064. output.push(value);
  19065. }
  19066. }
  19067. return output;
  19068. }
  19069. function ucs2encode(array) {
  19070. return map(array, function(value) {
  19071. var output = "";
  19072. if (value > 65535) {
  19073. value -= 65536;
  19074. output += stringFromCharCode(value >>> 10 & 1023 | 55296);
  19075. value = 56320 | value & 1023;
  19076. }
  19077. output += stringFromCharCode(value);
  19078. return output;
  19079. }).join("");
  19080. }
  19081. function basicToDigit(codePoint) {
  19082. if (codePoint - 48 < 10) {
  19083. return codePoint - 22;
  19084. }
  19085. if (codePoint - 65 < 26) {
  19086. return codePoint - 65;
  19087. }
  19088. if (codePoint - 97 < 26) {
  19089. return codePoint - 97;
  19090. }
  19091. return base;
  19092. }
  19093. function digitToBasic(digit, flag) {
  19094. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  19095. }
  19096. function adapt(delta, numPoints, firstTime) {
  19097. var k = 0;
  19098. delta = firstTime ? floor(delta / damp) : delta >> 1;
  19099. delta += floor(delta / numPoints);
  19100. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  19101. delta = floor(delta / baseMinusTMin);
  19102. }
  19103. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  19104. }
  19105. function decode(input) {
  19106. var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, baseMinusT;
  19107. basic = input.lastIndexOf(delimiter);
  19108. if (basic < 0) {
  19109. basic = 0;
  19110. }
  19111. for (j = 0; j < basic; ++j) {
  19112. if (input.charCodeAt(j) >= 128) {
  19113. error("not-basic");
  19114. }
  19115. output.push(input.charCodeAt(j));
  19116. }
  19117. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
  19118. for (oldi = i, w = 1, k = base; ; k += base) {
  19119. if (index >= inputLength) {
  19120. error("invalid-input");
  19121. }
  19122. digit = basicToDigit(input.charCodeAt(index++));
  19123. if (digit >= base || digit > floor((maxInt - i) / w)) {
  19124. error("overflow");
  19125. }
  19126. i += digit * w;
  19127. t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  19128. if (digit < t) {
  19129. break;
  19130. }
  19131. baseMinusT = base - t;
  19132. if (w > floor(maxInt / baseMinusT)) {
  19133. error("overflow");
  19134. }
  19135. w *= baseMinusT;
  19136. }
  19137. out = output.length + 1;
  19138. bias = adapt(i - oldi, out, oldi == 0);
  19139. if (floor(i / out) > maxInt - n) {
  19140. error("overflow");
  19141. }
  19142. n += floor(i / out);
  19143. i %= out;
  19144. output.splice(i++, 0, n);
  19145. }
  19146. return ucs2encode(output);
  19147. }
  19148. function encode(input) {
  19149. var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
  19150. input = ucs2decode(input);
  19151. inputLength = input.length;
  19152. n = initialN;
  19153. delta = 0;
  19154. bias = initialBias;
  19155. for (j = 0; j < inputLength; ++j) {
  19156. currentValue = input[j];
  19157. if (currentValue < 128) {
  19158. output.push(stringFromCharCode(currentValue));
  19159. }
  19160. }
  19161. handledCPCount = basicLength = output.length;
  19162. if (basicLength) {
  19163. output.push(delimiter);
  19164. }
  19165. while (handledCPCount < inputLength) {
  19166. for (m = maxInt, j = 0; j < inputLength; ++j) {
  19167. currentValue = input[j];
  19168. if (currentValue >= n && currentValue < m) {
  19169. m = currentValue;
  19170. }
  19171. }
  19172. handledCPCountPlusOne = handledCPCount + 1;
  19173. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  19174. error("overflow");
  19175. }
  19176. delta += (m - n) * handledCPCountPlusOne;
  19177. n = m;
  19178. for (j = 0; j < inputLength; ++j) {
  19179. currentValue = input[j];
  19180. if (currentValue < n && ++delta > maxInt) {
  19181. error("overflow");
  19182. }
  19183. if (currentValue == n) {
  19184. for (q = delta, k = base; ; k += base) {
  19185. t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  19186. if (q < t) {
  19187. break;
  19188. }
  19189. qMinusT = q - t;
  19190. baseMinusT = base - t;
  19191. output.push(
  19192. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  19193. );
  19194. q = floor(qMinusT / baseMinusT);
  19195. }
  19196. output.push(stringFromCharCode(digitToBasic(q, 0)));
  19197. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  19198. delta = 0;
  19199. ++handledCPCount;
  19200. }
  19201. }
  19202. ++delta;
  19203. ++n;
  19204. }
  19205. return output.join("");
  19206. }
  19207. function toUnicode(input) {
  19208. return mapDomain(input, function(string) {
  19209. return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
  19210. });
  19211. }
  19212. function toASCII(input) {
  19213. return mapDomain(input, function(string) {
  19214. return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
  19215. });
  19216. }
  19217. punycode = {
  19218. /**
  19219. * A string representing the current Punycode.js version number.
  19220. * @memberOf punycode
  19221. * @type String
  19222. */
  19223. "version": "1.4.1",
  19224. /**
  19225. * An object of methods to convert from JavaScript's internal character
  19226. * representation (UCS-2) to Unicode code points, and back.
  19227. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  19228. * @memberOf punycode
  19229. * @type Object
  19230. */
  19231. "ucs2": {
  19232. "decode": ucs2decode,
  19233. "encode": ucs2encode
  19234. },
  19235. "decode": decode,
  19236. "encode": encode,
  19237. "toASCII": toASCII,
  19238. "toUnicode": toUnicode
  19239. };
  19240. if (typeof define2 == "function" && typeof define2.amd == "object" && define2.amd) {
  19241. define2("punycode", function() {
  19242. return punycode;
  19243. });
  19244. } else if (freeExports && freeModule) {
  19245. if (module3.exports == freeExports) {
  19246. freeModule.exports = punycode;
  19247. } else {
  19248. for (key in punycode) {
  19249. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  19250. }
  19251. }
  19252. } else {
  19253. root.punycode = punycode;
  19254. }
  19255. })(this);
  19256. }).call(this);
  19257. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  19258. }, {}], 383: [function(require2, module3, exports3) {
  19259. "use strict";
  19260. function hasOwnProperty(obj, prop) {
  19261. return Object.prototype.hasOwnProperty.call(obj, prop);
  19262. }
  19263. module3.exports = function(qs2, sep, eq, options) {
  19264. sep = sep || "&";
  19265. eq = eq || "=";
  19266. var obj = {};
  19267. if (typeof qs2 !== "string" || qs2.length === 0) {
  19268. return obj;
  19269. }
  19270. var regexp = /\+/g;
  19271. qs2 = qs2.split(sep);
  19272. var maxKeys = 1e3;
  19273. if (options && typeof options.maxKeys === "number") {
  19274. maxKeys = options.maxKeys;
  19275. }
  19276. var len = qs2.length;
  19277. if (maxKeys > 0 && len > maxKeys) {
  19278. len = maxKeys;
  19279. }
  19280. for (var i = 0; i < len; ++i) {
  19281. var x = qs2[i].replace(regexp, "%20"), idx = x.indexOf(eq), kstr, vstr, k, v;
  19282. if (idx >= 0) {
  19283. kstr = x.substr(0, idx);
  19284. vstr = x.substr(idx + 1);
  19285. } else {
  19286. kstr = x;
  19287. vstr = "";
  19288. }
  19289. k = decodeURIComponent(kstr);
  19290. v = decodeURIComponent(vstr);
  19291. if (!hasOwnProperty(obj, k)) {
  19292. obj[k] = v;
  19293. } else if (isArray(obj[k])) {
  19294. obj[k].push(v);
  19295. } else {
  19296. obj[k] = [obj[k], v];
  19297. }
  19298. }
  19299. return obj;
  19300. };
  19301. var isArray = Array.isArray || function(xs) {
  19302. return Object.prototype.toString.call(xs) === "[object Array]";
  19303. };
  19304. }, {}], 384: [function(require2, module3, exports3) {
  19305. "use strict";
  19306. var stringifyPrimitive = function(v) {
  19307. switch (typeof v) {
  19308. case "string":
  19309. return v;
  19310. case "boolean":
  19311. return v ? "true" : "false";
  19312. case "number":
  19313. return isFinite(v) ? v : "";
  19314. default:
  19315. return "";
  19316. }
  19317. };
  19318. module3.exports = function(obj, sep, eq, name) {
  19319. sep = sep || "&";
  19320. eq = eq || "=";
  19321. if (obj === null) {
  19322. obj = void 0;
  19323. }
  19324. if (typeof obj === "object") {
  19325. return map(objectKeys(obj), function(k) {
  19326. var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
  19327. if (isArray(obj[k])) {
  19328. return map(obj[k], function(v) {
  19329. return ks + encodeURIComponent(stringifyPrimitive(v));
  19330. }).join(sep);
  19331. } else {
  19332. return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
  19333. }
  19334. }).join(sep);
  19335. }
  19336. if (!name)
  19337. return "";
  19338. return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
  19339. };
  19340. var isArray = Array.isArray || function(xs) {
  19341. return Object.prototype.toString.call(xs) === "[object Array]";
  19342. };
  19343. function map(xs, f) {
  19344. if (xs.map)
  19345. return xs.map(f);
  19346. var res = [];
  19347. for (var i = 0; i < xs.length; i++) {
  19348. res.push(f(xs[i], i));
  19349. }
  19350. return res;
  19351. }
  19352. var objectKeys = Object.keys || function(obj) {
  19353. var res = [];
  19354. for (var key in obj) {
  19355. if (Object.prototype.hasOwnProperty.call(obj, key))
  19356. res.push(key);
  19357. }
  19358. return res;
  19359. };
  19360. }, {}], 385: [function(require2, module3, exports3) {
  19361. "use strict";
  19362. exports3.decode = exports3.parse = require2("./decode");
  19363. exports3.encode = exports3.stringify = require2("./encode");
  19364. }, { "./decode": 383, "./encode": 384 }], 386: [function(require2, module3, exports3) {
  19365. "use strict";
  19366. var pna = require2("process-nextick-args");
  19367. var objectKeys = Object.keys || function(obj) {
  19368. var keys2 = [];
  19369. for (var key in obj) {
  19370. keys2.push(key);
  19371. }
  19372. return keys2;
  19373. };
  19374. module3.exports = Duplex;
  19375. var util = Object.create(require2("core-util-is"));
  19376. util.inherits = require2("inherits");
  19377. var Readable = require2("./_stream_readable");
  19378. var Writable = require2("./_stream_writable");
  19379. util.inherits(Duplex, Readable);
  19380. {
  19381. var keys = objectKeys(Writable.prototype);
  19382. for (var v = 0; v < keys.length; v++) {
  19383. var method = keys[v];
  19384. if (!Duplex.prototype[method])
  19385. Duplex.prototype[method] = Writable.prototype[method];
  19386. }
  19387. }
  19388. function Duplex(options) {
  19389. if (!(this instanceof Duplex))
  19390. return new Duplex(options);
  19391. Readable.call(this, options);
  19392. Writable.call(this, options);
  19393. if (options && options.readable === false)
  19394. this.readable = false;
  19395. if (options && options.writable === false)
  19396. this.writable = false;
  19397. this.allowHalfOpen = true;
  19398. if (options && options.allowHalfOpen === false)
  19399. this.allowHalfOpen = false;
  19400. this.once("end", onend);
  19401. }
  19402. Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
  19403. // making it explicit this property is not enumerable
  19404. // because otherwise some prototype manipulation in
  19405. // userland will fail
  19406. enumerable: false,
  19407. get: function() {
  19408. return this._writableState.highWaterMark;
  19409. }
  19410. });
  19411. function onend() {
  19412. if (this.allowHalfOpen || this._writableState.ended)
  19413. return;
  19414. pna.nextTick(onEndNT, this);
  19415. }
  19416. function onEndNT(self2) {
  19417. self2.end();
  19418. }
  19419. Object.defineProperty(Duplex.prototype, "destroyed", {
  19420. get: function() {
  19421. if (this._readableState === void 0 || this._writableState === void 0) {
  19422. return false;
  19423. }
  19424. return this._readableState.destroyed && this._writableState.destroyed;
  19425. },
  19426. set: function(value) {
  19427. if (this._readableState === void 0 || this._writableState === void 0) {
  19428. return;
  19429. }
  19430. this._readableState.destroyed = value;
  19431. this._writableState.destroyed = value;
  19432. }
  19433. });
  19434. Duplex.prototype._destroy = function(err, cb) {
  19435. this.push(null);
  19436. this.end();
  19437. pna.nextTick(cb, err);
  19438. };
  19439. }, { "./_stream_readable": 388, "./_stream_writable": 390, "core-util-is": 341, "inherits": 364, "process-nextick-args": 380 }], 387: [function(require2, module3, exports3) {
  19440. "use strict";
  19441. module3.exports = PassThrough;
  19442. var Transform = require2("./_stream_transform");
  19443. var util = Object.create(require2("core-util-is"));
  19444. util.inherits = require2("inherits");
  19445. util.inherits(PassThrough, Transform);
  19446. function PassThrough(options) {
  19447. if (!(this instanceof PassThrough))
  19448. return new PassThrough(options);
  19449. Transform.call(this, options);
  19450. }
  19451. PassThrough.prototype._transform = function(chunk, encoding, cb) {
  19452. cb(null, chunk);
  19453. };
  19454. }, { "./_stream_transform": 389, "core-util-is": 341, "inherits": 364 }], 388: [function(require2, module3, exports3) {
  19455. (function(process, global2) {
  19456. (function() {
  19457. "use strict";
  19458. var pna = require2("process-nextick-args");
  19459. module3.exports = Readable;
  19460. var isArray = require2("isarray");
  19461. var Duplex;
  19462. Readable.ReadableState = ReadableState;
  19463. var EE = require2("events").EventEmitter;
  19464. var EElistenerCount = function(emitter, type) {
  19465. return emitter.listeners(type).length;
  19466. };
  19467. var Stream = require2("./internal/streams/stream");
  19468. var Buffer = require2("safe-buffer").Buffer;
  19469. var OurUint8Array = global2.Uint8Array || function() {
  19470. };
  19471. function _uint8ArrayToBuffer(chunk) {
  19472. return Buffer.from(chunk);
  19473. }
  19474. function _isUint8Array(obj) {
  19475. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  19476. }
  19477. var util = Object.create(require2("core-util-is"));
  19478. util.inherits = require2("inherits");
  19479. var debugUtil = require2("util");
  19480. var debug = void 0;
  19481. if (debugUtil && debugUtil.debuglog) {
  19482. debug = debugUtil.debuglog("stream");
  19483. } else {
  19484. debug = function() {
  19485. };
  19486. }
  19487. var BufferList = require2("./internal/streams/BufferList");
  19488. var destroyImpl = require2("./internal/streams/destroy");
  19489. var StringDecoder;
  19490. util.inherits(Readable, Stream);
  19491. var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
  19492. function prependListener(emitter, event, fn) {
  19493. if (typeof emitter.prependListener === "function")
  19494. return emitter.prependListener(event, fn);
  19495. if (!emitter._events || !emitter._events[event])
  19496. emitter.on(event, fn);
  19497. else if (isArray(emitter._events[event]))
  19498. emitter._events[event].unshift(fn);
  19499. else
  19500. emitter._events[event] = [fn, emitter._events[event]];
  19501. }
  19502. function ReadableState(options, stream) {
  19503. Duplex = Duplex || require2("./_stream_duplex");
  19504. options = options || {};
  19505. var isDuplex = stream instanceof Duplex;
  19506. this.objectMode = !!options.objectMode;
  19507. if (isDuplex)
  19508. this.objectMode = this.objectMode || !!options.readableObjectMode;
  19509. var hwm = options.highWaterMark;
  19510. var readableHwm = options.readableHighWaterMark;
  19511. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  19512. if (hwm || hwm === 0)
  19513. this.highWaterMark = hwm;
  19514. else if (isDuplex && (readableHwm || readableHwm === 0))
  19515. this.highWaterMark = readableHwm;
  19516. else
  19517. this.highWaterMark = defaultHwm;
  19518. this.highWaterMark = Math.floor(this.highWaterMark);
  19519. this.buffer = new BufferList();
  19520. this.length = 0;
  19521. this.pipes = null;
  19522. this.pipesCount = 0;
  19523. this.flowing = null;
  19524. this.ended = false;
  19525. this.endEmitted = false;
  19526. this.reading = false;
  19527. this.sync = true;
  19528. this.needReadable = false;
  19529. this.emittedReadable = false;
  19530. this.readableListening = false;
  19531. this.resumeScheduled = false;
  19532. this.destroyed = false;
  19533. this.defaultEncoding = options.defaultEncoding || "utf8";
  19534. this.awaitDrain = 0;
  19535. this.readingMore = false;
  19536. this.decoder = null;
  19537. this.encoding = null;
  19538. if (options.encoding) {
  19539. if (!StringDecoder)
  19540. StringDecoder = require2("string_decoder/").StringDecoder;
  19541. this.decoder = new StringDecoder(options.encoding);
  19542. this.encoding = options.encoding;
  19543. }
  19544. }
  19545. function Readable(options) {
  19546. Duplex = Duplex || require2("./_stream_duplex");
  19547. if (!(this instanceof Readable))
  19548. return new Readable(options);
  19549. this._readableState = new ReadableState(options, this);
  19550. this.readable = true;
  19551. if (options) {
  19552. if (typeof options.read === "function")
  19553. this._read = options.read;
  19554. if (typeof options.destroy === "function")
  19555. this._destroy = options.destroy;
  19556. }
  19557. Stream.call(this);
  19558. }
  19559. Object.defineProperty(Readable.prototype, "destroyed", {
  19560. get: function() {
  19561. if (this._readableState === void 0) {
  19562. return false;
  19563. }
  19564. return this._readableState.destroyed;
  19565. },
  19566. set: function(value) {
  19567. if (!this._readableState) {
  19568. return;
  19569. }
  19570. this._readableState.destroyed = value;
  19571. }
  19572. });
  19573. Readable.prototype.destroy = destroyImpl.destroy;
  19574. Readable.prototype._undestroy = destroyImpl.undestroy;
  19575. Readable.prototype._destroy = function(err, cb) {
  19576. this.push(null);
  19577. cb(err);
  19578. };
  19579. Readable.prototype.push = function(chunk, encoding) {
  19580. var state = this._readableState;
  19581. var skipChunkCheck;
  19582. if (!state.objectMode) {
  19583. if (typeof chunk === "string") {
  19584. encoding = encoding || state.defaultEncoding;
  19585. if (encoding !== state.encoding) {
  19586. chunk = Buffer.from(chunk, encoding);
  19587. encoding = "";
  19588. }
  19589. skipChunkCheck = true;
  19590. }
  19591. } else {
  19592. skipChunkCheck = true;
  19593. }
  19594. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  19595. };
  19596. Readable.prototype.unshift = function(chunk) {
  19597. return readableAddChunk(this, chunk, null, true, false);
  19598. };
  19599. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  19600. var state = stream._readableState;
  19601. if (chunk === null) {
  19602. state.reading = false;
  19603. onEofChunk(stream, state);
  19604. } else {
  19605. var er;
  19606. if (!skipChunkCheck)
  19607. er = chunkInvalid(state, chunk);
  19608. if (er) {
  19609. stream.emit("error", er);
  19610. } else if (state.objectMode || chunk && chunk.length > 0) {
  19611. if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  19612. chunk = _uint8ArrayToBuffer(chunk);
  19613. }
  19614. if (addToFront) {
  19615. if (state.endEmitted)
  19616. stream.emit("error", new Error("stream.unshift() after end event"));
  19617. else
  19618. addChunk(stream, state, chunk, true);
  19619. } else if (state.ended) {
  19620. stream.emit("error", new Error("stream.push() after EOF"));
  19621. } else {
  19622. state.reading = false;
  19623. if (state.decoder && !encoding) {
  19624. chunk = state.decoder.write(chunk);
  19625. if (state.objectMode || chunk.length !== 0)
  19626. addChunk(stream, state, chunk, false);
  19627. else
  19628. maybeReadMore(stream, state);
  19629. } else {
  19630. addChunk(stream, state, chunk, false);
  19631. }
  19632. }
  19633. } else if (!addToFront) {
  19634. state.reading = false;
  19635. }
  19636. }
  19637. return needMoreData(state);
  19638. }
  19639. function addChunk(stream, state, chunk, addToFront) {
  19640. if (state.flowing && state.length === 0 && !state.sync) {
  19641. stream.emit("data", chunk);
  19642. stream.read(0);
  19643. } else {
  19644. state.length += state.objectMode ? 1 : chunk.length;
  19645. if (addToFront)
  19646. state.buffer.unshift(chunk);
  19647. else
  19648. state.buffer.push(chunk);
  19649. if (state.needReadable)
  19650. emitReadable(stream);
  19651. }
  19652. maybeReadMore(stream, state);
  19653. }
  19654. function chunkInvalid(state, chunk) {
  19655. var er;
  19656. if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
  19657. er = new TypeError("Invalid non-string/buffer chunk");
  19658. }
  19659. return er;
  19660. }
  19661. function needMoreData(state) {
  19662. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  19663. }
  19664. Readable.prototype.isPaused = function() {
  19665. return this._readableState.flowing === false;
  19666. };
  19667. Readable.prototype.setEncoding = function(enc) {
  19668. if (!StringDecoder)
  19669. StringDecoder = require2("string_decoder/").StringDecoder;
  19670. this._readableState.decoder = new StringDecoder(enc);
  19671. this._readableState.encoding = enc;
  19672. return this;
  19673. };
  19674. var MAX_HWM = 8388608;
  19675. function computeNewHighWaterMark(n) {
  19676. if (n >= MAX_HWM) {
  19677. n = MAX_HWM;
  19678. } else {
  19679. n--;
  19680. n |= n >>> 1;
  19681. n |= n >>> 2;
  19682. n |= n >>> 4;
  19683. n |= n >>> 8;
  19684. n |= n >>> 16;
  19685. n++;
  19686. }
  19687. return n;
  19688. }
  19689. function howMuchToRead(n, state) {
  19690. if (n <= 0 || state.length === 0 && state.ended)
  19691. return 0;
  19692. if (state.objectMode)
  19693. return 1;
  19694. if (n !== n) {
  19695. if (state.flowing && state.length)
  19696. return state.buffer.head.data.length;
  19697. else
  19698. return state.length;
  19699. }
  19700. if (n > state.highWaterMark)
  19701. state.highWaterMark = computeNewHighWaterMark(n);
  19702. if (n <= state.length)
  19703. return n;
  19704. if (!state.ended) {
  19705. state.needReadable = true;
  19706. return 0;
  19707. }
  19708. return state.length;
  19709. }
  19710. Readable.prototype.read = function(n) {
  19711. debug("read", n);
  19712. n = parseInt(n, 10);
  19713. var state = this._readableState;
  19714. var nOrig = n;
  19715. if (n !== 0)
  19716. state.emittedReadable = false;
  19717. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  19718. debug("read: emitReadable", state.length, state.ended);
  19719. if (state.length === 0 && state.ended)
  19720. endReadable(this);
  19721. else
  19722. emitReadable(this);
  19723. return null;
  19724. }
  19725. n = howMuchToRead(n, state);
  19726. if (n === 0 && state.ended) {
  19727. if (state.length === 0)
  19728. endReadable(this);
  19729. return null;
  19730. }
  19731. var doRead = state.needReadable;
  19732. debug("need readable", doRead);
  19733. if (state.length === 0 || state.length - n < state.highWaterMark) {
  19734. doRead = true;
  19735. debug("length less than watermark", doRead);
  19736. }
  19737. if (state.ended || state.reading) {
  19738. doRead = false;
  19739. debug("reading or ended", doRead);
  19740. } else if (doRead) {
  19741. debug("do read");
  19742. state.reading = true;
  19743. state.sync = true;
  19744. if (state.length === 0)
  19745. state.needReadable = true;
  19746. this._read(state.highWaterMark);
  19747. state.sync = false;
  19748. if (!state.reading)
  19749. n = howMuchToRead(nOrig, state);
  19750. }
  19751. var ret;
  19752. if (n > 0)
  19753. ret = fromList(n, state);
  19754. else
  19755. ret = null;
  19756. if (ret === null) {
  19757. state.needReadable = true;
  19758. n = 0;
  19759. } else {
  19760. state.length -= n;
  19761. }
  19762. if (state.length === 0) {
  19763. if (!state.ended)
  19764. state.needReadable = true;
  19765. if (nOrig !== n && state.ended)
  19766. endReadable(this);
  19767. }
  19768. if (ret !== null)
  19769. this.emit("data", ret);
  19770. return ret;
  19771. };
  19772. function onEofChunk(stream, state) {
  19773. if (state.ended)
  19774. return;
  19775. if (state.decoder) {
  19776. var chunk = state.decoder.end();
  19777. if (chunk && chunk.length) {
  19778. state.buffer.push(chunk);
  19779. state.length += state.objectMode ? 1 : chunk.length;
  19780. }
  19781. }
  19782. state.ended = true;
  19783. emitReadable(stream);
  19784. }
  19785. function emitReadable(stream) {
  19786. var state = stream._readableState;
  19787. state.needReadable = false;
  19788. if (!state.emittedReadable) {
  19789. debug("emitReadable", state.flowing);
  19790. state.emittedReadable = true;
  19791. if (state.sync)
  19792. pna.nextTick(emitReadable_, stream);
  19793. else
  19794. emitReadable_(stream);
  19795. }
  19796. }
  19797. function emitReadable_(stream) {
  19798. debug("emit readable");
  19799. stream.emit("readable");
  19800. flow(stream);
  19801. }
  19802. function maybeReadMore(stream, state) {
  19803. if (!state.readingMore) {
  19804. state.readingMore = true;
  19805. pna.nextTick(maybeReadMore_, stream, state);
  19806. }
  19807. }
  19808. function maybeReadMore_(stream, state) {
  19809. var len = state.length;
  19810. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  19811. debug("maybeReadMore read 0");
  19812. stream.read(0);
  19813. if (len === state.length)
  19814. break;
  19815. else
  19816. len = state.length;
  19817. }
  19818. state.readingMore = false;
  19819. }
  19820. Readable.prototype._read = function(n) {
  19821. this.emit("error", new Error("_read() is not implemented"));
  19822. };
  19823. Readable.prototype.pipe = function(dest, pipeOpts) {
  19824. var src = this;
  19825. var state = this._readableState;
  19826. switch (state.pipesCount) {
  19827. case 0:
  19828. state.pipes = dest;
  19829. break;
  19830. case 1:
  19831. state.pipes = [state.pipes, dest];
  19832. break;
  19833. default:
  19834. state.pipes.push(dest);
  19835. break;
  19836. }
  19837. state.pipesCount += 1;
  19838. debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
  19839. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  19840. var endFn = doEnd ? onend : unpipe;
  19841. if (state.endEmitted)
  19842. pna.nextTick(endFn);
  19843. else
  19844. src.once("end", endFn);
  19845. dest.on("unpipe", onunpipe);
  19846. function onunpipe(readable, unpipeInfo) {
  19847. debug("onunpipe");
  19848. if (readable === src) {
  19849. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  19850. unpipeInfo.hasUnpiped = true;
  19851. cleanup();
  19852. }
  19853. }
  19854. }
  19855. function onend() {
  19856. debug("onend");
  19857. dest.end();
  19858. }
  19859. var ondrain = pipeOnDrain(src);
  19860. dest.on("drain", ondrain);
  19861. var cleanedUp = false;
  19862. function cleanup() {
  19863. debug("cleanup");
  19864. dest.removeListener("close", onclose);
  19865. dest.removeListener("finish", onfinish);
  19866. dest.removeListener("drain", ondrain);
  19867. dest.removeListener("error", onerror);
  19868. dest.removeListener("unpipe", onunpipe);
  19869. src.removeListener("end", onend);
  19870. src.removeListener("end", unpipe);
  19871. src.removeListener("data", ondata);
  19872. cleanedUp = true;
  19873. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
  19874. ondrain();
  19875. }
  19876. var increasedAwaitDrain = false;
  19877. src.on("data", ondata);
  19878. function ondata(chunk) {
  19879. debug("ondata");
  19880. increasedAwaitDrain = false;
  19881. var ret = dest.write(chunk);
  19882. if (false === ret && !increasedAwaitDrain) {
  19883. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  19884. debug("false write response, pause", src._readableState.awaitDrain);
  19885. src._readableState.awaitDrain++;
  19886. increasedAwaitDrain = true;
  19887. }
  19888. src.pause();
  19889. }
  19890. }
  19891. function onerror(er) {
  19892. debug("onerror", er);
  19893. unpipe();
  19894. dest.removeListener("error", onerror);
  19895. if (EElistenerCount(dest, "error") === 0)
  19896. dest.emit("error", er);
  19897. }
  19898. prependListener(dest, "error", onerror);
  19899. function onclose() {
  19900. dest.removeListener("finish", onfinish);
  19901. unpipe();
  19902. }
  19903. dest.once("close", onclose);
  19904. function onfinish() {
  19905. debug("onfinish");
  19906. dest.removeListener("close", onclose);
  19907. unpipe();
  19908. }
  19909. dest.once("finish", onfinish);
  19910. function unpipe() {
  19911. debug("unpipe");
  19912. src.unpipe(dest);
  19913. }
  19914. dest.emit("pipe", src);
  19915. if (!state.flowing) {
  19916. debug("pipe resume");
  19917. src.resume();
  19918. }
  19919. return dest;
  19920. };
  19921. function pipeOnDrain(src) {
  19922. return function() {
  19923. var state = src._readableState;
  19924. debug("pipeOnDrain", state.awaitDrain);
  19925. if (state.awaitDrain)
  19926. state.awaitDrain--;
  19927. if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
  19928. state.flowing = true;
  19929. flow(src);
  19930. }
  19931. };
  19932. }
  19933. Readable.prototype.unpipe = function(dest) {
  19934. var state = this._readableState;
  19935. var unpipeInfo = { hasUnpiped: false };
  19936. if (state.pipesCount === 0)
  19937. return this;
  19938. if (state.pipesCount === 1) {
  19939. if (dest && dest !== state.pipes)
  19940. return this;
  19941. if (!dest)
  19942. dest = state.pipes;
  19943. state.pipes = null;
  19944. state.pipesCount = 0;
  19945. state.flowing = false;
  19946. if (dest)
  19947. dest.emit("unpipe", this, unpipeInfo);
  19948. return this;
  19949. }
  19950. if (!dest) {
  19951. var dests = state.pipes;
  19952. var len = state.pipesCount;
  19953. state.pipes = null;
  19954. state.pipesCount = 0;
  19955. state.flowing = false;
  19956. for (var i = 0; i < len; i++) {
  19957. dests[i].emit("unpipe", this, unpipeInfo);
  19958. }
  19959. return this;
  19960. }
  19961. var index = indexOf(state.pipes, dest);
  19962. if (index === -1)
  19963. return this;
  19964. state.pipes.splice(index, 1);
  19965. state.pipesCount -= 1;
  19966. if (state.pipesCount === 1)
  19967. state.pipes = state.pipes[0];
  19968. dest.emit("unpipe", this, unpipeInfo);
  19969. return this;
  19970. };
  19971. Readable.prototype.on = function(ev, fn) {
  19972. var res = Stream.prototype.on.call(this, ev, fn);
  19973. if (ev === "data") {
  19974. if (this._readableState.flowing !== false)
  19975. this.resume();
  19976. } else if (ev === "readable") {
  19977. var state = this._readableState;
  19978. if (!state.endEmitted && !state.readableListening) {
  19979. state.readableListening = state.needReadable = true;
  19980. state.emittedReadable = false;
  19981. if (!state.reading) {
  19982. pna.nextTick(nReadingNextTick, this);
  19983. } else if (state.length) {
  19984. emitReadable(this);
  19985. }
  19986. }
  19987. }
  19988. return res;
  19989. };
  19990. Readable.prototype.addListener = Readable.prototype.on;
  19991. function nReadingNextTick(self2) {
  19992. debug("readable nexttick read 0");
  19993. self2.read(0);
  19994. }
  19995. Readable.prototype.resume = function() {
  19996. var state = this._readableState;
  19997. if (!state.flowing) {
  19998. debug("resume");
  19999. state.flowing = true;
  20000. resume(this, state);
  20001. }
  20002. return this;
  20003. };
  20004. function resume(stream, state) {
  20005. if (!state.resumeScheduled) {
  20006. state.resumeScheduled = true;
  20007. pna.nextTick(resume_, stream, state);
  20008. }
  20009. }
  20010. function resume_(stream, state) {
  20011. if (!state.reading) {
  20012. debug("resume read 0");
  20013. stream.read(0);
  20014. }
  20015. state.resumeScheduled = false;
  20016. state.awaitDrain = 0;
  20017. stream.emit("resume");
  20018. flow(stream);
  20019. if (state.flowing && !state.reading)
  20020. stream.read(0);
  20021. }
  20022. Readable.prototype.pause = function() {
  20023. debug("call pause flowing=%j", this._readableState.flowing);
  20024. if (false !== this._readableState.flowing) {
  20025. debug("pause");
  20026. this._readableState.flowing = false;
  20027. this.emit("pause");
  20028. }
  20029. return this;
  20030. };
  20031. function flow(stream) {
  20032. var state = stream._readableState;
  20033. debug("flow", state.flowing);
  20034. while (state.flowing && stream.read() !== null) {
  20035. }
  20036. }
  20037. Readable.prototype.wrap = function(stream) {
  20038. var _this = this;
  20039. var state = this._readableState;
  20040. var paused = false;
  20041. stream.on("end", function() {
  20042. debug("wrapped end");
  20043. if (state.decoder && !state.ended) {
  20044. var chunk = state.decoder.end();
  20045. if (chunk && chunk.length)
  20046. _this.push(chunk);
  20047. }
  20048. _this.push(null);
  20049. });
  20050. stream.on("data", function(chunk) {
  20051. debug("wrapped data");
  20052. if (state.decoder)
  20053. chunk = state.decoder.write(chunk);
  20054. if (state.objectMode && (chunk === null || chunk === void 0))
  20055. return;
  20056. else if (!state.objectMode && (!chunk || !chunk.length))
  20057. return;
  20058. var ret = _this.push(chunk);
  20059. if (!ret) {
  20060. paused = true;
  20061. stream.pause();
  20062. }
  20063. });
  20064. for (var i in stream) {
  20065. if (this[i] === void 0 && typeof stream[i] === "function") {
  20066. this[i] = function(method) {
  20067. return function() {
  20068. return stream[method].apply(stream, arguments);
  20069. };
  20070. }(i);
  20071. }
  20072. }
  20073. for (var n = 0; n < kProxyEvents.length; n++) {
  20074. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  20075. }
  20076. this._read = function(n2) {
  20077. debug("wrapped _read", n2);
  20078. if (paused) {
  20079. paused = false;
  20080. stream.resume();
  20081. }
  20082. };
  20083. return this;
  20084. };
  20085. Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
  20086. // making it explicit this property is not enumerable
  20087. // because otherwise some prototype manipulation in
  20088. // userland will fail
  20089. enumerable: false,
  20090. get: function() {
  20091. return this._readableState.highWaterMark;
  20092. }
  20093. });
  20094. Readable._fromList = fromList;
  20095. function fromList(n, state) {
  20096. if (state.length === 0)
  20097. return null;
  20098. var ret;
  20099. if (state.objectMode)
  20100. ret = state.buffer.shift();
  20101. else if (!n || n >= state.length) {
  20102. if (state.decoder)
  20103. ret = state.buffer.join("");
  20104. else if (state.buffer.length === 1)
  20105. ret = state.buffer.head.data;
  20106. else
  20107. ret = state.buffer.concat(state.length);
  20108. state.buffer.clear();
  20109. } else {
  20110. ret = fromListPartial(n, state.buffer, state.decoder);
  20111. }
  20112. return ret;
  20113. }
  20114. function fromListPartial(n, list, hasStrings) {
  20115. var ret;
  20116. if (n < list.head.data.length) {
  20117. ret = list.head.data.slice(0, n);
  20118. list.head.data = list.head.data.slice(n);
  20119. } else if (n === list.head.data.length) {
  20120. ret = list.shift();
  20121. } else {
  20122. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  20123. }
  20124. return ret;
  20125. }
  20126. function copyFromBufferString(n, list) {
  20127. var p = list.head;
  20128. var c = 1;
  20129. var ret = p.data;
  20130. n -= ret.length;
  20131. while (p = p.next) {
  20132. var str = p.data;
  20133. var nb = n > str.length ? str.length : n;
  20134. if (nb === str.length)
  20135. ret += str;
  20136. else
  20137. ret += str.slice(0, n);
  20138. n -= nb;
  20139. if (n === 0) {
  20140. if (nb === str.length) {
  20141. ++c;
  20142. if (p.next)
  20143. list.head = p.next;
  20144. else
  20145. list.head = list.tail = null;
  20146. } else {
  20147. list.head = p;
  20148. p.data = str.slice(nb);
  20149. }
  20150. break;
  20151. }
  20152. ++c;
  20153. }
  20154. list.length -= c;
  20155. return ret;
  20156. }
  20157. function copyFromBuffer(n, list) {
  20158. var ret = Buffer.allocUnsafe(n);
  20159. var p = list.head;
  20160. var c = 1;
  20161. p.data.copy(ret);
  20162. n -= p.data.length;
  20163. while (p = p.next) {
  20164. var buf = p.data;
  20165. var nb = n > buf.length ? buf.length : n;
  20166. buf.copy(ret, ret.length - n, 0, nb);
  20167. n -= nb;
  20168. if (n === 0) {
  20169. if (nb === buf.length) {
  20170. ++c;
  20171. if (p.next)
  20172. list.head = p.next;
  20173. else
  20174. list.head = list.tail = null;
  20175. } else {
  20176. list.head = p;
  20177. p.data = buf.slice(nb);
  20178. }
  20179. break;
  20180. }
  20181. ++c;
  20182. }
  20183. list.length -= c;
  20184. return ret;
  20185. }
  20186. function endReadable(stream) {
  20187. var state = stream._readableState;
  20188. if (state.length > 0)
  20189. throw new Error('"endReadable()" called on non-empty stream');
  20190. if (!state.endEmitted) {
  20191. state.ended = true;
  20192. pna.nextTick(endReadableNT, state, stream);
  20193. }
  20194. }
  20195. function endReadableNT(state, stream) {
  20196. if (!state.endEmitted && state.length === 0) {
  20197. state.endEmitted = true;
  20198. stream.readable = false;
  20199. stream.emit("end");
  20200. }
  20201. }
  20202. function indexOf(xs, x) {
  20203. for (var i = 0, l = xs.length; i < l; i++) {
  20204. if (xs[i] === x)
  20205. return i;
  20206. }
  20207. return -1;
  20208. }
  20209. }).call(this);
  20210. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  20211. }, { "./_stream_duplex": 386, "./internal/streams/BufferList": 391, "./internal/streams/destroy": 392, "./internal/streams/stream": 393, "_process": 467, "core-util-is": 341, "events": 344, "inherits": 364, "isarray": 370, "process-nextick-args": 380, "safe-buffer": 396, "string_decoder/": 413, "util": 89 }], 389: [function(require2, module3, exports3) {
  20212. "use strict";
  20213. module3.exports = Transform;
  20214. var Duplex = require2("./_stream_duplex");
  20215. var util = Object.create(require2("core-util-is"));
  20216. util.inherits = require2("inherits");
  20217. util.inherits(Transform, Duplex);
  20218. function afterTransform(er, data) {
  20219. var ts = this._transformState;
  20220. ts.transforming = false;
  20221. var cb = ts.writecb;
  20222. if (!cb) {
  20223. return this.emit("error", new Error("write callback called multiple times"));
  20224. }
  20225. ts.writechunk = null;
  20226. ts.writecb = null;
  20227. if (data != null)
  20228. this.push(data);
  20229. cb(er);
  20230. var rs = this._readableState;
  20231. rs.reading = false;
  20232. if (rs.needReadable || rs.length < rs.highWaterMark) {
  20233. this._read(rs.highWaterMark);
  20234. }
  20235. }
  20236. function Transform(options) {
  20237. if (!(this instanceof Transform))
  20238. return new Transform(options);
  20239. Duplex.call(this, options);
  20240. this._transformState = {
  20241. afterTransform: afterTransform.bind(this),
  20242. needTransform: false,
  20243. transforming: false,
  20244. writecb: null,
  20245. writechunk: null,
  20246. writeencoding: null
  20247. };
  20248. this._readableState.needReadable = true;
  20249. this._readableState.sync = false;
  20250. if (options) {
  20251. if (typeof options.transform === "function")
  20252. this._transform = options.transform;
  20253. if (typeof options.flush === "function")
  20254. this._flush = options.flush;
  20255. }
  20256. this.on("prefinish", prefinish);
  20257. }
  20258. function prefinish() {
  20259. var _this = this;
  20260. if (typeof this._flush === "function") {
  20261. this._flush(function(er, data) {
  20262. done(_this, er, data);
  20263. });
  20264. } else {
  20265. done(this, null, null);
  20266. }
  20267. }
  20268. Transform.prototype.push = function(chunk, encoding) {
  20269. this._transformState.needTransform = false;
  20270. return Duplex.prototype.push.call(this, chunk, encoding);
  20271. };
  20272. Transform.prototype._transform = function(chunk, encoding, cb) {
  20273. throw new Error("_transform() is not implemented");
  20274. };
  20275. Transform.prototype._write = function(chunk, encoding, cb) {
  20276. var ts = this._transformState;
  20277. ts.writecb = cb;
  20278. ts.writechunk = chunk;
  20279. ts.writeencoding = encoding;
  20280. if (!ts.transforming) {
  20281. var rs = this._readableState;
  20282. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
  20283. this._read(rs.highWaterMark);
  20284. }
  20285. };
  20286. Transform.prototype._read = function(n) {
  20287. var ts = this._transformState;
  20288. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  20289. ts.transforming = true;
  20290. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  20291. } else {
  20292. ts.needTransform = true;
  20293. }
  20294. };
  20295. Transform.prototype._destroy = function(err, cb) {
  20296. var _this2 = this;
  20297. Duplex.prototype._destroy.call(this, err, function(err2) {
  20298. cb(err2);
  20299. _this2.emit("close");
  20300. });
  20301. };
  20302. function done(stream, er, data) {
  20303. if (er)
  20304. return stream.emit("error", er);
  20305. if (data != null)
  20306. stream.push(data);
  20307. if (stream._writableState.length)
  20308. throw new Error("Calling transform done when ws.length != 0");
  20309. if (stream._transformState.transforming)
  20310. throw new Error("Calling transform done when still transforming");
  20311. return stream.push(null);
  20312. }
  20313. }, { "./_stream_duplex": 386, "core-util-is": 341, "inherits": 364 }], 390: [function(require2, module3, exports3) {
  20314. (function(process, global2, setImmediate) {
  20315. (function() {
  20316. "use strict";
  20317. var pna = require2("process-nextick-args");
  20318. module3.exports = Writable;
  20319. function WriteReq(chunk, encoding, cb) {
  20320. this.chunk = chunk;
  20321. this.encoding = encoding;
  20322. this.callback = cb;
  20323. this.next = null;
  20324. }
  20325. function CorkedRequest(state) {
  20326. var _this = this;
  20327. this.next = null;
  20328. this.entry = null;
  20329. this.finish = function() {
  20330. onCorkedFinish(_this, state);
  20331. };
  20332. }
  20333. var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  20334. var Duplex;
  20335. Writable.WritableState = WritableState;
  20336. var util = Object.create(require2("core-util-is"));
  20337. util.inherits = require2("inherits");
  20338. var internalUtil = {
  20339. deprecate: require2("util-deprecate")
  20340. };
  20341. var Stream = require2("./internal/streams/stream");
  20342. var Buffer = require2("safe-buffer").Buffer;
  20343. var OurUint8Array = global2.Uint8Array || function() {
  20344. };
  20345. function _uint8ArrayToBuffer(chunk) {
  20346. return Buffer.from(chunk);
  20347. }
  20348. function _isUint8Array(obj) {
  20349. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  20350. }
  20351. var destroyImpl = require2("./internal/streams/destroy");
  20352. util.inherits(Writable, Stream);
  20353. function nop() {
  20354. }
  20355. function WritableState(options, stream) {
  20356. Duplex = Duplex || require2("./_stream_duplex");
  20357. options = options || {};
  20358. var isDuplex = stream instanceof Duplex;
  20359. this.objectMode = !!options.objectMode;
  20360. if (isDuplex)
  20361. this.objectMode = this.objectMode || !!options.writableObjectMode;
  20362. var hwm = options.highWaterMark;
  20363. var writableHwm = options.writableHighWaterMark;
  20364. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  20365. if (hwm || hwm === 0)
  20366. this.highWaterMark = hwm;
  20367. else if (isDuplex && (writableHwm || writableHwm === 0))
  20368. this.highWaterMark = writableHwm;
  20369. else
  20370. this.highWaterMark = defaultHwm;
  20371. this.highWaterMark = Math.floor(this.highWaterMark);
  20372. this.finalCalled = false;
  20373. this.needDrain = false;
  20374. this.ending = false;
  20375. this.ended = false;
  20376. this.finished = false;
  20377. this.destroyed = false;
  20378. var noDecode = options.decodeStrings === false;
  20379. this.decodeStrings = !noDecode;
  20380. this.defaultEncoding = options.defaultEncoding || "utf8";
  20381. this.length = 0;
  20382. this.writing = false;
  20383. this.corked = 0;
  20384. this.sync = true;
  20385. this.bufferProcessing = false;
  20386. this.onwrite = function(er) {
  20387. onwrite(stream, er);
  20388. };
  20389. this.writecb = null;
  20390. this.writelen = 0;
  20391. this.bufferedRequest = null;
  20392. this.lastBufferedRequest = null;
  20393. this.pendingcb = 0;
  20394. this.prefinished = false;
  20395. this.errorEmitted = false;
  20396. this.bufferedRequestCount = 0;
  20397. this.corkedRequestsFree = new CorkedRequest(this);
  20398. }
  20399. WritableState.prototype.getBuffer = function getBuffer() {
  20400. var current = this.bufferedRequest;
  20401. var out = [];
  20402. while (current) {
  20403. out.push(current);
  20404. current = current.next;
  20405. }
  20406. return out;
  20407. };
  20408. (function() {
  20409. try {
  20410. Object.defineProperty(WritableState.prototype, "buffer", {
  20411. get: internalUtil.deprecate(function() {
  20412. return this.getBuffer();
  20413. }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
  20414. });
  20415. } catch (_) {
  20416. }
  20417. })();
  20418. var realHasInstance;
  20419. if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
  20420. realHasInstance = Function.prototype[Symbol.hasInstance];
  20421. Object.defineProperty(Writable, Symbol.hasInstance, {
  20422. value: function(object) {
  20423. if (realHasInstance.call(this, object))
  20424. return true;
  20425. if (this !== Writable)
  20426. return false;
  20427. return object && object._writableState instanceof WritableState;
  20428. }
  20429. });
  20430. } else {
  20431. realHasInstance = function(object) {
  20432. return object instanceof this;
  20433. };
  20434. }
  20435. function Writable(options) {
  20436. Duplex = Duplex || require2("./_stream_duplex");
  20437. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  20438. return new Writable(options);
  20439. }
  20440. this._writableState = new WritableState(options, this);
  20441. this.writable = true;
  20442. if (options) {
  20443. if (typeof options.write === "function")
  20444. this._write = options.write;
  20445. if (typeof options.writev === "function")
  20446. this._writev = options.writev;
  20447. if (typeof options.destroy === "function")
  20448. this._destroy = options.destroy;
  20449. if (typeof options.final === "function")
  20450. this._final = options.final;
  20451. }
  20452. Stream.call(this);
  20453. }
  20454. Writable.prototype.pipe = function() {
  20455. this.emit("error", new Error("Cannot pipe, not readable"));
  20456. };
  20457. function writeAfterEnd(stream, cb) {
  20458. var er = new Error("write after end");
  20459. stream.emit("error", er);
  20460. pna.nextTick(cb, er);
  20461. }
  20462. function validChunk(stream, state, chunk, cb) {
  20463. var valid = true;
  20464. var er = false;
  20465. if (chunk === null) {
  20466. er = new TypeError("May not write null values to stream");
  20467. } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
  20468. er = new TypeError("Invalid non-string/buffer chunk");
  20469. }
  20470. if (er) {
  20471. stream.emit("error", er);
  20472. pna.nextTick(cb, er);
  20473. valid = false;
  20474. }
  20475. return valid;
  20476. }
  20477. Writable.prototype.write = function(chunk, encoding, cb) {
  20478. var state = this._writableState;
  20479. var ret = false;
  20480. var isBuf = !state.objectMode && _isUint8Array(chunk);
  20481. if (isBuf && !Buffer.isBuffer(chunk)) {
  20482. chunk = _uint8ArrayToBuffer(chunk);
  20483. }
  20484. if (typeof encoding === "function") {
  20485. cb = encoding;
  20486. encoding = null;
  20487. }
  20488. if (isBuf)
  20489. encoding = "buffer";
  20490. else if (!encoding)
  20491. encoding = state.defaultEncoding;
  20492. if (typeof cb !== "function")
  20493. cb = nop;
  20494. if (state.ended)
  20495. writeAfterEnd(this, cb);
  20496. else if (isBuf || validChunk(this, state, chunk, cb)) {
  20497. state.pendingcb++;
  20498. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  20499. }
  20500. return ret;
  20501. };
  20502. Writable.prototype.cork = function() {
  20503. var state = this._writableState;
  20504. state.corked++;
  20505. };
  20506. Writable.prototype.uncork = function() {
  20507. var state = this._writableState;
  20508. if (state.corked) {
  20509. state.corked--;
  20510. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest)
  20511. clearBuffer(this, state);
  20512. }
  20513. };
  20514. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  20515. if (typeof encoding === "string")
  20516. encoding = encoding.toLowerCase();
  20517. if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
  20518. throw new TypeError("Unknown encoding: " + encoding);
  20519. this._writableState.defaultEncoding = encoding;
  20520. return this;
  20521. };
  20522. function decodeChunk(state, chunk, encoding) {
  20523. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
  20524. chunk = Buffer.from(chunk, encoding);
  20525. }
  20526. return chunk;
  20527. }
  20528. Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
  20529. // making it explicit this property is not enumerable
  20530. // because otherwise some prototype manipulation in
  20531. // userland will fail
  20532. enumerable: false,
  20533. get: function() {
  20534. return this._writableState.highWaterMark;
  20535. }
  20536. });
  20537. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  20538. if (!isBuf) {
  20539. var newChunk = decodeChunk(state, chunk, encoding);
  20540. if (chunk !== newChunk) {
  20541. isBuf = true;
  20542. encoding = "buffer";
  20543. chunk = newChunk;
  20544. }
  20545. }
  20546. var len = state.objectMode ? 1 : chunk.length;
  20547. state.length += len;
  20548. var ret = state.length < state.highWaterMark;
  20549. if (!ret)
  20550. state.needDrain = true;
  20551. if (state.writing || state.corked) {
  20552. var last = state.lastBufferedRequest;
  20553. state.lastBufferedRequest = {
  20554. chunk,
  20555. encoding,
  20556. isBuf,
  20557. callback: cb,
  20558. next: null
  20559. };
  20560. if (last) {
  20561. last.next = state.lastBufferedRequest;
  20562. } else {
  20563. state.bufferedRequest = state.lastBufferedRequest;
  20564. }
  20565. state.bufferedRequestCount += 1;
  20566. } else {
  20567. doWrite(stream, state, false, len, chunk, encoding, cb);
  20568. }
  20569. return ret;
  20570. }
  20571. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  20572. state.writelen = len;
  20573. state.writecb = cb;
  20574. state.writing = true;
  20575. state.sync = true;
  20576. if (writev)
  20577. stream._writev(chunk, state.onwrite);
  20578. else
  20579. stream._write(chunk, encoding, state.onwrite);
  20580. state.sync = false;
  20581. }
  20582. function onwriteError(stream, state, sync, er, cb) {
  20583. --state.pendingcb;
  20584. if (sync) {
  20585. pna.nextTick(cb, er);
  20586. pna.nextTick(finishMaybe, stream, state);
  20587. stream._writableState.errorEmitted = true;
  20588. stream.emit("error", er);
  20589. } else {
  20590. cb(er);
  20591. stream._writableState.errorEmitted = true;
  20592. stream.emit("error", er);
  20593. finishMaybe(stream, state);
  20594. }
  20595. }
  20596. function onwriteStateUpdate(state) {
  20597. state.writing = false;
  20598. state.writecb = null;
  20599. state.length -= state.writelen;
  20600. state.writelen = 0;
  20601. }
  20602. function onwrite(stream, er) {
  20603. var state = stream._writableState;
  20604. var sync = state.sync;
  20605. var cb = state.writecb;
  20606. onwriteStateUpdate(state);
  20607. if (er)
  20608. onwriteError(stream, state, sync, er, cb);
  20609. else {
  20610. var finished = needFinish(state);
  20611. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  20612. clearBuffer(stream, state);
  20613. }
  20614. if (sync) {
  20615. asyncWrite(afterWrite, stream, state, finished, cb);
  20616. } else {
  20617. afterWrite(stream, state, finished, cb);
  20618. }
  20619. }
  20620. }
  20621. function afterWrite(stream, state, finished, cb) {
  20622. if (!finished)
  20623. onwriteDrain(stream, state);
  20624. state.pendingcb--;
  20625. cb();
  20626. finishMaybe(stream, state);
  20627. }
  20628. function onwriteDrain(stream, state) {
  20629. if (state.length === 0 && state.needDrain) {
  20630. state.needDrain = false;
  20631. stream.emit("drain");
  20632. }
  20633. }
  20634. function clearBuffer(stream, state) {
  20635. state.bufferProcessing = true;
  20636. var entry = state.bufferedRequest;
  20637. if (stream._writev && entry && entry.next) {
  20638. var l = state.bufferedRequestCount;
  20639. var buffer = new Array(l);
  20640. var holder = state.corkedRequestsFree;
  20641. holder.entry = entry;
  20642. var count = 0;
  20643. var allBuffers = true;
  20644. while (entry) {
  20645. buffer[count] = entry;
  20646. if (!entry.isBuf)
  20647. allBuffers = false;
  20648. entry = entry.next;
  20649. count += 1;
  20650. }
  20651. buffer.allBuffers = allBuffers;
  20652. doWrite(stream, state, true, state.length, buffer, "", holder.finish);
  20653. state.pendingcb++;
  20654. state.lastBufferedRequest = null;
  20655. if (holder.next) {
  20656. state.corkedRequestsFree = holder.next;
  20657. holder.next = null;
  20658. } else {
  20659. state.corkedRequestsFree = new CorkedRequest(state);
  20660. }
  20661. state.bufferedRequestCount = 0;
  20662. } else {
  20663. while (entry) {
  20664. var chunk = entry.chunk;
  20665. var encoding = entry.encoding;
  20666. var cb = entry.callback;
  20667. var len = state.objectMode ? 1 : chunk.length;
  20668. doWrite(stream, state, false, len, chunk, encoding, cb);
  20669. entry = entry.next;
  20670. state.bufferedRequestCount--;
  20671. if (state.writing) {
  20672. break;
  20673. }
  20674. }
  20675. if (entry === null)
  20676. state.lastBufferedRequest = null;
  20677. }
  20678. state.bufferedRequest = entry;
  20679. state.bufferProcessing = false;
  20680. }
  20681. Writable.prototype._write = function(chunk, encoding, cb) {
  20682. cb(new Error("_write() is not implemented"));
  20683. };
  20684. Writable.prototype._writev = null;
  20685. Writable.prototype.end = function(chunk, encoding, cb) {
  20686. var state = this._writableState;
  20687. if (typeof chunk === "function") {
  20688. cb = chunk;
  20689. chunk = null;
  20690. encoding = null;
  20691. } else if (typeof encoding === "function") {
  20692. cb = encoding;
  20693. encoding = null;
  20694. }
  20695. if (chunk !== null && chunk !== void 0)
  20696. this.write(chunk, encoding);
  20697. if (state.corked) {
  20698. state.corked = 1;
  20699. this.uncork();
  20700. }
  20701. if (!state.ending && !state.finished)
  20702. endWritable(this, state, cb);
  20703. };
  20704. function needFinish(state) {
  20705. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  20706. }
  20707. function callFinal(stream, state) {
  20708. stream._final(function(err) {
  20709. state.pendingcb--;
  20710. if (err) {
  20711. stream.emit("error", err);
  20712. }
  20713. state.prefinished = true;
  20714. stream.emit("prefinish");
  20715. finishMaybe(stream, state);
  20716. });
  20717. }
  20718. function prefinish(stream, state) {
  20719. if (!state.prefinished && !state.finalCalled) {
  20720. if (typeof stream._final === "function") {
  20721. state.pendingcb++;
  20722. state.finalCalled = true;
  20723. pna.nextTick(callFinal, stream, state);
  20724. } else {
  20725. state.prefinished = true;
  20726. stream.emit("prefinish");
  20727. }
  20728. }
  20729. }
  20730. function finishMaybe(stream, state) {
  20731. var need = needFinish(state);
  20732. if (need) {
  20733. prefinish(stream, state);
  20734. if (state.pendingcb === 0) {
  20735. state.finished = true;
  20736. stream.emit("finish");
  20737. }
  20738. }
  20739. return need;
  20740. }
  20741. function endWritable(stream, state, cb) {
  20742. state.ending = true;
  20743. finishMaybe(stream, state);
  20744. if (cb) {
  20745. if (state.finished)
  20746. pna.nextTick(cb);
  20747. else
  20748. stream.once("finish", cb);
  20749. }
  20750. state.ended = true;
  20751. stream.writable = false;
  20752. }
  20753. function onCorkedFinish(corkReq, state, err) {
  20754. var entry = corkReq.entry;
  20755. corkReq.entry = null;
  20756. while (entry) {
  20757. var cb = entry.callback;
  20758. state.pendingcb--;
  20759. cb(err);
  20760. entry = entry.next;
  20761. }
  20762. if (state.corkedRequestsFree) {
  20763. state.corkedRequestsFree.next = corkReq;
  20764. } else {
  20765. state.corkedRequestsFree = corkReq;
  20766. }
  20767. }
  20768. Object.defineProperty(Writable.prototype, "destroyed", {
  20769. get: function() {
  20770. if (this._writableState === void 0) {
  20771. return false;
  20772. }
  20773. return this._writableState.destroyed;
  20774. },
  20775. set: function(value) {
  20776. if (!this._writableState) {
  20777. return;
  20778. }
  20779. this._writableState.destroyed = value;
  20780. }
  20781. });
  20782. Writable.prototype.destroy = destroyImpl.destroy;
  20783. Writable.prototype._undestroy = destroyImpl.undestroy;
  20784. Writable.prototype._destroy = function(err, cb) {
  20785. this.end();
  20786. cb(err);
  20787. };
  20788. }).call(this);
  20789. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("timers").setImmediate);
  20790. }, { "./_stream_duplex": 386, "./internal/streams/destroy": 392, "./internal/streams/stream": 393, "_process": 467, "core-util-is": 341, "inherits": 364, "process-nextick-args": 380, "safe-buffer": 396, "timers": 414, "util-deprecate": 416 }], 391: [function(require2, module3, exports3) {
  20791. "use strict";
  20792. function _classCallCheck(instance, Constructor) {
  20793. if (!(instance instanceof Constructor)) {
  20794. throw new TypeError("Cannot call a class as a function");
  20795. }
  20796. }
  20797. var Buffer = require2("safe-buffer").Buffer;
  20798. var util = require2("util");
  20799. function copyBuffer(src, target, offset) {
  20800. src.copy(target, offset);
  20801. }
  20802. module3.exports = function() {
  20803. function BufferList() {
  20804. _classCallCheck(this, BufferList);
  20805. this.head = null;
  20806. this.tail = null;
  20807. this.length = 0;
  20808. }
  20809. BufferList.prototype.push = function push(v) {
  20810. var entry = { data: v, next: null };
  20811. if (this.length > 0)
  20812. this.tail.next = entry;
  20813. else
  20814. this.head = entry;
  20815. this.tail = entry;
  20816. ++this.length;
  20817. };
  20818. BufferList.prototype.unshift = function unshift(v) {
  20819. var entry = { data: v, next: this.head };
  20820. if (this.length === 0)
  20821. this.tail = entry;
  20822. this.head = entry;
  20823. ++this.length;
  20824. };
  20825. BufferList.prototype.shift = function shift() {
  20826. if (this.length === 0)
  20827. return;
  20828. var ret = this.head.data;
  20829. if (this.length === 1)
  20830. this.head = this.tail = null;
  20831. else
  20832. this.head = this.head.next;
  20833. --this.length;
  20834. return ret;
  20835. };
  20836. BufferList.prototype.clear = function clear() {
  20837. this.head = this.tail = null;
  20838. this.length = 0;
  20839. };
  20840. BufferList.prototype.join = function join(s) {
  20841. if (this.length === 0)
  20842. return "";
  20843. var p = this.head;
  20844. var ret = "" + p.data;
  20845. while (p = p.next) {
  20846. ret += s + p.data;
  20847. }
  20848. return ret;
  20849. };
  20850. BufferList.prototype.concat = function concat(n) {
  20851. if (this.length === 0)
  20852. return Buffer.alloc(0);
  20853. if (this.length === 1)
  20854. return this.head.data;
  20855. var ret = Buffer.allocUnsafe(n >>> 0);
  20856. var p = this.head;
  20857. var i = 0;
  20858. while (p) {
  20859. copyBuffer(p.data, ret, i);
  20860. i += p.data.length;
  20861. p = p.next;
  20862. }
  20863. return ret;
  20864. };
  20865. return BufferList;
  20866. }();
  20867. if (util && util.inspect && util.inspect.custom) {
  20868. module3.exports.prototype[util.inspect.custom] = function() {
  20869. var obj = util.inspect({ length: this.length });
  20870. return this.constructor.name + " " + obj;
  20871. };
  20872. }
  20873. }, { "safe-buffer": 396, "util": 89 }], 392: [function(require2, module3, exports3) {
  20874. "use strict";
  20875. var pna = require2("process-nextick-args");
  20876. function destroy(err, cb) {
  20877. var _this = this;
  20878. var readableDestroyed = this._readableState && this._readableState.destroyed;
  20879. var writableDestroyed = this._writableState && this._writableState.destroyed;
  20880. if (readableDestroyed || writableDestroyed) {
  20881. if (cb) {
  20882. cb(err);
  20883. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  20884. pna.nextTick(emitErrorNT, this, err);
  20885. }
  20886. return this;
  20887. }
  20888. if (this._readableState) {
  20889. this._readableState.destroyed = true;
  20890. }
  20891. if (this._writableState) {
  20892. this._writableState.destroyed = true;
  20893. }
  20894. this._destroy(err || null, function(err2) {
  20895. if (!cb && err2) {
  20896. pna.nextTick(emitErrorNT, _this, err2);
  20897. if (_this._writableState) {
  20898. _this._writableState.errorEmitted = true;
  20899. }
  20900. } else if (cb) {
  20901. cb(err2);
  20902. }
  20903. });
  20904. return this;
  20905. }
  20906. function undestroy() {
  20907. if (this._readableState) {
  20908. this._readableState.destroyed = false;
  20909. this._readableState.reading = false;
  20910. this._readableState.ended = false;
  20911. this._readableState.endEmitted = false;
  20912. }
  20913. if (this._writableState) {
  20914. this._writableState.destroyed = false;
  20915. this._writableState.ended = false;
  20916. this._writableState.ending = false;
  20917. this._writableState.finished = false;
  20918. this._writableState.errorEmitted = false;
  20919. }
  20920. }
  20921. function emitErrorNT(self2, err) {
  20922. self2.emit("error", err);
  20923. }
  20924. module3.exports = {
  20925. destroy,
  20926. undestroy
  20927. };
  20928. }, { "process-nextick-args": 380 }], 393: [function(require2, module3, exports3) {
  20929. module3.exports = require2("events").EventEmitter;
  20930. }, { "events": 344 }], 394: [function(require2, module3, exports3) {
  20931. exports3 = module3.exports = require2("./lib/_stream_readable.js");
  20932. exports3.Stream = exports3;
  20933. exports3.Readable = exports3;
  20934. exports3.Writable = require2("./lib/_stream_writable.js");
  20935. exports3.Duplex = require2("./lib/_stream_duplex.js");
  20936. exports3.Transform = require2("./lib/_stream_transform.js");
  20937. exports3.PassThrough = require2("./lib/_stream_passthrough.js");
  20938. }, { "./lib/_stream_duplex.js": 386, "./lib/_stream_passthrough.js": 387, "./lib/_stream_readable.js": 388, "./lib/_stream_transform.js": 389, "./lib/_stream_writable.js": 390 }], 395: [function(require2, module3, exports3) {
  20939. var runtime = function(exports4) {
  20940. "use strict";
  20941. var Op = Object.prototype;
  20942. var hasOwn = Op.hasOwnProperty;
  20943. var undefined2;
  20944. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  20945. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  20946. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  20947. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  20948. function define3(obj, key, value) {
  20949. Object.defineProperty(obj, key, {
  20950. value,
  20951. enumerable: true,
  20952. configurable: true,
  20953. writable: true
  20954. });
  20955. return obj[key];
  20956. }
  20957. try {
  20958. define3({}, "");
  20959. } catch (err) {
  20960. define3 = function(obj, key, value) {
  20961. return obj[key] = value;
  20962. };
  20963. }
  20964. function wrap(innerFn, outerFn, self2, tryLocsList) {
  20965. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  20966. var generator = Object.create(protoGenerator.prototype);
  20967. var context = new Context(tryLocsList || []);
  20968. generator._invoke = makeInvokeMethod(innerFn, self2, context);
  20969. return generator;
  20970. }
  20971. exports4.wrap = wrap;
  20972. function tryCatch(fn, obj, arg) {
  20973. try {
  20974. return { type: "normal", arg: fn.call(obj, arg) };
  20975. } catch (err) {
  20976. return { type: "throw", arg: err };
  20977. }
  20978. }
  20979. var GenStateSuspendedStart = "suspendedStart";
  20980. var GenStateSuspendedYield = "suspendedYield";
  20981. var GenStateExecuting = "executing";
  20982. var GenStateCompleted = "completed";
  20983. var ContinueSentinel = {};
  20984. function Generator() {
  20985. }
  20986. function GeneratorFunction() {
  20987. }
  20988. function GeneratorFunctionPrototype() {
  20989. }
  20990. var IteratorPrototype = {};
  20991. define3(IteratorPrototype, iteratorSymbol, function() {
  20992. return this;
  20993. });
  20994. var getProto = Object.getPrototypeOf;
  20995. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  20996. if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  20997. IteratorPrototype = NativeIteratorPrototype;
  20998. }
  20999. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  21000. GeneratorFunction.prototype = GeneratorFunctionPrototype;
  21001. define3(Gp, "constructor", GeneratorFunctionPrototype);
  21002. define3(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
  21003. GeneratorFunction.displayName = define3(
  21004. GeneratorFunctionPrototype,
  21005. toStringTagSymbol,
  21006. "GeneratorFunction"
  21007. );
  21008. function defineIteratorMethods(prototype) {
  21009. ["next", "throw", "return"].forEach(function(method) {
  21010. define3(prototype, method, function(arg) {
  21011. return this._invoke(method, arg);
  21012. });
  21013. });
  21014. }
  21015. exports4.isGeneratorFunction = function(genFun) {
  21016. var ctor = typeof genFun === "function" && genFun.constructor;
  21017. return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
  21018. // do is to check its .name property.
  21019. (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
  21020. };
  21021. exports4.mark = function(genFun) {
  21022. if (Object.setPrototypeOf) {
  21023. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  21024. } else {
  21025. genFun.__proto__ = GeneratorFunctionPrototype;
  21026. define3(genFun, toStringTagSymbol, "GeneratorFunction");
  21027. }
  21028. genFun.prototype = Object.create(Gp);
  21029. return genFun;
  21030. };
  21031. exports4.awrap = function(arg) {
  21032. return { __await: arg };
  21033. };
  21034. function AsyncIterator(generator, PromiseImpl) {
  21035. function invoke(method, arg, resolve, reject) {
  21036. var record = tryCatch(generator[method], generator, arg);
  21037. if (record.type === "throw") {
  21038. reject(record.arg);
  21039. } else {
  21040. var result = record.arg;
  21041. var value = result.value;
  21042. if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
  21043. return PromiseImpl.resolve(value.__await).then(function(value2) {
  21044. invoke("next", value2, resolve, reject);
  21045. }, function(err) {
  21046. invoke("throw", err, resolve, reject);
  21047. });
  21048. }
  21049. return PromiseImpl.resolve(value).then(function(unwrapped) {
  21050. result.value = unwrapped;
  21051. resolve(result);
  21052. }, function(error) {
  21053. return invoke("throw", error, resolve, reject);
  21054. });
  21055. }
  21056. }
  21057. var previousPromise;
  21058. function enqueue(method, arg) {
  21059. function callInvokeWithMethodAndArg() {
  21060. return new PromiseImpl(function(resolve, reject) {
  21061. invoke(method, arg, resolve, reject);
  21062. });
  21063. }
  21064. return previousPromise = // If enqueue has been called before, then we want to wait until
  21065. // all previous Promises have been resolved before calling invoke,
  21066. // so that results are always delivered in the correct order. If
  21067. // enqueue has not been called before, then it is important to
  21068. // call invoke immediately, without waiting on a callback to fire,
  21069. // so that the async generator function has the opportunity to do
  21070. // any necessary setup in a predictable way. This predictability
  21071. // is why the Promise constructor synchronously invokes its
  21072. // executor callback, and why async functions synchronously
  21073. // execute code before the first await. Since we implement simple
  21074. // async functions in terms of async generators, it is especially
  21075. // important to get this right, even though it requires care.
  21076. previousPromise ? previousPromise.then(
  21077. callInvokeWithMethodAndArg,
  21078. // Avoid propagating failures to Promises returned by later
  21079. // invocations of the iterator.
  21080. callInvokeWithMethodAndArg
  21081. ) : callInvokeWithMethodAndArg();
  21082. }
  21083. this._invoke = enqueue;
  21084. }
  21085. defineIteratorMethods(AsyncIterator.prototype);
  21086. define3(AsyncIterator.prototype, asyncIteratorSymbol, function() {
  21087. return this;
  21088. });
  21089. exports4.AsyncIterator = AsyncIterator;
  21090. exports4.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
  21091. if (PromiseImpl === void 0)
  21092. PromiseImpl = Promise;
  21093. var iter = new AsyncIterator(
  21094. wrap(innerFn, outerFn, self2, tryLocsList),
  21095. PromiseImpl
  21096. );
  21097. return exports4.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
  21098. return result.done ? result.value : iter.next();
  21099. });
  21100. };
  21101. function makeInvokeMethod(innerFn, self2, context) {
  21102. var state = GenStateSuspendedStart;
  21103. return function invoke(method, arg) {
  21104. if (state === GenStateExecuting) {
  21105. throw new Error("Generator is already running");
  21106. }
  21107. if (state === GenStateCompleted) {
  21108. if (method === "throw") {
  21109. throw arg;
  21110. }
  21111. return doneResult();
  21112. }
  21113. context.method = method;
  21114. context.arg = arg;
  21115. while (true) {
  21116. var delegate = context.delegate;
  21117. if (delegate) {
  21118. var delegateResult = maybeInvokeDelegate(delegate, context);
  21119. if (delegateResult) {
  21120. if (delegateResult === ContinueSentinel)
  21121. continue;
  21122. return delegateResult;
  21123. }
  21124. }
  21125. if (context.method === "next") {
  21126. context.sent = context._sent = context.arg;
  21127. } else if (context.method === "throw") {
  21128. if (state === GenStateSuspendedStart) {
  21129. state = GenStateCompleted;
  21130. throw context.arg;
  21131. }
  21132. context.dispatchException(context.arg);
  21133. } else if (context.method === "return") {
  21134. context.abrupt("return", context.arg);
  21135. }
  21136. state = GenStateExecuting;
  21137. var record = tryCatch(innerFn, self2, context);
  21138. if (record.type === "normal") {
  21139. state = context.done ? GenStateCompleted : GenStateSuspendedYield;
  21140. if (record.arg === ContinueSentinel) {
  21141. continue;
  21142. }
  21143. return {
  21144. value: record.arg,
  21145. done: context.done
  21146. };
  21147. } else if (record.type === "throw") {
  21148. state = GenStateCompleted;
  21149. context.method = "throw";
  21150. context.arg = record.arg;
  21151. }
  21152. }
  21153. };
  21154. }
  21155. function maybeInvokeDelegate(delegate, context) {
  21156. var method = delegate.iterator[context.method];
  21157. if (method === undefined2) {
  21158. context.delegate = null;
  21159. if (context.method === "throw") {
  21160. if (delegate.iterator["return"]) {
  21161. context.method = "return";
  21162. context.arg = undefined2;
  21163. maybeInvokeDelegate(delegate, context);
  21164. if (context.method === "throw") {
  21165. return ContinueSentinel;
  21166. }
  21167. }
  21168. context.method = "throw";
  21169. context.arg = new TypeError(
  21170. "The iterator does not provide a 'throw' method"
  21171. );
  21172. }
  21173. return ContinueSentinel;
  21174. }
  21175. var record = tryCatch(method, delegate.iterator, context.arg);
  21176. if (record.type === "throw") {
  21177. context.method = "throw";
  21178. context.arg = record.arg;
  21179. context.delegate = null;
  21180. return ContinueSentinel;
  21181. }
  21182. var info = record.arg;
  21183. if (!info) {
  21184. context.method = "throw";
  21185. context.arg = new TypeError("iterator result is not an object");
  21186. context.delegate = null;
  21187. return ContinueSentinel;
  21188. }
  21189. if (info.done) {
  21190. context[delegate.resultName] = info.value;
  21191. context.next = delegate.nextLoc;
  21192. if (context.method !== "return") {
  21193. context.method = "next";
  21194. context.arg = undefined2;
  21195. }
  21196. } else {
  21197. return info;
  21198. }
  21199. context.delegate = null;
  21200. return ContinueSentinel;
  21201. }
  21202. defineIteratorMethods(Gp);
  21203. define3(Gp, toStringTagSymbol, "Generator");
  21204. define3(Gp, iteratorSymbol, function() {
  21205. return this;
  21206. });
  21207. define3(Gp, "toString", function() {
  21208. return "[object Generator]";
  21209. });
  21210. function pushTryEntry(locs) {
  21211. var entry = { tryLoc: locs[0] };
  21212. if (1 in locs) {
  21213. entry.catchLoc = locs[1];
  21214. }
  21215. if (2 in locs) {
  21216. entry.finallyLoc = locs[2];
  21217. entry.afterLoc = locs[3];
  21218. }
  21219. this.tryEntries.push(entry);
  21220. }
  21221. function resetTryEntry(entry) {
  21222. var record = entry.completion || {};
  21223. record.type = "normal";
  21224. delete record.arg;
  21225. entry.completion = record;
  21226. }
  21227. function Context(tryLocsList) {
  21228. this.tryEntries = [{ tryLoc: "root" }];
  21229. tryLocsList.forEach(pushTryEntry, this);
  21230. this.reset(true);
  21231. }
  21232. exports4.keys = function(object) {
  21233. var keys = [];
  21234. for (var key in object) {
  21235. keys.push(key);
  21236. }
  21237. keys.reverse();
  21238. return function next() {
  21239. while (keys.length) {
  21240. var key2 = keys.pop();
  21241. if (key2 in object) {
  21242. next.value = key2;
  21243. next.done = false;
  21244. return next;
  21245. }
  21246. }
  21247. next.done = true;
  21248. return next;
  21249. };
  21250. };
  21251. function values(iterable) {
  21252. if (iterable) {
  21253. var iteratorMethod = iterable[iteratorSymbol];
  21254. if (iteratorMethod) {
  21255. return iteratorMethod.call(iterable);
  21256. }
  21257. if (typeof iterable.next === "function") {
  21258. return iterable;
  21259. }
  21260. if (!isNaN(iterable.length)) {
  21261. var i = -1, next = function next2() {
  21262. while (++i < iterable.length) {
  21263. if (hasOwn.call(iterable, i)) {
  21264. next2.value = iterable[i];
  21265. next2.done = false;
  21266. return next2;
  21267. }
  21268. }
  21269. next2.value = undefined2;
  21270. next2.done = true;
  21271. return next2;
  21272. };
  21273. return next.next = next;
  21274. }
  21275. }
  21276. return { next: doneResult };
  21277. }
  21278. exports4.values = values;
  21279. function doneResult() {
  21280. return { value: undefined2, done: true };
  21281. }
  21282. Context.prototype = {
  21283. constructor: Context,
  21284. reset: function(skipTempReset) {
  21285. this.prev = 0;
  21286. this.next = 0;
  21287. this.sent = this._sent = undefined2;
  21288. this.done = false;
  21289. this.delegate = null;
  21290. this.method = "next";
  21291. this.arg = undefined2;
  21292. this.tryEntries.forEach(resetTryEntry);
  21293. if (!skipTempReset) {
  21294. for (var name in this) {
  21295. if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
  21296. this[name] = undefined2;
  21297. }
  21298. }
  21299. }
  21300. },
  21301. stop: function() {
  21302. this.done = true;
  21303. var rootEntry = this.tryEntries[0];
  21304. var rootRecord = rootEntry.completion;
  21305. if (rootRecord.type === "throw") {
  21306. throw rootRecord.arg;
  21307. }
  21308. return this.rval;
  21309. },
  21310. dispatchException: function(exception) {
  21311. if (this.done) {
  21312. throw exception;
  21313. }
  21314. var context = this;
  21315. function handle(loc, caught) {
  21316. record.type = "throw";
  21317. record.arg = exception;
  21318. context.next = loc;
  21319. if (caught) {
  21320. context.method = "next";
  21321. context.arg = undefined2;
  21322. }
  21323. return !!caught;
  21324. }
  21325. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  21326. var entry = this.tryEntries[i];
  21327. var record = entry.completion;
  21328. if (entry.tryLoc === "root") {
  21329. return handle("end");
  21330. }
  21331. if (entry.tryLoc <= this.prev) {
  21332. var hasCatch = hasOwn.call(entry, "catchLoc");
  21333. var hasFinally = hasOwn.call(entry, "finallyLoc");
  21334. if (hasCatch && hasFinally) {
  21335. if (this.prev < entry.catchLoc) {
  21336. return handle(entry.catchLoc, true);
  21337. } else if (this.prev < entry.finallyLoc) {
  21338. return handle(entry.finallyLoc);
  21339. }
  21340. } else if (hasCatch) {
  21341. if (this.prev < entry.catchLoc) {
  21342. return handle(entry.catchLoc, true);
  21343. }
  21344. } else if (hasFinally) {
  21345. if (this.prev < entry.finallyLoc) {
  21346. return handle(entry.finallyLoc);
  21347. }
  21348. } else {
  21349. throw new Error("try statement without catch or finally");
  21350. }
  21351. }
  21352. }
  21353. },
  21354. abrupt: function(type, arg) {
  21355. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  21356. var entry = this.tryEntries[i];
  21357. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  21358. var finallyEntry = entry;
  21359. break;
  21360. }
  21361. }
  21362. if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
  21363. finallyEntry = null;
  21364. }
  21365. var record = finallyEntry ? finallyEntry.completion : {};
  21366. record.type = type;
  21367. record.arg = arg;
  21368. if (finallyEntry) {
  21369. this.method = "next";
  21370. this.next = finallyEntry.finallyLoc;
  21371. return ContinueSentinel;
  21372. }
  21373. return this.complete(record);
  21374. },
  21375. complete: function(record, afterLoc) {
  21376. if (record.type === "throw") {
  21377. throw record.arg;
  21378. }
  21379. if (record.type === "break" || record.type === "continue") {
  21380. this.next = record.arg;
  21381. } else if (record.type === "return") {
  21382. this.rval = this.arg = record.arg;
  21383. this.method = "return";
  21384. this.next = "end";
  21385. } else if (record.type === "normal" && afterLoc) {
  21386. this.next = afterLoc;
  21387. }
  21388. return ContinueSentinel;
  21389. },
  21390. finish: function(finallyLoc) {
  21391. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  21392. var entry = this.tryEntries[i];
  21393. if (entry.finallyLoc === finallyLoc) {
  21394. this.complete(entry.completion, entry.afterLoc);
  21395. resetTryEntry(entry);
  21396. return ContinueSentinel;
  21397. }
  21398. }
  21399. },
  21400. "catch": function(tryLoc) {
  21401. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  21402. var entry = this.tryEntries[i];
  21403. if (entry.tryLoc === tryLoc) {
  21404. var record = entry.completion;
  21405. if (record.type === "throw") {
  21406. var thrown = record.arg;
  21407. resetTryEntry(entry);
  21408. }
  21409. return thrown;
  21410. }
  21411. }
  21412. throw new Error("illegal catch attempt");
  21413. },
  21414. delegateYield: function(iterable, resultName, nextLoc) {
  21415. this.delegate = {
  21416. iterator: values(iterable),
  21417. resultName,
  21418. nextLoc
  21419. };
  21420. if (this.method === "next") {
  21421. this.arg = undefined2;
  21422. }
  21423. return ContinueSentinel;
  21424. }
  21425. };
  21426. return exports4;
  21427. }(
  21428. // If this script is executing as a CommonJS module, use module.exports
  21429. // as the regeneratorRuntime namespace. Otherwise create a new empty
  21430. // object. Either way, the resulting object will be used to initialize
  21431. // the regeneratorRuntime variable at the top of this file.
  21432. typeof module3 === "object" ? module3.exports : {}
  21433. );
  21434. try {
  21435. regeneratorRuntime = runtime;
  21436. } catch (accidentalStrictMode) {
  21437. if (typeof globalThis === "object") {
  21438. globalThis.regeneratorRuntime = runtime;
  21439. } else {
  21440. Function("r", "regeneratorRuntime = r")(runtime);
  21441. }
  21442. }
  21443. }, {}], 396: [function(require2, module3, exports3) {
  21444. var buffer = require2("buffer");
  21445. var Buffer = buffer.Buffer;
  21446. function copyProps(src, dst) {
  21447. for (var key in src) {
  21448. dst[key] = src[key];
  21449. }
  21450. }
  21451. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  21452. module3.exports = buffer;
  21453. } else {
  21454. copyProps(buffer, exports3);
  21455. exports3.Buffer = SafeBuffer;
  21456. }
  21457. function SafeBuffer(arg, encodingOrOffset, length) {
  21458. return Buffer(arg, encodingOrOffset, length);
  21459. }
  21460. copyProps(Buffer, SafeBuffer);
  21461. SafeBuffer.from = function(arg, encodingOrOffset, length) {
  21462. if (typeof arg === "number") {
  21463. throw new TypeError("Argument must not be a number");
  21464. }
  21465. return Buffer(arg, encodingOrOffset, length);
  21466. };
  21467. SafeBuffer.alloc = function(size, fill, encoding) {
  21468. if (typeof size !== "number") {
  21469. throw new TypeError("Argument must be a number");
  21470. }
  21471. var buf = Buffer(size);
  21472. if (fill !== void 0) {
  21473. if (typeof encoding === "string") {
  21474. buf.fill(fill, encoding);
  21475. } else {
  21476. buf.fill(fill);
  21477. }
  21478. } else {
  21479. buf.fill(0);
  21480. }
  21481. return buf;
  21482. };
  21483. SafeBuffer.allocUnsafe = function(size) {
  21484. if (typeof size !== "number") {
  21485. throw new TypeError("Argument must be a number");
  21486. }
  21487. return Buffer(size);
  21488. };
  21489. SafeBuffer.allocUnsafeSlow = function(size) {
  21490. if (typeof size !== "number") {
  21491. throw new TypeError("Argument must be a number");
  21492. }
  21493. return buffer.SlowBuffer(size);
  21494. };
  21495. }, { "buffer": 90 }], 397: [function(require2, module3, exports3) {
  21496. (function(Buffer) {
  21497. (function() {
  21498. ;
  21499. (function(sax) {
  21500. sax.parser = function(strict, opt) {
  21501. return new SAXParser(strict, opt);
  21502. };
  21503. sax.SAXParser = SAXParser;
  21504. sax.SAXStream = SAXStream;
  21505. sax.createStream = createStream;
  21506. sax.MAX_BUFFER_LENGTH = 64 * 1024;
  21507. var buffers = [
  21508. "comment",
  21509. "sgmlDecl",
  21510. "textNode",
  21511. "tagName",
  21512. "doctype",
  21513. "procInstName",
  21514. "procInstBody",
  21515. "entity",
  21516. "attribName",
  21517. "attribValue",
  21518. "cdata",
  21519. "script"
  21520. ];
  21521. sax.EVENTS = [
  21522. "text",
  21523. "processinginstruction",
  21524. "sgmldeclaration",
  21525. "doctype",
  21526. "comment",
  21527. "opentagstart",
  21528. "attribute",
  21529. "opentag",
  21530. "closetag",
  21531. "opencdata",
  21532. "cdata",
  21533. "closecdata",
  21534. "error",
  21535. "end",
  21536. "ready",
  21537. "script",
  21538. "opennamespace",
  21539. "closenamespace"
  21540. ];
  21541. function SAXParser(strict, opt) {
  21542. if (!(this instanceof SAXParser)) {
  21543. return new SAXParser(strict, opt);
  21544. }
  21545. var parser = this;
  21546. clearBuffers(parser);
  21547. parser.q = parser.c = "";
  21548. parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
  21549. parser.opt = opt || {};
  21550. parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
  21551. parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
  21552. parser.tags = [];
  21553. parser.closed = parser.closedRoot = parser.sawRoot = false;
  21554. parser.tag = parser.error = null;
  21555. parser.strict = !!strict;
  21556. parser.noscript = !!(strict || parser.opt.noscript);
  21557. parser.state = S.BEGIN;
  21558. parser.strictEntities = parser.opt.strictEntities;
  21559. parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
  21560. parser.attribList = [];
  21561. if (parser.opt.xmlns) {
  21562. parser.ns = Object.create(rootNS);
  21563. }
  21564. parser.trackPosition = parser.opt.position !== false;
  21565. if (parser.trackPosition) {
  21566. parser.position = parser.line = parser.column = 0;
  21567. }
  21568. emit(parser, "onready");
  21569. }
  21570. if (!Object.create) {
  21571. Object.create = function(o) {
  21572. function F() {
  21573. }
  21574. F.prototype = o;
  21575. var newf = new F();
  21576. return newf;
  21577. };
  21578. }
  21579. if (!Object.keys) {
  21580. Object.keys = function(o) {
  21581. var a = [];
  21582. for (var i in o)
  21583. if (o.hasOwnProperty(i))
  21584. a.push(i);
  21585. return a;
  21586. };
  21587. }
  21588. function checkBufferLength(parser) {
  21589. var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
  21590. var maxActual = 0;
  21591. for (var i = 0, l = buffers.length; i < l; i++) {
  21592. var len = parser[buffers[i]].length;
  21593. if (len > maxAllowed) {
  21594. switch (buffers[i]) {
  21595. case "textNode":
  21596. closeText(parser);
  21597. break;
  21598. case "cdata":
  21599. emitNode(parser, "oncdata", parser.cdata);
  21600. parser.cdata = "";
  21601. break;
  21602. case "script":
  21603. emitNode(parser, "onscript", parser.script);
  21604. parser.script = "";
  21605. break;
  21606. default:
  21607. error(parser, "Max buffer length exceeded: " + buffers[i]);
  21608. }
  21609. }
  21610. maxActual = Math.max(maxActual, len);
  21611. }
  21612. var m = sax.MAX_BUFFER_LENGTH - maxActual;
  21613. parser.bufferCheckPosition = m + parser.position;
  21614. }
  21615. function clearBuffers(parser) {
  21616. for (var i = 0, l = buffers.length; i < l; i++) {
  21617. parser[buffers[i]] = "";
  21618. }
  21619. }
  21620. function flushBuffers(parser) {
  21621. closeText(parser);
  21622. if (parser.cdata !== "") {
  21623. emitNode(parser, "oncdata", parser.cdata);
  21624. parser.cdata = "";
  21625. }
  21626. if (parser.script !== "") {
  21627. emitNode(parser, "onscript", parser.script);
  21628. parser.script = "";
  21629. }
  21630. }
  21631. SAXParser.prototype = {
  21632. end: function() {
  21633. end(this);
  21634. },
  21635. write,
  21636. resume: function() {
  21637. this.error = null;
  21638. return this;
  21639. },
  21640. close: function() {
  21641. return this.write(null);
  21642. },
  21643. flush: function() {
  21644. flushBuffers(this);
  21645. }
  21646. };
  21647. var Stream;
  21648. try {
  21649. Stream = require2("stream").Stream;
  21650. } catch (ex) {
  21651. Stream = function() {
  21652. };
  21653. }
  21654. var streamWraps = sax.EVENTS.filter(function(ev) {
  21655. return ev !== "error" && ev !== "end";
  21656. });
  21657. function createStream(strict, opt) {
  21658. return new SAXStream(strict, opt);
  21659. }
  21660. function SAXStream(strict, opt) {
  21661. if (!(this instanceof SAXStream)) {
  21662. return new SAXStream(strict, opt);
  21663. }
  21664. Stream.apply(this);
  21665. this._parser = new SAXParser(strict, opt);
  21666. this.writable = true;
  21667. this.readable = true;
  21668. var me = this;
  21669. this._parser.onend = function() {
  21670. me.emit("end");
  21671. };
  21672. this._parser.onerror = function(er) {
  21673. me.emit("error", er);
  21674. me._parser.error = null;
  21675. };
  21676. this._decoder = null;
  21677. streamWraps.forEach(function(ev) {
  21678. Object.defineProperty(me, "on" + ev, {
  21679. get: function() {
  21680. return me._parser["on" + ev];
  21681. },
  21682. set: function(h) {
  21683. if (!h) {
  21684. me.removeAllListeners(ev);
  21685. me._parser["on" + ev] = h;
  21686. return h;
  21687. }
  21688. me.on(ev, h);
  21689. },
  21690. enumerable: true,
  21691. configurable: false
  21692. });
  21693. });
  21694. }
  21695. SAXStream.prototype = Object.create(Stream.prototype, {
  21696. constructor: {
  21697. value: SAXStream
  21698. }
  21699. });
  21700. SAXStream.prototype.write = function(data) {
  21701. if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
  21702. if (!this._decoder) {
  21703. var SD = require2("string_decoder").StringDecoder;
  21704. this._decoder = new SD("utf8");
  21705. }
  21706. data = this._decoder.write(data);
  21707. }
  21708. this._parser.write(data.toString());
  21709. this.emit("data", data);
  21710. return true;
  21711. };
  21712. SAXStream.prototype.end = function(chunk) {
  21713. if (chunk && chunk.length) {
  21714. this.write(chunk);
  21715. }
  21716. this._parser.end();
  21717. return true;
  21718. };
  21719. SAXStream.prototype.on = function(ev, handler) {
  21720. var me = this;
  21721. if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
  21722. me._parser["on" + ev] = function() {
  21723. var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
  21724. args.splice(0, 0, ev);
  21725. me.emit.apply(me, args);
  21726. };
  21727. }
  21728. return Stream.prototype.on.call(me, ev, handler);
  21729. };
  21730. var CDATA = "[CDATA[";
  21731. var DOCTYPE = "DOCTYPE";
  21732. var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
  21733. var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
  21734. var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };
  21735. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
  21736. var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
  21737. var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
  21738. var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
  21739. function isWhitespace(c) {
  21740. return c === " " || c === "\n" || c === "\r" || c === " ";
  21741. }
  21742. function isQuote(c) {
  21743. return c === '"' || c === "'";
  21744. }
  21745. function isAttribEnd(c) {
  21746. return c === ">" || isWhitespace(c);
  21747. }
  21748. function isMatch(regex, c) {
  21749. return regex.test(c);
  21750. }
  21751. function notMatch(regex, c) {
  21752. return !isMatch(regex, c);
  21753. }
  21754. var S = 0;
  21755. sax.STATE = {
  21756. BEGIN: S++,
  21757. // leading byte order mark or whitespace
  21758. BEGIN_WHITESPACE: S++,
  21759. // leading whitespace
  21760. TEXT: S++,
  21761. // general stuff
  21762. TEXT_ENTITY: S++,
  21763. // &amp and such.
  21764. OPEN_WAKA: S++,
  21765. // <
  21766. SGML_DECL: S++,
  21767. // <!BLARG
  21768. SGML_DECL_QUOTED: S++,
  21769. // <!BLARG foo "bar
  21770. DOCTYPE: S++,
  21771. // <!DOCTYPE
  21772. DOCTYPE_QUOTED: S++,
  21773. // <!DOCTYPE "//blah
  21774. DOCTYPE_DTD: S++,
  21775. // <!DOCTYPE "//blah" [ ...
  21776. DOCTYPE_DTD_QUOTED: S++,
  21777. // <!DOCTYPE "//blah" [ "foo
  21778. COMMENT_STARTING: S++,
  21779. // <!-
  21780. COMMENT: S++,
  21781. // <!--
  21782. COMMENT_ENDING: S++,
  21783. // <!-- blah -
  21784. COMMENT_ENDED: S++,
  21785. // <!-- blah --
  21786. CDATA: S++,
  21787. // <![CDATA[ something
  21788. CDATA_ENDING: S++,
  21789. // ]
  21790. CDATA_ENDING_2: S++,
  21791. // ]]
  21792. PROC_INST: S++,
  21793. // <?hi
  21794. PROC_INST_BODY: S++,
  21795. // <?hi there
  21796. PROC_INST_ENDING: S++,
  21797. // <?hi "there" ?
  21798. OPEN_TAG: S++,
  21799. // <strong
  21800. OPEN_TAG_SLASH: S++,
  21801. // <strong /
  21802. ATTRIB: S++,
  21803. // <a
  21804. ATTRIB_NAME: S++,
  21805. // <a foo
  21806. ATTRIB_NAME_SAW_WHITE: S++,
  21807. // <a foo _
  21808. ATTRIB_VALUE: S++,
  21809. // <a foo=
  21810. ATTRIB_VALUE_QUOTED: S++,
  21811. // <a foo="bar
  21812. ATTRIB_VALUE_CLOSED: S++,
  21813. // <a foo="bar"
  21814. ATTRIB_VALUE_UNQUOTED: S++,
  21815. // <a foo=bar
  21816. ATTRIB_VALUE_ENTITY_Q: S++,
  21817. // <foo bar="&quot;"
  21818. ATTRIB_VALUE_ENTITY_U: S++,
  21819. // <foo bar=&quot
  21820. CLOSE_TAG: S++,
  21821. // </a
  21822. CLOSE_TAG_SAW_WHITE: S++,
  21823. // </a >
  21824. SCRIPT: S++,
  21825. // <script> ...
  21826. SCRIPT_ENDING: S++
  21827. // <script> ... <
  21828. };
  21829. sax.XML_ENTITIES = {
  21830. "amp": "&",
  21831. "gt": ">",
  21832. "lt": "<",
  21833. "quot": '"',
  21834. "apos": "'"
  21835. };
  21836. sax.ENTITIES = {
  21837. "amp": "&",
  21838. "gt": ">",
  21839. "lt": "<",
  21840. "quot": '"',
  21841. "apos": "'",
  21842. "AElig": 198,
  21843. "Aacute": 193,
  21844. "Acirc": 194,
  21845. "Agrave": 192,
  21846. "Aring": 197,
  21847. "Atilde": 195,
  21848. "Auml": 196,
  21849. "Ccedil": 199,
  21850. "ETH": 208,
  21851. "Eacute": 201,
  21852. "Ecirc": 202,
  21853. "Egrave": 200,
  21854. "Euml": 203,
  21855. "Iacute": 205,
  21856. "Icirc": 206,
  21857. "Igrave": 204,
  21858. "Iuml": 207,
  21859. "Ntilde": 209,
  21860. "Oacute": 211,
  21861. "Ocirc": 212,
  21862. "Ograve": 210,
  21863. "Oslash": 216,
  21864. "Otilde": 213,
  21865. "Ouml": 214,
  21866. "THORN": 222,
  21867. "Uacute": 218,
  21868. "Ucirc": 219,
  21869. "Ugrave": 217,
  21870. "Uuml": 220,
  21871. "Yacute": 221,
  21872. "aacute": 225,
  21873. "acirc": 226,
  21874. "aelig": 230,
  21875. "agrave": 224,
  21876. "aring": 229,
  21877. "atilde": 227,
  21878. "auml": 228,
  21879. "ccedil": 231,
  21880. "eacute": 233,
  21881. "ecirc": 234,
  21882. "egrave": 232,
  21883. "eth": 240,
  21884. "euml": 235,
  21885. "iacute": 237,
  21886. "icirc": 238,
  21887. "igrave": 236,
  21888. "iuml": 239,
  21889. "ntilde": 241,
  21890. "oacute": 243,
  21891. "ocirc": 244,
  21892. "ograve": 242,
  21893. "oslash": 248,
  21894. "otilde": 245,
  21895. "ouml": 246,
  21896. "szlig": 223,
  21897. "thorn": 254,
  21898. "uacute": 250,
  21899. "ucirc": 251,
  21900. "ugrave": 249,
  21901. "uuml": 252,
  21902. "yacute": 253,
  21903. "yuml": 255,
  21904. "copy": 169,
  21905. "reg": 174,
  21906. "nbsp": 160,
  21907. "iexcl": 161,
  21908. "cent": 162,
  21909. "pound": 163,
  21910. "curren": 164,
  21911. "yen": 165,
  21912. "brvbar": 166,
  21913. "sect": 167,
  21914. "uml": 168,
  21915. "ordf": 170,
  21916. "laquo": 171,
  21917. "not": 172,
  21918. "shy": 173,
  21919. "macr": 175,
  21920. "deg": 176,
  21921. "plusmn": 177,
  21922. "sup1": 185,
  21923. "sup2": 178,
  21924. "sup3": 179,
  21925. "acute": 180,
  21926. "micro": 181,
  21927. "para": 182,
  21928. "middot": 183,
  21929. "cedil": 184,
  21930. "ordm": 186,
  21931. "raquo": 187,
  21932. "frac14": 188,
  21933. "frac12": 189,
  21934. "frac34": 190,
  21935. "iquest": 191,
  21936. "times": 215,
  21937. "divide": 247,
  21938. "OElig": 338,
  21939. "oelig": 339,
  21940. "Scaron": 352,
  21941. "scaron": 353,
  21942. "Yuml": 376,
  21943. "fnof": 402,
  21944. "circ": 710,
  21945. "tilde": 732,
  21946. "Alpha": 913,
  21947. "Beta": 914,
  21948. "Gamma": 915,
  21949. "Delta": 916,
  21950. "Epsilon": 917,
  21951. "Zeta": 918,
  21952. "Eta": 919,
  21953. "Theta": 920,
  21954. "Iota": 921,
  21955. "Kappa": 922,
  21956. "Lambda": 923,
  21957. "Mu": 924,
  21958. "Nu": 925,
  21959. "Xi": 926,
  21960. "Omicron": 927,
  21961. "Pi": 928,
  21962. "Rho": 929,
  21963. "Sigma": 931,
  21964. "Tau": 932,
  21965. "Upsilon": 933,
  21966. "Phi": 934,
  21967. "Chi": 935,
  21968. "Psi": 936,
  21969. "Omega": 937,
  21970. "alpha": 945,
  21971. "beta": 946,
  21972. "gamma": 947,
  21973. "delta": 948,
  21974. "epsilon": 949,
  21975. "zeta": 950,
  21976. "eta": 951,
  21977. "theta": 952,
  21978. "iota": 953,
  21979. "kappa": 954,
  21980. "lambda": 955,
  21981. "mu": 956,
  21982. "nu": 957,
  21983. "xi": 958,
  21984. "omicron": 959,
  21985. "pi": 960,
  21986. "rho": 961,
  21987. "sigmaf": 962,
  21988. "sigma": 963,
  21989. "tau": 964,
  21990. "upsilon": 965,
  21991. "phi": 966,
  21992. "chi": 967,
  21993. "psi": 968,
  21994. "omega": 969,
  21995. "thetasym": 977,
  21996. "upsih": 978,
  21997. "piv": 982,
  21998. "ensp": 8194,
  21999. "emsp": 8195,
  22000. "thinsp": 8201,
  22001. "zwnj": 8204,
  22002. "zwj": 8205,
  22003. "lrm": 8206,
  22004. "rlm": 8207,
  22005. "ndash": 8211,
  22006. "mdash": 8212,
  22007. "lsquo": 8216,
  22008. "rsquo": 8217,
  22009. "sbquo": 8218,
  22010. "ldquo": 8220,
  22011. "rdquo": 8221,
  22012. "bdquo": 8222,
  22013. "dagger": 8224,
  22014. "Dagger": 8225,
  22015. "bull": 8226,
  22016. "hellip": 8230,
  22017. "permil": 8240,
  22018. "prime": 8242,
  22019. "Prime": 8243,
  22020. "lsaquo": 8249,
  22021. "rsaquo": 8250,
  22022. "oline": 8254,
  22023. "frasl": 8260,
  22024. "euro": 8364,
  22025. "image": 8465,
  22026. "weierp": 8472,
  22027. "real": 8476,
  22028. "trade": 8482,
  22029. "alefsym": 8501,
  22030. "larr": 8592,
  22031. "uarr": 8593,
  22032. "rarr": 8594,
  22033. "darr": 8595,
  22034. "harr": 8596,
  22035. "crarr": 8629,
  22036. "lArr": 8656,
  22037. "uArr": 8657,
  22038. "rArr": 8658,
  22039. "dArr": 8659,
  22040. "hArr": 8660,
  22041. "forall": 8704,
  22042. "part": 8706,
  22043. "exist": 8707,
  22044. "empty": 8709,
  22045. "nabla": 8711,
  22046. "isin": 8712,
  22047. "notin": 8713,
  22048. "ni": 8715,
  22049. "prod": 8719,
  22050. "sum": 8721,
  22051. "minus": 8722,
  22052. "lowast": 8727,
  22053. "radic": 8730,
  22054. "prop": 8733,
  22055. "infin": 8734,
  22056. "ang": 8736,
  22057. "and": 8743,
  22058. "or": 8744,
  22059. "cap": 8745,
  22060. "cup": 8746,
  22061. "int": 8747,
  22062. "there4": 8756,
  22063. "sim": 8764,
  22064. "cong": 8773,
  22065. "asymp": 8776,
  22066. "ne": 8800,
  22067. "equiv": 8801,
  22068. "le": 8804,
  22069. "ge": 8805,
  22070. "sub": 8834,
  22071. "sup": 8835,
  22072. "nsub": 8836,
  22073. "sube": 8838,
  22074. "supe": 8839,
  22075. "oplus": 8853,
  22076. "otimes": 8855,
  22077. "perp": 8869,
  22078. "sdot": 8901,
  22079. "lceil": 8968,
  22080. "rceil": 8969,
  22081. "lfloor": 8970,
  22082. "rfloor": 8971,
  22083. "lang": 9001,
  22084. "rang": 9002,
  22085. "loz": 9674,
  22086. "spades": 9824,
  22087. "clubs": 9827,
  22088. "hearts": 9829,
  22089. "diams": 9830
  22090. };
  22091. Object.keys(sax.ENTITIES).forEach(function(key) {
  22092. var e = sax.ENTITIES[key];
  22093. var s2 = typeof e === "number" ? String.fromCharCode(e) : e;
  22094. sax.ENTITIES[key] = s2;
  22095. });
  22096. for (var s in sax.STATE) {
  22097. sax.STATE[sax.STATE[s]] = s;
  22098. }
  22099. S = sax.STATE;
  22100. function emit(parser, event, data) {
  22101. parser[event] && parser[event](data);
  22102. }
  22103. function emitNode(parser, nodeType, data) {
  22104. if (parser.textNode)
  22105. closeText(parser);
  22106. emit(parser, nodeType, data);
  22107. }
  22108. function closeText(parser) {
  22109. parser.textNode = textopts(parser.opt, parser.textNode);
  22110. if (parser.textNode)
  22111. emit(parser, "ontext", parser.textNode);
  22112. parser.textNode = "";
  22113. }
  22114. function textopts(opt, text) {
  22115. if (opt.trim)
  22116. text = text.trim();
  22117. if (opt.normalize)
  22118. text = text.replace(/\s+/g, " ");
  22119. return text;
  22120. }
  22121. function error(parser, er) {
  22122. closeText(parser);
  22123. if (parser.trackPosition) {
  22124. er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c;
  22125. }
  22126. er = new Error(er);
  22127. parser.error = er;
  22128. emit(parser, "onerror", er);
  22129. return parser;
  22130. }
  22131. function end(parser) {
  22132. if (parser.sawRoot && !parser.closedRoot)
  22133. strictFail(parser, "Unclosed root tag");
  22134. if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) {
  22135. error(parser, "Unexpected end");
  22136. }
  22137. closeText(parser);
  22138. parser.c = "";
  22139. parser.closed = true;
  22140. emit(parser, "onend");
  22141. SAXParser.call(parser, parser.strict, parser.opt);
  22142. return parser;
  22143. }
  22144. function strictFail(parser, message) {
  22145. if (typeof parser !== "object" || !(parser instanceof SAXParser)) {
  22146. throw new Error("bad call to strictFail");
  22147. }
  22148. if (parser.strict) {
  22149. error(parser, message);
  22150. }
  22151. }
  22152. function newTag(parser) {
  22153. if (!parser.strict)
  22154. parser.tagName = parser.tagName[parser.looseCase]();
  22155. var parent = parser.tags[parser.tags.length - 1] || parser;
  22156. var tag = parser.tag = { name: parser.tagName, attributes: {} };
  22157. if (parser.opt.xmlns) {
  22158. tag.ns = parent.ns;
  22159. }
  22160. parser.attribList.length = 0;
  22161. emitNode(parser, "onopentagstart", tag);
  22162. }
  22163. function qname(name, attribute) {
  22164. var i = name.indexOf(":");
  22165. var qualName = i < 0 ? ["", name] : name.split(":");
  22166. var prefix = qualName[0];
  22167. var local = qualName[1];
  22168. if (attribute && name === "xmlns") {
  22169. prefix = "xmlns";
  22170. local = "";
  22171. }
  22172. return { prefix, local };
  22173. }
  22174. function attrib(parser) {
  22175. if (!parser.strict) {
  22176. parser.attribName = parser.attribName[parser.looseCase]();
  22177. }
  22178. if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) {
  22179. parser.attribName = parser.attribValue = "";
  22180. return;
  22181. }
  22182. if (parser.opt.xmlns) {
  22183. var qn = qname(parser.attribName, true);
  22184. var prefix = qn.prefix;
  22185. var local = qn.local;
  22186. if (prefix === "xmlns") {
  22187. if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
  22188. strictFail(
  22189. parser,
  22190. "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue
  22191. );
  22192. } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
  22193. strictFail(
  22194. parser,
  22195. "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser.attribValue
  22196. );
  22197. } else {
  22198. var tag = parser.tag;
  22199. var parent = parser.tags[parser.tags.length - 1] || parser;
  22200. if (tag.ns === parent.ns) {
  22201. tag.ns = Object.create(parent.ns);
  22202. }
  22203. tag.ns[local] = parser.attribValue;
  22204. }
  22205. }
  22206. parser.attribList.push([parser.attribName, parser.attribValue]);
  22207. } else {
  22208. parser.tag.attributes[parser.attribName] = parser.attribValue;
  22209. emitNode(parser, "onattribute", {
  22210. name: parser.attribName,
  22211. value: parser.attribValue
  22212. });
  22213. }
  22214. parser.attribName = parser.attribValue = "";
  22215. }
  22216. function openTag(parser, selfClosing) {
  22217. if (parser.opt.xmlns) {
  22218. var tag = parser.tag;
  22219. var qn = qname(parser.tagName);
  22220. tag.prefix = qn.prefix;
  22221. tag.local = qn.local;
  22222. tag.uri = tag.ns[qn.prefix] || "";
  22223. if (tag.prefix && !tag.uri) {
  22224. strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName));
  22225. tag.uri = qn.prefix;
  22226. }
  22227. var parent = parser.tags[parser.tags.length - 1] || parser;
  22228. if (tag.ns && parent.ns !== tag.ns) {
  22229. Object.keys(tag.ns).forEach(function(p) {
  22230. emitNode(parser, "onopennamespace", {
  22231. prefix: p,
  22232. uri: tag.ns[p]
  22233. });
  22234. });
  22235. }
  22236. for (var i = 0, l = parser.attribList.length; i < l; i++) {
  22237. var nv = parser.attribList[i];
  22238. var name = nv[0];
  22239. var value = nv[1];
  22240. var qualName = qname(name, true);
  22241. var prefix = qualName.prefix;
  22242. var local = qualName.local;
  22243. var uri = prefix === "" ? "" : tag.ns[prefix] || "";
  22244. var a = {
  22245. name,
  22246. value,
  22247. prefix,
  22248. local,
  22249. uri
  22250. };
  22251. if (prefix && prefix !== "xmlns" && !uri) {
  22252. strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix));
  22253. a.uri = prefix;
  22254. }
  22255. parser.tag.attributes[name] = a;
  22256. emitNode(parser, "onattribute", a);
  22257. }
  22258. parser.attribList.length = 0;
  22259. }
  22260. parser.tag.isSelfClosing = !!selfClosing;
  22261. parser.sawRoot = true;
  22262. parser.tags.push(parser.tag);
  22263. emitNode(parser, "onopentag", parser.tag);
  22264. if (!selfClosing) {
  22265. if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
  22266. parser.state = S.SCRIPT;
  22267. } else {
  22268. parser.state = S.TEXT;
  22269. }
  22270. parser.tag = null;
  22271. parser.tagName = "";
  22272. }
  22273. parser.attribName = parser.attribValue = "";
  22274. parser.attribList.length = 0;
  22275. }
  22276. function closeTag(parser) {
  22277. if (!parser.tagName) {
  22278. strictFail(parser, "Weird empty close tag.");
  22279. parser.textNode += "</>";
  22280. parser.state = S.TEXT;
  22281. return;
  22282. }
  22283. if (parser.script) {
  22284. if (parser.tagName !== "script") {
  22285. parser.script += "</" + parser.tagName + ">";
  22286. parser.tagName = "";
  22287. parser.state = S.SCRIPT;
  22288. return;
  22289. }
  22290. emitNode(parser, "onscript", parser.script);
  22291. parser.script = "";
  22292. }
  22293. var t = parser.tags.length;
  22294. var tagName = parser.tagName;
  22295. if (!parser.strict) {
  22296. tagName = tagName[parser.looseCase]();
  22297. }
  22298. var closeTo = tagName;
  22299. while (t--) {
  22300. var close = parser.tags[t];
  22301. if (close.name !== closeTo) {
  22302. strictFail(parser, "Unexpected close tag");
  22303. } else {
  22304. break;
  22305. }
  22306. }
  22307. if (t < 0) {
  22308. strictFail(parser, "Unmatched closing tag: " + parser.tagName);
  22309. parser.textNode += "</" + parser.tagName + ">";
  22310. parser.state = S.TEXT;
  22311. return;
  22312. }
  22313. parser.tagName = tagName;
  22314. var s2 = parser.tags.length;
  22315. while (s2-- > t) {
  22316. var tag = parser.tag = parser.tags.pop();
  22317. parser.tagName = parser.tag.name;
  22318. emitNode(parser, "onclosetag", parser.tagName);
  22319. var x = {};
  22320. for (var i in tag.ns) {
  22321. x[i] = tag.ns[i];
  22322. }
  22323. var parent = parser.tags[parser.tags.length - 1] || parser;
  22324. if (parser.opt.xmlns && tag.ns !== parent.ns) {
  22325. Object.keys(tag.ns).forEach(function(p) {
  22326. var n = tag.ns[p];
  22327. emitNode(parser, "onclosenamespace", { prefix: p, uri: n });
  22328. });
  22329. }
  22330. }
  22331. if (t === 0)
  22332. parser.closedRoot = true;
  22333. parser.tagName = parser.attribValue = parser.attribName = "";
  22334. parser.attribList.length = 0;
  22335. parser.state = S.TEXT;
  22336. }
  22337. function parseEntity(parser) {
  22338. var entity = parser.entity;
  22339. var entityLC = entity.toLowerCase();
  22340. var num;
  22341. var numStr = "";
  22342. if (parser.ENTITIES[entity]) {
  22343. return parser.ENTITIES[entity];
  22344. }
  22345. if (parser.ENTITIES[entityLC]) {
  22346. return parser.ENTITIES[entityLC];
  22347. }
  22348. entity = entityLC;
  22349. if (entity.charAt(0) === "#") {
  22350. if (entity.charAt(1) === "x") {
  22351. entity = entity.slice(2);
  22352. num = parseInt(entity, 16);
  22353. numStr = num.toString(16);
  22354. } else {
  22355. entity = entity.slice(1);
  22356. num = parseInt(entity, 10);
  22357. numStr = num.toString(10);
  22358. }
  22359. }
  22360. entity = entity.replace(/^0+/, "");
  22361. if (isNaN(num) || numStr.toLowerCase() !== entity) {
  22362. strictFail(parser, "Invalid character entity");
  22363. return "&" + parser.entity + ";";
  22364. }
  22365. return String.fromCodePoint(num);
  22366. }
  22367. function beginWhiteSpace(parser, c) {
  22368. if (c === "<") {
  22369. parser.state = S.OPEN_WAKA;
  22370. parser.startTagPosition = parser.position;
  22371. } else if (!isWhitespace(c)) {
  22372. strictFail(parser, "Non-whitespace before first tag.");
  22373. parser.textNode = c;
  22374. parser.state = S.TEXT;
  22375. }
  22376. }
  22377. function charAt(chunk, i) {
  22378. var result = "";
  22379. if (i < chunk.length) {
  22380. result = chunk.charAt(i);
  22381. }
  22382. return result;
  22383. }
  22384. function write(chunk) {
  22385. var parser = this;
  22386. if (this.error) {
  22387. throw this.error;
  22388. }
  22389. if (parser.closed) {
  22390. return error(
  22391. parser,
  22392. "Cannot write after close. Assign an onready handler."
  22393. );
  22394. }
  22395. if (chunk === null) {
  22396. return end(parser);
  22397. }
  22398. if (typeof chunk === "object") {
  22399. chunk = chunk.toString();
  22400. }
  22401. var i = 0;
  22402. var c = "";
  22403. while (true) {
  22404. c = charAt(chunk, i++);
  22405. parser.c = c;
  22406. if (!c) {
  22407. break;
  22408. }
  22409. if (parser.trackPosition) {
  22410. parser.position++;
  22411. if (c === "\n") {
  22412. parser.line++;
  22413. parser.column = 0;
  22414. } else {
  22415. parser.column++;
  22416. }
  22417. }
  22418. switch (parser.state) {
  22419. case S.BEGIN:
  22420. parser.state = S.BEGIN_WHITESPACE;
  22421. if (c === "\uFEFF") {
  22422. continue;
  22423. }
  22424. beginWhiteSpace(parser, c);
  22425. continue;
  22426. case S.BEGIN_WHITESPACE:
  22427. beginWhiteSpace(parser, c);
  22428. continue;
  22429. case S.TEXT:
  22430. if (parser.sawRoot && !parser.closedRoot) {
  22431. var starti = i - 1;
  22432. while (c && c !== "<" && c !== "&") {
  22433. c = charAt(chunk, i++);
  22434. if (c && parser.trackPosition) {
  22435. parser.position++;
  22436. if (c === "\n") {
  22437. parser.line++;
  22438. parser.column = 0;
  22439. } else {
  22440. parser.column++;
  22441. }
  22442. }
  22443. }
  22444. parser.textNode += chunk.substring(starti, i - 1);
  22445. }
  22446. if (c === "<" && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
  22447. parser.state = S.OPEN_WAKA;
  22448. parser.startTagPosition = parser.position;
  22449. } else {
  22450. if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
  22451. strictFail(parser, "Text data outside of root node.");
  22452. }
  22453. if (c === "&") {
  22454. parser.state = S.TEXT_ENTITY;
  22455. } else {
  22456. parser.textNode += c;
  22457. }
  22458. }
  22459. continue;
  22460. case S.SCRIPT:
  22461. if (c === "<") {
  22462. parser.state = S.SCRIPT_ENDING;
  22463. } else {
  22464. parser.script += c;
  22465. }
  22466. continue;
  22467. case S.SCRIPT_ENDING:
  22468. if (c === "/") {
  22469. parser.state = S.CLOSE_TAG;
  22470. } else {
  22471. parser.script += "<" + c;
  22472. parser.state = S.SCRIPT;
  22473. }
  22474. continue;
  22475. case S.OPEN_WAKA:
  22476. if (c === "!") {
  22477. parser.state = S.SGML_DECL;
  22478. parser.sgmlDecl = "";
  22479. } else if (isWhitespace(c)) {
  22480. } else if (isMatch(nameStart, c)) {
  22481. parser.state = S.OPEN_TAG;
  22482. parser.tagName = c;
  22483. } else if (c === "/") {
  22484. parser.state = S.CLOSE_TAG;
  22485. parser.tagName = "";
  22486. } else if (c === "?") {
  22487. parser.state = S.PROC_INST;
  22488. parser.procInstName = parser.procInstBody = "";
  22489. } else {
  22490. strictFail(parser, "Unencoded <");
  22491. if (parser.startTagPosition + 1 < parser.position) {
  22492. var pad = parser.position - parser.startTagPosition;
  22493. c = new Array(pad).join(" ") + c;
  22494. }
  22495. parser.textNode += "<" + c;
  22496. parser.state = S.TEXT;
  22497. }
  22498. continue;
  22499. case S.SGML_DECL:
  22500. if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
  22501. emitNode(parser, "onopencdata");
  22502. parser.state = S.CDATA;
  22503. parser.sgmlDecl = "";
  22504. parser.cdata = "";
  22505. } else if (parser.sgmlDecl + c === "--") {
  22506. parser.state = S.COMMENT;
  22507. parser.comment = "";
  22508. parser.sgmlDecl = "";
  22509. } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
  22510. parser.state = S.DOCTYPE;
  22511. if (parser.doctype || parser.sawRoot) {
  22512. strictFail(
  22513. parser,
  22514. "Inappropriately located doctype declaration"
  22515. );
  22516. }
  22517. parser.doctype = "";
  22518. parser.sgmlDecl = "";
  22519. } else if (c === ">") {
  22520. emitNode(parser, "onsgmldeclaration", parser.sgmlDecl);
  22521. parser.sgmlDecl = "";
  22522. parser.state = S.TEXT;
  22523. } else if (isQuote(c)) {
  22524. parser.state = S.SGML_DECL_QUOTED;
  22525. parser.sgmlDecl += c;
  22526. } else {
  22527. parser.sgmlDecl += c;
  22528. }
  22529. continue;
  22530. case S.SGML_DECL_QUOTED:
  22531. if (c === parser.q) {
  22532. parser.state = S.SGML_DECL;
  22533. parser.q = "";
  22534. }
  22535. parser.sgmlDecl += c;
  22536. continue;
  22537. case S.DOCTYPE:
  22538. if (c === ">") {
  22539. parser.state = S.TEXT;
  22540. emitNode(parser, "ondoctype", parser.doctype);
  22541. parser.doctype = true;
  22542. } else {
  22543. parser.doctype += c;
  22544. if (c === "[") {
  22545. parser.state = S.DOCTYPE_DTD;
  22546. } else if (isQuote(c)) {
  22547. parser.state = S.DOCTYPE_QUOTED;
  22548. parser.q = c;
  22549. }
  22550. }
  22551. continue;
  22552. case S.DOCTYPE_QUOTED:
  22553. parser.doctype += c;
  22554. if (c === parser.q) {
  22555. parser.q = "";
  22556. parser.state = S.DOCTYPE;
  22557. }
  22558. continue;
  22559. case S.DOCTYPE_DTD:
  22560. parser.doctype += c;
  22561. if (c === "]") {
  22562. parser.state = S.DOCTYPE;
  22563. } else if (isQuote(c)) {
  22564. parser.state = S.DOCTYPE_DTD_QUOTED;
  22565. parser.q = c;
  22566. }
  22567. continue;
  22568. case S.DOCTYPE_DTD_QUOTED:
  22569. parser.doctype += c;
  22570. if (c === parser.q) {
  22571. parser.state = S.DOCTYPE_DTD;
  22572. parser.q = "";
  22573. }
  22574. continue;
  22575. case S.COMMENT:
  22576. if (c === "-") {
  22577. parser.state = S.COMMENT_ENDING;
  22578. } else {
  22579. parser.comment += c;
  22580. }
  22581. continue;
  22582. case S.COMMENT_ENDING:
  22583. if (c === "-") {
  22584. parser.state = S.COMMENT_ENDED;
  22585. parser.comment = textopts(parser.opt, parser.comment);
  22586. if (parser.comment) {
  22587. emitNode(parser, "oncomment", parser.comment);
  22588. }
  22589. parser.comment = "";
  22590. } else {
  22591. parser.comment += "-" + c;
  22592. parser.state = S.COMMENT;
  22593. }
  22594. continue;
  22595. case S.COMMENT_ENDED:
  22596. if (c !== ">") {
  22597. strictFail(parser, "Malformed comment");
  22598. parser.comment += "--" + c;
  22599. parser.state = S.COMMENT;
  22600. } else {
  22601. parser.state = S.TEXT;
  22602. }
  22603. continue;
  22604. case S.CDATA:
  22605. if (c === "]") {
  22606. parser.state = S.CDATA_ENDING;
  22607. } else {
  22608. parser.cdata += c;
  22609. }
  22610. continue;
  22611. case S.CDATA_ENDING:
  22612. if (c === "]") {
  22613. parser.state = S.CDATA_ENDING_2;
  22614. } else {
  22615. parser.cdata += "]" + c;
  22616. parser.state = S.CDATA;
  22617. }
  22618. continue;
  22619. case S.CDATA_ENDING_2:
  22620. if (c === ">") {
  22621. if (parser.cdata) {
  22622. emitNode(parser, "oncdata", parser.cdata);
  22623. }
  22624. emitNode(parser, "onclosecdata");
  22625. parser.cdata = "";
  22626. parser.state = S.TEXT;
  22627. } else if (c === "]") {
  22628. parser.cdata += "]";
  22629. } else {
  22630. parser.cdata += "]]" + c;
  22631. parser.state = S.CDATA;
  22632. }
  22633. continue;
  22634. case S.PROC_INST:
  22635. if (c === "?") {
  22636. parser.state = S.PROC_INST_ENDING;
  22637. } else if (isWhitespace(c)) {
  22638. parser.state = S.PROC_INST_BODY;
  22639. } else {
  22640. parser.procInstName += c;
  22641. }
  22642. continue;
  22643. case S.PROC_INST_BODY:
  22644. if (!parser.procInstBody && isWhitespace(c)) {
  22645. continue;
  22646. } else if (c === "?") {
  22647. parser.state = S.PROC_INST_ENDING;
  22648. } else {
  22649. parser.procInstBody += c;
  22650. }
  22651. continue;
  22652. case S.PROC_INST_ENDING:
  22653. if (c === ">") {
  22654. emitNode(parser, "onprocessinginstruction", {
  22655. name: parser.procInstName,
  22656. body: parser.procInstBody
  22657. });
  22658. parser.procInstName = parser.procInstBody = "";
  22659. parser.state = S.TEXT;
  22660. } else {
  22661. parser.procInstBody += "?" + c;
  22662. parser.state = S.PROC_INST_BODY;
  22663. }
  22664. continue;
  22665. case S.OPEN_TAG:
  22666. if (isMatch(nameBody, c)) {
  22667. parser.tagName += c;
  22668. } else {
  22669. newTag(parser);
  22670. if (c === ">") {
  22671. openTag(parser);
  22672. } else if (c === "/") {
  22673. parser.state = S.OPEN_TAG_SLASH;
  22674. } else {
  22675. if (!isWhitespace(c)) {
  22676. strictFail(parser, "Invalid character in tag name");
  22677. }
  22678. parser.state = S.ATTRIB;
  22679. }
  22680. }
  22681. continue;
  22682. case S.OPEN_TAG_SLASH:
  22683. if (c === ">") {
  22684. openTag(parser, true);
  22685. closeTag(parser);
  22686. } else {
  22687. strictFail(parser, "Forward-slash in opening tag not followed by >");
  22688. parser.state = S.ATTRIB;
  22689. }
  22690. continue;
  22691. case S.ATTRIB:
  22692. if (isWhitespace(c)) {
  22693. continue;
  22694. } else if (c === ">") {
  22695. openTag(parser);
  22696. } else if (c === "/") {
  22697. parser.state = S.OPEN_TAG_SLASH;
  22698. } else if (isMatch(nameStart, c)) {
  22699. parser.attribName = c;
  22700. parser.attribValue = "";
  22701. parser.state = S.ATTRIB_NAME;
  22702. } else {
  22703. strictFail(parser, "Invalid attribute name");
  22704. }
  22705. continue;
  22706. case S.ATTRIB_NAME:
  22707. if (c === "=") {
  22708. parser.state = S.ATTRIB_VALUE;
  22709. } else if (c === ">") {
  22710. strictFail(parser, "Attribute without value");
  22711. parser.attribValue = parser.attribName;
  22712. attrib(parser);
  22713. openTag(parser);
  22714. } else if (isWhitespace(c)) {
  22715. parser.state = S.ATTRIB_NAME_SAW_WHITE;
  22716. } else if (isMatch(nameBody, c)) {
  22717. parser.attribName += c;
  22718. } else {
  22719. strictFail(parser, "Invalid attribute name");
  22720. }
  22721. continue;
  22722. case S.ATTRIB_NAME_SAW_WHITE:
  22723. if (c === "=") {
  22724. parser.state = S.ATTRIB_VALUE;
  22725. } else if (isWhitespace(c)) {
  22726. continue;
  22727. } else {
  22728. strictFail(parser, "Attribute without value");
  22729. parser.tag.attributes[parser.attribName] = "";
  22730. parser.attribValue = "";
  22731. emitNode(parser, "onattribute", {
  22732. name: parser.attribName,
  22733. value: ""
  22734. });
  22735. parser.attribName = "";
  22736. if (c === ">") {
  22737. openTag(parser);
  22738. } else if (isMatch(nameStart, c)) {
  22739. parser.attribName = c;
  22740. parser.state = S.ATTRIB_NAME;
  22741. } else {
  22742. strictFail(parser, "Invalid attribute name");
  22743. parser.state = S.ATTRIB;
  22744. }
  22745. }
  22746. continue;
  22747. case S.ATTRIB_VALUE:
  22748. if (isWhitespace(c)) {
  22749. continue;
  22750. } else if (isQuote(c)) {
  22751. parser.q = c;
  22752. parser.state = S.ATTRIB_VALUE_QUOTED;
  22753. } else {
  22754. strictFail(parser, "Unquoted attribute value");
  22755. parser.state = S.ATTRIB_VALUE_UNQUOTED;
  22756. parser.attribValue = c;
  22757. }
  22758. continue;
  22759. case S.ATTRIB_VALUE_QUOTED:
  22760. if (c !== parser.q) {
  22761. if (c === "&") {
  22762. parser.state = S.ATTRIB_VALUE_ENTITY_Q;
  22763. } else {
  22764. parser.attribValue += c;
  22765. }
  22766. continue;
  22767. }
  22768. attrib(parser);
  22769. parser.q = "";
  22770. parser.state = S.ATTRIB_VALUE_CLOSED;
  22771. continue;
  22772. case S.ATTRIB_VALUE_CLOSED:
  22773. if (isWhitespace(c)) {
  22774. parser.state = S.ATTRIB;
  22775. } else if (c === ">") {
  22776. openTag(parser);
  22777. } else if (c === "/") {
  22778. parser.state = S.OPEN_TAG_SLASH;
  22779. } else if (isMatch(nameStart, c)) {
  22780. strictFail(parser, "No whitespace between attributes");
  22781. parser.attribName = c;
  22782. parser.attribValue = "";
  22783. parser.state = S.ATTRIB_NAME;
  22784. } else {
  22785. strictFail(parser, "Invalid attribute name");
  22786. }
  22787. continue;
  22788. case S.ATTRIB_VALUE_UNQUOTED:
  22789. if (!isAttribEnd(c)) {
  22790. if (c === "&") {
  22791. parser.state = S.ATTRIB_VALUE_ENTITY_U;
  22792. } else {
  22793. parser.attribValue += c;
  22794. }
  22795. continue;
  22796. }
  22797. attrib(parser);
  22798. if (c === ">") {
  22799. openTag(parser);
  22800. } else {
  22801. parser.state = S.ATTRIB;
  22802. }
  22803. continue;
  22804. case S.CLOSE_TAG:
  22805. if (!parser.tagName) {
  22806. if (isWhitespace(c)) {
  22807. continue;
  22808. } else if (notMatch(nameStart, c)) {
  22809. if (parser.script) {
  22810. parser.script += "</" + c;
  22811. parser.state = S.SCRIPT;
  22812. } else {
  22813. strictFail(parser, "Invalid tagname in closing tag.");
  22814. }
  22815. } else {
  22816. parser.tagName = c;
  22817. }
  22818. } else if (c === ">") {
  22819. closeTag(parser);
  22820. } else if (isMatch(nameBody, c)) {
  22821. parser.tagName += c;
  22822. } else if (parser.script) {
  22823. parser.script += "</" + parser.tagName;
  22824. parser.tagName = "";
  22825. parser.state = S.SCRIPT;
  22826. } else {
  22827. if (!isWhitespace(c)) {
  22828. strictFail(parser, "Invalid tagname in closing tag");
  22829. }
  22830. parser.state = S.CLOSE_TAG_SAW_WHITE;
  22831. }
  22832. continue;
  22833. case S.CLOSE_TAG_SAW_WHITE:
  22834. if (isWhitespace(c)) {
  22835. continue;
  22836. }
  22837. if (c === ">") {
  22838. closeTag(parser);
  22839. } else {
  22840. strictFail(parser, "Invalid characters in closing tag");
  22841. }
  22842. continue;
  22843. case S.TEXT_ENTITY:
  22844. case S.ATTRIB_VALUE_ENTITY_Q:
  22845. case S.ATTRIB_VALUE_ENTITY_U:
  22846. var returnState;
  22847. var buffer;
  22848. switch (parser.state) {
  22849. case S.TEXT_ENTITY:
  22850. returnState = S.TEXT;
  22851. buffer = "textNode";
  22852. break;
  22853. case S.ATTRIB_VALUE_ENTITY_Q:
  22854. returnState = S.ATTRIB_VALUE_QUOTED;
  22855. buffer = "attribValue";
  22856. break;
  22857. case S.ATTRIB_VALUE_ENTITY_U:
  22858. returnState = S.ATTRIB_VALUE_UNQUOTED;
  22859. buffer = "attribValue";
  22860. break;
  22861. }
  22862. if (c === ";") {
  22863. parser[buffer] += parseEntity(parser);
  22864. parser.entity = "";
  22865. parser.state = returnState;
  22866. } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
  22867. parser.entity += c;
  22868. } else {
  22869. strictFail(parser, "Invalid character in entity name");
  22870. parser[buffer] += "&" + parser.entity + c;
  22871. parser.entity = "";
  22872. parser.state = returnState;
  22873. }
  22874. continue;
  22875. default:
  22876. throw new Error(parser, "Unknown state: " + parser.state);
  22877. }
  22878. }
  22879. if (parser.position >= parser.bufferCheckPosition) {
  22880. checkBufferLength(parser);
  22881. }
  22882. return parser;
  22883. }
  22884. if (!String.fromCodePoint) {
  22885. (function() {
  22886. var stringFromCharCode = String.fromCharCode;
  22887. var floor = Math.floor;
  22888. var fromCodePoint = function() {
  22889. var MAX_SIZE = 16384;
  22890. var codeUnits = [];
  22891. var highSurrogate;
  22892. var lowSurrogate;
  22893. var index = -1;
  22894. var length = arguments.length;
  22895. if (!length) {
  22896. return "";
  22897. }
  22898. var result = "";
  22899. while (++index < length) {
  22900. var codePoint = Number(arguments[index]);
  22901. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  22902. codePoint < 0 || // not a valid Unicode code point
  22903. codePoint > 1114111 || // not a valid Unicode code point
  22904. floor(codePoint) !== codePoint) {
  22905. throw RangeError("Invalid code point: " + codePoint);
  22906. }
  22907. if (codePoint <= 65535) {
  22908. codeUnits.push(codePoint);
  22909. } else {
  22910. codePoint -= 65536;
  22911. highSurrogate = (codePoint >> 10) + 55296;
  22912. lowSurrogate = codePoint % 1024 + 56320;
  22913. codeUnits.push(highSurrogate, lowSurrogate);
  22914. }
  22915. if (index + 1 === length || codeUnits.length > MAX_SIZE) {
  22916. result += stringFromCharCode.apply(null, codeUnits);
  22917. codeUnits.length = 0;
  22918. }
  22919. }
  22920. return result;
  22921. };
  22922. if (Object.defineProperty) {
  22923. Object.defineProperty(String, "fromCodePoint", {
  22924. value: fromCodePoint,
  22925. configurable: true,
  22926. writable: true
  22927. });
  22928. } else {
  22929. String.fromCodePoint = fromCodePoint;
  22930. }
  22931. })();
  22932. }
  22933. })(typeof exports3 === "undefined" ? this.sax = {} : exports3);
  22934. }).call(this);
  22935. }).call(this, require2("buffer").Buffer);
  22936. }, { "buffer": 90, "stream": 398, "string_decoder": 413 }], 398: [function(require2, module3, exports3) {
  22937. module3.exports = Stream;
  22938. var EE = require2("events").EventEmitter;
  22939. var inherits = require2("inherits");
  22940. inherits(Stream, EE);
  22941. Stream.Readable = require2("readable-stream/lib/_stream_readable.js");
  22942. Stream.Writable = require2("readable-stream/lib/_stream_writable.js");
  22943. Stream.Duplex = require2("readable-stream/lib/_stream_duplex.js");
  22944. Stream.Transform = require2("readable-stream/lib/_stream_transform.js");
  22945. Stream.PassThrough = require2("readable-stream/lib/_stream_passthrough.js");
  22946. Stream.finished = require2("readable-stream/lib/internal/streams/end-of-stream.js");
  22947. Stream.pipeline = require2("readable-stream/lib/internal/streams/pipeline.js");
  22948. Stream.Stream = Stream;
  22949. function Stream() {
  22950. EE.call(this);
  22951. }
  22952. Stream.prototype.pipe = function(dest, options) {
  22953. var source = this;
  22954. function ondata(chunk) {
  22955. if (dest.writable) {
  22956. if (false === dest.write(chunk) && source.pause) {
  22957. source.pause();
  22958. }
  22959. }
  22960. }
  22961. source.on("data", ondata);
  22962. function ondrain() {
  22963. if (source.readable && source.resume) {
  22964. source.resume();
  22965. }
  22966. }
  22967. dest.on("drain", ondrain);
  22968. if (!dest._isStdio && (!options || options.end !== false)) {
  22969. source.on("end", onend);
  22970. source.on("close", onclose);
  22971. }
  22972. var didOnEnd = false;
  22973. function onend() {
  22974. if (didOnEnd)
  22975. return;
  22976. didOnEnd = true;
  22977. dest.end();
  22978. }
  22979. function onclose() {
  22980. if (didOnEnd)
  22981. return;
  22982. didOnEnd = true;
  22983. if (typeof dest.destroy === "function")
  22984. dest.destroy();
  22985. }
  22986. function onerror(er) {
  22987. cleanup();
  22988. if (EE.listenerCount(this, "error") === 0) {
  22989. throw er;
  22990. }
  22991. }
  22992. source.on("error", onerror);
  22993. dest.on("error", onerror);
  22994. function cleanup() {
  22995. source.removeListener("data", ondata);
  22996. dest.removeListener("drain", ondrain);
  22997. source.removeListener("end", onend);
  22998. source.removeListener("close", onclose);
  22999. source.removeListener("error", onerror);
  23000. dest.removeListener("error", onerror);
  23001. source.removeListener("end", cleanup);
  23002. source.removeListener("close", cleanup);
  23003. dest.removeListener("close", cleanup);
  23004. }
  23005. source.on("end", cleanup);
  23006. source.on("close", cleanup);
  23007. dest.on("close", cleanup);
  23008. dest.emit("pipe", source);
  23009. return dest;
  23010. };
  23011. }, { "events": 344, "inherits": 364, "readable-stream/lib/_stream_duplex.js": 400, "readable-stream/lib/_stream_passthrough.js": 401, "readable-stream/lib/_stream_readable.js": 402, "readable-stream/lib/_stream_transform.js": 403, "readable-stream/lib/_stream_writable.js": 404, "readable-stream/lib/internal/streams/end-of-stream.js": 408, "readable-stream/lib/internal/streams/pipeline.js": 410 }], 399: [function(require2, module3, exports3) {
  23012. "use strict";
  23013. function _inheritsLoose(subClass, superClass) {
  23014. subClass.prototype = Object.create(superClass.prototype);
  23015. subClass.prototype.constructor = subClass;
  23016. subClass.__proto__ = superClass;
  23017. }
  23018. var codes = {};
  23019. function createErrorType(code, message, Base) {
  23020. if (!Base) {
  23021. Base = Error;
  23022. }
  23023. function getMessage(arg1, arg2, arg3) {
  23024. if (typeof message === "string") {
  23025. return message;
  23026. } else {
  23027. return message(arg1, arg2, arg3);
  23028. }
  23029. }
  23030. var NodeError = function(_Base) {
  23031. _inheritsLoose(NodeError2, _Base);
  23032. function NodeError2(arg1, arg2, arg3) {
  23033. return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
  23034. }
  23035. return NodeError2;
  23036. }(Base);
  23037. NodeError.prototype.name = Base.name;
  23038. NodeError.prototype.code = code;
  23039. codes[code] = NodeError;
  23040. }
  23041. function oneOf(expected, thing) {
  23042. if (Array.isArray(expected)) {
  23043. var len = expected.length;
  23044. expected = expected.map(function(i) {
  23045. return String(i);
  23046. });
  23047. if (len > 2) {
  23048. return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
  23049. } else if (len === 2) {
  23050. return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
  23051. } else {
  23052. return "of ".concat(thing, " ").concat(expected[0]);
  23053. }
  23054. } else {
  23055. return "of ".concat(thing, " ").concat(String(expected));
  23056. }
  23057. }
  23058. function startsWith(str, search, pos) {
  23059. return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
  23060. }
  23061. function endsWith(str, search, this_len) {
  23062. if (this_len === void 0 || this_len > str.length) {
  23063. this_len = str.length;
  23064. }
  23065. return str.substring(this_len - search.length, this_len) === search;
  23066. }
  23067. function includes(str, search, start) {
  23068. if (typeof start !== "number") {
  23069. start = 0;
  23070. }
  23071. if (start + search.length > str.length) {
  23072. return false;
  23073. } else {
  23074. return str.indexOf(search, start) !== -1;
  23075. }
  23076. }
  23077. createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
  23078. return 'The value "' + value + '" is invalid for option "' + name + '"';
  23079. }, TypeError);
  23080. createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
  23081. var determiner;
  23082. if (typeof expected === "string" && startsWith(expected, "not ")) {
  23083. determiner = "must not be";
  23084. expected = expected.replace(/^not /, "");
  23085. } else {
  23086. determiner = "must be";
  23087. }
  23088. var msg;
  23089. if (endsWith(name, " argument")) {
  23090. msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
  23091. } else {
  23092. var type = includes(name, ".") ? "property" : "argument";
  23093. msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
  23094. }
  23095. msg += ". Received type ".concat(typeof actual);
  23096. return msg;
  23097. }, TypeError);
  23098. createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
  23099. createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
  23100. return "The " + name + " method is not implemented";
  23101. });
  23102. createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
  23103. createErrorType("ERR_STREAM_DESTROYED", function(name) {
  23104. return "Cannot call " + name + " after a stream was destroyed";
  23105. });
  23106. createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
  23107. createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
  23108. createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
  23109. createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
  23110. createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
  23111. return "Unknown encoding: " + arg;
  23112. }, TypeError);
  23113. createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
  23114. module3.exports.codes = codes;
  23115. }, {}], 400: [function(require2, module3, exports3) {
  23116. (function(process) {
  23117. (function() {
  23118. "use strict";
  23119. var objectKeys = Object.keys || function(obj) {
  23120. var keys2 = [];
  23121. for (var key in obj)
  23122. keys2.push(key);
  23123. return keys2;
  23124. };
  23125. module3.exports = Duplex;
  23126. var Readable = require2("./_stream_readable");
  23127. var Writable = require2("./_stream_writable");
  23128. require2("inherits")(Duplex, Readable);
  23129. {
  23130. var keys = objectKeys(Writable.prototype);
  23131. for (var v = 0; v < keys.length; v++) {
  23132. var method = keys[v];
  23133. if (!Duplex.prototype[method])
  23134. Duplex.prototype[method] = Writable.prototype[method];
  23135. }
  23136. }
  23137. function Duplex(options) {
  23138. if (!(this instanceof Duplex))
  23139. return new Duplex(options);
  23140. Readable.call(this, options);
  23141. Writable.call(this, options);
  23142. this.allowHalfOpen = true;
  23143. if (options) {
  23144. if (options.readable === false)
  23145. this.readable = false;
  23146. if (options.writable === false)
  23147. this.writable = false;
  23148. if (options.allowHalfOpen === false) {
  23149. this.allowHalfOpen = false;
  23150. this.once("end", onend);
  23151. }
  23152. }
  23153. }
  23154. Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
  23155. // making it explicit this property is not enumerable
  23156. // because otherwise some prototype manipulation in
  23157. // userland will fail
  23158. enumerable: false,
  23159. get: function get() {
  23160. return this._writableState.highWaterMark;
  23161. }
  23162. });
  23163. Object.defineProperty(Duplex.prototype, "writableBuffer", {
  23164. // making it explicit this property is not enumerable
  23165. // because otherwise some prototype manipulation in
  23166. // userland will fail
  23167. enumerable: false,
  23168. get: function get() {
  23169. return this._writableState && this._writableState.getBuffer();
  23170. }
  23171. });
  23172. Object.defineProperty(Duplex.prototype, "writableLength", {
  23173. // making it explicit this property is not enumerable
  23174. // because otherwise some prototype manipulation in
  23175. // userland will fail
  23176. enumerable: false,
  23177. get: function get() {
  23178. return this._writableState.length;
  23179. }
  23180. });
  23181. function onend() {
  23182. if (this._writableState.ended)
  23183. return;
  23184. process.nextTick(onEndNT, this);
  23185. }
  23186. function onEndNT(self2) {
  23187. self2.end();
  23188. }
  23189. Object.defineProperty(Duplex.prototype, "destroyed", {
  23190. // making it explicit this property is not enumerable
  23191. // because otherwise some prototype manipulation in
  23192. // userland will fail
  23193. enumerable: false,
  23194. get: function get() {
  23195. if (this._readableState === void 0 || this._writableState === void 0) {
  23196. return false;
  23197. }
  23198. return this._readableState.destroyed && this._writableState.destroyed;
  23199. },
  23200. set: function set(value) {
  23201. if (this._readableState === void 0 || this._writableState === void 0) {
  23202. return;
  23203. }
  23204. this._readableState.destroyed = value;
  23205. this._writableState.destroyed = value;
  23206. }
  23207. });
  23208. }).call(this);
  23209. }).call(this, require2("_process"));
  23210. }, { "./_stream_readable": 402, "./_stream_writable": 404, "_process": 467, "inherits": 364 }], 401: [function(require2, module3, exports3) {
  23211. "use strict";
  23212. module3.exports = PassThrough;
  23213. var Transform = require2("./_stream_transform");
  23214. require2("inherits")(PassThrough, Transform);
  23215. function PassThrough(options) {
  23216. if (!(this instanceof PassThrough))
  23217. return new PassThrough(options);
  23218. Transform.call(this, options);
  23219. }
  23220. PassThrough.prototype._transform = function(chunk, encoding, cb) {
  23221. cb(null, chunk);
  23222. };
  23223. }, { "./_stream_transform": 403, "inherits": 364 }], 402: [function(require2, module3, exports3) {
  23224. (function(process, global2) {
  23225. (function() {
  23226. "use strict";
  23227. module3.exports = Readable;
  23228. var Duplex;
  23229. Readable.ReadableState = ReadableState;
  23230. var EE = require2("events").EventEmitter;
  23231. var EElistenerCount = function EElistenerCount2(emitter, type) {
  23232. return emitter.listeners(type).length;
  23233. };
  23234. var Stream = require2("./internal/streams/stream");
  23235. var Buffer = require2("buffer").Buffer;
  23236. var OurUint8Array = (typeof global2 !== "undefined" ? global2 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
  23237. };
  23238. function _uint8ArrayToBuffer(chunk) {
  23239. return Buffer.from(chunk);
  23240. }
  23241. function _isUint8Array(obj) {
  23242. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  23243. }
  23244. var debugUtil = require2("util");
  23245. var debug;
  23246. if (debugUtil && debugUtil.debuglog) {
  23247. debug = debugUtil.debuglog("stream");
  23248. } else {
  23249. debug = function debug2() {
  23250. };
  23251. }
  23252. var BufferList = require2("./internal/streams/buffer_list");
  23253. var destroyImpl = require2("./internal/streams/destroy");
  23254. var _require = require2("./internal/streams/state"), getHighWaterMark = _require.getHighWaterMark;
  23255. var _require$codes = require2("../errors").codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
  23256. var StringDecoder;
  23257. var createReadableStreamAsyncIterator;
  23258. var from;
  23259. require2("inherits")(Readable, Stream);
  23260. var errorOrDestroy = destroyImpl.errorOrDestroy;
  23261. var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
  23262. function prependListener(emitter, event, fn) {
  23263. if (typeof emitter.prependListener === "function")
  23264. return emitter.prependListener(event, fn);
  23265. if (!emitter._events || !emitter._events[event])
  23266. emitter.on(event, fn);
  23267. else if (Array.isArray(emitter._events[event]))
  23268. emitter._events[event].unshift(fn);
  23269. else
  23270. emitter._events[event] = [fn, emitter._events[event]];
  23271. }
  23272. function ReadableState(options, stream, isDuplex) {
  23273. Duplex = Duplex || require2("./_stream_duplex");
  23274. options = options || {};
  23275. if (typeof isDuplex !== "boolean")
  23276. isDuplex = stream instanceof Duplex;
  23277. this.objectMode = !!options.objectMode;
  23278. if (isDuplex)
  23279. this.objectMode = this.objectMode || !!options.readableObjectMode;
  23280. this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
  23281. this.buffer = new BufferList();
  23282. this.length = 0;
  23283. this.pipes = null;
  23284. this.pipesCount = 0;
  23285. this.flowing = null;
  23286. this.ended = false;
  23287. this.endEmitted = false;
  23288. this.reading = false;
  23289. this.sync = true;
  23290. this.needReadable = false;
  23291. this.emittedReadable = false;
  23292. this.readableListening = false;
  23293. this.resumeScheduled = false;
  23294. this.paused = true;
  23295. this.emitClose = options.emitClose !== false;
  23296. this.autoDestroy = !!options.autoDestroy;
  23297. this.destroyed = false;
  23298. this.defaultEncoding = options.defaultEncoding || "utf8";
  23299. this.awaitDrain = 0;
  23300. this.readingMore = false;
  23301. this.decoder = null;
  23302. this.encoding = null;
  23303. if (options.encoding) {
  23304. if (!StringDecoder)
  23305. StringDecoder = require2("string_decoder/").StringDecoder;
  23306. this.decoder = new StringDecoder(options.encoding);
  23307. this.encoding = options.encoding;
  23308. }
  23309. }
  23310. function Readable(options) {
  23311. Duplex = Duplex || require2("./_stream_duplex");
  23312. if (!(this instanceof Readable))
  23313. return new Readable(options);
  23314. var isDuplex = this instanceof Duplex;
  23315. this._readableState = new ReadableState(options, this, isDuplex);
  23316. this.readable = true;
  23317. if (options) {
  23318. if (typeof options.read === "function")
  23319. this._read = options.read;
  23320. if (typeof options.destroy === "function")
  23321. this._destroy = options.destroy;
  23322. }
  23323. Stream.call(this);
  23324. }
  23325. Object.defineProperty(Readable.prototype, "destroyed", {
  23326. // making it explicit this property is not enumerable
  23327. // because otherwise some prototype manipulation in
  23328. // userland will fail
  23329. enumerable: false,
  23330. get: function get() {
  23331. if (this._readableState === void 0) {
  23332. return false;
  23333. }
  23334. return this._readableState.destroyed;
  23335. },
  23336. set: function set(value) {
  23337. if (!this._readableState) {
  23338. return;
  23339. }
  23340. this._readableState.destroyed = value;
  23341. }
  23342. });
  23343. Readable.prototype.destroy = destroyImpl.destroy;
  23344. Readable.prototype._undestroy = destroyImpl.undestroy;
  23345. Readable.prototype._destroy = function(err, cb) {
  23346. cb(err);
  23347. };
  23348. Readable.prototype.push = function(chunk, encoding) {
  23349. var state = this._readableState;
  23350. var skipChunkCheck;
  23351. if (!state.objectMode) {
  23352. if (typeof chunk === "string") {
  23353. encoding = encoding || state.defaultEncoding;
  23354. if (encoding !== state.encoding) {
  23355. chunk = Buffer.from(chunk, encoding);
  23356. encoding = "";
  23357. }
  23358. skipChunkCheck = true;
  23359. }
  23360. } else {
  23361. skipChunkCheck = true;
  23362. }
  23363. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  23364. };
  23365. Readable.prototype.unshift = function(chunk) {
  23366. return readableAddChunk(this, chunk, null, true, false);
  23367. };
  23368. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  23369. debug("readableAddChunk", chunk);
  23370. var state = stream._readableState;
  23371. if (chunk === null) {
  23372. state.reading = false;
  23373. onEofChunk(stream, state);
  23374. } else {
  23375. var er;
  23376. if (!skipChunkCheck)
  23377. er = chunkInvalid(state, chunk);
  23378. if (er) {
  23379. errorOrDestroy(stream, er);
  23380. } else if (state.objectMode || chunk && chunk.length > 0) {
  23381. if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  23382. chunk = _uint8ArrayToBuffer(chunk);
  23383. }
  23384. if (addToFront) {
  23385. if (state.endEmitted)
  23386. errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
  23387. else
  23388. addChunk(stream, state, chunk, true);
  23389. } else if (state.ended) {
  23390. errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
  23391. } else if (state.destroyed) {
  23392. return false;
  23393. } else {
  23394. state.reading = false;
  23395. if (state.decoder && !encoding) {
  23396. chunk = state.decoder.write(chunk);
  23397. if (state.objectMode || chunk.length !== 0)
  23398. addChunk(stream, state, chunk, false);
  23399. else
  23400. maybeReadMore(stream, state);
  23401. } else {
  23402. addChunk(stream, state, chunk, false);
  23403. }
  23404. }
  23405. } else if (!addToFront) {
  23406. state.reading = false;
  23407. maybeReadMore(stream, state);
  23408. }
  23409. }
  23410. return !state.ended && (state.length < state.highWaterMark || state.length === 0);
  23411. }
  23412. function addChunk(stream, state, chunk, addToFront) {
  23413. if (state.flowing && state.length === 0 && !state.sync) {
  23414. state.awaitDrain = 0;
  23415. stream.emit("data", chunk);
  23416. } else {
  23417. state.length += state.objectMode ? 1 : chunk.length;
  23418. if (addToFront)
  23419. state.buffer.unshift(chunk);
  23420. else
  23421. state.buffer.push(chunk);
  23422. if (state.needReadable)
  23423. emitReadable(stream);
  23424. }
  23425. maybeReadMore(stream, state);
  23426. }
  23427. function chunkInvalid(state, chunk) {
  23428. var er;
  23429. if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
  23430. er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
  23431. }
  23432. return er;
  23433. }
  23434. Readable.prototype.isPaused = function() {
  23435. return this._readableState.flowing === false;
  23436. };
  23437. Readable.prototype.setEncoding = function(enc) {
  23438. if (!StringDecoder)
  23439. StringDecoder = require2("string_decoder/").StringDecoder;
  23440. var decoder = new StringDecoder(enc);
  23441. this._readableState.decoder = decoder;
  23442. this._readableState.encoding = this._readableState.decoder.encoding;
  23443. var p = this._readableState.buffer.head;
  23444. var content = "";
  23445. while (p !== null) {
  23446. content += decoder.write(p.data);
  23447. p = p.next;
  23448. }
  23449. this._readableState.buffer.clear();
  23450. if (content !== "")
  23451. this._readableState.buffer.push(content);
  23452. this._readableState.length = content.length;
  23453. return this;
  23454. };
  23455. var MAX_HWM = 1073741824;
  23456. function computeNewHighWaterMark(n) {
  23457. if (n >= MAX_HWM) {
  23458. n = MAX_HWM;
  23459. } else {
  23460. n--;
  23461. n |= n >>> 1;
  23462. n |= n >>> 2;
  23463. n |= n >>> 4;
  23464. n |= n >>> 8;
  23465. n |= n >>> 16;
  23466. n++;
  23467. }
  23468. return n;
  23469. }
  23470. function howMuchToRead(n, state) {
  23471. if (n <= 0 || state.length === 0 && state.ended)
  23472. return 0;
  23473. if (state.objectMode)
  23474. return 1;
  23475. if (n !== n) {
  23476. if (state.flowing && state.length)
  23477. return state.buffer.head.data.length;
  23478. else
  23479. return state.length;
  23480. }
  23481. if (n > state.highWaterMark)
  23482. state.highWaterMark = computeNewHighWaterMark(n);
  23483. if (n <= state.length)
  23484. return n;
  23485. if (!state.ended) {
  23486. state.needReadable = true;
  23487. return 0;
  23488. }
  23489. return state.length;
  23490. }
  23491. Readable.prototype.read = function(n) {
  23492. debug("read", n);
  23493. n = parseInt(n, 10);
  23494. var state = this._readableState;
  23495. var nOrig = n;
  23496. if (n !== 0)
  23497. state.emittedReadable = false;
  23498. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
  23499. debug("read: emitReadable", state.length, state.ended);
  23500. if (state.length === 0 && state.ended)
  23501. endReadable(this);
  23502. else
  23503. emitReadable(this);
  23504. return null;
  23505. }
  23506. n = howMuchToRead(n, state);
  23507. if (n === 0 && state.ended) {
  23508. if (state.length === 0)
  23509. endReadable(this);
  23510. return null;
  23511. }
  23512. var doRead = state.needReadable;
  23513. debug("need readable", doRead);
  23514. if (state.length === 0 || state.length - n < state.highWaterMark) {
  23515. doRead = true;
  23516. debug("length less than watermark", doRead);
  23517. }
  23518. if (state.ended || state.reading) {
  23519. doRead = false;
  23520. debug("reading or ended", doRead);
  23521. } else if (doRead) {
  23522. debug("do read");
  23523. state.reading = true;
  23524. state.sync = true;
  23525. if (state.length === 0)
  23526. state.needReadable = true;
  23527. this._read(state.highWaterMark);
  23528. state.sync = false;
  23529. if (!state.reading)
  23530. n = howMuchToRead(nOrig, state);
  23531. }
  23532. var ret;
  23533. if (n > 0)
  23534. ret = fromList(n, state);
  23535. else
  23536. ret = null;
  23537. if (ret === null) {
  23538. state.needReadable = state.length <= state.highWaterMark;
  23539. n = 0;
  23540. } else {
  23541. state.length -= n;
  23542. state.awaitDrain = 0;
  23543. }
  23544. if (state.length === 0) {
  23545. if (!state.ended)
  23546. state.needReadable = true;
  23547. if (nOrig !== n && state.ended)
  23548. endReadable(this);
  23549. }
  23550. if (ret !== null)
  23551. this.emit("data", ret);
  23552. return ret;
  23553. };
  23554. function onEofChunk(stream, state) {
  23555. debug("onEofChunk");
  23556. if (state.ended)
  23557. return;
  23558. if (state.decoder) {
  23559. var chunk = state.decoder.end();
  23560. if (chunk && chunk.length) {
  23561. state.buffer.push(chunk);
  23562. state.length += state.objectMode ? 1 : chunk.length;
  23563. }
  23564. }
  23565. state.ended = true;
  23566. if (state.sync) {
  23567. emitReadable(stream);
  23568. } else {
  23569. state.needReadable = false;
  23570. if (!state.emittedReadable) {
  23571. state.emittedReadable = true;
  23572. emitReadable_(stream);
  23573. }
  23574. }
  23575. }
  23576. function emitReadable(stream) {
  23577. var state = stream._readableState;
  23578. debug("emitReadable", state.needReadable, state.emittedReadable);
  23579. state.needReadable = false;
  23580. if (!state.emittedReadable) {
  23581. debug("emitReadable", state.flowing);
  23582. state.emittedReadable = true;
  23583. process.nextTick(emitReadable_, stream);
  23584. }
  23585. }
  23586. function emitReadable_(stream) {
  23587. var state = stream._readableState;
  23588. debug("emitReadable_", state.destroyed, state.length, state.ended);
  23589. if (!state.destroyed && (state.length || state.ended)) {
  23590. stream.emit("readable");
  23591. state.emittedReadable = false;
  23592. }
  23593. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
  23594. flow(stream);
  23595. }
  23596. function maybeReadMore(stream, state) {
  23597. if (!state.readingMore) {
  23598. state.readingMore = true;
  23599. process.nextTick(maybeReadMore_, stream, state);
  23600. }
  23601. }
  23602. function maybeReadMore_(stream, state) {
  23603. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
  23604. var len = state.length;
  23605. debug("maybeReadMore read 0");
  23606. stream.read(0);
  23607. if (len === state.length)
  23608. break;
  23609. }
  23610. state.readingMore = false;
  23611. }
  23612. Readable.prototype._read = function(n) {
  23613. errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
  23614. };
  23615. Readable.prototype.pipe = function(dest, pipeOpts) {
  23616. var src = this;
  23617. var state = this._readableState;
  23618. switch (state.pipesCount) {
  23619. case 0:
  23620. state.pipes = dest;
  23621. break;
  23622. case 1:
  23623. state.pipes = [state.pipes, dest];
  23624. break;
  23625. default:
  23626. state.pipes.push(dest);
  23627. break;
  23628. }
  23629. state.pipesCount += 1;
  23630. debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
  23631. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  23632. var endFn = doEnd ? onend : unpipe;
  23633. if (state.endEmitted)
  23634. process.nextTick(endFn);
  23635. else
  23636. src.once("end", endFn);
  23637. dest.on("unpipe", onunpipe);
  23638. function onunpipe(readable, unpipeInfo) {
  23639. debug("onunpipe");
  23640. if (readable === src) {
  23641. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  23642. unpipeInfo.hasUnpiped = true;
  23643. cleanup();
  23644. }
  23645. }
  23646. }
  23647. function onend() {
  23648. debug("onend");
  23649. dest.end();
  23650. }
  23651. var ondrain = pipeOnDrain(src);
  23652. dest.on("drain", ondrain);
  23653. var cleanedUp = false;
  23654. function cleanup() {
  23655. debug("cleanup");
  23656. dest.removeListener("close", onclose);
  23657. dest.removeListener("finish", onfinish);
  23658. dest.removeListener("drain", ondrain);
  23659. dest.removeListener("error", onerror);
  23660. dest.removeListener("unpipe", onunpipe);
  23661. src.removeListener("end", onend);
  23662. src.removeListener("end", unpipe);
  23663. src.removeListener("data", ondata);
  23664. cleanedUp = true;
  23665. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
  23666. ondrain();
  23667. }
  23668. src.on("data", ondata);
  23669. function ondata(chunk) {
  23670. debug("ondata");
  23671. var ret = dest.write(chunk);
  23672. debug("dest.write", ret);
  23673. if (ret === false) {
  23674. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  23675. debug("false write response, pause", state.awaitDrain);
  23676. state.awaitDrain++;
  23677. }
  23678. src.pause();
  23679. }
  23680. }
  23681. function onerror(er) {
  23682. debug("onerror", er);
  23683. unpipe();
  23684. dest.removeListener("error", onerror);
  23685. if (EElistenerCount(dest, "error") === 0)
  23686. errorOrDestroy(dest, er);
  23687. }
  23688. prependListener(dest, "error", onerror);
  23689. function onclose() {
  23690. dest.removeListener("finish", onfinish);
  23691. unpipe();
  23692. }
  23693. dest.once("close", onclose);
  23694. function onfinish() {
  23695. debug("onfinish");
  23696. dest.removeListener("close", onclose);
  23697. unpipe();
  23698. }
  23699. dest.once("finish", onfinish);
  23700. function unpipe() {
  23701. debug("unpipe");
  23702. src.unpipe(dest);
  23703. }
  23704. dest.emit("pipe", src);
  23705. if (!state.flowing) {
  23706. debug("pipe resume");
  23707. src.resume();
  23708. }
  23709. return dest;
  23710. };
  23711. function pipeOnDrain(src) {
  23712. return function pipeOnDrainFunctionResult() {
  23713. var state = src._readableState;
  23714. debug("pipeOnDrain", state.awaitDrain);
  23715. if (state.awaitDrain)
  23716. state.awaitDrain--;
  23717. if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
  23718. state.flowing = true;
  23719. flow(src);
  23720. }
  23721. };
  23722. }
  23723. Readable.prototype.unpipe = function(dest) {
  23724. var state = this._readableState;
  23725. var unpipeInfo = {
  23726. hasUnpiped: false
  23727. };
  23728. if (state.pipesCount === 0)
  23729. return this;
  23730. if (state.pipesCount === 1) {
  23731. if (dest && dest !== state.pipes)
  23732. return this;
  23733. if (!dest)
  23734. dest = state.pipes;
  23735. state.pipes = null;
  23736. state.pipesCount = 0;
  23737. state.flowing = false;
  23738. if (dest)
  23739. dest.emit("unpipe", this, unpipeInfo);
  23740. return this;
  23741. }
  23742. if (!dest) {
  23743. var dests = state.pipes;
  23744. var len = state.pipesCount;
  23745. state.pipes = null;
  23746. state.pipesCount = 0;
  23747. state.flowing = false;
  23748. for (var i = 0; i < len; i++)
  23749. dests[i].emit("unpipe", this, {
  23750. hasUnpiped: false
  23751. });
  23752. return this;
  23753. }
  23754. var index = indexOf(state.pipes, dest);
  23755. if (index === -1)
  23756. return this;
  23757. state.pipes.splice(index, 1);
  23758. state.pipesCount -= 1;
  23759. if (state.pipesCount === 1)
  23760. state.pipes = state.pipes[0];
  23761. dest.emit("unpipe", this, unpipeInfo);
  23762. return this;
  23763. };
  23764. Readable.prototype.on = function(ev, fn) {
  23765. var res = Stream.prototype.on.call(this, ev, fn);
  23766. var state = this._readableState;
  23767. if (ev === "data") {
  23768. state.readableListening = this.listenerCount("readable") > 0;
  23769. if (state.flowing !== false)
  23770. this.resume();
  23771. } else if (ev === "readable") {
  23772. if (!state.endEmitted && !state.readableListening) {
  23773. state.readableListening = state.needReadable = true;
  23774. state.flowing = false;
  23775. state.emittedReadable = false;
  23776. debug("on readable", state.length, state.reading);
  23777. if (state.length) {
  23778. emitReadable(this);
  23779. } else if (!state.reading) {
  23780. process.nextTick(nReadingNextTick, this);
  23781. }
  23782. }
  23783. }
  23784. return res;
  23785. };
  23786. Readable.prototype.addListener = Readable.prototype.on;
  23787. Readable.prototype.removeListener = function(ev, fn) {
  23788. var res = Stream.prototype.removeListener.call(this, ev, fn);
  23789. if (ev === "readable") {
  23790. process.nextTick(updateReadableListening, this);
  23791. }
  23792. return res;
  23793. };
  23794. Readable.prototype.removeAllListeners = function(ev) {
  23795. var res = Stream.prototype.removeAllListeners.apply(this, arguments);
  23796. if (ev === "readable" || ev === void 0) {
  23797. process.nextTick(updateReadableListening, this);
  23798. }
  23799. return res;
  23800. };
  23801. function updateReadableListening(self2) {
  23802. var state = self2._readableState;
  23803. state.readableListening = self2.listenerCount("readable") > 0;
  23804. if (state.resumeScheduled && !state.paused) {
  23805. state.flowing = true;
  23806. } else if (self2.listenerCount("data") > 0) {
  23807. self2.resume();
  23808. }
  23809. }
  23810. function nReadingNextTick(self2) {
  23811. debug("readable nexttick read 0");
  23812. self2.read(0);
  23813. }
  23814. Readable.prototype.resume = function() {
  23815. var state = this._readableState;
  23816. if (!state.flowing) {
  23817. debug("resume");
  23818. state.flowing = !state.readableListening;
  23819. resume(this, state);
  23820. }
  23821. state.paused = false;
  23822. return this;
  23823. };
  23824. function resume(stream, state) {
  23825. if (!state.resumeScheduled) {
  23826. state.resumeScheduled = true;
  23827. process.nextTick(resume_, stream, state);
  23828. }
  23829. }
  23830. function resume_(stream, state) {
  23831. debug("resume", state.reading);
  23832. if (!state.reading) {
  23833. stream.read(0);
  23834. }
  23835. state.resumeScheduled = false;
  23836. stream.emit("resume");
  23837. flow(stream);
  23838. if (state.flowing && !state.reading)
  23839. stream.read(0);
  23840. }
  23841. Readable.prototype.pause = function() {
  23842. debug("call pause flowing=%j", this._readableState.flowing);
  23843. if (this._readableState.flowing !== false) {
  23844. debug("pause");
  23845. this._readableState.flowing = false;
  23846. this.emit("pause");
  23847. }
  23848. this._readableState.paused = true;
  23849. return this;
  23850. };
  23851. function flow(stream) {
  23852. var state = stream._readableState;
  23853. debug("flow", state.flowing);
  23854. while (state.flowing && stream.read() !== null)
  23855. ;
  23856. }
  23857. Readable.prototype.wrap = function(stream) {
  23858. var _this = this;
  23859. var state = this._readableState;
  23860. var paused = false;
  23861. stream.on("end", function() {
  23862. debug("wrapped end");
  23863. if (state.decoder && !state.ended) {
  23864. var chunk = state.decoder.end();
  23865. if (chunk && chunk.length)
  23866. _this.push(chunk);
  23867. }
  23868. _this.push(null);
  23869. });
  23870. stream.on("data", function(chunk) {
  23871. debug("wrapped data");
  23872. if (state.decoder)
  23873. chunk = state.decoder.write(chunk);
  23874. if (state.objectMode && (chunk === null || chunk === void 0))
  23875. return;
  23876. else if (!state.objectMode && (!chunk || !chunk.length))
  23877. return;
  23878. var ret = _this.push(chunk);
  23879. if (!ret) {
  23880. paused = true;
  23881. stream.pause();
  23882. }
  23883. });
  23884. for (var i in stream) {
  23885. if (this[i] === void 0 && typeof stream[i] === "function") {
  23886. this[i] = function methodWrap(method) {
  23887. return function methodWrapReturnFunction() {
  23888. return stream[method].apply(stream, arguments);
  23889. };
  23890. }(i);
  23891. }
  23892. }
  23893. for (var n = 0; n < kProxyEvents.length; n++) {
  23894. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  23895. }
  23896. this._read = function(n2) {
  23897. debug("wrapped _read", n2);
  23898. if (paused) {
  23899. paused = false;
  23900. stream.resume();
  23901. }
  23902. };
  23903. return this;
  23904. };
  23905. if (typeof Symbol === "function") {
  23906. Readable.prototype[Symbol.asyncIterator] = function() {
  23907. if (createReadableStreamAsyncIterator === void 0) {
  23908. createReadableStreamAsyncIterator = require2("./internal/streams/async_iterator");
  23909. }
  23910. return createReadableStreamAsyncIterator(this);
  23911. };
  23912. }
  23913. Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
  23914. // making it explicit this property is not enumerable
  23915. // because otherwise some prototype manipulation in
  23916. // userland will fail
  23917. enumerable: false,
  23918. get: function get() {
  23919. return this._readableState.highWaterMark;
  23920. }
  23921. });
  23922. Object.defineProperty(Readable.prototype, "readableBuffer", {
  23923. // making it explicit this property is not enumerable
  23924. // because otherwise some prototype manipulation in
  23925. // userland will fail
  23926. enumerable: false,
  23927. get: function get() {
  23928. return this._readableState && this._readableState.buffer;
  23929. }
  23930. });
  23931. Object.defineProperty(Readable.prototype, "readableFlowing", {
  23932. // making it explicit this property is not enumerable
  23933. // because otherwise some prototype manipulation in
  23934. // userland will fail
  23935. enumerable: false,
  23936. get: function get() {
  23937. return this._readableState.flowing;
  23938. },
  23939. set: function set(state) {
  23940. if (this._readableState) {
  23941. this._readableState.flowing = state;
  23942. }
  23943. }
  23944. });
  23945. Readable._fromList = fromList;
  23946. Object.defineProperty(Readable.prototype, "readableLength", {
  23947. // making it explicit this property is not enumerable
  23948. // because otherwise some prototype manipulation in
  23949. // userland will fail
  23950. enumerable: false,
  23951. get: function get() {
  23952. return this._readableState.length;
  23953. }
  23954. });
  23955. function fromList(n, state) {
  23956. if (state.length === 0)
  23957. return null;
  23958. var ret;
  23959. if (state.objectMode)
  23960. ret = state.buffer.shift();
  23961. else if (!n || n >= state.length) {
  23962. if (state.decoder)
  23963. ret = state.buffer.join("");
  23964. else if (state.buffer.length === 1)
  23965. ret = state.buffer.first();
  23966. else
  23967. ret = state.buffer.concat(state.length);
  23968. state.buffer.clear();
  23969. } else {
  23970. ret = state.buffer.consume(n, state.decoder);
  23971. }
  23972. return ret;
  23973. }
  23974. function endReadable(stream) {
  23975. var state = stream._readableState;
  23976. debug("endReadable", state.endEmitted);
  23977. if (!state.endEmitted) {
  23978. state.ended = true;
  23979. process.nextTick(endReadableNT, state, stream);
  23980. }
  23981. }
  23982. function endReadableNT(state, stream) {
  23983. debug("endReadableNT", state.endEmitted, state.length);
  23984. if (!state.endEmitted && state.length === 0) {
  23985. state.endEmitted = true;
  23986. stream.readable = false;
  23987. stream.emit("end");
  23988. if (state.autoDestroy) {
  23989. var wState = stream._writableState;
  23990. if (!wState || wState.autoDestroy && wState.finished) {
  23991. stream.destroy();
  23992. }
  23993. }
  23994. }
  23995. }
  23996. if (typeof Symbol === "function") {
  23997. Readable.from = function(iterable, opts) {
  23998. if (from === void 0) {
  23999. from = require2("./internal/streams/from");
  24000. }
  24001. return from(Readable, iterable, opts);
  24002. };
  24003. }
  24004. function indexOf(xs, x) {
  24005. for (var i = 0, l = xs.length; i < l; i++) {
  24006. if (xs[i] === x)
  24007. return i;
  24008. }
  24009. return -1;
  24010. }
  24011. }).call(this);
  24012. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  24013. }, { "../errors": 399, "./_stream_duplex": 400, "./internal/streams/async_iterator": 405, "./internal/streams/buffer_list": 406, "./internal/streams/destroy": 407, "./internal/streams/from": 409, "./internal/streams/state": 411, "./internal/streams/stream": 412, "_process": 467, "buffer": 90, "events": 344, "inherits": 364, "string_decoder/": 413, "util": 89 }], 403: [function(require2, module3, exports3) {
  24014. "use strict";
  24015. module3.exports = Transform;
  24016. var _require$codes = require2("../errors").codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
  24017. var Duplex = require2("./_stream_duplex");
  24018. require2("inherits")(Transform, Duplex);
  24019. function afterTransform(er, data) {
  24020. var ts = this._transformState;
  24021. ts.transforming = false;
  24022. var cb = ts.writecb;
  24023. if (cb === null) {
  24024. return this.emit("error", new ERR_MULTIPLE_CALLBACK());
  24025. }
  24026. ts.writechunk = null;
  24027. ts.writecb = null;
  24028. if (data != null)
  24029. this.push(data);
  24030. cb(er);
  24031. var rs = this._readableState;
  24032. rs.reading = false;
  24033. if (rs.needReadable || rs.length < rs.highWaterMark) {
  24034. this._read(rs.highWaterMark);
  24035. }
  24036. }
  24037. function Transform(options) {
  24038. if (!(this instanceof Transform))
  24039. return new Transform(options);
  24040. Duplex.call(this, options);
  24041. this._transformState = {
  24042. afterTransform: afterTransform.bind(this),
  24043. needTransform: false,
  24044. transforming: false,
  24045. writecb: null,
  24046. writechunk: null,
  24047. writeencoding: null
  24048. };
  24049. this._readableState.needReadable = true;
  24050. this._readableState.sync = false;
  24051. if (options) {
  24052. if (typeof options.transform === "function")
  24053. this._transform = options.transform;
  24054. if (typeof options.flush === "function")
  24055. this._flush = options.flush;
  24056. }
  24057. this.on("prefinish", prefinish);
  24058. }
  24059. function prefinish() {
  24060. var _this = this;
  24061. if (typeof this._flush === "function" && !this._readableState.destroyed) {
  24062. this._flush(function(er, data) {
  24063. done(_this, er, data);
  24064. });
  24065. } else {
  24066. done(this, null, null);
  24067. }
  24068. }
  24069. Transform.prototype.push = function(chunk, encoding) {
  24070. this._transformState.needTransform = false;
  24071. return Duplex.prototype.push.call(this, chunk, encoding);
  24072. };
  24073. Transform.prototype._transform = function(chunk, encoding, cb) {
  24074. cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
  24075. };
  24076. Transform.prototype._write = function(chunk, encoding, cb) {
  24077. var ts = this._transformState;
  24078. ts.writecb = cb;
  24079. ts.writechunk = chunk;
  24080. ts.writeencoding = encoding;
  24081. if (!ts.transforming) {
  24082. var rs = this._readableState;
  24083. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
  24084. this._read(rs.highWaterMark);
  24085. }
  24086. };
  24087. Transform.prototype._read = function(n) {
  24088. var ts = this._transformState;
  24089. if (ts.writechunk !== null && !ts.transforming) {
  24090. ts.transforming = true;
  24091. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  24092. } else {
  24093. ts.needTransform = true;
  24094. }
  24095. };
  24096. Transform.prototype._destroy = function(err, cb) {
  24097. Duplex.prototype._destroy.call(this, err, function(err2) {
  24098. cb(err2);
  24099. });
  24100. };
  24101. function done(stream, er, data) {
  24102. if (er)
  24103. return stream.emit("error", er);
  24104. if (data != null)
  24105. stream.push(data);
  24106. if (stream._writableState.length)
  24107. throw new ERR_TRANSFORM_WITH_LENGTH_0();
  24108. if (stream._transformState.transforming)
  24109. throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
  24110. return stream.push(null);
  24111. }
  24112. }, { "../errors": 399, "./_stream_duplex": 400, "inherits": 364 }], 404: [function(require2, module3, exports3) {
  24113. (function(process, global2) {
  24114. (function() {
  24115. "use strict";
  24116. module3.exports = Writable;
  24117. function WriteReq(chunk, encoding, cb) {
  24118. this.chunk = chunk;
  24119. this.encoding = encoding;
  24120. this.callback = cb;
  24121. this.next = null;
  24122. }
  24123. function CorkedRequest(state) {
  24124. var _this = this;
  24125. this.next = null;
  24126. this.entry = null;
  24127. this.finish = function() {
  24128. onCorkedFinish(_this, state);
  24129. };
  24130. }
  24131. var Duplex;
  24132. Writable.WritableState = WritableState;
  24133. var internalUtil = {
  24134. deprecate: require2("util-deprecate")
  24135. };
  24136. var Stream = require2("./internal/streams/stream");
  24137. var Buffer = require2("buffer").Buffer;
  24138. var OurUint8Array = (typeof global2 !== "undefined" ? global2 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
  24139. };
  24140. function _uint8ArrayToBuffer(chunk) {
  24141. return Buffer.from(chunk);
  24142. }
  24143. function _isUint8Array(obj) {
  24144. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  24145. }
  24146. var destroyImpl = require2("./internal/streams/destroy");
  24147. var _require = require2("./internal/streams/state"), getHighWaterMark = _require.getHighWaterMark;
  24148. var _require$codes = require2("../errors").codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
  24149. var errorOrDestroy = destroyImpl.errorOrDestroy;
  24150. require2("inherits")(Writable, Stream);
  24151. function nop() {
  24152. }
  24153. function WritableState(options, stream, isDuplex) {
  24154. Duplex = Duplex || require2("./_stream_duplex");
  24155. options = options || {};
  24156. if (typeof isDuplex !== "boolean")
  24157. isDuplex = stream instanceof Duplex;
  24158. this.objectMode = !!options.objectMode;
  24159. if (isDuplex)
  24160. this.objectMode = this.objectMode || !!options.writableObjectMode;
  24161. this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
  24162. this.finalCalled = false;
  24163. this.needDrain = false;
  24164. this.ending = false;
  24165. this.ended = false;
  24166. this.finished = false;
  24167. this.destroyed = false;
  24168. var noDecode = options.decodeStrings === false;
  24169. this.decodeStrings = !noDecode;
  24170. this.defaultEncoding = options.defaultEncoding || "utf8";
  24171. this.length = 0;
  24172. this.writing = false;
  24173. this.corked = 0;
  24174. this.sync = true;
  24175. this.bufferProcessing = false;
  24176. this.onwrite = function(er) {
  24177. onwrite(stream, er);
  24178. };
  24179. this.writecb = null;
  24180. this.writelen = 0;
  24181. this.bufferedRequest = null;
  24182. this.lastBufferedRequest = null;
  24183. this.pendingcb = 0;
  24184. this.prefinished = false;
  24185. this.errorEmitted = false;
  24186. this.emitClose = options.emitClose !== false;
  24187. this.autoDestroy = !!options.autoDestroy;
  24188. this.bufferedRequestCount = 0;
  24189. this.corkedRequestsFree = new CorkedRequest(this);
  24190. }
  24191. WritableState.prototype.getBuffer = function getBuffer() {
  24192. var current = this.bufferedRequest;
  24193. var out = [];
  24194. while (current) {
  24195. out.push(current);
  24196. current = current.next;
  24197. }
  24198. return out;
  24199. };
  24200. (function() {
  24201. try {
  24202. Object.defineProperty(WritableState.prototype, "buffer", {
  24203. get: internalUtil.deprecate(function writableStateBufferGetter() {
  24204. return this.getBuffer();
  24205. }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
  24206. });
  24207. } catch (_) {
  24208. }
  24209. })();
  24210. var realHasInstance;
  24211. if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
  24212. realHasInstance = Function.prototype[Symbol.hasInstance];
  24213. Object.defineProperty(Writable, Symbol.hasInstance, {
  24214. value: function value(object) {
  24215. if (realHasInstance.call(this, object))
  24216. return true;
  24217. if (this !== Writable)
  24218. return false;
  24219. return object && object._writableState instanceof WritableState;
  24220. }
  24221. });
  24222. } else {
  24223. realHasInstance = function realHasInstance2(object) {
  24224. return object instanceof this;
  24225. };
  24226. }
  24227. function Writable(options) {
  24228. Duplex = Duplex || require2("./_stream_duplex");
  24229. var isDuplex = this instanceof Duplex;
  24230. if (!isDuplex && !realHasInstance.call(Writable, this))
  24231. return new Writable(options);
  24232. this._writableState = new WritableState(options, this, isDuplex);
  24233. this.writable = true;
  24234. if (options) {
  24235. if (typeof options.write === "function")
  24236. this._write = options.write;
  24237. if (typeof options.writev === "function")
  24238. this._writev = options.writev;
  24239. if (typeof options.destroy === "function")
  24240. this._destroy = options.destroy;
  24241. if (typeof options.final === "function")
  24242. this._final = options.final;
  24243. }
  24244. Stream.call(this);
  24245. }
  24246. Writable.prototype.pipe = function() {
  24247. errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
  24248. };
  24249. function writeAfterEnd(stream, cb) {
  24250. var er = new ERR_STREAM_WRITE_AFTER_END();
  24251. errorOrDestroy(stream, er);
  24252. process.nextTick(cb, er);
  24253. }
  24254. function validChunk(stream, state, chunk, cb) {
  24255. var er;
  24256. if (chunk === null) {
  24257. er = new ERR_STREAM_NULL_VALUES();
  24258. } else if (typeof chunk !== "string" && !state.objectMode) {
  24259. er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
  24260. }
  24261. if (er) {
  24262. errorOrDestroy(stream, er);
  24263. process.nextTick(cb, er);
  24264. return false;
  24265. }
  24266. return true;
  24267. }
  24268. Writable.prototype.write = function(chunk, encoding, cb) {
  24269. var state = this._writableState;
  24270. var ret = false;
  24271. var isBuf = !state.objectMode && _isUint8Array(chunk);
  24272. if (isBuf && !Buffer.isBuffer(chunk)) {
  24273. chunk = _uint8ArrayToBuffer(chunk);
  24274. }
  24275. if (typeof encoding === "function") {
  24276. cb = encoding;
  24277. encoding = null;
  24278. }
  24279. if (isBuf)
  24280. encoding = "buffer";
  24281. else if (!encoding)
  24282. encoding = state.defaultEncoding;
  24283. if (typeof cb !== "function")
  24284. cb = nop;
  24285. if (state.ending)
  24286. writeAfterEnd(this, cb);
  24287. else if (isBuf || validChunk(this, state, chunk, cb)) {
  24288. state.pendingcb++;
  24289. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  24290. }
  24291. return ret;
  24292. };
  24293. Writable.prototype.cork = function() {
  24294. this._writableState.corked++;
  24295. };
  24296. Writable.prototype.uncork = function() {
  24297. var state = this._writableState;
  24298. if (state.corked) {
  24299. state.corked--;
  24300. if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest)
  24301. clearBuffer(this, state);
  24302. }
  24303. };
  24304. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  24305. if (typeof encoding === "string")
  24306. encoding = encoding.toLowerCase();
  24307. if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
  24308. throw new ERR_UNKNOWN_ENCODING(encoding);
  24309. this._writableState.defaultEncoding = encoding;
  24310. return this;
  24311. };
  24312. Object.defineProperty(Writable.prototype, "writableBuffer", {
  24313. // making it explicit this property is not enumerable
  24314. // because otherwise some prototype manipulation in
  24315. // userland will fail
  24316. enumerable: false,
  24317. get: function get() {
  24318. return this._writableState && this._writableState.getBuffer();
  24319. }
  24320. });
  24321. function decodeChunk(state, chunk, encoding) {
  24322. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
  24323. chunk = Buffer.from(chunk, encoding);
  24324. }
  24325. return chunk;
  24326. }
  24327. Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
  24328. // making it explicit this property is not enumerable
  24329. // because otherwise some prototype manipulation in
  24330. // userland will fail
  24331. enumerable: false,
  24332. get: function get() {
  24333. return this._writableState.highWaterMark;
  24334. }
  24335. });
  24336. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  24337. if (!isBuf) {
  24338. var newChunk = decodeChunk(state, chunk, encoding);
  24339. if (chunk !== newChunk) {
  24340. isBuf = true;
  24341. encoding = "buffer";
  24342. chunk = newChunk;
  24343. }
  24344. }
  24345. var len = state.objectMode ? 1 : chunk.length;
  24346. state.length += len;
  24347. var ret = state.length < state.highWaterMark;
  24348. if (!ret)
  24349. state.needDrain = true;
  24350. if (state.writing || state.corked) {
  24351. var last = state.lastBufferedRequest;
  24352. state.lastBufferedRequest = {
  24353. chunk,
  24354. encoding,
  24355. isBuf,
  24356. callback: cb,
  24357. next: null
  24358. };
  24359. if (last) {
  24360. last.next = state.lastBufferedRequest;
  24361. } else {
  24362. state.bufferedRequest = state.lastBufferedRequest;
  24363. }
  24364. state.bufferedRequestCount += 1;
  24365. } else {
  24366. doWrite(stream, state, false, len, chunk, encoding, cb);
  24367. }
  24368. return ret;
  24369. }
  24370. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  24371. state.writelen = len;
  24372. state.writecb = cb;
  24373. state.writing = true;
  24374. state.sync = true;
  24375. if (state.destroyed)
  24376. state.onwrite(new ERR_STREAM_DESTROYED("write"));
  24377. else if (writev)
  24378. stream._writev(chunk, state.onwrite);
  24379. else
  24380. stream._write(chunk, encoding, state.onwrite);
  24381. state.sync = false;
  24382. }
  24383. function onwriteError(stream, state, sync, er, cb) {
  24384. --state.pendingcb;
  24385. if (sync) {
  24386. process.nextTick(cb, er);
  24387. process.nextTick(finishMaybe, stream, state);
  24388. stream._writableState.errorEmitted = true;
  24389. errorOrDestroy(stream, er);
  24390. } else {
  24391. cb(er);
  24392. stream._writableState.errorEmitted = true;
  24393. errorOrDestroy(stream, er);
  24394. finishMaybe(stream, state);
  24395. }
  24396. }
  24397. function onwriteStateUpdate(state) {
  24398. state.writing = false;
  24399. state.writecb = null;
  24400. state.length -= state.writelen;
  24401. state.writelen = 0;
  24402. }
  24403. function onwrite(stream, er) {
  24404. var state = stream._writableState;
  24405. var sync = state.sync;
  24406. var cb = state.writecb;
  24407. if (typeof cb !== "function")
  24408. throw new ERR_MULTIPLE_CALLBACK();
  24409. onwriteStateUpdate(state);
  24410. if (er)
  24411. onwriteError(stream, state, sync, er, cb);
  24412. else {
  24413. var finished = needFinish(state) || stream.destroyed;
  24414. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  24415. clearBuffer(stream, state);
  24416. }
  24417. if (sync) {
  24418. process.nextTick(afterWrite, stream, state, finished, cb);
  24419. } else {
  24420. afterWrite(stream, state, finished, cb);
  24421. }
  24422. }
  24423. }
  24424. function afterWrite(stream, state, finished, cb) {
  24425. if (!finished)
  24426. onwriteDrain(stream, state);
  24427. state.pendingcb--;
  24428. cb();
  24429. finishMaybe(stream, state);
  24430. }
  24431. function onwriteDrain(stream, state) {
  24432. if (state.length === 0 && state.needDrain) {
  24433. state.needDrain = false;
  24434. stream.emit("drain");
  24435. }
  24436. }
  24437. function clearBuffer(stream, state) {
  24438. state.bufferProcessing = true;
  24439. var entry = state.bufferedRequest;
  24440. if (stream._writev && entry && entry.next) {
  24441. var l = state.bufferedRequestCount;
  24442. var buffer = new Array(l);
  24443. var holder = state.corkedRequestsFree;
  24444. holder.entry = entry;
  24445. var count = 0;
  24446. var allBuffers = true;
  24447. while (entry) {
  24448. buffer[count] = entry;
  24449. if (!entry.isBuf)
  24450. allBuffers = false;
  24451. entry = entry.next;
  24452. count += 1;
  24453. }
  24454. buffer.allBuffers = allBuffers;
  24455. doWrite(stream, state, true, state.length, buffer, "", holder.finish);
  24456. state.pendingcb++;
  24457. state.lastBufferedRequest = null;
  24458. if (holder.next) {
  24459. state.corkedRequestsFree = holder.next;
  24460. holder.next = null;
  24461. } else {
  24462. state.corkedRequestsFree = new CorkedRequest(state);
  24463. }
  24464. state.bufferedRequestCount = 0;
  24465. } else {
  24466. while (entry) {
  24467. var chunk = entry.chunk;
  24468. var encoding = entry.encoding;
  24469. var cb = entry.callback;
  24470. var len = state.objectMode ? 1 : chunk.length;
  24471. doWrite(stream, state, false, len, chunk, encoding, cb);
  24472. entry = entry.next;
  24473. state.bufferedRequestCount--;
  24474. if (state.writing) {
  24475. break;
  24476. }
  24477. }
  24478. if (entry === null)
  24479. state.lastBufferedRequest = null;
  24480. }
  24481. state.bufferedRequest = entry;
  24482. state.bufferProcessing = false;
  24483. }
  24484. Writable.prototype._write = function(chunk, encoding, cb) {
  24485. cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
  24486. };
  24487. Writable.prototype._writev = null;
  24488. Writable.prototype.end = function(chunk, encoding, cb) {
  24489. var state = this._writableState;
  24490. if (typeof chunk === "function") {
  24491. cb = chunk;
  24492. chunk = null;
  24493. encoding = null;
  24494. } else if (typeof encoding === "function") {
  24495. cb = encoding;
  24496. encoding = null;
  24497. }
  24498. if (chunk !== null && chunk !== void 0)
  24499. this.write(chunk, encoding);
  24500. if (state.corked) {
  24501. state.corked = 1;
  24502. this.uncork();
  24503. }
  24504. if (!state.ending)
  24505. endWritable(this, state, cb);
  24506. return this;
  24507. };
  24508. Object.defineProperty(Writable.prototype, "writableLength", {
  24509. // making it explicit this property is not enumerable
  24510. // because otherwise some prototype manipulation in
  24511. // userland will fail
  24512. enumerable: false,
  24513. get: function get() {
  24514. return this._writableState.length;
  24515. }
  24516. });
  24517. function needFinish(state) {
  24518. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  24519. }
  24520. function callFinal(stream, state) {
  24521. stream._final(function(err) {
  24522. state.pendingcb--;
  24523. if (err) {
  24524. errorOrDestroy(stream, err);
  24525. }
  24526. state.prefinished = true;
  24527. stream.emit("prefinish");
  24528. finishMaybe(stream, state);
  24529. });
  24530. }
  24531. function prefinish(stream, state) {
  24532. if (!state.prefinished && !state.finalCalled) {
  24533. if (typeof stream._final === "function" && !state.destroyed) {
  24534. state.pendingcb++;
  24535. state.finalCalled = true;
  24536. process.nextTick(callFinal, stream, state);
  24537. } else {
  24538. state.prefinished = true;
  24539. stream.emit("prefinish");
  24540. }
  24541. }
  24542. }
  24543. function finishMaybe(stream, state) {
  24544. var need = needFinish(state);
  24545. if (need) {
  24546. prefinish(stream, state);
  24547. if (state.pendingcb === 0) {
  24548. state.finished = true;
  24549. stream.emit("finish");
  24550. if (state.autoDestroy) {
  24551. var rState = stream._readableState;
  24552. if (!rState || rState.autoDestroy && rState.endEmitted) {
  24553. stream.destroy();
  24554. }
  24555. }
  24556. }
  24557. }
  24558. return need;
  24559. }
  24560. function endWritable(stream, state, cb) {
  24561. state.ending = true;
  24562. finishMaybe(stream, state);
  24563. if (cb) {
  24564. if (state.finished)
  24565. process.nextTick(cb);
  24566. else
  24567. stream.once("finish", cb);
  24568. }
  24569. state.ended = true;
  24570. stream.writable = false;
  24571. }
  24572. function onCorkedFinish(corkReq, state, err) {
  24573. var entry = corkReq.entry;
  24574. corkReq.entry = null;
  24575. while (entry) {
  24576. var cb = entry.callback;
  24577. state.pendingcb--;
  24578. cb(err);
  24579. entry = entry.next;
  24580. }
  24581. state.corkedRequestsFree.next = corkReq;
  24582. }
  24583. Object.defineProperty(Writable.prototype, "destroyed", {
  24584. // making it explicit this property is not enumerable
  24585. // because otherwise some prototype manipulation in
  24586. // userland will fail
  24587. enumerable: false,
  24588. get: function get() {
  24589. if (this._writableState === void 0) {
  24590. return false;
  24591. }
  24592. return this._writableState.destroyed;
  24593. },
  24594. set: function set(value) {
  24595. if (!this._writableState) {
  24596. return;
  24597. }
  24598. this._writableState.destroyed = value;
  24599. }
  24600. });
  24601. Writable.prototype.destroy = destroyImpl.destroy;
  24602. Writable.prototype._undestroy = destroyImpl.undestroy;
  24603. Writable.prototype._destroy = function(err, cb) {
  24604. cb(err);
  24605. };
  24606. }).call(this);
  24607. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  24608. }, { "../errors": 399, "./_stream_duplex": 400, "./internal/streams/destroy": 407, "./internal/streams/state": 411, "./internal/streams/stream": 412, "_process": 467, "buffer": 90, "inherits": 364, "util-deprecate": 416 }], 405: [function(require2, module3, exports3) {
  24609. (function(process) {
  24610. (function() {
  24611. "use strict";
  24612. var _Object$setPrototypeO;
  24613. function _defineProperty(obj, key, value) {
  24614. key = _toPropertyKey(key);
  24615. if (key in obj) {
  24616. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  24617. } else {
  24618. obj[key] = value;
  24619. }
  24620. return obj;
  24621. }
  24622. function _toPropertyKey(arg) {
  24623. var key = _toPrimitive(arg, "string");
  24624. return typeof key === "symbol" ? key : String(key);
  24625. }
  24626. function _toPrimitive(input, hint) {
  24627. if (typeof input !== "object" || input === null)
  24628. return input;
  24629. var prim = input[Symbol.toPrimitive];
  24630. if (prim !== void 0) {
  24631. var res = prim.call(input, hint || "default");
  24632. if (typeof res !== "object")
  24633. return res;
  24634. throw new TypeError("@@toPrimitive must return a primitive value.");
  24635. }
  24636. return (hint === "string" ? String : Number)(input);
  24637. }
  24638. var finished = require2("./end-of-stream");
  24639. var kLastResolve = Symbol("lastResolve");
  24640. var kLastReject = Symbol("lastReject");
  24641. var kError = Symbol("error");
  24642. var kEnded = Symbol("ended");
  24643. var kLastPromise = Symbol("lastPromise");
  24644. var kHandlePromise = Symbol("handlePromise");
  24645. var kStream = Symbol("stream");
  24646. function createIterResult(value, done) {
  24647. return {
  24648. value,
  24649. done
  24650. };
  24651. }
  24652. function readAndResolve(iter) {
  24653. var resolve = iter[kLastResolve];
  24654. if (resolve !== null) {
  24655. var data = iter[kStream].read();
  24656. if (data !== null) {
  24657. iter[kLastPromise] = null;
  24658. iter[kLastResolve] = null;
  24659. iter[kLastReject] = null;
  24660. resolve(createIterResult(data, false));
  24661. }
  24662. }
  24663. }
  24664. function onReadable(iter) {
  24665. process.nextTick(readAndResolve, iter);
  24666. }
  24667. function wrapForNext(lastPromise, iter) {
  24668. return function(resolve, reject) {
  24669. lastPromise.then(function() {
  24670. if (iter[kEnded]) {
  24671. resolve(createIterResult(void 0, true));
  24672. return;
  24673. }
  24674. iter[kHandlePromise](resolve, reject);
  24675. }, reject);
  24676. };
  24677. }
  24678. var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
  24679. });
  24680. var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
  24681. get stream() {
  24682. return this[kStream];
  24683. },
  24684. next: function next() {
  24685. var _this = this;
  24686. var error = this[kError];
  24687. if (error !== null) {
  24688. return Promise.reject(error);
  24689. }
  24690. if (this[kEnded]) {
  24691. return Promise.resolve(createIterResult(void 0, true));
  24692. }
  24693. if (this[kStream].destroyed) {
  24694. return new Promise(function(resolve, reject) {
  24695. process.nextTick(function() {
  24696. if (_this[kError]) {
  24697. reject(_this[kError]);
  24698. } else {
  24699. resolve(createIterResult(void 0, true));
  24700. }
  24701. });
  24702. });
  24703. }
  24704. var lastPromise = this[kLastPromise];
  24705. var promise;
  24706. if (lastPromise) {
  24707. promise = new Promise(wrapForNext(lastPromise, this));
  24708. } else {
  24709. var data = this[kStream].read();
  24710. if (data !== null) {
  24711. return Promise.resolve(createIterResult(data, false));
  24712. }
  24713. promise = new Promise(this[kHandlePromise]);
  24714. }
  24715. this[kLastPromise] = promise;
  24716. return promise;
  24717. }
  24718. }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
  24719. return this;
  24720. }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
  24721. var _this2 = this;
  24722. return new Promise(function(resolve, reject) {
  24723. _this2[kStream].destroy(null, function(err) {
  24724. if (err) {
  24725. reject(err);
  24726. return;
  24727. }
  24728. resolve(createIterResult(void 0, true));
  24729. });
  24730. });
  24731. }), _Object$setPrototypeO), AsyncIteratorPrototype);
  24732. var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
  24733. var _Object$create;
  24734. var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
  24735. value: stream,
  24736. writable: true
  24737. }), _defineProperty(_Object$create, kLastResolve, {
  24738. value: null,
  24739. writable: true
  24740. }), _defineProperty(_Object$create, kLastReject, {
  24741. value: null,
  24742. writable: true
  24743. }), _defineProperty(_Object$create, kError, {
  24744. value: null,
  24745. writable: true
  24746. }), _defineProperty(_Object$create, kEnded, {
  24747. value: stream._readableState.endEmitted,
  24748. writable: true
  24749. }), _defineProperty(_Object$create, kHandlePromise, {
  24750. value: function value(resolve, reject) {
  24751. var data = iterator[kStream].read();
  24752. if (data) {
  24753. iterator[kLastPromise] = null;
  24754. iterator[kLastResolve] = null;
  24755. iterator[kLastReject] = null;
  24756. resolve(createIterResult(data, false));
  24757. } else {
  24758. iterator[kLastResolve] = resolve;
  24759. iterator[kLastReject] = reject;
  24760. }
  24761. },
  24762. writable: true
  24763. }), _Object$create));
  24764. iterator[kLastPromise] = null;
  24765. finished(stream, function(err) {
  24766. if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
  24767. var reject = iterator[kLastReject];
  24768. if (reject !== null) {
  24769. iterator[kLastPromise] = null;
  24770. iterator[kLastResolve] = null;
  24771. iterator[kLastReject] = null;
  24772. reject(err);
  24773. }
  24774. iterator[kError] = err;
  24775. return;
  24776. }
  24777. var resolve = iterator[kLastResolve];
  24778. if (resolve !== null) {
  24779. iterator[kLastPromise] = null;
  24780. iterator[kLastResolve] = null;
  24781. iterator[kLastReject] = null;
  24782. resolve(createIterResult(void 0, true));
  24783. }
  24784. iterator[kEnded] = true;
  24785. });
  24786. stream.on("readable", onReadable.bind(null, iterator));
  24787. return iterator;
  24788. };
  24789. module3.exports = createReadableStreamAsyncIterator;
  24790. }).call(this);
  24791. }).call(this, require2("_process"));
  24792. }, { "./end-of-stream": 408, "_process": 467 }], 406: [function(require2, module3, exports3) {
  24793. "use strict";
  24794. function ownKeys(object, enumerableOnly) {
  24795. var keys = Object.keys(object);
  24796. if (Object.getOwnPropertySymbols) {
  24797. var symbols = Object.getOwnPropertySymbols(object);
  24798. enumerableOnly && (symbols = symbols.filter(function(sym) {
  24799. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  24800. })), keys.push.apply(keys, symbols);
  24801. }
  24802. return keys;
  24803. }
  24804. function _objectSpread(target) {
  24805. for (var i = 1; i < arguments.length; i++) {
  24806. var source = null != arguments[i] ? arguments[i] : {};
  24807. i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
  24808. _defineProperty(target, key, source[key]);
  24809. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
  24810. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  24811. });
  24812. }
  24813. return target;
  24814. }
  24815. function _defineProperty(obj, key, value) {
  24816. key = _toPropertyKey(key);
  24817. if (key in obj) {
  24818. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  24819. } else {
  24820. obj[key] = value;
  24821. }
  24822. return obj;
  24823. }
  24824. function _classCallCheck(instance, Constructor) {
  24825. if (!(instance instanceof Constructor)) {
  24826. throw new TypeError("Cannot call a class as a function");
  24827. }
  24828. }
  24829. function _defineProperties(target, props) {
  24830. for (var i = 0; i < props.length; i++) {
  24831. var descriptor = props[i];
  24832. descriptor.enumerable = descriptor.enumerable || false;
  24833. descriptor.configurable = true;
  24834. if ("value" in descriptor)
  24835. descriptor.writable = true;
  24836. Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
  24837. }
  24838. }
  24839. function _createClass(Constructor, protoProps, staticProps) {
  24840. if (protoProps)
  24841. _defineProperties(Constructor.prototype, protoProps);
  24842. if (staticProps)
  24843. _defineProperties(Constructor, staticProps);
  24844. Object.defineProperty(Constructor, "prototype", { writable: false });
  24845. return Constructor;
  24846. }
  24847. function _toPropertyKey(arg) {
  24848. var key = _toPrimitive(arg, "string");
  24849. return typeof key === "symbol" ? key : String(key);
  24850. }
  24851. function _toPrimitive(input, hint) {
  24852. if (typeof input !== "object" || input === null)
  24853. return input;
  24854. var prim = input[Symbol.toPrimitive];
  24855. if (prim !== void 0) {
  24856. var res = prim.call(input, hint || "default");
  24857. if (typeof res !== "object")
  24858. return res;
  24859. throw new TypeError("@@toPrimitive must return a primitive value.");
  24860. }
  24861. return (hint === "string" ? String : Number)(input);
  24862. }
  24863. var _require = require2("buffer"), Buffer = _require.Buffer;
  24864. var _require2 = require2("util"), inspect = _require2.inspect;
  24865. var custom = inspect && inspect.custom || "inspect";
  24866. function copyBuffer(src, target, offset) {
  24867. Buffer.prototype.copy.call(src, target, offset);
  24868. }
  24869. module3.exports = function() {
  24870. function BufferList() {
  24871. _classCallCheck(this, BufferList);
  24872. this.head = null;
  24873. this.tail = null;
  24874. this.length = 0;
  24875. }
  24876. _createClass(BufferList, [{
  24877. key: "push",
  24878. value: function push(v) {
  24879. var entry = {
  24880. data: v,
  24881. next: null
  24882. };
  24883. if (this.length > 0)
  24884. this.tail.next = entry;
  24885. else
  24886. this.head = entry;
  24887. this.tail = entry;
  24888. ++this.length;
  24889. }
  24890. }, {
  24891. key: "unshift",
  24892. value: function unshift(v) {
  24893. var entry = {
  24894. data: v,
  24895. next: this.head
  24896. };
  24897. if (this.length === 0)
  24898. this.tail = entry;
  24899. this.head = entry;
  24900. ++this.length;
  24901. }
  24902. }, {
  24903. key: "shift",
  24904. value: function shift() {
  24905. if (this.length === 0)
  24906. return;
  24907. var ret = this.head.data;
  24908. if (this.length === 1)
  24909. this.head = this.tail = null;
  24910. else
  24911. this.head = this.head.next;
  24912. --this.length;
  24913. return ret;
  24914. }
  24915. }, {
  24916. key: "clear",
  24917. value: function clear() {
  24918. this.head = this.tail = null;
  24919. this.length = 0;
  24920. }
  24921. }, {
  24922. key: "join",
  24923. value: function join(s) {
  24924. if (this.length === 0)
  24925. return "";
  24926. var p = this.head;
  24927. var ret = "" + p.data;
  24928. while (p = p.next)
  24929. ret += s + p.data;
  24930. return ret;
  24931. }
  24932. }, {
  24933. key: "concat",
  24934. value: function concat(n) {
  24935. if (this.length === 0)
  24936. return Buffer.alloc(0);
  24937. var ret = Buffer.allocUnsafe(n >>> 0);
  24938. var p = this.head;
  24939. var i = 0;
  24940. while (p) {
  24941. copyBuffer(p.data, ret, i);
  24942. i += p.data.length;
  24943. p = p.next;
  24944. }
  24945. return ret;
  24946. }
  24947. // Consumes a specified amount of bytes or characters from the buffered data.
  24948. }, {
  24949. key: "consume",
  24950. value: function consume(n, hasStrings) {
  24951. var ret;
  24952. if (n < this.head.data.length) {
  24953. ret = this.head.data.slice(0, n);
  24954. this.head.data = this.head.data.slice(n);
  24955. } else if (n === this.head.data.length) {
  24956. ret = this.shift();
  24957. } else {
  24958. ret = hasStrings ? this._getString(n) : this._getBuffer(n);
  24959. }
  24960. return ret;
  24961. }
  24962. }, {
  24963. key: "first",
  24964. value: function first() {
  24965. return this.head.data;
  24966. }
  24967. // Consumes a specified amount of characters from the buffered data.
  24968. }, {
  24969. key: "_getString",
  24970. value: function _getString(n) {
  24971. var p = this.head;
  24972. var c = 1;
  24973. var ret = p.data;
  24974. n -= ret.length;
  24975. while (p = p.next) {
  24976. var str = p.data;
  24977. var nb = n > str.length ? str.length : n;
  24978. if (nb === str.length)
  24979. ret += str;
  24980. else
  24981. ret += str.slice(0, n);
  24982. n -= nb;
  24983. if (n === 0) {
  24984. if (nb === str.length) {
  24985. ++c;
  24986. if (p.next)
  24987. this.head = p.next;
  24988. else
  24989. this.head = this.tail = null;
  24990. } else {
  24991. this.head = p;
  24992. p.data = str.slice(nb);
  24993. }
  24994. break;
  24995. }
  24996. ++c;
  24997. }
  24998. this.length -= c;
  24999. return ret;
  25000. }
  25001. // Consumes a specified amount of bytes from the buffered data.
  25002. }, {
  25003. key: "_getBuffer",
  25004. value: function _getBuffer(n) {
  25005. var ret = Buffer.allocUnsafe(n);
  25006. var p = this.head;
  25007. var c = 1;
  25008. p.data.copy(ret);
  25009. n -= p.data.length;
  25010. while (p = p.next) {
  25011. var buf = p.data;
  25012. var nb = n > buf.length ? buf.length : n;
  25013. buf.copy(ret, ret.length - n, 0, nb);
  25014. n -= nb;
  25015. if (n === 0) {
  25016. if (nb === buf.length) {
  25017. ++c;
  25018. if (p.next)
  25019. this.head = p.next;
  25020. else
  25021. this.head = this.tail = null;
  25022. } else {
  25023. this.head = p;
  25024. p.data = buf.slice(nb);
  25025. }
  25026. break;
  25027. }
  25028. ++c;
  25029. }
  25030. this.length -= c;
  25031. return ret;
  25032. }
  25033. // Make sure the linked list only shows the minimal necessary information.
  25034. }, {
  25035. key: custom,
  25036. value: function value(_, options) {
  25037. return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
  25038. // Only inspect one level.
  25039. depth: 0,
  25040. // It should not recurse.
  25041. customInspect: false
  25042. }));
  25043. }
  25044. }]);
  25045. return BufferList;
  25046. }();
  25047. }, { "buffer": 90, "util": 89 }], 407: [function(require2, module3, exports3) {
  25048. (function(process) {
  25049. (function() {
  25050. "use strict";
  25051. function destroy(err, cb) {
  25052. var _this = this;
  25053. var readableDestroyed = this._readableState && this._readableState.destroyed;
  25054. var writableDestroyed = this._writableState && this._writableState.destroyed;
  25055. if (readableDestroyed || writableDestroyed) {
  25056. if (cb) {
  25057. cb(err);
  25058. } else if (err) {
  25059. if (!this._writableState) {
  25060. process.nextTick(emitErrorNT, this, err);
  25061. } else if (!this._writableState.errorEmitted) {
  25062. this._writableState.errorEmitted = true;
  25063. process.nextTick(emitErrorNT, this, err);
  25064. }
  25065. }
  25066. return this;
  25067. }
  25068. if (this._readableState) {
  25069. this._readableState.destroyed = true;
  25070. }
  25071. if (this._writableState) {
  25072. this._writableState.destroyed = true;
  25073. }
  25074. this._destroy(err || null, function(err2) {
  25075. if (!cb && err2) {
  25076. if (!_this._writableState) {
  25077. process.nextTick(emitErrorAndCloseNT, _this, err2);
  25078. } else if (!_this._writableState.errorEmitted) {
  25079. _this._writableState.errorEmitted = true;
  25080. process.nextTick(emitErrorAndCloseNT, _this, err2);
  25081. } else {
  25082. process.nextTick(emitCloseNT, _this);
  25083. }
  25084. } else if (cb) {
  25085. process.nextTick(emitCloseNT, _this);
  25086. cb(err2);
  25087. } else {
  25088. process.nextTick(emitCloseNT, _this);
  25089. }
  25090. });
  25091. return this;
  25092. }
  25093. function emitErrorAndCloseNT(self2, err) {
  25094. emitErrorNT(self2, err);
  25095. emitCloseNT(self2);
  25096. }
  25097. function emitCloseNT(self2) {
  25098. if (self2._writableState && !self2._writableState.emitClose)
  25099. return;
  25100. if (self2._readableState && !self2._readableState.emitClose)
  25101. return;
  25102. self2.emit("close");
  25103. }
  25104. function undestroy() {
  25105. if (this._readableState) {
  25106. this._readableState.destroyed = false;
  25107. this._readableState.reading = false;
  25108. this._readableState.ended = false;
  25109. this._readableState.endEmitted = false;
  25110. }
  25111. if (this._writableState) {
  25112. this._writableState.destroyed = false;
  25113. this._writableState.ended = false;
  25114. this._writableState.ending = false;
  25115. this._writableState.finalCalled = false;
  25116. this._writableState.prefinished = false;
  25117. this._writableState.finished = false;
  25118. this._writableState.errorEmitted = false;
  25119. }
  25120. }
  25121. function emitErrorNT(self2, err) {
  25122. self2.emit("error", err);
  25123. }
  25124. function errorOrDestroy(stream, err) {
  25125. var rState = stream._readableState;
  25126. var wState = stream._writableState;
  25127. if (rState && rState.autoDestroy || wState && wState.autoDestroy)
  25128. stream.destroy(err);
  25129. else
  25130. stream.emit("error", err);
  25131. }
  25132. module3.exports = {
  25133. destroy,
  25134. undestroy,
  25135. errorOrDestroy
  25136. };
  25137. }).call(this);
  25138. }).call(this, require2("_process"));
  25139. }, { "_process": 467 }], 408: [function(require2, module3, exports3) {
  25140. "use strict";
  25141. var ERR_STREAM_PREMATURE_CLOSE = require2("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;
  25142. function once(callback) {
  25143. var called = false;
  25144. return function() {
  25145. if (called)
  25146. return;
  25147. called = true;
  25148. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  25149. args[_key] = arguments[_key];
  25150. }
  25151. callback.apply(this, args);
  25152. };
  25153. }
  25154. function noop() {
  25155. }
  25156. function isRequest(stream) {
  25157. return stream.setHeader && typeof stream.abort === "function";
  25158. }
  25159. function eos(stream, opts, callback) {
  25160. if (typeof opts === "function")
  25161. return eos(stream, null, opts);
  25162. if (!opts)
  25163. opts = {};
  25164. callback = once(callback || noop);
  25165. var readable = opts.readable || opts.readable !== false && stream.readable;
  25166. var writable = opts.writable || opts.writable !== false && stream.writable;
  25167. var onlegacyfinish = function onlegacyfinish2() {
  25168. if (!stream.writable)
  25169. onfinish();
  25170. };
  25171. var writableEnded = stream._writableState && stream._writableState.finished;
  25172. var onfinish = function onfinish2() {
  25173. writable = false;
  25174. writableEnded = true;
  25175. if (!readable)
  25176. callback.call(stream);
  25177. };
  25178. var readableEnded = stream._readableState && stream._readableState.endEmitted;
  25179. var onend = function onend2() {
  25180. readable = false;
  25181. readableEnded = true;
  25182. if (!writable)
  25183. callback.call(stream);
  25184. };
  25185. var onerror = function onerror2(err) {
  25186. callback.call(stream, err);
  25187. };
  25188. var onclose = function onclose2() {
  25189. var err;
  25190. if (readable && !readableEnded) {
  25191. if (!stream._readableState || !stream._readableState.ended)
  25192. err = new ERR_STREAM_PREMATURE_CLOSE();
  25193. return callback.call(stream, err);
  25194. }
  25195. if (writable && !writableEnded) {
  25196. if (!stream._writableState || !stream._writableState.ended)
  25197. err = new ERR_STREAM_PREMATURE_CLOSE();
  25198. return callback.call(stream, err);
  25199. }
  25200. };
  25201. var onrequest = function onrequest2() {
  25202. stream.req.on("finish", onfinish);
  25203. };
  25204. if (isRequest(stream)) {
  25205. stream.on("complete", onfinish);
  25206. stream.on("abort", onclose);
  25207. if (stream.req)
  25208. onrequest();
  25209. else
  25210. stream.on("request", onrequest);
  25211. } else if (writable && !stream._writableState) {
  25212. stream.on("end", onlegacyfinish);
  25213. stream.on("close", onlegacyfinish);
  25214. }
  25215. stream.on("end", onend);
  25216. stream.on("finish", onfinish);
  25217. if (opts.error !== false)
  25218. stream.on("error", onerror);
  25219. stream.on("close", onclose);
  25220. return function() {
  25221. stream.removeListener("complete", onfinish);
  25222. stream.removeListener("abort", onclose);
  25223. stream.removeListener("request", onrequest);
  25224. if (stream.req)
  25225. stream.req.removeListener("finish", onfinish);
  25226. stream.removeListener("end", onlegacyfinish);
  25227. stream.removeListener("close", onlegacyfinish);
  25228. stream.removeListener("finish", onfinish);
  25229. stream.removeListener("end", onend);
  25230. stream.removeListener("error", onerror);
  25231. stream.removeListener("close", onclose);
  25232. };
  25233. }
  25234. module3.exports = eos;
  25235. }, { "../../../errors": 399 }], 409: [function(require2, module3, exports3) {
  25236. module3.exports = function() {
  25237. throw new Error("Readable.from is not available in the browser");
  25238. };
  25239. }, {}], 410: [function(require2, module3, exports3) {
  25240. "use strict";
  25241. var eos;
  25242. function once(callback) {
  25243. var called = false;
  25244. return function() {
  25245. if (called)
  25246. return;
  25247. called = true;
  25248. callback.apply(void 0, arguments);
  25249. };
  25250. }
  25251. var _require$codes = require2("../../../errors").codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
  25252. function noop(err) {
  25253. if (err)
  25254. throw err;
  25255. }
  25256. function isRequest(stream) {
  25257. return stream.setHeader && typeof stream.abort === "function";
  25258. }
  25259. function destroyer(stream, reading, writing, callback) {
  25260. callback = once(callback);
  25261. var closed = false;
  25262. stream.on("close", function() {
  25263. closed = true;
  25264. });
  25265. if (eos === void 0)
  25266. eos = require2("./end-of-stream");
  25267. eos(stream, {
  25268. readable: reading,
  25269. writable: writing
  25270. }, function(err) {
  25271. if (err)
  25272. return callback(err);
  25273. closed = true;
  25274. callback();
  25275. });
  25276. var destroyed = false;
  25277. return function(err) {
  25278. if (closed)
  25279. return;
  25280. if (destroyed)
  25281. return;
  25282. destroyed = true;
  25283. if (isRequest(stream))
  25284. return stream.abort();
  25285. if (typeof stream.destroy === "function")
  25286. return stream.destroy();
  25287. callback(err || new ERR_STREAM_DESTROYED("pipe"));
  25288. };
  25289. }
  25290. function call(fn) {
  25291. fn();
  25292. }
  25293. function pipe(from, to) {
  25294. return from.pipe(to);
  25295. }
  25296. function popCallback(streams) {
  25297. if (!streams.length)
  25298. return noop;
  25299. if (typeof streams[streams.length - 1] !== "function")
  25300. return noop;
  25301. return streams.pop();
  25302. }
  25303. function pipeline() {
  25304. for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
  25305. streams[_key] = arguments[_key];
  25306. }
  25307. var callback = popCallback(streams);
  25308. if (Array.isArray(streams[0]))
  25309. streams = streams[0];
  25310. if (streams.length < 2) {
  25311. throw new ERR_MISSING_ARGS("streams");
  25312. }
  25313. var error;
  25314. var destroys = streams.map(function(stream, i) {
  25315. var reading = i < streams.length - 1;
  25316. var writing = i > 0;
  25317. return destroyer(stream, reading, writing, function(err) {
  25318. if (!error)
  25319. error = err;
  25320. if (err)
  25321. destroys.forEach(call);
  25322. if (reading)
  25323. return;
  25324. destroys.forEach(call);
  25325. callback(error);
  25326. });
  25327. });
  25328. return streams.reduce(pipe);
  25329. }
  25330. module3.exports = pipeline;
  25331. }, { "../../../errors": 399, "./end-of-stream": 408 }], 411: [function(require2, module3, exports3) {
  25332. "use strict";
  25333. var ERR_INVALID_OPT_VALUE = require2("../../../errors").codes.ERR_INVALID_OPT_VALUE;
  25334. function highWaterMarkFrom(options, isDuplex, duplexKey) {
  25335. return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
  25336. }
  25337. function getHighWaterMark(state, options, duplexKey, isDuplex) {
  25338. var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
  25339. if (hwm != null) {
  25340. if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
  25341. var name = isDuplex ? duplexKey : "highWaterMark";
  25342. throw new ERR_INVALID_OPT_VALUE(name, hwm);
  25343. }
  25344. return Math.floor(hwm);
  25345. }
  25346. return state.objectMode ? 16 : 16 * 1024;
  25347. }
  25348. module3.exports = {
  25349. getHighWaterMark
  25350. };
  25351. }, { "../../../errors": 399 }], 412: [function(require2, module3, exports3) {
  25352. arguments[4][393][0].apply(exports3, arguments);
  25353. }, { "dup": 393, "events": 344 }], 413: [function(require2, module3, exports3) {
  25354. "use strict";
  25355. var Buffer = require2("safe-buffer").Buffer;
  25356. var isEncoding = Buffer.isEncoding || function(encoding) {
  25357. encoding = "" + encoding;
  25358. switch (encoding && encoding.toLowerCase()) {
  25359. case "hex":
  25360. case "utf8":
  25361. case "utf-8":
  25362. case "ascii":
  25363. case "binary":
  25364. case "base64":
  25365. case "ucs2":
  25366. case "ucs-2":
  25367. case "utf16le":
  25368. case "utf-16le":
  25369. case "raw":
  25370. return true;
  25371. default:
  25372. return false;
  25373. }
  25374. };
  25375. function _normalizeEncoding(enc) {
  25376. if (!enc)
  25377. return "utf8";
  25378. var retried;
  25379. while (true) {
  25380. switch (enc) {
  25381. case "utf8":
  25382. case "utf-8":
  25383. return "utf8";
  25384. case "ucs2":
  25385. case "ucs-2":
  25386. case "utf16le":
  25387. case "utf-16le":
  25388. return "utf16le";
  25389. case "latin1":
  25390. case "binary":
  25391. return "latin1";
  25392. case "base64":
  25393. case "ascii":
  25394. case "hex":
  25395. return enc;
  25396. default:
  25397. if (retried)
  25398. return;
  25399. enc = ("" + enc).toLowerCase();
  25400. retried = true;
  25401. }
  25402. }
  25403. }
  25404. ;
  25405. function normalizeEncoding(enc) {
  25406. var nenc = _normalizeEncoding(enc);
  25407. if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc)))
  25408. throw new Error("Unknown encoding: " + enc);
  25409. return nenc || enc;
  25410. }
  25411. exports3.StringDecoder = StringDecoder;
  25412. function StringDecoder(encoding) {
  25413. this.encoding = normalizeEncoding(encoding);
  25414. var nb;
  25415. switch (this.encoding) {
  25416. case "utf16le":
  25417. this.text = utf16Text;
  25418. this.end = utf16End;
  25419. nb = 4;
  25420. break;
  25421. case "utf8":
  25422. this.fillLast = utf8FillLast;
  25423. nb = 4;
  25424. break;
  25425. case "base64":
  25426. this.text = base64Text;
  25427. this.end = base64End;
  25428. nb = 3;
  25429. break;
  25430. default:
  25431. this.write = simpleWrite;
  25432. this.end = simpleEnd;
  25433. return;
  25434. }
  25435. this.lastNeed = 0;
  25436. this.lastTotal = 0;
  25437. this.lastChar = Buffer.allocUnsafe(nb);
  25438. }
  25439. StringDecoder.prototype.write = function(buf) {
  25440. if (buf.length === 0)
  25441. return "";
  25442. var r;
  25443. var i;
  25444. if (this.lastNeed) {
  25445. r = this.fillLast(buf);
  25446. if (r === void 0)
  25447. return "";
  25448. i = this.lastNeed;
  25449. this.lastNeed = 0;
  25450. } else {
  25451. i = 0;
  25452. }
  25453. if (i < buf.length)
  25454. return r ? r + this.text(buf, i) : this.text(buf, i);
  25455. return r || "";
  25456. };
  25457. StringDecoder.prototype.end = utf8End;
  25458. StringDecoder.prototype.text = utf8Text;
  25459. StringDecoder.prototype.fillLast = function(buf) {
  25460. if (this.lastNeed <= buf.length) {
  25461. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  25462. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  25463. }
  25464. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  25465. this.lastNeed -= buf.length;
  25466. };
  25467. function utf8CheckByte(byte) {
  25468. if (byte <= 127)
  25469. return 0;
  25470. else if (byte >> 5 === 6)
  25471. return 2;
  25472. else if (byte >> 4 === 14)
  25473. return 3;
  25474. else if (byte >> 3 === 30)
  25475. return 4;
  25476. return byte >> 6 === 2 ? -1 : -2;
  25477. }
  25478. function utf8CheckIncomplete(self2, buf, i) {
  25479. var j = buf.length - 1;
  25480. if (j < i)
  25481. return 0;
  25482. var nb = utf8CheckByte(buf[j]);
  25483. if (nb >= 0) {
  25484. if (nb > 0)
  25485. self2.lastNeed = nb - 1;
  25486. return nb;
  25487. }
  25488. if (--j < i || nb === -2)
  25489. return 0;
  25490. nb = utf8CheckByte(buf[j]);
  25491. if (nb >= 0) {
  25492. if (nb > 0)
  25493. self2.lastNeed = nb - 2;
  25494. return nb;
  25495. }
  25496. if (--j < i || nb === -2)
  25497. return 0;
  25498. nb = utf8CheckByte(buf[j]);
  25499. if (nb >= 0) {
  25500. if (nb > 0) {
  25501. if (nb === 2)
  25502. nb = 0;
  25503. else
  25504. self2.lastNeed = nb - 3;
  25505. }
  25506. return nb;
  25507. }
  25508. return 0;
  25509. }
  25510. function utf8CheckExtraBytes(self2, buf, p) {
  25511. if ((buf[0] & 192) !== 128) {
  25512. self2.lastNeed = 0;
  25513. return "�";
  25514. }
  25515. if (self2.lastNeed > 1 && buf.length > 1) {
  25516. if ((buf[1] & 192) !== 128) {
  25517. self2.lastNeed = 1;
  25518. return "�";
  25519. }
  25520. if (self2.lastNeed > 2 && buf.length > 2) {
  25521. if ((buf[2] & 192) !== 128) {
  25522. self2.lastNeed = 2;
  25523. return "�";
  25524. }
  25525. }
  25526. }
  25527. }
  25528. function utf8FillLast(buf) {
  25529. var p = this.lastTotal - this.lastNeed;
  25530. var r = utf8CheckExtraBytes(this, buf, p);
  25531. if (r !== void 0)
  25532. return r;
  25533. if (this.lastNeed <= buf.length) {
  25534. buf.copy(this.lastChar, p, 0, this.lastNeed);
  25535. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  25536. }
  25537. buf.copy(this.lastChar, p, 0, buf.length);
  25538. this.lastNeed -= buf.length;
  25539. }
  25540. function utf8Text(buf, i) {
  25541. var total = utf8CheckIncomplete(this, buf, i);
  25542. if (!this.lastNeed)
  25543. return buf.toString("utf8", i);
  25544. this.lastTotal = total;
  25545. var end = buf.length - (total - this.lastNeed);
  25546. buf.copy(this.lastChar, 0, end);
  25547. return buf.toString("utf8", i, end);
  25548. }
  25549. function utf8End(buf) {
  25550. var r = buf && buf.length ? this.write(buf) : "";
  25551. if (this.lastNeed)
  25552. return r + "�";
  25553. return r;
  25554. }
  25555. function utf16Text(buf, i) {
  25556. if ((buf.length - i) % 2 === 0) {
  25557. var r = buf.toString("utf16le", i);
  25558. if (r) {
  25559. var c = r.charCodeAt(r.length - 1);
  25560. if (c >= 55296 && c <= 56319) {
  25561. this.lastNeed = 2;
  25562. this.lastTotal = 4;
  25563. this.lastChar[0] = buf[buf.length - 2];
  25564. this.lastChar[1] = buf[buf.length - 1];
  25565. return r.slice(0, -1);
  25566. }
  25567. }
  25568. return r;
  25569. }
  25570. this.lastNeed = 1;
  25571. this.lastTotal = 2;
  25572. this.lastChar[0] = buf[buf.length - 1];
  25573. return buf.toString("utf16le", i, buf.length - 1);
  25574. }
  25575. function utf16End(buf) {
  25576. var r = buf && buf.length ? this.write(buf) : "";
  25577. if (this.lastNeed) {
  25578. var end = this.lastTotal - this.lastNeed;
  25579. return r + this.lastChar.toString("utf16le", 0, end);
  25580. }
  25581. return r;
  25582. }
  25583. function base64Text(buf, i) {
  25584. var n = (buf.length - i) % 3;
  25585. if (n === 0)
  25586. return buf.toString("base64", i);
  25587. this.lastNeed = 3 - n;
  25588. this.lastTotal = 3;
  25589. if (n === 1) {
  25590. this.lastChar[0] = buf[buf.length - 1];
  25591. } else {
  25592. this.lastChar[0] = buf[buf.length - 2];
  25593. this.lastChar[1] = buf[buf.length - 1];
  25594. }
  25595. return buf.toString("base64", i, buf.length - n);
  25596. }
  25597. function base64End(buf) {
  25598. var r = buf && buf.length ? this.write(buf) : "";
  25599. if (this.lastNeed)
  25600. return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
  25601. return r;
  25602. }
  25603. function simpleWrite(buf) {
  25604. return buf.toString(this.encoding);
  25605. }
  25606. function simpleEnd(buf) {
  25607. return buf && buf.length ? this.write(buf) : "";
  25608. }
  25609. }, { "safe-buffer": 396 }], 414: [function(require2, module3, exports3) {
  25610. (function(setImmediate, clearImmediate) {
  25611. (function() {
  25612. var nextTick = require2("process/browser.js").nextTick;
  25613. var apply = Function.prototype.apply;
  25614. var slice = Array.prototype.slice;
  25615. var immediateIds = {};
  25616. var nextImmediateId = 0;
  25617. exports3.setTimeout = function() {
  25618. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  25619. };
  25620. exports3.setInterval = function() {
  25621. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  25622. };
  25623. exports3.clearTimeout = exports3.clearInterval = function(timeout) {
  25624. timeout.close();
  25625. };
  25626. function Timeout(id, clearFn) {
  25627. this._id = id;
  25628. this._clearFn = clearFn;
  25629. }
  25630. Timeout.prototype.unref = Timeout.prototype.ref = function() {
  25631. };
  25632. Timeout.prototype.close = function() {
  25633. this._clearFn.call(window, this._id);
  25634. };
  25635. exports3.enroll = function(item, msecs) {
  25636. clearTimeout(item._idleTimeoutId);
  25637. item._idleTimeout = msecs;
  25638. };
  25639. exports3.unenroll = function(item) {
  25640. clearTimeout(item._idleTimeoutId);
  25641. item._idleTimeout = -1;
  25642. };
  25643. exports3._unrefActive = exports3.active = function(item) {
  25644. clearTimeout(item._idleTimeoutId);
  25645. var msecs = item._idleTimeout;
  25646. if (msecs >= 0) {
  25647. item._idleTimeoutId = setTimeout(function onTimeout() {
  25648. if (item._onTimeout)
  25649. item._onTimeout();
  25650. }, msecs);
  25651. }
  25652. };
  25653. exports3.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
  25654. var id = nextImmediateId++;
  25655. var args = arguments.length < 2 ? false : slice.call(arguments, 1);
  25656. immediateIds[id] = true;
  25657. nextTick(function onNextTick() {
  25658. if (immediateIds[id]) {
  25659. if (args) {
  25660. fn.apply(null, args);
  25661. } else {
  25662. fn.call(null);
  25663. }
  25664. exports3.clearImmediate(id);
  25665. }
  25666. });
  25667. return id;
  25668. };
  25669. exports3.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
  25670. delete immediateIds[id];
  25671. };
  25672. }).call(this);
  25673. }).call(this, require2("timers").setImmediate, require2("timers").clearImmediate);
  25674. }, { "process/browser.js": 381, "timers": 414 }], 415: [function(require2, module3, exports3) {
  25675. var Buffer = require2("buffer").Buffer;
  25676. module3.exports = function(buf) {
  25677. if (buf instanceof Uint8Array) {
  25678. if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
  25679. return buf.buffer;
  25680. } else if (typeof buf.buffer.slice === "function") {
  25681. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  25682. }
  25683. }
  25684. if (Buffer.isBuffer(buf)) {
  25685. var arrayCopy = new Uint8Array(buf.length);
  25686. var len = buf.length;
  25687. for (var i = 0; i < len; i++) {
  25688. arrayCopy[i] = buf[i];
  25689. }
  25690. return arrayCopy.buffer;
  25691. } else {
  25692. throw new Error("Argument must be a Buffer");
  25693. }
  25694. };
  25695. }, { "buffer": 90 }], 416: [function(require2, module3, exports3) {
  25696. (function(global2) {
  25697. (function() {
  25698. module3.exports = deprecate;
  25699. function deprecate(fn, msg) {
  25700. if (config("noDeprecation")) {
  25701. return fn;
  25702. }
  25703. var warned = false;
  25704. function deprecated() {
  25705. if (!warned) {
  25706. if (config("throwDeprecation")) {
  25707. throw new Error(msg);
  25708. } else if (config("traceDeprecation")) {
  25709. console.trace(msg);
  25710. } else {
  25711. console.warn(msg);
  25712. }
  25713. warned = true;
  25714. }
  25715. return fn.apply(this, arguments);
  25716. }
  25717. return deprecated;
  25718. }
  25719. function config(name) {
  25720. try {
  25721. if (!global2.localStorage)
  25722. return false;
  25723. } catch (_) {
  25724. return false;
  25725. }
  25726. var val = global2.localStorage[name];
  25727. if (null == val)
  25728. return false;
  25729. return String(val).toLowerCase() === "true";
  25730. }
  25731. }).call(this);
  25732. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  25733. }, {}], 417: [function(require2, module3, exports3) {
  25734. arguments[4][84][0].apply(exports3, arguments);
  25735. }, { "dup": 84 }], 418: [function(require2, module3, exports3) {
  25736. "use strict";
  25737. var isArgumentsObject = require2("is-arguments");
  25738. var isGeneratorFunction = require2("is-generator-function");
  25739. var whichTypedArray = require2("which-typed-array");
  25740. var isTypedArray = require2("is-typed-array");
  25741. function uncurryThis(f) {
  25742. return f.call.bind(f);
  25743. }
  25744. var BigIntSupported = typeof BigInt !== "undefined";
  25745. var SymbolSupported = typeof Symbol !== "undefined";
  25746. var ObjectToString = uncurryThis(Object.prototype.toString);
  25747. var numberValue = uncurryThis(Number.prototype.valueOf);
  25748. var stringValue = uncurryThis(String.prototype.valueOf);
  25749. var booleanValue = uncurryThis(Boolean.prototype.valueOf);
  25750. if (BigIntSupported) {
  25751. var bigIntValue = uncurryThis(BigInt.prototype.valueOf);
  25752. }
  25753. if (SymbolSupported) {
  25754. var symbolValue = uncurryThis(Symbol.prototype.valueOf);
  25755. }
  25756. function checkBoxedPrimitive(value, prototypeValueOf) {
  25757. if (typeof value !== "object") {
  25758. return false;
  25759. }
  25760. try {
  25761. prototypeValueOf(value);
  25762. return true;
  25763. } catch (e) {
  25764. return false;
  25765. }
  25766. }
  25767. exports3.isArgumentsObject = isArgumentsObject;
  25768. exports3.isGeneratorFunction = isGeneratorFunction;
  25769. exports3.isTypedArray = isTypedArray;
  25770. function isPromise(input) {
  25771. return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
  25772. }
  25773. exports3.isPromise = isPromise;
  25774. function isArrayBufferView(value) {
  25775. if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
  25776. return ArrayBuffer.isView(value);
  25777. }
  25778. return isTypedArray(value) || isDataView(value);
  25779. }
  25780. exports3.isArrayBufferView = isArrayBufferView;
  25781. function isUint8Array(value) {
  25782. return whichTypedArray(value) === "Uint8Array";
  25783. }
  25784. exports3.isUint8Array = isUint8Array;
  25785. function isUint8ClampedArray(value) {
  25786. return whichTypedArray(value) === "Uint8ClampedArray";
  25787. }
  25788. exports3.isUint8ClampedArray = isUint8ClampedArray;
  25789. function isUint16Array(value) {
  25790. return whichTypedArray(value) === "Uint16Array";
  25791. }
  25792. exports3.isUint16Array = isUint16Array;
  25793. function isUint32Array(value) {
  25794. return whichTypedArray(value) === "Uint32Array";
  25795. }
  25796. exports3.isUint32Array = isUint32Array;
  25797. function isInt8Array(value) {
  25798. return whichTypedArray(value) === "Int8Array";
  25799. }
  25800. exports3.isInt8Array = isInt8Array;
  25801. function isInt16Array(value) {
  25802. return whichTypedArray(value) === "Int16Array";
  25803. }
  25804. exports3.isInt16Array = isInt16Array;
  25805. function isInt32Array(value) {
  25806. return whichTypedArray(value) === "Int32Array";
  25807. }
  25808. exports3.isInt32Array = isInt32Array;
  25809. function isFloat32Array(value) {
  25810. return whichTypedArray(value) === "Float32Array";
  25811. }
  25812. exports3.isFloat32Array = isFloat32Array;
  25813. function isFloat64Array(value) {
  25814. return whichTypedArray(value) === "Float64Array";
  25815. }
  25816. exports3.isFloat64Array = isFloat64Array;
  25817. function isBigInt64Array(value) {
  25818. return whichTypedArray(value) === "BigInt64Array";
  25819. }
  25820. exports3.isBigInt64Array = isBigInt64Array;
  25821. function isBigUint64Array(value) {
  25822. return whichTypedArray(value) === "BigUint64Array";
  25823. }
  25824. exports3.isBigUint64Array = isBigUint64Array;
  25825. function isMapToString(value) {
  25826. return ObjectToString(value) === "[object Map]";
  25827. }
  25828. isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map());
  25829. function isMap(value) {
  25830. if (typeof Map === "undefined") {
  25831. return false;
  25832. }
  25833. return isMapToString.working ? isMapToString(value) : value instanceof Map;
  25834. }
  25835. exports3.isMap = isMap;
  25836. function isSetToString(value) {
  25837. return ObjectToString(value) === "[object Set]";
  25838. }
  25839. isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set());
  25840. function isSet(value) {
  25841. if (typeof Set === "undefined") {
  25842. return false;
  25843. }
  25844. return isSetToString.working ? isSetToString(value) : value instanceof Set;
  25845. }
  25846. exports3.isSet = isSet;
  25847. function isWeakMapToString(value) {
  25848. return ObjectToString(value) === "[object WeakMap]";
  25849. }
  25850. isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap());
  25851. function isWeakMap(value) {
  25852. if (typeof WeakMap === "undefined") {
  25853. return false;
  25854. }
  25855. return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
  25856. }
  25857. exports3.isWeakMap = isWeakMap;
  25858. function isWeakSetToString(value) {
  25859. return ObjectToString(value) === "[object WeakSet]";
  25860. }
  25861. isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet());
  25862. function isWeakSet(value) {
  25863. return isWeakSetToString(value);
  25864. }
  25865. exports3.isWeakSet = isWeakSet;
  25866. function isArrayBufferToString(value) {
  25867. return ObjectToString(value) === "[object ArrayBuffer]";
  25868. }
  25869. isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer());
  25870. function isArrayBuffer(value) {
  25871. if (typeof ArrayBuffer === "undefined") {
  25872. return false;
  25873. }
  25874. return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
  25875. }
  25876. exports3.isArrayBuffer = isArrayBuffer;
  25877. function isDataViewToString(value) {
  25878. return ObjectToString(value) === "[object DataView]";
  25879. }
  25880. isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));
  25881. function isDataView(value) {
  25882. if (typeof DataView === "undefined") {
  25883. return false;
  25884. }
  25885. return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
  25886. }
  25887. exports3.isDataView = isDataView;
  25888. var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
  25889. function isSharedArrayBufferToString(value) {
  25890. return ObjectToString(value) === "[object SharedArrayBuffer]";
  25891. }
  25892. function isSharedArrayBuffer(value) {
  25893. if (typeof SharedArrayBufferCopy === "undefined") {
  25894. return false;
  25895. }
  25896. if (typeof isSharedArrayBufferToString.working === "undefined") {
  25897. isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
  25898. }
  25899. return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
  25900. }
  25901. exports3.isSharedArrayBuffer = isSharedArrayBuffer;
  25902. function isAsyncFunction(value) {
  25903. return ObjectToString(value) === "[object AsyncFunction]";
  25904. }
  25905. exports3.isAsyncFunction = isAsyncFunction;
  25906. function isMapIterator(value) {
  25907. return ObjectToString(value) === "[object Map Iterator]";
  25908. }
  25909. exports3.isMapIterator = isMapIterator;
  25910. function isSetIterator(value) {
  25911. return ObjectToString(value) === "[object Set Iterator]";
  25912. }
  25913. exports3.isSetIterator = isSetIterator;
  25914. function isGeneratorObject(value) {
  25915. return ObjectToString(value) === "[object Generator]";
  25916. }
  25917. exports3.isGeneratorObject = isGeneratorObject;
  25918. function isWebAssemblyCompiledModule(value) {
  25919. return ObjectToString(value) === "[object WebAssembly.Module]";
  25920. }
  25921. exports3.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
  25922. function isNumberObject(value) {
  25923. return checkBoxedPrimitive(value, numberValue);
  25924. }
  25925. exports3.isNumberObject = isNumberObject;
  25926. function isStringObject(value) {
  25927. return checkBoxedPrimitive(value, stringValue);
  25928. }
  25929. exports3.isStringObject = isStringObject;
  25930. function isBooleanObject(value) {
  25931. return checkBoxedPrimitive(value, booleanValue);
  25932. }
  25933. exports3.isBooleanObject = isBooleanObject;
  25934. function isBigIntObject(value) {
  25935. return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
  25936. }
  25937. exports3.isBigIntObject = isBigIntObject;
  25938. function isSymbolObject(value) {
  25939. return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
  25940. }
  25941. exports3.isSymbolObject = isSymbolObject;
  25942. function isBoxedPrimitive(value) {
  25943. return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
  25944. }
  25945. exports3.isBoxedPrimitive = isBoxedPrimitive;
  25946. function isAnyArrayBuffer(value) {
  25947. return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
  25948. }
  25949. exports3.isAnyArrayBuffer = isAnyArrayBuffer;
  25950. ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
  25951. Object.defineProperty(exports3, method, {
  25952. enumerable: false,
  25953. value: function() {
  25954. throw new Error(method + " is not supported in userland");
  25955. }
  25956. });
  25957. });
  25958. }, { "is-arguments": 365, "is-generator-function": 368, "is-typed-array": 369, "which-typed-array": 420 }], 419: [function(require2, module3, exports3) {
  25959. (function(process) {
  25960. (function() {
  25961. var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) {
  25962. var keys = Object.keys(obj);
  25963. var descriptors = {};
  25964. for (var i = 0; i < keys.length; i++) {
  25965. descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
  25966. }
  25967. return descriptors;
  25968. };
  25969. var formatRegExp = /%[sdj%]/g;
  25970. exports3.format = function(f) {
  25971. if (!isString(f)) {
  25972. var objects = [];
  25973. for (var i = 0; i < arguments.length; i++) {
  25974. objects.push(inspect(arguments[i]));
  25975. }
  25976. return objects.join(" ");
  25977. }
  25978. var i = 1;
  25979. var args = arguments;
  25980. var len = args.length;
  25981. var str = String(f).replace(formatRegExp, function(x2) {
  25982. if (x2 === "%%")
  25983. return "%";
  25984. if (i >= len)
  25985. return x2;
  25986. switch (x2) {
  25987. case "%s":
  25988. return String(args[i++]);
  25989. case "%d":
  25990. return Number(args[i++]);
  25991. case "%j":
  25992. try {
  25993. return JSON.stringify(args[i++]);
  25994. } catch (_) {
  25995. return "[Circular]";
  25996. }
  25997. default:
  25998. return x2;
  25999. }
  26000. });
  26001. for (var x = args[i]; i < len; x = args[++i]) {
  26002. if (isNull(x) || !isObject(x)) {
  26003. str += " " + x;
  26004. } else {
  26005. str += " " + inspect(x);
  26006. }
  26007. }
  26008. return str;
  26009. };
  26010. exports3.deprecate = function(fn, msg) {
  26011. if (typeof process !== "undefined" && process.noDeprecation === true) {
  26012. return fn;
  26013. }
  26014. if (typeof process === "undefined") {
  26015. return function() {
  26016. return exports3.deprecate(fn, msg).apply(this, arguments);
  26017. };
  26018. }
  26019. var warned = false;
  26020. function deprecated() {
  26021. if (!warned) {
  26022. if (process.throwDeprecation) {
  26023. throw new Error(msg);
  26024. } else if (process.traceDeprecation) {
  26025. console.trace(msg);
  26026. } else {
  26027. console.error(msg);
  26028. }
  26029. warned = true;
  26030. }
  26031. return fn.apply(this, arguments);
  26032. }
  26033. return deprecated;
  26034. };
  26035. var debugs = {};
  26036. var debugEnvRegex = /^$/;
  26037. if (process.env.NODE_DEBUG) {
  26038. var debugEnv = process.env.NODE_DEBUG;
  26039. debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
  26040. debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
  26041. }
  26042. exports3.debuglog = function(set) {
  26043. set = set.toUpperCase();
  26044. if (!debugs[set]) {
  26045. if (debugEnvRegex.test(set)) {
  26046. var pid = process.pid;
  26047. debugs[set] = function() {
  26048. var msg = exports3.format.apply(exports3, arguments);
  26049. console.error("%s %d: %s", set, pid, msg);
  26050. };
  26051. } else {
  26052. debugs[set] = function() {
  26053. };
  26054. }
  26055. }
  26056. return debugs[set];
  26057. };
  26058. function inspect(obj, opts) {
  26059. var ctx = {
  26060. seen: [],
  26061. stylize: stylizeNoColor
  26062. };
  26063. if (arguments.length >= 3)
  26064. ctx.depth = arguments[2];
  26065. if (arguments.length >= 4)
  26066. ctx.colors = arguments[3];
  26067. if (isBoolean(opts)) {
  26068. ctx.showHidden = opts;
  26069. } else if (opts) {
  26070. exports3._extend(ctx, opts);
  26071. }
  26072. if (isUndefined(ctx.showHidden))
  26073. ctx.showHidden = false;
  26074. if (isUndefined(ctx.depth))
  26075. ctx.depth = 2;
  26076. if (isUndefined(ctx.colors))
  26077. ctx.colors = false;
  26078. if (isUndefined(ctx.customInspect))
  26079. ctx.customInspect = true;
  26080. if (ctx.colors)
  26081. ctx.stylize = stylizeWithColor;
  26082. return formatValue(ctx, obj, ctx.depth);
  26083. }
  26084. exports3.inspect = inspect;
  26085. inspect.colors = {
  26086. "bold": [1, 22],
  26087. "italic": [3, 23],
  26088. "underline": [4, 24],
  26089. "inverse": [7, 27],
  26090. "white": [37, 39],
  26091. "grey": [90, 39],
  26092. "black": [30, 39],
  26093. "blue": [34, 39],
  26094. "cyan": [36, 39],
  26095. "green": [32, 39],
  26096. "magenta": [35, 39],
  26097. "red": [31, 39],
  26098. "yellow": [33, 39]
  26099. };
  26100. inspect.styles = {
  26101. "special": "cyan",
  26102. "number": "yellow",
  26103. "boolean": "yellow",
  26104. "undefined": "grey",
  26105. "null": "bold",
  26106. "string": "green",
  26107. "date": "magenta",
  26108. // "name": intentionally not styling
  26109. "regexp": "red"
  26110. };
  26111. function stylizeWithColor(str, styleType) {
  26112. var style = inspect.styles[styleType];
  26113. if (style) {
  26114. return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
  26115. } else {
  26116. return str;
  26117. }
  26118. }
  26119. function stylizeNoColor(str, styleType) {
  26120. return str;
  26121. }
  26122. function arrayToHash(array) {
  26123. var hash = {};
  26124. array.forEach(function(val, idx) {
  26125. hash[val] = true;
  26126. });
  26127. return hash;
  26128. }
  26129. function formatValue(ctx, value, recurseTimes) {
  26130. if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
  26131. value.inspect !== exports3.inspect && // Also filter out any prototype objects using the circular check.
  26132. !(value.constructor && value.constructor.prototype === value)) {
  26133. var ret = value.inspect(recurseTimes, ctx);
  26134. if (!isString(ret)) {
  26135. ret = formatValue(ctx, ret, recurseTimes);
  26136. }
  26137. return ret;
  26138. }
  26139. var primitive = formatPrimitive(ctx, value);
  26140. if (primitive) {
  26141. return primitive;
  26142. }
  26143. var keys = Object.keys(value);
  26144. var visibleKeys = arrayToHash(keys);
  26145. if (ctx.showHidden) {
  26146. keys = Object.getOwnPropertyNames(value);
  26147. }
  26148. if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
  26149. return formatError(value);
  26150. }
  26151. if (keys.length === 0) {
  26152. if (isFunction(value)) {
  26153. var name = value.name ? ": " + value.name : "";
  26154. return ctx.stylize("[Function" + name + "]", "special");
  26155. }
  26156. if (isRegExp(value)) {
  26157. return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
  26158. }
  26159. if (isDate(value)) {
  26160. return ctx.stylize(Date.prototype.toString.call(value), "date");
  26161. }
  26162. if (isError(value)) {
  26163. return formatError(value);
  26164. }
  26165. }
  26166. var base = "", array = false, braces = ["{", "}"];
  26167. if (isArray(value)) {
  26168. array = true;
  26169. braces = ["[", "]"];
  26170. }
  26171. if (isFunction(value)) {
  26172. var n = value.name ? ": " + value.name : "";
  26173. base = " [Function" + n + "]";
  26174. }
  26175. if (isRegExp(value)) {
  26176. base = " " + RegExp.prototype.toString.call(value);
  26177. }
  26178. if (isDate(value)) {
  26179. base = " " + Date.prototype.toUTCString.call(value);
  26180. }
  26181. if (isError(value)) {
  26182. base = " " + formatError(value);
  26183. }
  26184. if (keys.length === 0 && (!array || value.length == 0)) {
  26185. return braces[0] + base + braces[1];
  26186. }
  26187. if (recurseTimes < 0) {
  26188. if (isRegExp(value)) {
  26189. return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
  26190. } else {
  26191. return ctx.stylize("[Object]", "special");
  26192. }
  26193. }
  26194. ctx.seen.push(value);
  26195. var output;
  26196. if (array) {
  26197. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  26198. } else {
  26199. output = keys.map(function(key) {
  26200. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  26201. });
  26202. }
  26203. ctx.seen.pop();
  26204. return reduceToSingleString(output, base, braces);
  26205. }
  26206. function formatPrimitive(ctx, value) {
  26207. if (isUndefined(value))
  26208. return ctx.stylize("undefined", "undefined");
  26209. if (isString(value)) {
  26210. var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
  26211. return ctx.stylize(simple, "string");
  26212. }
  26213. if (isNumber(value))
  26214. return ctx.stylize("" + value, "number");
  26215. if (isBoolean(value))
  26216. return ctx.stylize("" + value, "boolean");
  26217. if (isNull(value))
  26218. return ctx.stylize("null", "null");
  26219. }
  26220. function formatError(value) {
  26221. return "[" + Error.prototype.toString.call(value) + "]";
  26222. }
  26223. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  26224. var output = [];
  26225. for (var i = 0, l = value.length; i < l; ++i) {
  26226. if (hasOwnProperty(value, String(i))) {
  26227. output.push(formatProperty(
  26228. ctx,
  26229. value,
  26230. recurseTimes,
  26231. visibleKeys,
  26232. String(i),
  26233. true
  26234. ));
  26235. } else {
  26236. output.push("");
  26237. }
  26238. }
  26239. keys.forEach(function(key) {
  26240. if (!key.match(/^\d+$/)) {
  26241. output.push(formatProperty(
  26242. ctx,
  26243. value,
  26244. recurseTimes,
  26245. visibleKeys,
  26246. key,
  26247. true
  26248. ));
  26249. }
  26250. });
  26251. return output;
  26252. }
  26253. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  26254. var name, str, desc;
  26255. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  26256. if (desc.get) {
  26257. if (desc.set) {
  26258. str = ctx.stylize("[Getter/Setter]", "special");
  26259. } else {
  26260. str = ctx.stylize("[Getter]", "special");
  26261. }
  26262. } else {
  26263. if (desc.set) {
  26264. str = ctx.stylize("[Setter]", "special");
  26265. }
  26266. }
  26267. if (!hasOwnProperty(visibleKeys, key)) {
  26268. name = "[" + key + "]";
  26269. }
  26270. if (!str) {
  26271. if (ctx.seen.indexOf(desc.value) < 0) {
  26272. if (isNull(recurseTimes)) {
  26273. str = formatValue(ctx, desc.value, null);
  26274. } else {
  26275. str = formatValue(ctx, desc.value, recurseTimes - 1);
  26276. }
  26277. if (str.indexOf("\n") > -1) {
  26278. if (array) {
  26279. str = str.split("\n").map(function(line) {
  26280. return " " + line;
  26281. }).join("\n").slice(2);
  26282. } else {
  26283. str = "\n" + str.split("\n").map(function(line) {
  26284. return " " + line;
  26285. }).join("\n");
  26286. }
  26287. }
  26288. } else {
  26289. str = ctx.stylize("[Circular]", "special");
  26290. }
  26291. }
  26292. if (isUndefined(name)) {
  26293. if (array && key.match(/^\d+$/)) {
  26294. return str;
  26295. }
  26296. name = JSON.stringify("" + key);
  26297. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  26298. name = name.slice(1, -1);
  26299. name = ctx.stylize(name, "name");
  26300. } else {
  26301. name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
  26302. name = ctx.stylize(name, "string");
  26303. }
  26304. }
  26305. return name + ": " + str;
  26306. }
  26307. function reduceToSingleString(output, base, braces) {
  26308. var numLinesEst = 0;
  26309. var length = output.reduce(function(prev, cur) {
  26310. numLinesEst++;
  26311. if (cur.indexOf("\n") >= 0)
  26312. numLinesEst++;
  26313. return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
  26314. }, 0);
  26315. if (length > 60) {
  26316. return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
  26317. }
  26318. return braces[0] + base + " " + output.join(", ") + " " + braces[1];
  26319. }
  26320. exports3.types = require2("./support/types");
  26321. function isArray(ar) {
  26322. return Array.isArray(ar);
  26323. }
  26324. exports3.isArray = isArray;
  26325. function isBoolean(arg) {
  26326. return typeof arg === "boolean";
  26327. }
  26328. exports3.isBoolean = isBoolean;
  26329. function isNull(arg) {
  26330. return arg === null;
  26331. }
  26332. exports3.isNull = isNull;
  26333. function isNullOrUndefined(arg) {
  26334. return arg == null;
  26335. }
  26336. exports3.isNullOrUndefined = isNullOrUndefined;
  26337. function isNumber(arg) {
  26338. return typeof arg === "number";
  26339. }
  26340. exports3.isNumber = isNumber;
  26341. function isString(arg) {
  26342. return typeof arg === "string";
  26343. }
  26344. exports3.isString = isString;
  26345. function isSymbol(arg) {
  26346. return typeof arg === "symbol";
  26347. }
  26348. exports3.isSymbol = isSymbol;
  26349. function isUndefined(arg) {
  26350. return arg === void 0;
  26351. }
  26352. exports3.isUndefined = isUndefined;
  26353. function isRegExp(re) {
  26354. return isObject(re) && objectToString(re) === "[object RegExp]";
  26355. }
  26356. exports3.isRegExp = isRegExp;
  26357. exports3.types.isRegExp = isRegExp;
  26358. function isObject(arg) {
  26359. return typeof arg === "object" && arg !== null;
  26360. }
  26361. exports3.isObject = isObject;
  26362. function isDate(d) {
  26363. return isObject(d) && objectToString(d) === "[object Date]";
  26364. }
  26365. exports3.isDate = isDate;
  26366. exports3.types.isDate = isDate;
  26367. function isError(e) {
  26368. return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
  26369. }
  26370. exports3.isError = isError;
  26371. exports3.types.isNativeError = isError;
  26372. function isFunction(arg) {
  26373. return typeof arg === "function";
  26374. }
  26375. exports3.isFunction = isFunction;
  26376. function isPrimitive(arg) {
  26377. return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
  26378. typeof arg === "undefined";
  26379. }
  26380. exports3.isPrimitive = isPrimitive;
  26381. exports3.isBuffer = require2("./support/isBuffer");
  26382. function objectToString(o) {
  26383. return Object.prototype.toString.call(o);
  26384. }
  26385. function pad(n) {
  26386. return n < 10 ? "0" + n.toString(10) : n.toString(10);
  26387. }
  26388. var months = [
  26389. "Jan",
  26390. "Feb",
  26391. "Mar",
  26392. "Apr",
  26393. "May",
  26394. "Jun",
  26395. "Jul",
  26396. "Aug",
  26397. "Sep",
  26398. "Oct",
  26399. "Nov",
  26400. "Dec"
  26401. ];
  26402. function timestamp() {
  26403. var d = /* @__PURE__ */ new Date();
  26404. var time = [
  26405. pad(d.getHours()),
  26406. pad(d.getMinutes()),
  26407. pad(d.getSeconds())
  26408. ].join(":");
  26409. return [d.getDate(), months[d.getMonth()], time].join(" ");
  26410. }
  26411. exports3.log = function() {
  26412. console.log("%s - %s", timestamp(), exports3.format.apply(exports3, arguments));
  26413. };
  26414. exports3.inherits = require2("inherits");
  26415. exports3._extend = function(origin, add) {
  26416. if (!add || !isObject(add))
  26417. return origin;
  26418. var keys = Object.keys(add);
  26419. var i = keys.length;
  26420. while (i--) {
  26421. origin[keys[i]] = add[keys[i]];
  26422. }
  26423. return origin;
  26424. };
  26425. function hasOwnProperty(obj, prop) {
  26426. return Object.prototype.hasOwnProperty.call(obj, prop);
  26427. }
  26428. var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
  26429. exports3.promisify = function promisify(original) {
  26430. if (typeof original !== "function")
  26431. throw new TypeError('The "original" argument must be of type Function');
  26432. if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
  26433. var fn = original[kCustomPromisifiedSymbol];
  26434. if (typeof fn !== "function") {
  26435. throw new TypeError('The "util.promisify.custom" argument must be of type Function');
  26436. }
  26437. Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  26438. value: fn,
  26439. enumerable: false,
  26440. writable: false,
  26441. configurable: true
  26442. });
  26443. return fn;
  26444. }
  26445. function fn() {
  26446. var promiseResolve, promiseReject;
  26447. var promise = new Promise(function(resolve, reject) {
  26448. promiseResolve = resolve;
  26449. promiseReject = reject;
  26450. });
  26451. var args = [];
  26452. for (var i = 0; i < arguments.length; i++) {
  26453. args.push(arguments[i]);
  26454. }
  26455. args.push(function(err, value) {
  26456. if (err) {
  26457. promiseReject(err);
  26458. } else {
  26459. promiseResolve(value);
  26460. }
  26461. });
  26462. try {
  26463. original.apply(this, args);
  26464. } catch (err) {
  26465. promiseReject(err);
  26466. }
  26467. return promise;
  26468. }
  26469. Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
  26470. if (kCustomPromisifiedSymbol)
  26471. Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  26472. value: fn,
  26473. enumerable: false,
  26474. writable: false,
  26475. configurable: true
  26476. });
  26477. return Object.defineProperties(
  26478. fn,
  26479. getOwnPropertyDescriptors(original)
  26480. );
  26481. };
  26482. exports3.promisify.custom = kCustomPromisifiedSymbol;
  26483. function callbackifyOnRejected(reason, cb) {
  26484. if (!reason) {
  26485. var newReason = new Error("Promise was rejected with a falsy value");
  26486. newReason.reason = reason;
  26487. reason = newReason;
  26488. }
  26489. return cb(reason);
  26490. }
  26491. function callbackify(original) {
  26492. if (typeof original !== "function") {
  26493. throw new TypeError('The "original" argument must be of type Function');
  26494. }
  26495. function callbackified() {
  26496. var args = [];
  26497. for (var i = 0; i < arguments.length; i++) {
  26498. args.push(arguments[i]);
  26499. }
  26500. var maybeCb = args.pop();
  26501. if (typeof maybeCb !== "function") {
  26502. throw new TypeError("The last argument must be of type Function");
  26503. }
  26504. var self2 = this;
  26505. var cb = function() {
  26506. return maybeCb.apply(self2, arguments);
  26507. };
  26508. original.apply(this, args).then(
  26509. function(ret) {
  26510. process.nextTick(cb.bind(null, null, ret));
  26511. },
  26512. function(rej) {
  26513. process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
  26514. }
  26515. );
  26516. }
  26517. Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  26518. Object.defineProperties(
  26519. callbackified,
  26520. getOwnPropertyDescriptors(original)
  26521. );
  26522. return callbackified;
  26523. }
  26524. exports3.callbackify = callbackify;
  26525. }).call(this);
  26526. }).call(this, require2("_process"));
  26527. }, { "./support/isBuffer": 417, "./support/types": 418, "_process": 467, "inherits": 364 }], 420: [function(require2, module3, exports3) {
  26528. (function(global2) {
  26529. (function() {
  26530. "use strict";
  26531. var forEach = require2("for-each");
  26532. var availableTypedArrays = require2("available-typed-arrays");
  26533. var callBind = require2("call-bind");
  26534. var callBound = require2("call-bind/callBound");
  26535. var gOPD = require2("gopd");
  26536. var $toString = callBound("Object.prototype.toString");
  26537. var hasToStringTag = require2("has-tostringtag/shams")();
  26538. var g = typeof globalThis === "undefined" ? global2 : globalThis;
  26539. var typedArrays = availableTypedArrays();
  26540. var $slice = callBound("String.prototype.slice");
  26541. var getPrototypeOf = Object.getPrototypeOf;
  26542. var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) {
  26543. for (var i = 0; i < array.length; i += 1) {
  26544. if (array[i] === value) {
  26545. return i;
  26546. }
  26547. }
  26548. return -1;
  26549. };
  26550. var cache = { __proto__: null };
  26551. if (hasToStringTag && gOPD && getPrototypeOf) {
  26552. forEach(typedArrays, function(typedArray) {
  26553. var arr = new g[typedArray]();
  26554. if (Symbol.toStringTag in arr) {
  26555. var proto = getPrototypeOf(arr);
  26556. var descriptor = gOPD(proto, Symbol.toStringTag);
  26557. if (!descriptor) {
  26558. var superProto = getPrototypeOf(proto);
  26559. descriptor = gOPD(superProto, Symbol.toStringTag);
  26560. }
  26561. cache["$" + typedArray] = callBind(descriptor.get);
  26562. }
  26563. });
  26564. } else {
  26565. forEach(typedArrays, function(typedArray) {
  26566. var arr = new g[typedArray]();
  26567. cache["$" + typedArray] = callBind(arr.slice);
  26568. });
  26569. }
  26570. var tryTypedArrays = function tryAllTypedArrays(value) {
  26571. var found = false;
  26572. forEach(cache, function(getter, typedArray) {
  26573. if (!found) {
  26574. try {
  26575. if ("$" + getter(value) === typedArray) {
  26576. found = $slice(typedArray, 1);
  26577. }
  26578. } catch (e) {
  26579. }
  26580. }
  26581. });
  26582. return found;
  26583. };
  26584. var trySlices = function tryAllSlices(value) {
  26585. var found = false;
  26586. forEach(cache, function(getter, name) {
  26587. if (!found) {
  26588. try {
  26589. getter(value);
  26590. found = $slice(name, 1);
  26591. } catch (e) {
  26592. }
  26593. }
  26594. });
  26595. return found;
  26596. };
  26597. module3.exports = function whichTypedArray(value) {
  26598. if (!value || typeof value !== "object") {
  26599. return false;
  26600. }
  26601. if (!hasToStringTag) {
  26602. var tag = $slice($toString(value), 8, -1);
  26603. if ($indexOf(typedArrays, tag) > -1) {
  26604. return tag;
  26605. }
  26606. if (tag !== "Object") {
  26607. return false;
  26608. }
  26609. return trySlices(value);
  26610. }
  26611. if (!gOPD) {
  26612. return null;
  26613. }
  26614. return tryTypedArrays(value);
  26615. };
  26616. }).call(this);
  26617. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  26618. }, { "available-typed-arrays": 86, "call-bind": 93, "call-bind/callBound": 92, "for-each": 345, "gopd": 349, "has-tostringtag/shams": 353 }], 421: [function(require2, module3, exports3) {
  26619. (function() {
  26620. "use strict";
  26621. exports3.stripBOM = function(str) {
  26622. if (str[0] === "\uFEFF") {
  26623. return str.substring(1);
  26624. } else {
  26625. return str;
  26626. }
  26627. };
  26628. }).call(this);
  26629. }, {}], 422: [function(require2, module3, exports3) {
  26630. (function() {
  26631. "use strict";
  26632. var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty;
  26633. builder = require2("xmlbuilder");
  26634. defaults = require2("./defaults").defaults;
  26635. requiresCDATA = function(entry) {
  26636. return typeof entry === "string" && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0);
  26637. };
  26638. wrapCDATA = function(entry) {
  26639. return "<![CDATA[" + escapeCDATA(entry) + "]]>";
  26640. };
  26641. escapeCDATA = function(entry) {
  26642. return entry.replace("]]>", "]]]]><![CDATA[>");
  26643. };
  26644. exports3.Builder = function() {
  26645. function Builder(opts) {
  26646. var key, ref, value;
  26647. this.options = {};
  26648. ref = defaults["0.2"];
  26649. for (key in ref) {
  26650. if (!hasProp.call(ref, key))
  26651. continue;
  26652. value = ref[key];
  26653. this.options[key] = value;
  26654. }
  26655. for (key in opts) {
  26656. if (!hasProp.call(opts, key))
  26657. continue;
  26658. value = opts[key];
  26659. this.options[key] = value;
  26660. }
  26661. }
  26662. Builder.prototype.buildObject = function(rootObj) {
  26663. var attrkey, charkey, render, rootElement, rootName;
  26664. attrkey = this.options.attrkey;
  26665. charkey = this.options.charkey;
  26666. if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults["0.2"].rootName) {
  26667. rootName = Object.keys(rootObj)[0];
  26668. rootObj = rootObj[rootName];
  26669. } else {
  26670. rootName = this.options.rootName;
  26671. }
  26672. render = function(_this) {
  26673. return function(element, obj) {
  26674. var attr, child, entry, index, key, value;
  26675. if (typeof obj !== "object") {
  26676. if (_this.options.cdata && requiresCDATA(obj)) {
  26677. element.raw(wrapCDATA(obj));
  26678. } else {
  26679. element.txt(obj);
  26680. }
  26681. } else if (Array.isArray(obj)) {
  26682. for (index in obj) {
  26683. if (!hasProp.call(obj, index))
  26684. continue;
  26685. child = obj[index];
  26686. for (key in child) {
  26687. entry = child[key];
  26688. element = render(element.ele(key), entry).up();
  26689. }
  26690. }
  26691. } else {
  26692. for (key in obj) {
  26693. if (!hasProp.call(obj, key))
  26694. continue;
  26695. child = obj[key];
  26696. if (key === attrkey) {
  26697. if (typeof child === "object") {
  26698. for (attr in child) {
  26699. value = child[attr];
  26700. element = element.att(attr, value);
  26701. }
  26702. }
  26703. } else if (key === charkey) {
  26704. if (_this.options.cdata && requiresCDATA(child)) {
  26705. element = element.raw(wrapCDATA(child));
  26706. } else {
  26707. element = element.txt(child);
  26708. }
  26709. } else if (Array.isArray(child)) {
  26710. for (index in child) {
  26711. if (!hasProp.call(child, index))
  26712. continue;
  26713. entry = child[index];
  26714. if (typeof entry === "string") {
  26715. if (_this.options.cdata && requiresCDATA(entry)) {
  26716. element = element.ele(key).raw(wrapCDATA(entry)).up();
  26717. } else {
  26718. element = element.ele(key, entry).up();
  26719. }
  26720. } else {
  26721. element = render(element.ele(key), entry).up();
  26722. }
  26723. }
  26724. } else if (typeof child === "object") {
  26725. element = render(element.ele(key), child).up();
  26726. } else {
  26727. if (typeof child === "string" && _this.options.cdata && requiresCDATA(child)) {
  26728. element = element.ele(key).raw(wrapCDATA(child)).up();
  26729. } else {
  26730. if (child == null) {
  26731. child = "";
  26732. }
  26733. element = element.ele(key, child.toString()).up();
  26734. }
  26735. }
  26736. }
  26737. }
  26738. return element;
  26739. };
  26740. }(this);
  26741. rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
  26742. headless: this.options.headless,
  26743. allowSurrogateChars: this.options.allowSurrogateChars
  26744. });
  26745. return render(rootElement, rootObj).end(this.options.renderOpts);
  26746. };
  26747. return Builder;
  26748. }();
  26749. }).call(this);
  26750. }, { "./defaults": 423, "xmlbuilder": 459 }], 423: [function(require2, module3, exports3) {
  26751. (function() {
  26752. exports3.defaults = {
  26753. "0.1": {
  26754. explicitCharkey: false,
  26755. trim: true,
  26756. normalize: true,
  26757. normalizeTags: false,
  26758. attrkey: "@",
  26759. charkey: "#",
  26760. explicitArray: false,
  26761. ignoreAttrs: false,
  26762. mergeAttrs: false,
  26763. explicitRoot: false,
  26764. validator: null,
  26765. xmlns: false,
  26766. explicitChildren: false,
  26767. childkey: "@@",
  26768. charsAsChildren: false,
  26769. includeWhiteChars: false,
  26770. async: false,
  26771. strict: true,
  26772. attrNameProcessors: null,
  26773. attrValueProcessors: null,
  26774. tagNameProcessors: null,
  26775. valueProcessors: null,
  26776. emptyTag: ""
  26777. },
  26778. "0.2": {
  26779. explicitCharkey: false,
  26780. trim: false,
  26781. normalize: false,
  26782. normalizeTags: false,
  26783. attrkey: "$",
  26784. charkey: "_",
  26785. explicitArray: true,
  26786. ignoreAttrs: false,
  26787. mergeAttrs: false,
  26788. explicitRoot: true,
  26789. validator: null,
  26790. xmlns: false,
  26791. explicitChildren: false,
  26792. preserveChildrenOrder: false,
  26793. childkey: "$$",
  26794. charsAsChildren: false,
  26795. includeWhiteChars: false,
  26796. async: false,
  26797. strict: true,
  26798. attrNameProcessors: null,
  26799. attrValueProcessors: null,
  26800. tagNameProcessors: null,
  26801. valueProcessors: null,
  26802. rootName: "root",
  26803. xmldec: {
  26804. "version": "1.0",
  26805. "encoding": "UTF-8",
  26806. "standalone": true
  26807. },
  26808. doctype: null,
  26809. renderOpts: {
  26810. "pretty": true,
  26811. "indent": " ",
  26812. "newline": "\n"
  26813. },
  26814. headless: false,
  26815. chunkSize: 1e4,
  26816. emptyTag: "",
  26817. cdata: false
  26818. }
  26819. };
  26820. }).call(this);
  26821. }, {}], 424: [function(require2, module3, exports3) {
  26822. (function() {
  26823. "use strict";
  26824. var bom, defaults, defineProperty, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me) {
  26825. return function() {
  26826. return fn.apply(me, arguments);
  26827. };
  26828. }, extend = function(child, parent) {
  26829. for (var key in parent) {
  26830. if (hasProp.call(parent, key))
  26831. child[key] = parent[key];
  26832. }
  26833. function ctor() {
  26834. this.constructor = child;
  26835. }
  26836. ctor.prototype = parent.prototype;
  26837. child.prototype = new ctor();
  26838. child.__super__ = parent.prototype;
  26839. return child;
  26840. }, hasProp = {}.hasOwnProperty;
  26841. sax = require2("sax");
  26842. events = require2("events");
  26843. bom = require2("./bom");
  26844. processors = require2("./processors");
  26845. setImmediate = require2("timers").setImmediate;
  26846. defaults = require2("./defaults").defaults;
  26847. isEmpty = function(thing) {
  26848. return typeof thing === "object" && thing != null && Object.keys(thing).length === 0;
  26849. };
  26850. processItem = function(processors2, item, key) {
  26851. var i, len, process;
  26852. for (i = 0, len = processors2.length; i < len; i++) {
  26853. process = processors2[i];
  26854. item = process(item, key);
  26855. }
  26856. return item;
  26857. };
  26858. defineProperty = function(obj, key, value) {
  26859. var descriptor;
  26860. descriptor = /* @__PURE__ */ Object.create(null);
  26861. descriptor.value = value;
  26862. descriptor.writable = true;
  26863. descriptor.enumerable = true;
  26864. descriptor.configurable = true;
  26865. return Object.defineProperty(obj, key, descriptor);
  26866. };
  26867. exports3.Parser = function(superClass) {
  26868. extend(Parser, superClass);
  26869. function Parser(opts) {
  26870. this.parseStringPromise = bind(this.parseStringPromise, this);
  26871. this.parseString = bind(this.parseString, this);
  26872. this.reset = bind(this.reset, this);
  26873. this.assignOrPush = bind(this.assignOrPush, this);
  26874. this.processAsync = bind(this.processAsync, this);
  26875. var key, ref, value;
  26876. if (!(this instanceof exports3.Parser)) {
  26877. return new exports3.Parser(opts);
  26878. }
  26879. this.options = {};
  26880. ref = defaults["0.2"];
  26881. for (key in ref) {
  26882. if (!hasProp.call(ref, key))
  26883. continue;
  26884. value = ref[key];
  26885. this.options[key] = value;
  26886. }
  26887. for (key in opts) {
  26888. if (!hasProp.call(opts, key))
  26889. continue;
  26890. value = opts[key];
  26891. this.options[key] = value;
  26892. }
  26893. if (this.options.xmlns) {
  26894. this.options.xmlnskey = this.options.attrkey + "ns";
  26895. }
  26896. if (this.options.normalizeTags) {
  26897. if (!this.options.tagNameProcessors) {
  26898. this.options.tagNameProcessors = [];
  26899. }
  26900. this.options.tagNameProcessors.unshift(processors.normalize);
  26901. }
  26902. this.reset();
  26903. }
  26904. Parser.prototype.processAsync = function() {
  26905. var chunk, err;
  26906. try {
  26907. if (this.remaining.length <= this.options.chunkSize) {
  26908. chunk = this.remaining;
  26909. this.remaining = "";
  26910. this.saxParser = this.saxParser.write(chunk);
  26911. return this.saxParser.close();
  26912. } else {
  26913. chunk = this.remaining.substr(0, this.options.chunkSize);
  26914. this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
  26915. this.saxParser = this.saxParser.write(chunk);
  26916. return setImmediate(this.processAsync);
  26917. }
  26918. } catch (error1) {
  26919. err = error1;
  26920. if (!this.saxParser.errThrown) {
  26921. this.saxParser.errThrown = true;
  26922. return this.emit(err);
  26923. }
  26924. }
  26925. };
  26926. Parser.prototype.assignOrPush = function(obj, key, newValue) {
  26927. if (!(key in obj)) {
  26928. if (!this.options.explicitArray) {
  26929. return defineProperty(obj, key, newValue);
  26930. } else {
  26931. return defineProperty(obj, key, [newValue]);
  26932. }
  26933. } else {
  26934. if (!(obj[key] instanceof Array)) {
  26935. defineProperty(obj, key, [obj[key]]);
  26936. }
  26937. return obj[key].push(newValue);
  26938. }
  26939. };
  26940. Parser.prototype.reset = function() {
  26941. var attrkey, charkey, ontext, stack;
  26942. this.removeAllListeners();
  26943. this.saxParser = sax.parser(this.options.strict, {
  26944. trim: false,
  26945. normalize: false,
  26946. xmlns: this.options.xmlns
  26947. });
  26948. this.saxParser.errThrown = false;
  26949. this.saxParser.onerror = function(_this) {
  26950. return function(error) {
  26951. _this.saxParser.resume();
  26952. if (!_this.saxParser.errThrown) {
  26953. _this.saxParser.errThrown = true;
  26954. return _this.emit("error", error);
  26955. }
  26956. };
  26957. }(this);
  26958. this.saxParser.onend = function(_this) {
  26959. return function() {
  26960. if (!_this.saxParser.ended) {
  26961. _this.saxParser.ended = true;
  26962. return _this.emit("end", _this.resultObject);
  26963. }
  26964. };
  26965. }(this);
  26966. this.saxParser.ended = false;
  26967. this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
  26968. this.resultObject = null;
  26969. stack = [];
  26970. attrkey = this.options.attrkey;
  26971. charkey = this.options.charkey;
  26972. this.saxParser.onopentag = function(_this) {
  26973. return function(node) {
  26974. var key, newValue, obj, processedKey, ref;
  26975. obj = {};
  26976. obj[charkey] = "";
  26977. if (!_this.options.ignoreAttrs) {
  26978. ref = node.attributes;
  26979. for (key in ref) {
  26980. if (!hasProp.call(ref, key))
  26981. continue;
  26982. if (!(attrkey in obj) && !_this.options.mergeAttrs) {
  26983. obj[attrkey] = {};
  26984. }
  26985. newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
  26986. processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
  26987. if (_this.options.mergeAttrs) {
  26988. _this.assignOrPush(obj, processedKey, newValue);
  26989. } else {
  26990. defineProperty(obj[attrkey], processedKey, newValue);
  26991. }
  26992. }
  26993. }
  26994. obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
  26995. if (_this.options.xmlns) {
  26996. obj[_this.options.xmlnskey] = {
  26997. uri: node.uri,
  26998. local: node.local
  26999. };
  27000. }
  27001. return stack.push(obj);
  27002. };
  27003. }(this);
  27004. this.saxParser.onclosetag = function(_this) {
  27005. return function() {
  27006. var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
  27007. obj = stack.pop();
  27008. nodeName = obj["#name"];
  27009. if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
  27010. delete obj["#name"];
  27011. }
  27012. if (obj.cdata === true) {
  27013. cdata = obj.cdata;
  27014. delete obj.cdata;
  27015. }
  27016. s = stack[stack.length - 1];
  27017. if (obj[charkey].match(/^\s*$/) && !cdata) {
  27018. emptyStr = obj[charkey];
  27019. delete obj[charkey];
  27020. } else {
  27021. if (_this.options.trim) {
  27022. obj[charkey] = obj[charkey].trim();
  27023. }
  27024. if (_this.options.normalize) {
  27025. obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
  27026. }
  27027. obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
  27028. if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
  27029. obj = obj[charkey];
  27030. }
  27031. }
  27032. if (isEmpty(obj)) {
  27033. if (typeof _this.options.emptyTag === "function") {
  27034. obj = _this.options.emptyTag();
  27035. } else {
  27036. obj = _this.options.emptyTag !== "" ? _this.options.emptyTag : emptyStr;
  27037. }
  27038. }
  27039. if (_this.options.validator != null) {
  27040. xpath = "/" + function() {
  27041. var i, len, results;
  27042. results = [];
  27043. for (i = 0, len = stack.length; i < len; i++) {
  27044. node = stack[i];
  27045. results.push(node["#name"]);
  27046. }
  27047. return results;
  27048. }().concat(nodeName).join("/");
  27049. (function() {
  27050. var err;
  27051. try {
  27052. return obj = _this.options.validator(xpath, s && s[nodeName], obj);
  27053. } catch (error1) {
  27054. err = error1;
  27055. return _this.emit("error", err);
  27056. }
  27057. })();
  27058. }
  27059. if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === "object") {
  27060. if (!_this.options.preserveChildrenOrder) {
  27061. node = {};
  27062. if (_this.options.attrkey in obj) {
  27063. node[_this.options.attrkey] = obj[_this.options.attrkey];
  27064. delete obj[_this.options.attrkey];
  27065. }
  27066. if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
  27067. node[_this.options.charkey] = obj[_this.options.charkey];
  27068. delete obj[_this.options.charkey];
  27069. }
  27070. if (Object.getOwnPropertyNames(obj).length > 0) {
  27071. node[_this.options.childkey] = obj;
  27072. }
  27073. obj = node;
  27074. } else if (s) {
  27075. s[_this.options.childkey] = s[_this.options.childkey] || [];
  27076. objClone = {};
  27077. for (key in obj) {
  27078. if (!hasProp.call(obj, key))
  27079. continue;
  27080. defineProperty(objClone, key, obj[key]);
  27081. }
  27082. s[_this.options.childkey].push(objClone);
  27083. delete obj["#name"];
  27084. if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
  27085. obj = obj[charkey];
  27086. }
  27087. }
  27088. }
  27089. if (stack.length > 0) {
  27090. return _this.assignOrPush(s, nodeName, obj);
  27091. } else {
  27092. if (_this.options.explicitRoot) {
  27093. old = obj;
  27094. obj = {};
  27095. defineProperty(obj, nodeName, old);
  27096. }
  27097. _this.resultObject = obj;
  27098. _this.saxParser.ended = true;
  27099. return _this.emit("end", _this.resultObject);
  27100. }
  27101. };
  27102. }(this);
  27103. ontext = function(_this) {
  27104. return function(text) {
  27105. var charChild, s;
  27106. s = stack[stack.length - 1];
  27107. if (s) {
  27108. s[charkey] += text;
  27109. if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, "").trim() !== "")) {
  27110. s[_this.options.childkey] = s[_this.options.childkey] || [];
  27111. charChild = {
  27112. "#name": "__text__"
  27113. };
  27114. charChild[charkey] = text;
  27115. if (_this.options.normalize) {
  27116. charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
  27117. }
  27118. s[_this.options.childkey].push(charChild);
  27119. }
  27120. return s;
  27121. }
  27122. };
  27123. }(this);
  27124. this.saxParser.ontext = ontext;
  27125. return this.saxParser.oncdata = function(_this) {
  27126. return function(text) {
  27127. var s;
  27128. s = ontext(text);
  27129. if (s) {
  27130. return s.cdata = true;
  27131. }
  27132. };
  27133. }(this);
  27134. };
  27135. Parser.prototype.parseString = function(str, cb) {
  27136. var err;
  27137. if (cb != null && typeof cb === "function") {
  27138. this.on("end", function(result) {
  27139. this.reset();
  27140. return cb(null, result);
  27141. });
  27142. this.on("error", function(err2) {
  27143. this.reset();
  27144. return cb(err2);
  27145. });
  27146. }
  27147. try {
  27148. str = str.toString();
  27149. if (str.trim() === "") {
  27150. this.emit("end", null);
  27151. return true;
  27152. }
  27153. str = bom.stripBOM(str);
  27154. if (this.options.async) {
  27155. this.remaining = str;
  27156. setImmediate(this.processAsync);
  27157. return this.saxParser;
  27158. }
  27159. return this.saxParser.write(str).close();
  27160. } catch (error1) {
  27161. err = error1;
  27162. if (!(this.saxParser.errThrown || this.saxParser.ended)) {
  27163. this.emit("error", err);
  27164. return this.saxParser.errThrown = true;
  27165. } else if (this.saxParser.ended) {
  27166. throw err;
  27167. }
  27168. }
  27169. };
  27170. Parser.prototype.parseStringPromise = function(str) {
  27171. return new Promise(function(_this) {
  27172. return function(resolve, reject) {
  27173. return _this.parseString(str, function(err, value) {
  27174. if (err) {
  27175. return reject(err);
  27176. } else {
  27177. return resolve(value);
  27178. }
  27179. });
  27180. };
  27181. }(this));
  27182. };
  27183. return Parser;
  27184. }(events);
  27185. exports3.parseString = function(str, a, b) {
  27186. var cb, options, parser;
  27187. if (b != null) {
  27188. if (typeof b === "function") {
  27189. cb = b;
  27190. }
  27191. if (typeof a === "object") {
  27192. options = a;
  27193. }
  27194. } else {
  27195. if (typeof a === "function") {
  27196. cb = a;
  27197. }
  27198. options = {};
  27199. }
  27200. parser = new exports3.Parser(options);
  27201. return parser.parseString(str, cb);
  27202. };
  27203. exports3.parseStringPromise = function(str, a) {
  27204. var options, parser;
  27205. if (typeof a === "object") {
  27206. options = a;
  27207. }
  27208. parser = new exports3.Parser(options);
  27209. return parser.parseStringPromise(str);
  27210. };
  27211. }).call(this);
  27212. }, { "./bom": 421, "./defaults": 423, "./processors": 425, "events": 344, "sax": 397, "timers": 414 }], 425: [function(require2, module3, exports3) {
  27213. (function() {
  27214. "use strict";
  27215. var prefixMatch;
  27216. prefixMatch = new RegExp(/(?!xmlns)^.*:/);
  27217. exports3.normalize = function(str) {
  27218. return str.toLowerCase();
  27219. };
  27220. exports3.firstCharLowerCase = function(str) {
  27221. return str.charAt(0).toLowerCase() + str.slice(1);
  27222. };
  27223. exports3.stripPrefix = function(str) {
  27224. return str.replace(prefixMatch, "");
  27225. };
  27226. exports3.parseNumbers = function(str) {
  27227. if (!isNaN(str)) {
  27228. str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
  27229. }
  27230. return str;
  27231. };
  27232. exports3.parseBooleans = function(str) {
  27233. if (/^(?:true|false)$/i.test(str)) {
  27234. str = str.toLowerCase() === "true";
  27235. }
  27236. return str;
  27237. };
  27238. }).call(this);
  27239. }, {}], 426: [function(require2, module3, exports3) {
  27240. (function() {
  27241. "use strict";
  27242. var builder, defaults, parser, processors, extend = function(child, parent) {
  27243. for (var key in parent) {
  27244. if (hasProp.call(parent, key))
  27245. child[key] = parent[key];
  27246. }
  27247. function ctor() {
  27248. this.constructor = child;
  27249. }
  27250. ctor.prototype = parent.prototype;
  27251. child.prototype = new ctor();
  27252. child.__super__ = parent.prototype;
  27253. return child;
  27254. }, hasProp = {}.hasOwnProperty;
  27255. defaults = require2("./defaults");
  27256. builder = require2("./builder");
  27257. parser = require2("./parser");
  27258. processors = require2("./processors");
  27259. exports3.defaults = defaults.defaults;
  27260. exports3.processors = processors;
  27261. exports3.ValidationError = function(superClass) {
  27262. extend(ValidationError, superClass);
  27263. function ValidationError(message) {
  27264. this.message = message;
  27265. }
  27266. return ValidationError;
  27267. }(Error);
  27268. exports3.Builder = builder.Builder;
  27269. exports3.Parser = parser.Parser;
  27270. exports3.parseString = parser.parseString;
  27271. exports3.parseStringPromise = parser.parseStringPromise;
  27272. }).call(this);
  27273. }, { "./builder": 422, "./defaults": 423, "./parser": 424, "./processors": 425 }], 427: [function(require2, module3, exports3) {
  27274. (function() {
  27275. module3.exports = {
  27276. Disconnected: 1,
  27277. Preceding: 2,
  27278. Following: 4,
  27279. Contains: 8,
  27280. ContainedBy: 16,
  27281. ImplementationSpecific: 32
  27282. };
  27283. }).call(this);
  27284. }, {}], 428: [function(require2, module3, exports3) {
  27285. (function() {
  27286. module3.exports = {
  27287. Element: 1,
  27288. Attribute: 2,
  27289. Text: 3,
  27290. CData: 4,
  27291. EntityReference: 5,
  27292. EntityDeclaration: 6,
  27293. ProcessingInstruction: 7,
  27294. Comment: 8,
  27295. Document: 9,
  27296. DocType: 10,
  27297. DocumentFragment: 11,
  27298. NotationDeclaration: 12,
  27299. Declaration: 201,
  27300. Raw: 202,
  27301. AttributeDeclaration: 203,
  27302. ElementDeclaration: 204,
  27303. Dummy: 205
  27304. };
  27305. }).call(this);
  27306. }, {}], 429: [function(require2, module3, exports3) {
  27307. (function() {
  27308. var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty;
  27309. assign = function() {
  27310. var i, key, len, source, sources, target;
  27311. target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
  27312. if (isFunction(Object.assign)) {
  27313. Object.assign.apply(null, arguments);
  27314. } else {
  27315. for (i = 0, len = sources.length; i < len; i++) {
  27316. source = sources[i];
  27317. if (source != null) {
  27318. for (key in source) {
  27319. if (!hasProp.call(source, key))
  27320. continue;
  27321. target[key] = source[key];
  27322. }
  27323. }
  27324. }
  27325. }
  27326. return target;
  27327. };
  27328. isFunction = function(val) {
  27329. return !!val && Object.prototype.toString.call(val) === "[object Function]";
  27330. };
  27331. isObject = function(val) {
  27332. var ref;
  27333. return !!val && ((ref = typeof val) === "function" || ref === "object");
  27334. };
  27335. isArray = function(val) {
  27336. if (isFunction(Array.isArray)) {
  27337. return Array.isArray(val);
  27338. } else {
  27339. return Object.prototype.toString.call(val) === "[object Array]";
  27340. }
  27341. };
  27342. isEmpty = function(val) {
  27343. var key;
  27344. if (isArray(val)) {
  27345. return !val.length;
  27346. } else {
  27347. for (key in val) {
  27348. if (!hasProp.call(val, key))
  27349. continue;
  27350. return false;
  27351. }
  27352. return true;
  27353. }
  27354. };
  27355. isPlainObject = function(val) {
  27356. var ctor, proto;
  27357. return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object);
  27358. };
  27359. getValue = function(obj) {
  27360. if (isFunction(obj.valueOf)) {
  27361. return obj.valueOf();
  27362. } else {
  27363. return obj;
  27364. }
  27365. };
  27366. module3.exports.assign = assign;
  27367. module3.exports.isFunction = isFunction;
  27368. module3.exports.isObject = isObject;
  27369. module3.exports.isArray = isArray;
  27370. module3.exports.isEmpty = isEmpty;
  27371. module3.exports.isPlainObject = isPlainObject;
  27372. module3.exports.getValue = getValue;
  27373. }).call(this);
  27374. }, {}], 430: [function(require2, module3, exports3) {
  27375. (function() {
  27376. module3.exports = {
  27377. None: 0,
  27378. OpenTag: 1,
  27379. InsideTag: 2,
  27380. CloseTag: 3
  27381. };
  27382. }).call(this);
  27383. }, {}], 431: [function(require2, module3, exports3) {
  27384. (function() {
  27385. var NodeType, XMLAttribute, XMLNode;
  27386. NodeType = require2("./NodeType");
  27387. XMLNode = require2("./XMLNode");
  27388. module3.exports = XMLAttribute = function() {
  27389. function XMLAttribute2(parent, name, value) {
  27390. this.parent = parent;
  27391. if (this.parent) {
  27392. this.options = this.parent.options;
  27393. this.stringify = this.parent.stringify;
  27394. }
  27395. if (name == null) {
  27396. throw new Error("Missing attribute name. " + this.debugInfo(name));
  27397. }
  27398. this.name = this.stringify.name(name);
  27399. this.value = this.stringify.attValue(value);
  27400. this.type = NodeType.Attribute;
  27401. this.isId = false;
  27402. this.schemaTypeInfo = null;
  27403. }
  27404. Object.defineProperty(XMLAttribute2.prototype, "nodeType", {
  27405. get: function() {
  27406. return this.type;
  27407. }
  27408. });
  27409. Object.defineProperty(XMLAttribute2.prototype, "ownerElement", {
  27410. get: function() {
  27411. return this.parent;
  27412. }
  27413. });
  27414. Object.defineProperty(XMLAttribute2.prototype, "textContent", {
  27415. get: function() {
  27416. return this.value;
  27417. },
  27418. set: function(value) {
  27419. return this.value = value || "";
  27420. }
  27421. });
  27422. Object.defineProperty(XMLAttribute2.prototype, "namespaceURI", {
  27423. get: function() {
  27424. return "";
  27425. }
  27426. });
  27427. Object.defineProperty(XMLAttribute2.prototype, "prefix", {
  27428. get: function() {
  27429. return "";
  27430. }
  27431. });
  27432. Object.defineProperty(XMLAttribute2.prototype, "localName", {
  27433. get: function() {
  27434. return this.name;
  27435. }
  27436. });
  27437. Object.defineProperty(XMLAttribute2.prototype, "specified", {
  27438. get: function() {
  27439. return true;
  27440. }
  27441. });
  27442. XMLAttribute2.prototype.clone = function() {
  27443. return Object.create(this);
  27444. };
  27445. XMLAttribute2.prototype.toString = function(options) {
  27446. return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
  27447. };
  27448. XMLAttribute2.prototype.debugInfo = function(name) {
  27449. name = name || this.name;
  27450. if (name == null) {
  27451. return "parent: <" + this.parent.name + ">";
  27452. } else {
  27453. return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
  27454. }
  27455. };
  27456. XMLAttribute2.prototype.isEqualNode = function(node) {
  27457. if (node.namespaceURI !== this.namespaceURI) {
  27458. return false;
  27459. }
  27460. if (node.prefix !== this.prefix) {
  27461. return false;
  27462. }
  27463. if (node.localName !== this.localName) {
  27464. return false;
  27465. }
  27466. if (node.value !== this.value) {
  27467. return false;
  27468. }
  27469. return true;
  27470. };
  27471. return XMLAttribute2;
  27472. }();
  27473. }).call(this);
  27474. }, { "./NodeType": 428, "./XMLNode": 450 }], 432: [function(require2, module3, exports3) {
  27475. (function() {
  27476. var NodeType, XMLCData, XMLCharacterData, extend = function(child, parent) {
  27477. for (var key in parent) {
  27478. if (hasProp.call(parent, key))
  27479. child[key] = parent[key];
  27480. }
  27481. function ctor() {
  27482. this.constructor = child;
  27483. }
  27484. ctor.prototype = parent.prototype;
  27485. child.prototype = new ctor();
  27486. child.__super__ = parent.prototype;
  27487. return child;
  27488. }, hasProp = {}.hasOwnProperty;
  27489. NodeType = require2("./NodeType");
  27490. XMLCharacterData = require2("./XMLCharacterData");
  27491. module3.exports = XMLCData = function(superClass) {
  27492. extend(XMLCData2, superClass);
  27493. function XMLCData2(parent, text) {
  27494. XMLCData2.__super__.constructor.call(this, parent);
  27495. if (text == null) {
  27496. throw new Error("Missing CDATA text. " + this.debugInfo());
  27497. }
  27498. this.name = "#cdata-section";
  27499. this.type = NodeType.CData;
  27500. this.value = this.stringify.cdata(text);
  27501. }
  27502. XMLCData2.prototype.clone = function() {
  27503. return Object.create(this);
  27504. };
  27505. XMLCData2.prototype.toString = function(options) {
  27506. return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
  27507. };
  27508. return XMLCData2;
  27509. }(XMLCharacterData);
  27510. }).call(this);
  27511. }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 433: [function(require2, module3, exports3) {
  27512. (function() {
  27513. var XMLCharacterData, XMLNode, extend = function(child, parent) {
  27514. for (var key in parent) {
  27515. if (hasProp.call(parent, key))
  27516. child[key] = parent[key];
  27517. }
  27518. function ctor() {
  27519. this.constructor = child;
  27520. }
  27521. ctor.prototype = parent.prototype;
  27522. child.prototype = new ctor();
  27523. child.__super__ = parent.prototype;
  27524. return child;
  27525. }, hasProp = {}.hasOwnProperty;
  27526. XMLNode = require2("./XMLNode");
  27527. module3.exports = XMLCharacterData = function(superClass) {
  27528. extend(XMLCharacterData2, superClass);
  27529. function XMLCharacterData2(parent) {
  27530. XMLCharacterData2.__super__.constructor.call(this, parent);
  27531. this.value = "";
  27532. }
  27533. Object.defineProperty(XMLCharacterData2.prototype, "data", {
  27534. get: function() {
  27535. return this.value;
  27536. },
  27537. set: function(value) {
  27538. return this.value = value || "";
  27539. }
  27540. });
  27541. Object.defineProperty(XMLCharacterData2.prototype, "length", {
  27542. get: function() {
  27543. return this.value.length;
  27544. }
  27545. });
  27546. Object.defineProperty(XMLCharacterData2.prototype, "textContent", {
  27547. get: function() {
  27548. return this.value;
  27549. },
  27550. set: function(value) {
  27551. return this.value = value || "";
  27552. }
  27553. });
  27554. XMLCharacterData2.prototype.clone = function() {
  27555. return Object.create(this);
  27556. };
  27557. XMLCharacterData2.prototype.substringData = function(offset, count) {
  27558. throw new Error("This DOM method is not implemented." + this.debugInfo());
  27559. };
  27560. XMLCharacterData2.prototype.appendData = function(arg) {
  27561. throw new Error("This DOM method is not implemented." + this.debugInfo());
  27562. };
  27563. XMLCharacterData2.prototype.insertData = function(offset, arg) {
  27564. throw new Error("This DOM method is not implemented." + this.debugInfo());
  27565. };
  27566. XMLCharacterData2.prototype.deleteData = function(offset, count) {
  27567. throw new Error("This DOM method is not implemented." + this.debugInfo());
  27568. };
  27569. XMLCharacterData2.prototype.replaceData = function(offset, count, arg) {
  27570. throw new Error("This DOM method is not implemented." + this.debugInfo());
  27571. };
  27572. XMLCharacterData2.prototype.isEqualNode = function(node) {
  27573. if (!XMLCharacterData2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
  27574. return false;
  27575. }
  27576. if (node.data !== this.data) {
  27577. return false;
  27578. }
  27579. return true;
  27580. };
  27581. return XMLCharacterData2;
  27582. }(XMLNode);
  27583. }).call(this);
  27584. }, { "./XMLNode": 450 }], 434: [function(require2, module3, exports3) {
  27585. (function() {
  27586. var NodeType, XMLCharacterData, XMLComment, extend = function(child, parent) {
  27587. for (var key in parent) {
  27588. if (hasProp.call(parent, key))
  27589. child[key] = parent[key];
  27590. }
  27591. function ctor() {
  27592. this.constructor = child;
  27593. }
  27594. ctor.prototype = parent.prototype;
  27595. child.prototype = new ctor();
  27596. child.__super__ = parent.prototype;
  27597. return child;
  27598. }, hasProp = {}.hasOwnProperty;
  27599. NodeType = require2("./NodeType");
  27600. XMLCharacterData = require2("./XMLCharacterData");
  27601. module3.exports = XMLComment = function(superClass) {
  27602. extend(XMLComment2, superClass);
  27603. function XMLComment2(parent, text) {
  27604. XMLComment2.__super__.constructor.call(this, parent);
  27605. if (text == null) {
  27606. throw new Error("Missing comment text. " + this.debugInfo());
  27607. }
  27608. this.name = "#comment";
  27609. this.type = NodeType.Comment;
  27610. this.value = this.stringify.comment(text);
  27611. }
  27612. XMLComment2.prototype.clone = function() {
  27613. return Object.create(this);
  27614. };
  27615. XMLComment2.prototype.toString = function(options) {
  27616. return this.options.writer.comment(this, this.options.writer.filterOptions(options));
  27617. };
  27618. return XMLComment2;
  27619. }(XMLCharacterData);
  27620. }).call(this);
  27621. }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 435: [function(require2, module3, exports3) {
  27622. (function() {
  27623. var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
  27624. XMLDOMErrorHandler = require2("./XMLDOMErrorHandler");
  27625. XMLDOMStringList = require2("./XMLDOMStringList");
  27626. module3.exports = XMLDOMConfiguration = function() {
  27627. function XMLDOMConfiguration2() {
  27628. var clonedSelf;
  27629. this.defaultParams = {
  27630. "canonical-form": false,
  27631. "cdata-sections": false,
  27632. "comments": false,
  27633. "datatype-normalization": false,
  27634. "element-content-whitespace": true,
  27635. "entities": true,
  27636. "error-handler": new XMLDOMErrorHandler(),
  27637. "infoset": true,
  27638. "validate-if-schema": false,
  27639. "namespaces": true,
  27640. "namespace-declarations": true,
  27641. "normalize-characters": false,
  27642. "schema-location": "",
  27643. "schema-type": "",
  27644. "split-cdata-sections": true,
  27645. "validate": false,
  27646. "well-formed": true
  27647. };
  27648. this.params = clonedSelf = Object.create(this.defaultParams);
  27649. }
  27650. Object.defineProperty(XMLDOMConfiguration2.prototype, "parameterNames", {
  27651. get: function() {
  27652. return new XMLDOMStringList(Object.keys(this.defaultParams));
  27653. }
  27654. });
  27655. XMLDOMConfiguration2.prototype.getParameter = function(name) {
  27656. if (this.params.hasOwnProperty(name)) {
  27657. return this.params[name];
  27658. } else {
  27659. return null;
  27660. }
  27661. };
  27662. XMLDOMConfiguration2.prototype.canSetParameter = function(name, value) {
  27663. return true;
  27664. };
  27665. XMLDOMConfiguration2.prototype.setParameter = function(name, value) {
  27666. if (value != null) {
  27667. return this.params[name] = value;
  27668. } else {
  27669. return delete this.params[name];
  27670. }
  27671. };
  27672. return XMLDOMConfiguration2;
  27673. }();
  27674. }).call(this);
  27675. }, { "./XMLDOMErrorHandler": 436, "./XMLDOMStringList": 438 }], 436: [function(require2, module3, exports3) {
  27676. (function() {
  27677. var XMLDOMErrorHandler;
  27678. module3.exports = XMLDOMErrorHandler = function() {
  27679. function XMLDOMErrorHandler2() {
  27680. }
  27681. XMLDOMErrorHandler2.prototype.handleError = function(error) {
  27682. throw new Error(error);
  27683. };
  27684. return XMLDOMErrorHandler2;
  27685. }();
  27686. }).call(this);
  27687. }, {}], 437: [function(require2, module3, exports3) {
  27688. (function() {
  27689. var XMLDOMImplementation;
  27690. module3.exports = XMLDOMImplementation = function() {
  27691. function XMLDOMImplementation2() {
  27692. }
  27693. XMLDOMImplementation2.prototype.hasFeature = function(feature, version) {
  27694. return true;
  27695. };
  27696. XMLDOMImplementation2.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
  27697. throw new Error("This DOM method is not implemented.");
  27698. };
  27699. XMLDOMImplementation2.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
  27700. throw new Error("This DOM method is not implemented.");
  27701. };
  27702. XMLDOMImplementation2.prototype.createHTMLDocument = function(title) {
  27703. throw new Error("This DOM method is not implemented.");
  27704. };
  27705. XMLDOMImplementation2.prototype.getFeature = function(feature, version) {
  27706. throw new Error("This DOM method is not implemented.");
  27707. };
  27708. return XMLDOMImplementation2;
  27709. }();
  27710. }).call(this);
  27711. }, {}], 438: [function(require2, module3, exports3) {
  27712. (function() {
  27713. var XMLDOMStringList;
  27714. module3.exports = XMLDOMStringList = function() {
  27715. function XMLDOMStringList2(arr) {
  27716. this.arr = arr || [];
  27717. }
  27718. Object.defineProperty(XMLDOMStringList2.prototype, "length", {
  27719. get: function() {
  27720. return this.arr.length;
  27721. }
  27722. });
  27723. XMLDOMStringList2.prototype.item = function(index) {
  27724. return this.arr[index] || null;
  27725. };
  27726. XMLDOMStringList2.prototype.contains = function(str) {
  27727. return this.arr.indexOf(str) !== -1;
  27728. };
  27729. return XMLDOMStringList2;
  27730. }();
  27731. }).call(this);
  27732. }, {}], 439: [function(require2, module3, exports3) {
  27733. (function() {
  27734. var NodeType, XMLDTDAttList, XMLNode, extend = function(child, parent) {
  27735. for (var key in parent) {
  27736. if (hasProp.call(parent, key))
  27737. child[key] = parent[key];
  27738. }
  27739. function ctor() {
  27740. this.constructor = child;
  27741. }
  27742. ctor.prototype = parent.prototype;
  27743. child.prototype = new ctor();
  27744. child.__super__ = parent.prototype;
  27745. return child;
  27746. }, hasProp = {}.hasOwnProperty;
  27747. XMLNode = require2("./XMLNode");
  27748. NodeType = require2("./NodeType");
  27749. module3.exports = XMLDTDAttList = function(superClass) {
  27750. extend(XMLDTDAttList2, superClass);
  27751. function XMLDTDAttList2(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  27752. XMLDTDAttList2.__super__.constructor.call(this, parent);
  27753. if (elementName == null) {
  27754. throw new Error("Missing DTD element name. " + this.debugInfo());
  27755. }
  27756. if (attributeName == null) {
  27757. throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
  27758. }
  27759. if (!attributeType) {
  27760. throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
  27761. }
  27762. if (!defaultValueType) {
  27763. throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
  27764. }
  27765. if (defaultValueType.indexOf("#") !== 0) {
  27766. defaultValueType = "#" + defaultValueType;
  27767. }
  27768. if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
  27769. throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
  27770. }
  27771. if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
  27772. throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
  27773. }
  27774. this.elementName = this.stringify.name(elementName);
  27775. this.type = NodeType.AttributeDeclaration;
  27776. this.attributeName = this.stringify.name(attributeName);
  27777. this.attributeType = this.stringify.dtdAttType(attributeType);
  27778. if (defaultValue) {
  27779. this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
  27780. }
  27781. this.defaultValueType = defaultValueType;
  27782. }
  27783. XMLDTDAttList2.prototype.toString = function(options) {
  27784. return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
  27785. };
  27786. return XMLDTDAttList2;
  27787. }(XMLNode);
  27788. }).call(this);
  27789. }, { "./NodeType": 428, "./XMLNode": 450 }], 440: [function(require2, module3, exports3) {
  27790. (function() {
  27791. var NodeType, XMLDTDElement, XMLNode, extend = function(child, parent) {
  27792. for (var key in parent) {
  27793. if (hasProp.call(parent, key))
  27794. child[key] = parent[key];
  27795. }
  27796. function ctor() {
  27797. this.constructor = child;
  27798. }
  27799. ctor.prototype = parent.prototype;
  27800. child.prototype = new ctor();
  27801. child.__super__ = parent.prototype;
  27802. return child;
  27803. }, hasProp = {}.hasOwnProperty;
  27804. XMLNode = require2("./XMLNode");
  27805. NodeType = require2("./NodeType");
  27806. module3.exports = XMLDTDElement = function(superClass) {
  27807. extend(XMLDTDElement2, superClass);
  27808. function XMLDTDElement2(parent, name, value) {
  27809. XMLDTDElement2.__super__.constructor.call(this, parent);
  27810. if (name == null) {
  27811. throw new Error("Missing DTD element name. " + this.debugInfo());
  27812. }
  27813. if (!value) {
  27814. value = "(#PCDATA)";
  27815. }
  27816. if (Array.isArray(value)) {
  27817. value = "(" + value.join(",") + ")";
  27818. }
  27819. this.name = this.stringify.name(name);
  27820. this.type = NodeType.ElementDeclaration;
  27821. this.value = this.stringify.dtdElementValue(value);
  27822. }
  27823. XMLDTDElement2.prototype.toString = function(options) {
  27824. return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
  27825. };
  27826. return XMLDTDElement2;
  27827. }(XMLNode);
  27828. }).call(this);
  27829. }, { "./NodeType": 428, "./XMLNode": 450 }], 441: [function(require2, module3, exports3) {
  27830. (function() {
  27831. var NodeType, XMLDTDEntity, XMLNode, isObject, extend = function(child, parent) {
  27832. for (var key in parent) {
  27833. if (hasProp.call(parent, key))
  27834. child[key] = parent[key];
  27835. }
  27836. function ctor() {
  27837. this.constructor = child;
  27838. }
  27839. ctor.prototype = parent.prototype;
  27840. child.prototype = new ctor();
  27841. child.__super__ = parent.prototype;
  27842. return child;
  27843. }, hasProp = {}.hasOwnProperty;
  27844. isObject = require2("./Utility").isObject;
  27845. XMLNode = require2("./XMLNode");
  27846. NodeType = require2("./NodeType");
  27847. module3.exports = XMLDTDEntity = function(superClass) {
  27848. extend(XMLDTDEntity2, superClass);
  27849. function XMLDTDEntity2(parent, pe, name, value) {
  27850. XMLDTDEntity2.__super__.constructor.call(this, parent);
  27851. if (name == null) {
  27852. throw new Error("Missing DTD entity name. " + this.debugInfo(name));
  27853. }
  27854. if (value == null) {
  27855. throw new Error("Missing DTD entity value. " + this.debugInfo(name));
  27856. }
  27857. this.pe = !!pe;
  27858. this.name = this.stringify.name(name);
  27859. this.type = NodeType.EntityDeclaration;
  27860. if (!isObject(value)) {
  27861. this.value = this.stringify.dtdEntityValue(value);
  27862. this.internal = true;
  27863. } else {
  27864. if (!value.pubID && !value.sysID) {
  27865. throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name));
  27866. }
  27867. if (value.pubID && !value.sysID) {
  27868. throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name));
  27869. }
  27870. this.internal = false;
  27871. if (value.pubID != null) {
  27872. this.pubID = this.stringify.dtdPubID(value.pubID);
  27873. }
  27874. if (value.sysID != null) {
  27875. this.sysID = this.stringify.dtdSysID(value.sysID);
  27876. }
  27877. if (value.nData != null) {
  27878. this.nData = this.stringify.dtdNData(value.nData);
  27879. }
  27880. if (this.pe && this.nData) {
  27881. throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name));
  27882. }
  27883. }
  27884. }
  27885. Object.defineProperty(XMLDTDEntity2.prototype, "publicId", {
  27886. get: function() {
  27887. return this.pubID;
  27888. }
  27889. });
  27890. Object.defineProperty(XMLDTDEntity2.prototype, "systemId", {
  27891. get: function() {
  27892. return this.sysID;
  27893. }
  27894. });
  27895. Object.defineProperty(XMLDTDEntity2.prototype, "notationName", {
  27896. get: function() {
  27897. return this.nData || null;
  27898. }
  27899. });
  27900. Object.defineProperty(XMLDTDEntity2.prototype, "inputEncoding", {
  27901. get: function() {
  27902. return null;
  27903. }
  27904. });
  27905. Object.defineProperty(XMLDTDEntity2.prototype, "xmlEncoding", {
  27906. get: function() {
  27907. return null;
  27908. }
  27909. });
  27910. Object.defineProperty(XMLDTDEntity2.prototype, "xmlVersion", {
  27911. get: function() {
  27912. return null;
  27913. }
  27914. });
  27915. XMLDTDEntity2.prototype.toString = function(options) {
  27916. return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
  27917. };
  27918. return XMLDTDEntity2;
  27919. }(XMLNode);
  27920. }).call(this);
  27921. }, { "./NodeType": 428, "./Utility": 429, "./XMLNode": 450 }], 442: [function(require2, module3, exports3) {
  27922. (function() {
  27923. var NodeType, XMLDTDNotation, XMLNode, extend = function(child, parent) {
  27924. for (var key in parent) {
  27925. if (hasProp.call(parent, key))
  27926. child[key] = parent[key];
  27927. }
  27928. function ctor() {
  27929. this.constructor = child;
  27930. }
  27931. ctor.prototype = parent.prototype;
  27932. child.prototype = new ctor();
  27933. child.__super__ = parent.prototype;
  27934. return child;
  27935. }, hasProp = {}.hasOwnProperty;
  27936. XMLNode = require2("./XMLNode");
  27937. NodeType = require2("./NodeType");
  27938. module3.exports = XMLDTDNotation = function(superClass) {
  27939. extend(XMLDTDNotation2, superClass);
  27940. function XMLDTDNotation2(parent, name, value) {
  27941. XMLDTDNotation2.__super__.constructor.call(this, parent);
  27942. if (name == null) {
  27943. throw new Error("Missing DTD notation name. " + this.debugInfo(name));
  27944. }
  27945. if (!value.pubID && !value.sysID) {
  27946. throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
  27947. }
  27948. this.name = this.stringify.name(name);
  27949. this.type = NodeType.NotationDeclaration;
  27950. if (value.pubID != null) {
  27951. this.pubID = this.stringify.dtdPubID(value.pubID);
  27952. }
  27953. if (value.sysID != null) {
  27954. this.sysID = this.stringify.dtdSysID(value.sysID);
  27955. }
  27956. }
  27957. Object.defineProperty(XMLDTDNotation2.prototype, "publicId", {
  27958. get: function() {
  27959. return this.pubID;
  27960. }
  27961. });
  27962. Object.defineProperty(XMLDTDNotation2.prototype, "systemId", {
  27963. get: function() {
  27964. return this.sysID;
  27965. }
  27966. });
  27967. XMLDTDNotation2.prototype.toString = function(options) {
  27968. return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
  27969. };
  27970. return XMLDTDNotation2;
  27971. }(XMLNode);
  27972. }).call(this);
  27973. }, { "./NodeType": 428, "./XMLNode": 450 }], 443: [function(require2, module3, exports3) {
  27974. (function() {
  27975. var NodeType, XMLDeclaration, XMLNode, isObject, extend = function(child, parent) {
  27976. for (var key in parent) {
  27977. if (hasProp.call(parent, key))
  27978. child[key] = parent[key];
  27979. }
  27980. function ctor() {
  27981. this.constructor = child;
  27982. }
  27983. ctor.prototype = parent.prototype;
  27984. child.prototype = new ctor();
  27985. child.__super__ = parent.prototype;
  27986. return child;
  27987. }, hasProp = {}.hasOwnProperty;
  27988. isObject = require2("./Utility").isObject;
  27989. XMLNode = require2("./XMLNode");
  27990. NodeType = require2("./NodeType");
  27991. module3.exports = XMLDeclaration = function(superClass) {
  27992. extend(XMLDeclaration2, superClass);
  27993. function XMLDeclaration2(parent, version, encoding, standalone) {
  27994. var ref;
  27995. XMLDeclaration2.__super__.constructor.call(this, parent);
  27996. if (isObject(version)) {
  27997. ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
  27998. }
  27999. if (!version) {
  28000. version = "1.0";
  28001. }
  28002. this.type = NodeType.Declaration;
  28003. this.version = this.stringify.xmlVersion(version);
  28004. if (encoding != null) {
  28005. this.encoding = this.stringify.xmlEncoding(encoding);
  28006. }
  28007. if (standalone != null) {
  28008. this.standalone = this.stringify.xmlStandalone(standalone);
  28009. }
  28010. }
  28011. XMLDeclaration2.prototype.toString = function(options) {
  28012. return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
  28013. };
  28014. return XMLDeclaration2;
  28015. }(XMLNode);
  28016. }).call(this);
  28017. }, { "./NodeType": 428, "./Utility": 429, "./XMLNode": 450 }], 444: [function(require2, module3, exports3) {
  28018. (function() {
  28019. var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject, extend = function(child, parent) {
  28020. for (var key in parent) {
  28021. if (hasProp.call(parent, key))
  28022. child[key] = parent[key];
  28023. }
  28024. function ctor() {
  28025. this.constructor = child;
  28026. }
  28027. ctor.prototype = parent.prototype;
  28028. child.prototype = new ctor();
  28029. child.__super__ = parent.prototype;
  28030. return child;
  28031. }, hasProp = {}.hasOwnProperty;
  28032. isObject = require2("./Utility").isObject;
  28033. XMLNode = require2("./XMLNode");
  28034. NodeType = require2("./NodeType");
  28035. XMLDTDAttList = require2("./XMLDTDAttList");
  28036. XMLDTDEntity = require2("./XMLDTDEntity");
  28037. XMLDTDElement = require2("./XMLDTDElement");
  28038. XMLDTDNotation = require2("./XMLDTDNotation");
  28039. XMLNamedNodeMap = require2("./XMLNamedNodeMap");
  28040. module3.exports = XMLDocType = function(superClass) {
  28041. extend(XMLDocType2, superClass);
  28042. function XMLDocType2(parent, pubID, sysID) {
  28043. var child, i, len, ref, ref1, ref2;
  28044. XMLDocType2.__super__.constructor.call(this, parent);
  28045. this.type = NodeType.DocType;
  28046. if (parent.children) {
  28047. ref = parent.children;
  28048. for (i = 0, len = ref.length; i < len; i++) {
  28049. child = ref[i];
  28050. if (child.type === NodeType.Element) {
  28051. this.name = child.name;
  28052. break;
  28053. }
  28054. }
  28055. }
  28056. this.documentObject = parent;
  28057. if (isObject(pubID)) {
  28058. ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;
  28059. }
  28060. if (sysID == null) {
  28061. ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];
  28062. }
  28063. if (pubID != null) {
  28064. this.pubID = this.stringify.dtdPubID(pubID);
  28065. }
  28066. if (sysID != null) {
  28067. this.sysID = this.stringify.dtdSysID(sysID);
  28068. }
  28069. }
  28070. Object.defineProperty(XMLDocType2.prototype, "entities", {
  28071. get: function() {
  28072. var child, i, len, nodes, ref;
  28073. nodes = {};
  28074. ref = this.children;
  28075. for (i = 0, len = ref.length; i < len; i++) {
  28076. child = ref[i];
  28077. if (child.type === NodeType.EntityDeclaration && !child.pe) {
  28078. nodes[child.name] = child;
  28079. }
  28080. }
  28081. return new XMLNamedNodeMap(nodes);
  28082. }
  28083. });
  28084. Object.defineProperty(XMLDocType2.prototype, "notations", {
  28085. get: function() {
  28086. var child, i, len, nodes, ref;
  28087. nodes = {};
  28088. ref = this.children;
  28089. for (i = 0, len = ref.length; i < len; i++) {
  28090. child = ref[i];
  28091. if (child.type === NodeType.NotationDeclaration) {
  28092. nodes[child.name] = child;
  28093. }
  28094. }
  28095. return new XMLNamedNodeMap(nodes);
  28096. }
  28097. });
  28098. Object.defineProperty(XMLDocType2.prototype, "publicId", {
  28099. get: function() {
  28100. return this.pubID;
  28101. }
  28102. });
  28103. Object.defineProperty(XMLDocType2.prototype, "systemId", {
  28104. get: function() {
  28105. return this.sysID;
  28106. }
  28107. });
  28108. Object.defineProperty(XMLDocType2.prototype, "internalSubset", {
  28109. get: function() {
  28110. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28111. }
  28112. });
  28113. XMLDocType2.prototype.element = function(name, value) {
  28114. var child;
  28115. child = new XMLDTDElement(this, name, value);
  28116. this.children.push(child);
  28117. return this;
  28118. };
  28119. XMLDocType2.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  28120. var child;
  28121. child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  28122. this.children.push(child);
  28123. return this;
  28124. };
  28125. XMLDocType2.prototype.entity = function(name, value) {
  28126. var child;
  28127. child = new XMLDTDEntity(this, false, name, value);
  28128. this.children.push(child);
  28129. return this;
  28130. };
  28131. XMLDocType2.prototype.pEntity = function(name, value) {
  28132. var child;
  28133. child = new XMLDTDEntity(this, true, name, value);
  28134. this.children.push(child);
  28135. return this;
  28136. };
  28137. XMLDocType2.prototype.notation = function(name, value) {
  28138. var child;
  28139. child = new XMLDTDNotation(this, name, value);
  28140. this.children.push(child);
  28141. return this;
  28142. };
  28143. XMLDocType2.prototype.toString = function(options) {
  28144. return this.options.writer.docType(this, this.options.writer.filterOptions(options));
  28145. };
  28146. XMLDocType2.prototype.ele = function(name, value) {
  28147. return this.element(name, value);
  28148. };
  28149. XMLDocType2.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  28150. return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
  28151. };
  28152. XMLDocType2.prototype.ent = function(name, value) {
  28153. return this.entity(name, value);
  28154. };
  28155. XMLDocType2.prototype.pent = function(name, value) {
  28156. return this.pEntity(name, value);
  28157. };
  28158. XMLDocType2.prototype.not = function(name, value) {
  28159. return this.notation(name, value);
  28160. };
  28161. XMLDocType2.prototype.up = function() {
  28162. return this.root() || this.documentObject;
  28163. };
  28164. XMLDocType2.prototype.isEqualNode = function(node) {
  28165. if (!XMLDocType2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
  28166. return false;
  28167. }
  28168. if (node.name !== this.name) {
  28169. return false;
  28170. }
  28171. if (node.publicId !== this.publicId) {
  28172. return false;
  28173. }
  28174. if (node.systemId !== this.systemId) {
  28175. return false;
  28176. }
  28177. return true;
  28178. };
  28179. return XMLDocType2;
  28180. }(XMLNode);
  28181. }).call(this);
  28182. }, { "./NodeType": 428, "./Utility": 429, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLNamedNodeMap": 449, "./XMLNode": 450 }], 445: [function(require2, module3, exports3) {
  28183. (function() {
  28184. var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, extend = function(child, parent) {
  28185. for (var key in parent) {
  28186. if (hasProp.call(parent, key))
  28187. child[key] = parent[key];
  28188. }
  28189. function ctor() {
  28190. this.constructor = child;
  28191. }
  28192. ctor.prototype = parent.prototype;
  28193. child.prototype = new ctor();
  28194. child.__super__ = parent.prototype;
  28195. return child;
  28196. }, hasProp = {}.hasOwnProperty;
  28197. isPlainObject = require2("./Utility").isPlainObject;
  28198. XMLDOMImplementation = require2("./XMLDOMImplementation");
  28199. XMLDOMConfiguration = require2("./XMLDOMConfiguration");
  28200. XMLNode = require2("./XMLNode");
  28201. NodeType = require2("./NodeType");
  28202. XMLStringifier = require2("./XMLStringifier");
  28203. XMLStringWriter = require2("./XMLStringWriter");
  28204. module3.exports = XMLDocument = function(superClass) {
  28205. extend(XMLDocument2, superClass);
  28206. function XMLDocument2(options) {
  28207. XMLDocument2.__super__.constructor.call(this, null);
  28208. this.name = "#document";
  28209. this.type = NodeType.Document;
  28210. this.documentURI = null;
  28211. this.domConfig = new XMLDOMConfiguration();
  28212. options || (options = {});
  28213. if (!options.writer) {
  28214. options.writer = new XMLStringWriter();
  28215. }
  28216. this.options = options;
  28217. this.stringify = new XMLStringifier(options);
  28218. }
  28219. Object.defineProperty(XMLDocument2.prototype, "implementation", {
  28220. value: new XMLDOMImplementation()
  28221. });
  28222. Object.defineProperty(XMLDocument2.prototype, "doctype", {
  28223. get: function() {
  28224. var child, i, len, ref;
  28225. ref = this.children;
  28226. for (i = 0, len = ref.length; i < len; i++) {
  28227. child = ref[i];
  28228. if (child.type === NodeType.DocType) {
  28229. return child;
  28230. }
  28231. }
  28232. return null;
  28233. }
  28234. });
  28235. Object.defineProperty(XMLDocument2.prototype, "documentElement", {
  28236. get: function() {
  28237. return this.rootObject || null;
  28238. }
  28239. });
  28240. Object.defineProperty(XMLDocument2.prototype, "inputEncoding", {
  28241. get: function() {
  28242. return null;
  28243. }
  28244. });
  28245. Object.defineProperty(XMLDocument2.prototype, "strictErrorChecking", {
  28246. get: function() {
  28247. return false;
  28248. }
  28249. });
  28250. Object.defineProperty(XMLDocument2.prototype, "xmlEncoding", {
  28251. get: function() {
  28252. if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
  28253. return this.children[0].encoding;
  28254. } else {
  28255. return null;
  28256. }
  28257. }
  28258. });
  28259. Object.defineProperty(XMLDocument2.prototype, "xmlStandalone", {
  28260. get: function() {
  28261. if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
  28262. return this.children[0].standalone === "yes";
  28263. } else {
  28264. return false;
  28265. }
  28266. }
  28267. });
  28268. Object.defineProperty(XMLDocument2.prototype, "xmlVersion", {
  28269. get: function() {
  28270. if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
  28271. return this.children[0].version;
  28272. } else {
  28273. return "1.0";
  28274. }
  28275. }
  28276. });
  28277. Object.defineProperty(XMLDocument2.prototype, "URL", {
  28278. get: function() {
  28279. return this.documentURI;
  28280. }
  28281. });
  28282. Object.defineProperty(XMLDocument2.prototype, "origin", {
  28283. get: function() {
  28284. return null;
  28285. }
  28286. });
  28287. Object.defineProperty(XMLDocument2.prototype, "compatMode", {
  28288. get: function() {
  28289. return null;
  28290. }
  28291. });
  28292. Object.defineProperty(XMLDocument2.prototype, "characterSet", {
  28293. get: function() {
  28294. return null;
  28295. }
  28296. });
  28297. Object.defineProperty(XMLDocument2.prototype, "contentType", {
  28298. get: function() {
  28299. return null;
  28300. }
  28301. });
  28302. XMLDocument2.prototype.end = function(writer) {
  28303. var writerOptions;
  28304. writerOptions = {};
  28305. if (!writer) {
  28306. writer = this.options.writer;
  28307. } else if (isPlainObject(writer)) {
  28308. writerOptions = writer;
  28309. writer = this.options.writer;
  28310. }
  28311. return writer.document(this, writer.filterOptions(writerOptions));
  28312. };
  28313. XMLDocument2.prototype.toString = function(options) {
  28314. return this.options.writer.document(this, this.options.writer.filterOptions(options));
  28315. };
  28316. XMLDocument2.prototype.createElement = function(tagName) {
  28317. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28318. };
  28319. XMLDocument2.prototype.createDocumentFragment = function() {
  28320. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28321. };
  28322. XMLDocument2.prototype.createTextNode = function(data) {
  28323. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28324. };
  28325. XMLDocument2.prototype.createComment = function(data) {
  28326. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28327. };
  28328. XMLDocument2.prototype.createCDATASection = function(data) {
  28329. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28330. };
  28331. XMLDocument2.prototype.createProcessingInstruction = function(target, data) {
  28332. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28333. };
  28334. XMLDocument2.prototype.createAttribute = function(name) {
  28335. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28336. };
  28337. XMLDocument2.prototype.createEntityReference = function(name) {
  28338. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28339. };
  28340. XMLDocument2.prototype.getElementsByTagName = function(tagname) {
  28341. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28342. };
  28343. XMLDocument2.prototype.importNode = function(importedNode, deep) {
  28344. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28345. };
  28346. XMLDocument2.prototype.createElementNS = function(namespaceURI, qualifiedName) {
  28347. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28348. };
  28349. XMLDocument2.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
  28350. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28351. };
  28352. XMLDocument2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
  28353. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28354. };
  28355. XMLDocument2.prototype.getElementById = function(elementId) {
  28356. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28357. };
  28358. XMLDocument2.prototype.adoptNode = function(source) {
  28359. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28360. };
  28361. XMLDocument2.prototype.normalizeDocument = function() {
  28362. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28363. };
  28364. XMLDocument2.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
  28365. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28366. };
  28367. XMLDocument2.prototype.getElementsByClassName = function(classNames) {
  28368. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28369. };
  28370. XMLDocument2.prototype.createEvent = function(eventInterface) {
  28371. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28372. };
  28373. XMLDocument2.prototype.createRange = function() {
  28374. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28375. };
  28376. XMLDocument2.prototype.createNodeIterator = function(root, whatToShow, filter) {
  28377. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28378. };
  28379. XMLDocument2.prototype.createTreeWalker = function(root, whatToShow, filter) {
  28380. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28381. };
  28382. return XMLDocument2;
  28383. }(XMLNode);
  28384. }).call(this);
  28385. }, { "./NodeType": 428, "./Utility": 429, "./XMLDOMConfiguration": 435, "./XMLDOMImplementation": 437, "./XMLNode": 450, "./XMLStringWriter": 455, "./XMLStringifier": 456 }], 446: [function(require2, module3, exports3) {
  28386. (function() {
  28387. var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty;
  28388. ref = require2("./Utility"), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
  28389. NodeType = require2("./NodeType");
  28390. XMLDocument = require2("./XMLDocument");
  28391. XMLElement = require2("./XMLElement");
  28392. XMLCData = require2("./XMLCData");
  28393. XMLComment = require2("./XMLComment");
  28394. XMLRaw = require2("./XMLRaw");
  28395. XMLText = require2("./XMLText");
  28396. XMLProcessingInstruction = require2("./XMLProcessingInstruction");
  28397. XMLDeclaration = require2("./XMLDeclaration");
  28398. XMLDocType = require2("./XMLDocType");
  28399. XMLDTDAttList = require2("./XMLDTDAttList");
  28400. XMLDTDEntity = require2("./XMLDTDEntity");
  28401. XMLDTDElement = require2("./XMLDTDElement");
  28402. XMLDTDNotation = require2("./XMLDTDNotation");
  28403. XMLAttribute = require2("./XMLAttribute");
  28404. XMLStringifier = require2("./XMLStringifier");
  28405. XMLStringWriter = require2("./XMLStringWriter");
  28406. WriterState = require2("./WriterState");
  28407. module3.exports = XMLDocumentCB = function() {
  28408. function XMLDocumentCB2(options, onData, onEnd) {
  28409. var writerOptions;
  28410. this.name = "?xml";
  28411. this.type = NodeType.Document;
  28412. options || (options = {});
  28413. writerOptions = {};
  28414. if (!options.writer) {
  28415. options.writer = new XMLStringWriter();
  28416. } else if (isPlainObject(options.writer)) {
  28417. writerOptions = options.writer;
  28418. options.writer = new XMLStringWriter();
  28419. }
  28420. this.options = options;
  28421. this.writer = options.writer;
  28422. this.writerOptions = this.writer.filterOptions(writerOptions);
  28423. this.stringify = new XMLStringifier(options);
  28424. this.onDataCallback = onData || function() {
  28425. };
  28426. this.onEndCallback = onEnd || function() {
  28427. };
  28428. this.currentNode = null;
  28429. this.currentLevel = -1;
  28430. this.openTags = {};
  28431. this.documentStarted = false;
  28432. this.documentCompleted = false;
  28433. this.root = null;
  28434. }
  28435. XMLDocumentCB2.prototype.createChildNode = function(node) {
  28436. var att, attName, attributes, child, i, len, ref1, ref2;
  28437. switch (node.type) {
  28438. case NodeType.CData:
  28439. this.cdata(node.value);
  28440. break;
  28441. case NodeType.Comment:
  28442. this.comment(node.value);
  28443. break;
  28444. case NodeType.Element:
  28445. attributes = {};
  28446. ref1 = node.attribs;
  28447. for (attName in ref1) {
  28448. if (!hasProp.call(ref1, attName))
  28449. continue;
  28450. att = ref1[attName];
  28451. attributes[attName] = att.value;
  28452. }
  28453. this.node(node.name, attributes);
  28454. break;
  28455. case NodeType.Dummy:
  28456. this.dummy();
  28457. break;
  28458. case NodeType.Raw:
  28459. this.raw(node.value);
  28460. break;
  28461. case NodeType.Text:
  28462. this.text(node.value);
  28463. break;
  28464. case NodeType.ProcessingInstruction:
  28465. this.instruction(node.target, node.value);
  28466. break;
  28467. default:
  28468. throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
  28469. }
  28470. ref2 = node.children;
  28471. for (i = 0, len = ref2.length; i < len; i++) {
  28472. child = ref2[i];
  28473. this.createChildNode(child);
  28474. if (child.type === NodeType.Element) {
  28475. this.up();
  28476. }
  28477. }
  28478. return this;
  28479. };
  28480. XMLDocumentCB2.prototype.dummy = function() {
  28481. return this;
  28482. };
  28483. XMLDocumentCB2.prototype.node = function(name, attributes, text) {
  28484. var ref1;
  28485. if (name == null) {
  28486. throw new Error("Missing node name.");
  28487. }
  28488. if (this.root && this.currentLevel === -1) {
  28489. throw new Error("Document can only have one root node. " + this.debugInfo(name));
  28490. }
  28491. this.openCurrent();
  28492. name = getValue(name);
  28493. if (attributes == null) {
  28494. attributes = {};
  28495. }
  28496. attributes = getValue(attributes);
  28497. if (!isObject(attributes)) {
  28498. ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
  28499. }
  28500. this.currentNode = new XMLElement(this, name, attributes);
  28501. this.currentNode.children = false;
  28502. this.currentLevel++;
  28503. this.openTags[this.currentLevel] = this.currentNode;
  28504. if (text != null) {
  28505. this.text(text);
  28506. }
  28507. return this;
  28508. };
  28509. XMLDocumentCB2.prototype.element = function(name, attributes, text) {
  28510. var child, i, len, oldValidationFlag, ref1, root;
  28511. if (this.currentNode && this.currentNode.type === NodeType.DocType) {
  28512. this.dtdElement.apply(this, arguments);
  28513. } else {
  28514. if (Array.isArray(name) || isObject(name) || isFunction(name)) {
  28515. oldValidationFlag = this.options.noValidation;
  28516. this.options.noValidation = true;
  28517. root = new XMLDocument(this.options).element("TEMP_ROOT");
  28518. root.element(name);
  28519. this.options.noValidation = oldValidationFlag;
  28520. ref1 = root.children;
  28521. for (i = 0, len = ref1.length; i < len; i++) {
  28522. child = ref1[i];
  28523. this.createChildNode(child);
  28524. if (child.type === NodeType.Element) {
  28525. this.up();
  28526. }
  28527. }
  28528. } else {
  28529. this.node(name, attributes, text);
  28530. }
  28531. }
  28532. return this;
  28533. };
  28534. XMLDocumentCB2.prototype.attribute = function(name, value) {
  28535. var attName, attValue;
  28536. if (!this.currentNode || this.currentNode.children) {
  28537. throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
  28538. }
  28539. if (name != null) {
  28540. name = getValue(name);
  28541. }
  28542. if (isObject(name)) {
  28543. for (attName in name) {
  28544. if (!hasProp.call(name, attName))
  28545. continue;
  28546. attValue = name[attName];
  28547. this.attribute(attName, attValue);
  28548. }
  28549. } else {
  28550. if (isFunction(value)) {
  28551. value = value.apply();
  28552. }
  28553. if (this.options.keepNullAttributes && value == null) {
  28554. this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
  28555. } else if (value != null) {
  28556. this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
  28557. }
  28558. }
  28559. return this;
  28560. };
  28561. XMLDocumentCB2.prototype.text = function(value) {
  28562. var node;
  28563. this.openCurrent();
  28564. node = new XMLText(this, value);
  28565. this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28566. return this;
  28567. };
  28568. XMLDocumentCB2.prototype.cdata = function(value) {
  28569. var node;
  28570. this.openCurrent();
  28571. node = new XMLCData(this, value);
  28572. this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28573. return this;
  28574. };
  28575. XMLDocumentCB2.prototype.comment = function(value) {
  28576. var node;
  28577. this.openCurrent();
  28578. node = new XMLComment(this, value);
  28579. this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28580. return this;
  28581. };
  28582. XMLDocumentCB2.prototype.raw = function(value) {
  28583. var node;
  28584. this.openCurrent();
  28585. node = new XMLRaw(this, value);
  28586. this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28587. return this;
  28588. };
  28589. XMLDocumentCB2.prototype.instruction = function(target, value) {
  28590. var i, insTarget, insValue, len, node;
  28591. this.openCurrent();
  28592. if (target != null) {
  28593. target = getValue(target);
  28594. }
  28595. if (value != null) {
  28596. value = getValue(value);
  28597. }
  28598. if (Array.isArray(target)) {
  28599. for (i = 0, len = target.length; i < len; i++) {
  28600. insTarget = target[i];
  28601. this.instruction(insTarget);
  28602. }
  28603. } else if (isObject(target)) {
  28604. for (insTarget in target) {
  28605. if (!hasProp.call(target, insTarget))
  28606. continue;
  28607. insValue = target[insTarget];
  28608. this.instruction(insTarget, insValue);
  28609. }
  28610. } else {
  28611. if (isFunction(value)) {
  28612. value = value.apply();
  28613. }
  28614. node = new XMLProcessingInstruction(this, target, value);
  28615. this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28616. }
  28617. return this;
  28618. };
  28619. XMLDocumentCB2.prototype.declaration = function(version, encoding, standalone) {
  28620. var node;
  28621. this.openCurrent();
  28622. if (this.documentStarted) {
  28623. throw new Error("declaration() must be the first node.");
  28624. }
  28625. node = new XMLDeclaration(this, version, encoding, standalone);
  28626. this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28627. return this;
  28628. };
  28629. XMLDocumentCB2.prototype.doctype = function(root, pubID, sysID) {
  28630. this.openCurrent();
  28631. if (root == null) {
  28632. throw new Error("Missing root node name.");
  28633. }
  28634. if (this.root) {
  28635. throw new Error("dtd() must come before the root node.");
  28636. }
  28637. this.currentNode = new XMLDocType(this, pubID, sysID);
  28638. this.currentNode.rootNodeName = root;
  28639. this.currentNode.children = false;
  28640. this.currentLevel++;
  28641. this.openTags[this.currentLevel] = this.currentNode;
  28642. return this;
  28643. };
  28644. XMLDocumentCB2.prototype.dtdElement = function(name, value) {
  28645. var node;
  28646. this.openCurrent();
  28647. node = new XMLDTDElement(this, name, value);
  28648. this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28649. return this;
  28650. };
  28651. XMLDocumentCB2.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  28652. var node;
  28653. this.openCurrent();
  28654. node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  28655. this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28656. return this;
  28657. };
  28658. XMLDocumentCB2.prototype.entity = function(name, value) {
  28659. var node;
  28660. this.openCurrent();
  28661. node = new XMLDTDEntity(this, false, name, value);
  28662. this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28663. return this;
  28664. };
  28665. XMLDocumentCB2.prototype.pEntity = function(name, value) {
  28666. var node;
  28667. this.openCurrent();
  28668. node = new XMLDTDEntity(this, true, name, value);
  28669. this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28670. return this;
  28671. };
  28672. XMLDocumentCB2.prototype.notation = function(name, value) {
  28673. var node;
  28674. this.openCurrent();
  28675. node = new XMLDTDNotation(this, name, value);
  28676. this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
  28677. return this;
  28678. };
  28679. XMLDocumentCB2.prototype.up = function() {
  28680. if (this.currentLevel < 0) {
  28681. throw new Error("The document node has no parent.");
  28682. }
  28683. if (this.currentNode) {
  28684. if (this.currentNode.children) {
  28685. this.closeNode(this.currentNode);
  28686. } else {
  28687. this.openNode(this.currentNode);
  28688. }
  28689. this.currentNode = null;
  28690. } else {
  28691. this.closeNode(this.openTags[this.currentLevel]);
  28692. }
  28693. delete this.openTags[this.currentLevel];
  28694. this.currentLevel--;
  28695. return this;
  28696. };
  28697. XMLDocumentCB2.prototype.end = function() {
  28698. while (this.currentLevel >= 0) {
  28699. this.up();
  28700. }
  28701. return this.onEnd();
  28702. };
  28703. XMLDocumentCB2.prototype.openCurrent = function() {
  28704. if (this.currentNode) {
  28705. this.currentNode.children = true;
  28706. return this.openNode(this.currentNode);
  28707. }
  28708. };
  28709. XMLDocumentCB2.prototype.openNode = function(node) {
  28710. var att, chunk, name, ref1;
  28711. if (!node.isOpen) {
  28712. if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
  28713. this.root = node;
  28714. }
  28715. chunk = "";
  28716. if (node.type === NodeType.Element) {
  28717. this.writerOptions.state = WriterState.OpenTag;
  28718. chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name;
  28719. ref1 = node.attribs;
  28720. for (name in ref1) {
  28721. if (!hasProp.call(ref1, name))
  28722. continue;
  28723. att = ref1[name];
  28724. chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
  28725. }
  28726. chunk += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel);
  28727. this.writerOptions.state = WriterState.InsideTag;
  28728. } else {
  28729. this.writerOptions.state = WriterState.OpenTag;
  28730. chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<!DOCTYPE " + node.rootNodeName;
  28731. if (node.pubID && node.sysID) {
  28732. chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  28733. } else if (node.sysID) {
  28734. chunk += ' SYSTEM "' + node.sysID + '"';
  28735. }
  28736. if (node.children) {
  28737. chunk += " [";
  28738. this.writerOptions.state = WriterState.InsideTag;
  28739. } else {
  28740. this.writerOptions.state = WriterState.CloseTag;
  28741. chunk += ">";
  28742. }
  28743. chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
  28744. }
  28745. this.onData(chunk, this.currentLevel);
  28746. return node.isOpen = true;
  28747. }
  28748. };
  28749. XMLDocumentCB2.prototype.closeNode = function(node) {
  28750. var chunk;
  28751. if (!node.isClosed) {
  28752. chunk = "";
  28753. this.writerOptions.state = WriterState.CloseTag;
  28754. if (node.type === NodeType.Element) {
  28755. chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "</" + node.name + ">" + this.writer.endline(node, this.writerOptions, this.currentLevel);
  28756. } else {
  28757. chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel);
  28758. }
  28759. this.writerOptions.state = WriterState.None;
  28760. this.onData(chunk, this.currentLevel);
  28761. return node.isClosed = true;
  28762. }
  28763. };
  28764. XMLDocumentCB2.prototype.onData = function(chunk, level) {
  28765. this.documentStarted = true;
  28766. return this.onDataCallback(chunk, level + 1);
  28767. };
  28768. XMLDocumentCB2.prototype.onEnd = function() {
  28769. this.documentCompleted = true;
  28770. return this.onEndCallback();
  28771. };
  28772. XMLDocumentCB2.prototype.debugInfo = function(name) {
  28773. if (name == null) {
  28774. return "";
  28775. } else {
  28776. return "node: <" + name + ">";
  28777. }
  28778. };
  28779. XMLDocumentCB2.prototype.ele = function() {
  28780. return this.element.apply(this, arguments);
  28781. };
  28782. XMLDocumentCB2.prototype.nod = function(name, attributes, text) {
  28783. return this.node(name, attributes, text);
  28784. };
  28785. XMLDocumentCB2.prototype.txt = function(value) {
  28786. return this.text(value);
  28787. };
  28788. XMLDocumentCB2.prototype.dat = function(value) {
  28789. return this.cdata(value);
  28790. };
  28791. XMLDocumentCB2.prototype.com = function(value) {
  28792. return this.comment(value);
  28793. };
  28794. XMLDocumentCB2.prototype.ins = function(target, value) {
  28795. return this.instruction(target, value);
  28796. };
  28797. XMLDocumentCB2.prototype.dec = function(version, encoding, standalone) {
  28798. return this.declaration(version, encoding, standalone);
  28799. };
  28800. XMLDocumentCB2.prototype.dtd = function(root, pubID, sysID) {
  28801. return this.doctype(root, pubID, sysID);
  28802. };
  28803. XMLDocumentCB2.prototype.e = function(name, attributes, text) {
  28804. return this.element(name, attributes, text);
  28805. };
  28806. XMLDocumentCB2.prototype.n = function(name, attributes, text) {
  28807. return this.node(name, attributes, text);
  28808. };
  28809. XMLDocumentCB2.prototype.t = function(value) {
  28810. return this.text(value);
  28811. };
  28812. XMLDocumentCB2.prototype.d = function(value) {
  28813. return this.cdata(value);
  28814. };
  28815. XMLDocumentCB2.prototype.c = function(value) {
  28816. return this.comment(value);
  28817. };
  28818. XMLDocumentCB2.prototype.r = function(value) {
  28819. return this.raw(value);
  28820. };
  28821. XMLDocumentCB2.prototype.i = function(target, value) {
  28822. return this.instruction(target, value);
  28823. };
  28824. XMLDocumentCB2.prototype.att = function() {
  28825. if (this.currentNode && this.currentNode.type === NodeType.DocType) {
  28826. return this.attList.apply(this, arguments);
  28827. } else {
  28828. return this.attribute.apply(this, arguments);
  28829. }
  28830. };
  28831. XMLDocumentCB2.prototype.a = function() {
  28832. if (this.currentNode && this.currentNode.type === NodeType.DocType) {
  28833. return this.attList.apply(this, arguments);
  28834. } else {
  28835. return this.attribute.apply(this, arguments);
  28836. }
  28837. };
  28838. XMLDocumentCB2.prototype.ent = function(name, value) {
  28839. return this.entity(name, value);
  28840. };
  28841. XMLDocumentCB2.prototype.pent = function(name, value) {
  28842. return this.pEntity(name, value);
  28843. };
  28844. XMLDocumentCB2.prototype.not = function(name, value) {
  28845. return this.notation(name, value);
  28846. };
  28847. return XMLDocumentCB2;
  28848. }();
  28849. }).call(this);
  28850. }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLAttribute": 431, "./XMLCData": 432, "./XMLComment": 434, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDocument": 445, "./XMLElement": 448, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLStringWriter": 455, "./XMLStringifier": 456, "./XMLText": 457 }], 447: [function(require2, module3, exports3) {
  28851. (function() {
  28852. var NodeType, XMLDummy, XMLNode, extend = function(child, parent) {
  28853. for (var key in parent) {
  28854. if (hasProp.call(parent, key))
  28855. child[key] = parent[key];
  28856. }
  28857. function ctor() {
  28858. this.constructor = child;
  28859. }
  28860. ctor.prototype = parent.prototype;
  28861. child.prototype = new ctor();
  28862. child.__super__ = parent.prototype;
  28863. return child;
  28864. }, hasProp = {}.hasOwnProperty;
  28865. XMLNode = require2("./XMLNode");
  28866. NodeType = require2("./NodeType");
  28867. module3.exports = XMLDummy = function(superClass) {
  28868. extend(XMLDummy2, superClass);
  28869. function XMLDummy2(parent) {
  28870. XMLDummy2.__super__.constructor.call(this, parent);
  28871. this.type = NodeType.Dummy;
  28872. }
  28873. XMLDummy2.prototype.clone = function() {
  28874. return Object.create(this);
  28875. };
  28876. XMLDummy2.prototype.toString = function(options) {
  28877. return "";
  28878. };
  28879. return XMLDummy2;
  28880. }(XMLNode);
  28881. }).call(this);
  28882. }, { "./NodeType": 428, "./XMLNode": 450 }], 448: [function(require2, module3, exports3) {
  28883. (function() {
  28884. var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, extend = function(child, parent) {
  28885. for (var key in parent) {
  28886. if (hasProp.call(parent, key))
  28887. child[key] = parent[key];
  28888. }
  28889. function ctor() {
  28890. this.constructor = child;
  28891. }
  28892. ctor.prototype = parent.prototype;
  28893. child.prototype = new ctor();
  28894. child.__super__ = parent.prototype;
  28895. return child;
  28896. }, hasProp = {}.hasOwnProperty;
  28897. ref = require2("./Utility"), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
  28898. XMLNode = require2("./XMLNode");
  28899. NodeType = require2("./NodeType");
  28900. XMLAttribute = require2("./XMLAttribute");
  28901. XMLNamedNodeMap = require2("./XMLNamedNodeMap");
  28902. module3.exports = XMLElement = function(superClass) {
  28903. extend(XMLElement2, superClass);
  28904. function XMLElement2(parent, name, attributes) {
  28905. var child, j, len, ref1;
  28906. XMLElement2.__super__.constructor.call(this, parent);
  28907. if (name == null) {
  28908. throw new Error("Missing element name. " + this.debugInfo());
  28909. }
  28910. this.name = this.stringify.name(name);
  28911. this.type = NodeType.Element;
  28912. this.attribs = {};
  28913. this.schemaTypeInfo = null;
  28914. if (attributes != null) {
  28915. this.attribute(attributes);
  28916. }
  28917. if (parent.type === NodeType.Document) {
  28918. this.isRoot = true;
  28919. this.documentObject = parent;
  28920. parent.rootObject = this;
  28921. if (parent.children) {
  28922. ref1 = parent.children;
  28923. for (j = 0, len = ref1.length; j < len; j++) {
  28924. child = ref1[j];
  28925. if (child.type === NodeType.DocType) {
  28926. child.name = this.name;
  28927. break;
  28928. }
  28929. }
  28930. }
  28931. }
  28932. }
  28933. Object.defineProperty(XMLElement2.prototype, "tagName", {
  28934. get: function() {
  28935. return this.name;
  28936. }
  28937. });
  28938. Object.defineProperty(XMLElement2.prototype, "namespaceURI", {
  28939. get: function() {
  28940. return "";
  28941. }
  28942. });
  28943. Object.defineProperty(XMLElement2.prototype, "prefix", {
  28944. get: function() {
  28945. return "";
  28946. }
  28947. });
  28948. Object.defineProperty(XMLElement2.prototype, "localName", {
  28949. get: function() {
  28950. return this.name;
  28951. }
  28952. });
  28953. Object.defineProperty(XMLElement2.prototype, "id", {
  28954. get: function() {
  28955. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28956. }
  28957. });
  28958. Object.defineProperty(XMLElement2.prototype, "className", {
  28959. get: function() {
  28960. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28961. }
  28962. });
  28963. Object.defineProperty(XMLElement2.prototype, "classList", {
  28964. get: function() {
  28965. throw new Error("This DOM method is not implemented." + this.debugInfo());
  28966. }
  28967. });
  28968. Object.defineProperty(XMLElement2.prototype, "attributes", {
  28969. get: function() {
  28970. if (!this.attributeMap || !this.attributeMap.nodes) {
  28971. this.attributeMap = new XMLNamedNodeMap(this.attribs);
  28972. }
  28973. return this.attributeMap;
  28974. }
  28975. });
  28976. XMLElement2.prototype.clone = function() {
  28977. var att, attName, clonedSelf, ref1;
  28978. clonedSelf = Object.create(this);
  28979. if (clonedSelf.isRoot) {
  28980. clonedSelf.documentObject = null;
  28981. }
  28982. clonedSelf.attribs = {};
  28983. ref1 = this.attribs;
  28984. for (attName in ref1) {
  28985. if (!hasProp.call(ref1, attName))
  28986. continue;
  28987. att = ref1[attName];
  28988. clonedSelf.attribs[attName] = att.clone();
  28989. }
  28990. clonedSelf.children = [];
  28991. this.children.forEach(function(child) {
  28992. var clonedChild;
  28993. clonedChild = child.clone();
  28994. clonedChild.parent = clonedSelf;
  28995. return clonedSelf.children.push(clonedChild);
  28996. });
  28997. return clonedSelf;
  28998. };
  28999. XMLElement2.prototype.attribute = function(name, value) {
  29000. var attName, attValue;
  29001. if (name != null) {
  29002. name = getValue(name);
  29003. }
  29004. if (isObject(name)) {
  29005. for (attName in name) {
  29006. if (!hasProp.call(name, attName))
  29007. continue;
  29008. attValue = name[attName];
  29009. this.attribute(attName, attValue);
  29010. }
  29011. } else {
  29012. if (isFunction(value)) {
  29013. value = value.apply();
  29014. }
  29015. if (this.options.keepNullAttributes && value == null) {
  29016. this.attribs[name] = new XMLAttribute(this, name, "");
  29017. } else if (value != null) {
  29018. this.attribs[name] = new XMLAttribute(this, name, value);
  29019. }
  29020. }
  29021. return this;
  29022. };
  29023. XMLElement2.prototype.removeAttribute = function(name) {
  29024. var attName, j, len;
  29025. if (name == null) {
  29026. throw new Error("Missing attribute name. " + this.debugInfo());
  29027. }
  29028. name = getValue(name);
  29029. if (Array.isArray(name)) {
  29030. for (j = 0, len = name.length; j < len; j++) {
  29031. attName = name[j];
  29032. delete this.attribs[attName];
  29033. }
  29034. } else {
  29035. delete this.attribs[name];
  29036. }
  29037. return this;
  29038. };
  29039. XMLElement2.prototype.toString = function(options) {
  29040. return this.options.writer.element(this, this.options.writer.filterOptions(options));
  29041. };
  29042. XMLElement2.prototype.att = function(name, value) {
  29043. return this.attribute(name, value);
  29044. };
  29045. XMLElement2.prototype.a = function(name, value) {
  29046. return this.attribute(name, value);
  29047. };
  29048. XMLElement2.prototype.getAttribute = function(name) {
  29049. if (this.attribs.hasOwnProperty(name)) {
  29050. return this.attribs[name].value;
  29051. } else {
  29052. return null;
  29053. }
  29054. };
  29055. XMLElement2.prototype.setAttribute = function(name, value) {
  29056. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29057. };
  29058. XMLElement2.prototype.getAttributeNode = function(name) {
  29059. if (this.attribs.hasOwnProperty(name)) {
  29060. return this.attribs[name];
  29061. } else {
  29062. return null;
  29063. }
  29064. };
  29065. XMLElement2.prototype.setAttributeNode = function(newAttr) {
  29066. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29067. };
  29068. XMLElement2.prototype.removeAttributeNode = function(oldAttr) {
  29069. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29070. };
  29071. XMLElement2.prototype.getElementsByTagName = function(name) {
  29072. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29073. };
  29074. XMLElement2.prototype.getAttributeNS = function(namespaceURI, localName) {
  29075. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29076. };
  29077. XMLElement2.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
  29078. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29079. };
  29080. XMLElement2.prototype.removeAttributeNS = function(namespaceURI, localName) {
  29081. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29082. };
  29083. XMLElement2.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
  29084. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29085. };
  29086. XMLElement2.prototype.setAttributeNodeNS = function(newAttr) {
  29087. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29088. };
  29089. XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
  29090. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29091. };
  29092. XMLElement2.prototype.hasAttribute = function(name) {
  29093. return this.attribs.hasOwnProperty(name);
  29094. };
  29095. XMLElement2.prototype.hasAttributeNS = function(namespaceURI, localName) {
  29096. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29097. };
  29098. XMLElement2.prototype.setIdAttribute = function(name, isId) {
  29099. if (this.attribs.hasOwnProperty(name)) {
  29100. return this.attribs[name].isId;
  29101. } else {
  29102. return isId;
  29103. }
  29104. };
  29105. XMLElement2.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
  29106. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29107. };
  29108. XMLElement2.prototype.setIdAttributeNode = function(idAttr, isId) {
  29109. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29110. };
  29111. XMLElement2.prototype.getElementsByTagName = function(tagname) {
  29112. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29113. };
  29114. XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
  29115. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29116. };
  29117. XMLElement2.prototype.getElementsByClassName = function(classNames) {
  29118. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29119. };
  29120. XMLElement2.prototype.isEqualNode = function(node) {
  29121. var i, j, ref1;
  29122. if (!XMLElement2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
  29123. return false;
  29124. }
  29125. if (node.namespaceURI !== this.namespaceURI) {
  29126. return false;
  29127. }
  29128. if (node.prefix !== this.prefix) {
  29129. return false;
  29130. }
  29131. if (node.localName !== this.localName) {
  29132. return false;
  29133. }
  29134. if (node.attribs.length !== this.attribs.length) {
  29135. return false;
  29136. }
  29137. for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {
  29138. if (!this.attribs[i].isEqualNode(node.attribs[i])) {
  29139. return false;
  29140. }
  29141. }
  29142. return true;
  29143. };
  29144. return XMLElement2;
  29145. }(XMLNode);
  29146. }).call(this);
  29147. }, { "./NodeType": 428, "./Utility": 429, "./XMLAttribute": 431, "./XMLNamedNodeMap": 449, "./XMLNode": 450 }], 449: [function(require2, module3, exports3) {
  29148. (function() {
  29149. var XMLNamedNodeMap;
  29150. module3.exports = XMLNamedNodeMap = function() {
  29151. function XMLNamedNodeMap2(nodes) {
  29152. this.nodes = nodes;
  29153. }
  29154. Object.defineProperty(XMLNamedNodeMap2.prototype, "length", {
  29155. get: function() {
  29156. return Object.keys(this.nodes).length || 0;
  29157. }
  29158. });
  29159. XMLNamedNodeMap2.prototype.clone = function() {
  29160. return this.nodes = null;
  29161. };
  29162. XMLNamedNodeMap2.prototype.getNamedItem = function(name) {
  29163. return this.nodes[name];
  29164. };
  29165. XMLNamedNodeMap2.prototype.setNamedItem = function(node) {
  29166. var oldNode;
  29167. oldNode = this.nodes[node.nodeName];
  29168. this.nodes[node.nodeName] = node;
  29169. return oldNode || null;
  29170. };
  29171. XMLNamedNodeMap2.prototype.removeNamedItem = function(name) {
  29172. var oldNode;
  29173. oldNode = this.nodes[name];
  29174. delete this.nodes[name];
  29175. return oldNode || null;
  29176. };
  29177. XMLNamedNodeMap2.prototype.item = function(index) {
  29178. return this.nodes[Object.keys(this.nodes)[index]] || null;
  29179. };
  29180. XMLNamedNodeMap2.prototype.getNamedItemNS = function(namespaceURI, localName) {
  29181. throw new Error("This DOM method is not implemented.");
  29182. };
  29183. XMLNamedNodeMap2.prototype.setNamedItemNS = function(node) {
  29184. throw new Error("This DOM method is not implemented.");
  29185. };
  29186. XMLNamedNodeMap2.prototype.removeNamedItemNS = function(namespaceURI, localName) {
  29187. throw new Error("This DOM method is not implemented.");
  29188. };
  29189. return XMLNamedNodeMap2;
  29190. }();
  29191. }).call(this);
  29192. }, {}], 450: [function(require2, module3, exports3) {
  29193. (function() {
  29194. var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, hasProp = {}.hasOwnProperty;
  29195. ref1 = require2("./Utility"), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
  29196. XMLElement = null;
  29197. XMLCData = null;
  29198. XMLComment = null;
  29199. XMLDeclaration = null;
  29200. XMLDocType = null;
  29201. XMLRaw = null;
  29202. XMLText = null;
  29203. XMLProcessingInstruction = null;
  29204. XMLDummy = null;
  29205. NodeType = null;
  29206. XMLNodeList = null;
  29207. XMLNamedNodeMap = null;
  29208. DocumentPosition = null;
  29209. module3.exports = XMLNode = function() {
  29210. function XMLNode2(parent1) {
  29211. this.parent = parent1;
  29212. if (this.parent) {
  29213. this.options = this.parent.options;
  29214. this.stringify = this.parent.stringify;
  29215. }
  29216. this.value = null;
  29217. this.children = [];
  29218. this.baseURI = null;
  29219. if (!XMLElement) {
  29220. XMLElement = require2("./XMLElement");
  29221. XMLCData = require2("./XMLCData");
  29222. XMLComment = require2("./XMLComment");
  29223. XMLDeclaration = require2("./XMLDeclaration");
  29224. XMLDocType = require2("./XMLDocType");
  29225. XMLRaw = require2("./XMLRaw");
  29226. XMLText = require2("./XMLText");
  29227. XMLProcessingInstruction = require2("./XMLProcessingInstruction");
  29228. XMLDummy = require2("./XMLDummy");
  29229. NodeType = require2("./NodeType");
  29230. XMLNodeList = require2("./XMLNodeList");
  29231. XMLNamedNodeMap = require2("./XMLNamedNodeMap");
  29232. DocumentPosition = require2("./DocumentPosition");
  29233. }
  29234. }
  29235. Object.defineProperty(XMLNode2.prototype, "nodeName", {
  29236. get: function() {
  29237. return this.name;
  29238. }
  29239. });
  29240. Object.defineProperty(XMLNode2.prototype, "nodeType", {
  29241. get: function() {
  29242. return this.type;
  29243. }
  29244. });
  29245. Object.defineProperty(XMLNode2.prototype, "nodeValue", {
  29246. get: function() {
  29247. return this.value;
  29248. }
  29249. });
  29250. Object.defineProperty(XMLNode2.prototype, "parentNode", {
  29251. get: function() {
  29252. return this.parent;
  29253. }
  29254. });
  29255. Object.defineProperty(XMLNode2.prototype, "childNodes", {
  29256. get: function() {
  29257. if (!this.childNodeList || !this.childNodeList.nodes) {
  29258. this.childNodeList = new XMLNodeList(this.children);
  29259. }
  29260. return this.childNodeList;
  29261. }
  29262. });
  29263. Object.defineProperty(XMLNode2.prototype, "firstChild", {
  29264. get: function() {
  29265. return this.children[0] || null;
  29266. }
  29267. });
  29268. Object.defineProperty(XMLNode2.prototype, "lastChild", {
  29269. get: function() {
  29270. return this.children[this.children.length - 1] || null;
  29271. }
  29272. });
  29273. Object.defineProperty(XMLNode2.prototype, "previousSibling", {
  29274. get: function() {
  29275. var i;
  29276. i = this.parent.children.indexOf(this);
  29277. return this.parent.children[i - 1] || null;
  29278. }
  29279. });
  29280. Object.defineProperty(XMLNode2.prototype, "nextSibling", {
  29281. get: function() {
  29282. var i;
  29283. i = this.parent.children.indexOf(this);
  29284. return this.parent.children[i + 1] || null;
  29285. }
  29286. });
  29287. Object.defineProperty(XMLNode2.prototype, "ownerDocument", {
  29288. get: function() {
  29289. return this.document() || null;
  29290. }
  29291. });
  29292. Object.defineProperty(XMLNode2.prototype, "textContent", {
  29293. get: function() {
  29294. var child, j, len, ref2, str;
  29295. if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
  29296. str = "";
  29297. ref2 = this.children;
  29298. for (j = 0, len = ref2.length; j < len; j++) {
  29299. child = ref2[j];
  29300. if (child.textContent) {
  29301. str += child.textContent;
  29302. }
  29303. }
  29304. return str;
  29305. } else {
  29306. return null;
  29307. }
  29308. },
  29309. set: function(value) {
  29310. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29311. }
  29312. });
  29313. XMLNode2.prototype.setParent = function(parent) {
  29314. var child, j, len, ref2, results;
  29315. this.parent = parent;
  29316. if (parent) {
  29317. this.options = parent.options;
  29318. this.stringify = parent.stringify;
  29319. }
  29320. ref2 = this.children;
  29321. results = [];
  29322. for (j = 0, len = ref2.length; j < len; j++) {
  29323. child = ref2[j];
  29324. results.push(child.setParent(this));
  29325. }
  29326. return results;
  29327. };
  29328. XMLNode2.prototype.element = function(name, attributes, text) {
  29329. var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
  29330. lastChild = null;
  29331. if (attributes === null && text == null) {
  29332. ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
  29333. }
  29334. if (attributes == null) {
  29335. attributes = {};
  29336. }
  29337. attributes = getValue(attributes);
  29338. if (!isObject(attributes)) {
  29339. ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
  29340. }
  29341. if (name != null) {
  29342. name = getValue(name);
  29343. }
  29344. if (Array.isArray(name)) {
  29345. for (j = 0, len = name.length; j < len; j++) {
  29346. item = name[j];
  29347. lastChild = this.element(item);
  29348. }
  29349. } else if (isFunction(name)) {
  29350. lastChild = this.element(name.apply());
  29351. } else if (isObject(name)) {
  29352. for (key in name) {
  29353. if (!hasProp.call(name, key))
  29354. continue;
  29355. val = name[key];
  29356. if (isFunction(val)) {
  29357. val = val.apply();
  29358. }
  29359. if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
  29360. lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
  29361. } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
  29362. lastChild = this.dummy();
  29363. } else if (isObject(val) && isEmpty(val)) {
  29364. lastChild = this.element(key);
  29365. } else if (!this.options.keepNullNodes && val == null) {
  29366. lastChild = this.dummy();
  29367. } else if (!this.options.separateArrayItems && Array.isArray(val)) {
  29368. for (k = 0, len1 = val.length; k < len1; k++) {
  29369. item = val[k];
  29370. childNode = {};
  29371. childNode[key] = item;
  29372. lastChild = this.element(childNode);
  29373. }
  29374. } else if (isObject(val)) {
  29375. if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
  29376. lastChild = this.element(val);
  29377. } else {
  29378. lastChild = this.element(key);
  29379. lastChild.element(val);
  29380. }
  29381. } else {
  29382. lastChild = this.element(key, val);
  29383. }
  29384. }
  29385. } else if (!this.options.keepNullNodes && text === null) {
  29386. lastChild = this.dummy();
  29387. } else {
  29388. if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
  29389. lastChild = this.text(text);
  29390. } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
  29391. lastChild = this.cdata(text);
  29392. } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
  29393. lastChild = this.comment(text);
  29394. } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
  29395. lastChild = this.raw(text);
  29396. } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
  29397. lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
  29398. } else {
  29399. lastChild = this.node(name, attributes, text);
  29400. }
  29401. }
  29402. if (lastChild == null) {
  29403. throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
  29404. }
  29405. return lastChild;
  29406. };
  29407. XMLNode2.prototype.insertBefore = function(name, attributes, text) {
  29408. var child, i, newChild, refChild, removed;
  29409. if (name != null ? name.type : void 0) {
  29410. newChild = name;
  29411. refChild = attributes;
  29412. newChild.setParent(this);
  29413. if (refChild) {
  29414. i = children.indexOf(refChild);
  29415. removed = children.splice(i);
  29416. children.push(newChild);
  29417. Array.prototype.push.apply(children, removed);
  29418. } else {
  29419. children.push(newChild);
  29420. }
  29421. return newChild;
  29422. } else {
  29423. if (this.isRoot) {
  29424. throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
  29425. }
  29426. i = this.parent.children.indexOf(this);
  29427. removed = this.parent.children.splice(i);
  29428. child = this.parent.element(name, attributes, text);
  29429. Array.prototype.push.apply(this.parent.children, removed);
  29430. return child;
  29431. }
  29432. };
  29433. XMLNode2.prototype.insertAfter = function(name, attributes, text) {
  29434. var child, i, removed;
  29435. if (this.isRoot) {
  29436. throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
  29437. }
  29438. i = this.parent.children.indexOf(this);
  29439. removed = this.parent.children.splice(i + 1);
  29440. child = this.parent.element(name, attributes, text);
  29441. Array.prototype.push.apply(this.parent.children, removed);
  29442. return child;
  29443. };
  29444. XMLNode2.prototype.remove = function() {
  29445. var i, ref2;
  29446. if (this.isRoot) {
  29447. throw new Error("Cannot remove the root element. " + this.debugInfo());
  29448. }
  29449. i = this.parent.children.indexOf(this);
  29450. [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
  29451. return this.parent;
  29452. };
  29453. XMLNode2.prototype.node = function(name, attributes, text) {
  29454. var child, ref2;
  29455. if (name != null) {
  29456. name = getValue(name);
  29457. }
  29458. attributes || (attributes = {});
  29459. attributes = getValue(attributes);
  29460. if (!isObject(attributes)) {
  29461. ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
  29462. }
  29463. child = new XMLElement(this, name, attributes);
  29464. if (text != null) {
  29465. child.text(text);
  29466. }
  29467. this.children.push(child);
  29468. return child;
  29469. };
  29470. XMLNode2.prototype.text = function(value) {
  29471. var child;
  29472. if (isObject(value)) {
  29473. this.element(value);
  29474. }
  29475. child = new XMLText(this, value);
  29476. this.children.push(child);
  29477. return this;
  29478. };
  29479. XMLNode2.prototype.cdata = function(value) {
  29480. var child;
  29481. child = new XMLCData(this, value);
  29482. this.children.push(child);
  29483. return this;
  29484. };
  29485. XMLNode2.prototype.comment = function(value) {
  29486. var child;
  29487. child = new XMLComment(this, value);
  29488. this.children.push(child);
  29489. return this;
  29490. };
  29491. XMLNode2.prototype.commentBefore = function(value) {
  29492. var child, i, removed;
  29493. i = this.parent.children.indexOf(this);
  29494. removed = this.parent.children.splice(i);
  29495. child = this.parent.comment(value);
  29496. Array.prototype.push.apply(this.parent.children, removed);
  29497. return this;
  29498. };
  29499. XMLNode2.prototype.commentAfter = function(value) {
  29500. var child, i, removed;
  29501. i = this.parent.children.indexOf(this);
  29502. removed = this.parent.children.splice(i + 1);
  29503. child = this.parent.comment(value);
  29504. Array.prototype.push.apply(this.parent.children, removed);
  29505. return this;
  29506. };
  29507. XMLNode2.prototype.raw = function(value) {
  29508. var child;
  29509. child = new XMLRaw(this, value);
  29510. this.children.push(child);
  29511. return this;
  29512. };
  29513. XMLNode2.prototype.dummy = function() {
  29514. var child;
  29515. child = new XMLDummy(this);
  29516. return child;
  29517. };
  29518. XMLNode2.prototype.instruction = function(target, value) {
  29519. var insTarget, insValue, instruction, j, len;
  29520. if (target != null) {
  29521. target = getValue(target);
  29522. }
  29523. if (value != null) {
  29524. value = getValue(value);
  29525. }
  29526. if (Array.isArray(target)) {
  29527. for (j = 0, len = target.length; j < len; j++) {
  29528. insTarget = target[j];
  29529. this.instruction(insTarget);
  29530. }
  29531. } else if (isObject(target)) {
  29532. for (insTarget in target) {
  29533. if (!hasProp.call(target, insTarget))
  29534. continue;
  29535. insValue = target[insTarget];
  29536. this.instruction(insTarget, insValue);
  29537. }
  29538. } else {
  29539. if (isFunction(value)) {
  29540. value = value.apply();
  29541. }
  29542. instruction = new XMLProcessingInstruction(this, target, value);
  29543. this.children.push(instruction);
  29544. }
  29545. return this;
  29546. };
  29547. XMLNode2.prototype.instructionBefore = function(target, value) {
  29548. var child, i, removed;
  29549. i = this.parent.children.indexOf(this);
  29550. removed = this.parent.children.splice(i);
  29551. child = this.parent.instruction(target, value);
  29552. Array.prototype.push.apply(this.parent.children, removed);
  29553. return this;
  29554. };
  29555. XMLNode2.prototype.instructionAfter = function(target, value) {
  29556. var child, i, removed;
  29557. i = this.parent.children.indexOf(this);
  29558. removed = this.parent.children.splice(i + 1);
  29559. child = this.parent.instruction(target, value);
  29560. Array.prototype.push.apply(this.parent.children, removed);
  29561. return this;
  29562. };
  29563. XMLNode2.prototype.declaration = function(version, encoding, standalone) {
  29564. var doc, xmldec;
  29565. doc = this.document();
  29566. xmldec = new XMLDeclaration(doc, version, encoding, standalone);
  29567. if (doc.children.length === 0) {
  29568. doc.children.unshift(xmldec);
  29569. } else if (doc.children[0].type === NodeType.Declaration) {
  29570. doc.children[0] = xmldec;
  29571. } else {
  29572. doc.children.unshift(xmldec);
  29573. }
  29574. return doc.root() || doc;
  29575. };
  29576. XMLNode2.prototype.dtd = function(pubID, sysID) {
  29577. var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
  29578. doc = this.document();
  29579. doctype = new XMLDocType(doc, pubID, sysID);
  29580. ref2 = doc.children;
  29581. for (i = j = 0, len = ref2.length; j < len; i = ++j) {
  29582. child = ref2[i];
  29583. if (child.type === NodeType.DocType) {
  29584. doc.children[i] = doctype;
  29585. return doctype;
  29586. }
  29587. }
  29588. ref3 = doc.children;
  29589. for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
  29590. child = ref3[i];
  29591. if (child.isRoot) {
  29592. doc.children.splice(i, 0, doctype);
  29593. return doctype;
  29594. }
  29595. }
  29596. doc.children.push(doctype);
  29597. return doctype;
  29598. };
  29599. XMLNode2.prototype.up = function() {
  29600. if (this.isRoot) {
  29601. throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
  29602. }
  29603. return this.parent;
  29604. };
  29605. XMLNode2.prototype.root = function() {
  29606. var node;
  29607. node = this;
  29608. while (node) {
  29609. if (node.type === NodeType.Document) {
  29610. return node.rootObject;
  29611. } else if (node.isRoot) {
  29612. return node;
  29613. } else {
  29614. node = node.parent;
  29615. }
  29616. }
  29617. };
  29618. XMLNode2.prototype.document = function() {
  29619. var node;
  29620. node = this;
  29621. while (node) {
  29622. if (node.type === NodeType.Document) {
  29623. return node;
  29624. } else {
  29625. node = node.parent;
  29626. }
  29627. }
  29628. };
  29629. XMLNode2.prototype.end = function(options) {
  29630. return this.document().end(options);
  29631. };
  29632. XMLNode2.prototype.prev = function() {
  29633. var i;
  29634. i = this.parent.children.indexOf(this);
  29635. if (i < 1) {
  29636. throw new Error("Already at the first node. " + this.debugInfo());
  29637. }
  29638. return this.parent.children[i - 1];
  29639. };
  29640. XMLNode2.prototype.next = function() {
  29641. var i;
  29642. i = this.parent.children.indexOf(this);
  29643. if (i === -1 || i === this.parent.children.length - 1) {
  29644. throw new Error("Already at the last node. " + this.debugInfo());
  29645. }
  29646. return this.parent.children[i + 1];
  29647. };
  29648. XMLNode2.prototype.importDocument = function(doc) {
  29649. var clonedRoot;
  29650. clonedRoot = doc.root().clone();
  29651. clonedRoot.parent = this;
  29652. clonedRoot.isRoot = false;
  29653. this.children.push(clonedRoot);
  29654. return this;
  29655. };
  29656. XMLNode2.prototype.debugInfo = function(name) {
  29657. var ref2, ref3;
  29658. name = name || this.name;
  29659. if (name == null && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
  29660. return "";
  29661. } else if (name == null) {
  29662. return "parent: <" + this.parent.name + ">";
  29663. } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
  29664. return "node: <" + name + ">";
  29665. } else {
  29666. return "node: <" + name + ">, parent: <" + this.parent.name + ">";
  29667. }
  29668. };
  29669. XMLNode2.prototype.ele = function(name, attributes, text) {
  29670. return this.element(name, attributes, text);
  29671. };
  29672. XMLNode2.prototype.nod = function(name, attributes, text) {
  29673. return this.node(name, attributes, text);
  29674. };
  29675. XMLNode2.prototype.txt = function(value) {
  29676. return this.text(value);
  29677. };
  29678. XMLNode2.prototype.dat = function(value) {
  29679. return this.cdata(value);
  29680. };
  29681. XMLNode2.prototype.com = function(value) {
  29682. return this.comment(value);
  29683. };
  29684. XMLNode2.prototype.ins = function(target, value) {
  29685. return this.instruction(target, value);
  29686. };
  29687. XMLNode2.prototype.doc = function() {
  29688. return this.document();
  29689. };
  29690. XMLNode2.prototype.dec = function(version, encoding, standalone) {
  29691. return this.declaration(version, encoding, standalone);
  29692. };
  29693. XMLNode2.prototype.e = function(name, attributes, text) {
  29694. return this.element(name, attributes, text);
  29695. };
  29696. XMLNode2.prototype.n = function(name, attributes, text) {
  29697. return this.node(name, attributes, text);
  29698. };
  29699. XMLNode2.prototype.t = function(value) {
  29700. return this.text(value);
  29701. };
  29702. XMLNode2.prototype.d = function(value) {
  29703. return this.cdata(value);
  29704. };
  29705. XMLNode2.prototype.c = function(value) {
  29706. return this.comment(value);
  29707. };
  29708. XMLNode2.prototype.r = function(value) {
  29709. return this.raw(value);
  29710. };
  29711. XMLNode2.prototype.i = function(target, value) {
  29712. return this.instruction(target, value);
  29713. };
  29714. XMLNode2.prototype.u = function() {
  29715. return this.up();
  29716. };
  29717. XMLNode2.prototype.importXMLBuilder = function(doc) {
  29718. return this.importDocument(doc);
  29719. };
  29720. XMLNode2.prototype.replaceChild = function(newChild, oldChild) {
  29721. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29722. };
  29723. XMLNode2.prototype.removeChild = function(oldChild) {
  29724. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29725. };
  29726. XMLNode2.prototype.appendChild = function(newChild) {
  29727. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29728. };
  29729. XMLNode2.prototype.hasChildNodes = function() {
  29730. return this.children.length !== 0;
  29731. };
  29732. XMLNode2.prototype.cloneNode = function(deep) {
  29733. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29734. };
  29735. XMLNode2.prototype.normalize = function() {
  29736. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29737. };
  29738. XMLNode2.prototype.isSupported = function(feature, version) {
  29739. return true;
  29740. };
  29741. XMLNode2.prototype.hasAttributes = function() {
  29742. return this.attribs.length !== 0;
  29743. };
  29744. XMLNode2.prototype.compareDocumentPosition = function(other) {
  29745. var ref, res;
  29746. ref = this;
  29747. if (ref === other) {
  29748. return 0;
  29749. } else if (this.document() !== other.document()) {
  29750. res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
  29751. if (Math.random() < 0.5) {
  29752. res |= DocumentPosition.Preceding;
  29753. } else {
  29754. res |= DocumentPosition.Following;
  29755. }
  29756. return res;
  29757. } else if (ref.isAncestor(other)) {
  29758. return DocumentPosition.Contains | DocumentPosition.Preceding;
  29759. } else if (ref.isDescendant(other)) {
  29760. return DocumentPosition.Contains | DocumentPosition.Following;
  29761. } else if (ref.isPreceding(other)) {
  29762. return DocumentPosition.Preceding;
  29763. } else {
  29764. return DocumentPosition.Following;
  29765. }
  29766. };
  29767. XMLNode2.prototype.isSameNode = function(other) {
  29768. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29769. };
  29770. XMLNode2.prototype.lookupPrefix = function(namespaceURI) {
  29771. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29772. };
  29773. XMLNode2.prototype.isDefaultNamespace = function(namespaceURI) {
  29774. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29775. };
  29776. XMLNode2.prototype.lookupNamespaceURI = function(prefix) {
  29777. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29778. };
  29779. XMLNode2.prototype.isEqualNode = function(node) {
  29780. var i, j, ref2;
  29781. if (node.nodeType !== this.nodeType) {
  29782. return false;
  29783. }
  29784. if (node.children.length !== this.children.length) {
  29785. return false;
  29786. }
  29787. for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
  29788. if (!this.children[i].isEqualNode(node.children[i])) {
  29789. return false;
  29790. }
  29791. }
  29792. return true;
  29793. };
  29794. XMLNode2.prototype.getFeature = function(feature, version) {
  29795. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29796. };
  29797. XMLNode2.prototype.setUserData = function(key, data, handler) {
  29798. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29799. };
  29800. XMLNode2.prototype.getUserData = function(key) {
  29801. throw new Error("This DOM method is not implemented." + this.debugInfo());
  29802. };
  29803. XMLNode2.prototype.contains = function(other) {
  29804. if (!other) {
  29805. return false;
  29806. }
  29807. return other === this || this.isDescendant(other);
  29808. };
  29809. XMLNode2.prototype.isDescendant = function(node) {
  29810. var child, isDescendantChild, j, len, ref2;
  29811. ref2 = this.children;
  29812. for (j = 0, len = ref2.length; j < len; j++) {
  29813. child = ref2[j];
  29814. if (node === child) {
  29815. return true;
  29816. }
  29817. isDescendantChild = child.isDescendant(node);
  29818. if (isDescendantChild) {
  29819. return true;
  29820. }
  29821. }
  29822. return false;
  29823. };
  29824. XMLNode2.prototype.isAncestor = function(node) {
  29825. return node.isDescendant(this);
  29826. };
  29827. XMLNode2.prototype.isPreceding = function(node) {
  29828. var nodePos, thisPos;
  29829. nodePos = this.treePosition(node);
  29830. thisPos = this.treePosition(this);
  29831. if (nodePos === -1 || thisPos === -1) {
  29832. return false;
  29833. } else {
  29834. return nodePos < thisPos;
  29835. }
  29836. };
  29837. XMLNode2.prototype.isFollowing = function(node) {
  29838. var nodePos, thisPos;
  29839. nodePos = this.treePosition(node);
  29840. thisPos = this.treePosition(this);
  29841. if (nodePos === -1 || thisPos === -1) {
  29842. return false;
  29843. } else {
  29844. return nodePos > thisPos;
  29845. }
  29846. };
  29847. XMLNode2.prototype.treePosition = function(node) {
  29848. var found, pos;
  29849. pos = 0;
  29850. found = false;
  29851. this.foreachTreeNode(this.document(), function(childNode) {
  29852. pos++;
  29853. if (!found && childNode === node) {
  29854. return found = true;
  29855. }
  29856. });
  29857. if (found) {
  29858. return pos;
  29859. } else {
  29860. return -1;
  29861. }
  29862. };
  29863. XMLNode2.prototype.foreachTreeNode = function(node, func) {
  29864. var child, j, len, ref2, res;
  29865. node || (node = this.document());
  29866. ref2 = node.children;
  29867. for (j = 0, len = ref2.length; j < len; j++) {
  29868. child = ref2[j];
  29869. if (res = func(child)) {
  29870. return res;
  29871. } else {
  29872. res = this.foreachTreeNode(child, func);
  29873. if (res) {
  29874. return res;
  29875. }
  29876. }
  29877. }
  29878. };
  29879. return XMLNode2;
  29880. }();
  29881. }).call(this);
  29882. }, { "./DocumentPosition": 427, "./NodeType": 428, "./Utility": 429, "./XMLCData": 432, "./XMLComment": 434, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDummy": 447, "./XMLElement": 448, "./XMLNamedNodeMap": 449, "./XMLNodeList": 451, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLText": 457 }], 451: [function(require2, module3, exports3) {
  29883. (function() {
  29884. var XMLNodeList;
  29885. module3.exports = XMLNodeList = function() {
  29886. function XMLNodeList2(nodes) {
  29887. this.nodes = nodes;
  29888. }
  29889. Object.defineProperty(XMLNodeList2.prototype, "length", {
  29890. get: function() {
  29891. return this.nodes.length || 0;
  29892. }
  29893. });
  29894. XMLNodeList2.prototype.clone = function() {
  29895. return this.nodes = null;
  29896. };
  29897. XMLNodeList2.prototype.item = function(index) {
  29898. return this.nodes[index] || null;
  29899. };
  29900. return XMLNodeList2;
  29901. }();
  29902. }).call(this);
  29903. }, {}], 452: [function(require2, module3, exports3) {
  29904. (function() {
  29905. var NodeType, XMLCharacterData, XMLProcessingInstruction, extend = function(child, parent) {
  29906. for (var key in parent) {
  29907. if (hasProp.call(parent, key))
  29908. child[key] = parent[key];
  29909. }
  29910. function ctor() {
  29911. this.constructor = child;
  29912. }
  29913. ctor.prototype = parent.prototype;
  29914. child.prototype = new ctor();
  29915. child.__super__ = parent.prototype;
  29916. return child;
  29917. }, hasProp = {}.hasOwnProperty;
  29918. NodeType = require2("./NodeType");
  29919. XMLCharacterData = require2("./XMLCharacterData");
  29920. module3.exports = XMLProcessingInstruction = function(superClass) {
  29921. extend(XMLProcessingInstruction2, superClass);
  29922. function XMLProcessingInstruction2(parent, target, value) {
  29923. XMLProcessingInstruction2.__super__.constructor.call(this, parent);
  29924. if (target == null) {
  29925. throw new Error("Missing instruction target. " + this.debugInfo());
  29926. }
  29927. this.type = NodeType.ProcessingInstruction;
  29928. this.target = this.stringify.insTarget(target);
  29929. this.name = this.target;
  29930. if (value) {
  29931. this.value = this.stringify.insValue(value);
  29932. }
  29933. }
  29934. XMLProcessingInstruction2.prototype.clone = function() {
  29935. return Object.create(this);
  29936. };
  29937. XMLProcessingInstruction2.prototype.toString = function(options) {
  29938. return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
  29939. };
  29940. XMLProcessingInstruction2.prototype.isEqualNode = function(node) {
  29941. if (!XMLProcessingInstruction2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
  29942. return false;
  29943. }
  29944. if (node.target !== this.target) {
  29945. return false;
  29946. }
  29947. return true;
  29948. };
  29949. return XMLProcessingInstruction2;
  29950. }(XMLCharacterData);
  29951. }).call(this);
  29952. }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 453: [function(require2, module3, exports3) {
  29953. (function() {
  29954. var NodeType, XMLNode, XMLRaw, extend = function(child, parent) {
  29955. for (var key in parent) {
  29956. if (hasProp.call(parent, key))
  29957. child[key] = parent[key];
  29958. }
  29959. function ctor() {
  29960. this.constructor = child;
  29961. }
  29962. ctor.prototype = parent.prototype;
  29963. child.prototype = new ctor();
  29964. child.__super__ = parent.prototype;
  29965. return child;
  29966. }, hasProp = {}.hasOwnProperty;
  29967. NodeType = require2("./NodeType");
  29968. XMLNode = require2("./XMLNode");
  29969. module3.exports = XMLRaw = function(superClass) {
  29970. extend(XMLRaw2, superClass);
  29971. function XMLRaw2(parent, text) {
  29972. XMLRaw2.__super__.constructor.call(this, parent);
  29973. if (text == null) {
  29974. throw new Error("Missing raw text. " + this.debugInfo());
  29975. }
  29976. this.type = NodeType.Raw;
  29977. this.value = this.stringify.raw(text);
  29978. }
  29979. XMLRaw2.prototype.clone = function() {
  29980. return Object.create(this);
  29981. };
  29982. XMLRaw2.prototype.toString = function(options) {
  29983. return this.options.writer.raw(this, this.options.writer.filterOptions(options));
  29984. };
  29985. return XMLRaw2;
  29986. }(XMLNode);
  29987. }).call(this);
  29988. }, { "./NodeType": 428, "./XMLNode": 450 }], 454: [function(require2, module3, exports3) {
  29989. (function() {
  29990. var NodeType, WriterState, XMLStreamWriter, XMLWriterBase, extend = function(child, parent) {
  29991. for (var key in parent) {
  29992. if (hasProp.call(parent, key))
  29993. child[key] = parent[key];
  29994. }
  29995. function ctor() {
  29996. this.constructor = child;
  29997. }
  29998. ctor.prototype = parent.prototype;
  29999. child.prototype = new ctor();
  30000. child.__super__ = parent.prototype;
  30001. return child;
  30002. }, hasProp = {}.hasOwnProperty;
  30003. NodeType = require2("./NodeType");
  30004. XMLWriterBase = require2("./XMLWriterBase");
  30005. WriterState = require2("./WriterState");
  30006. module3.exports = XMLStreamWriter = function(superClass) {
  30007. extend(XMLStreamWriter2, superClass);
  30008. function XMLStreamWriter2(stream, options) {
  30009. this.stream = stream;
  30010. XMLStreamWriter2.__super__.constructor.call(this, options);
  30011. }
  30012. XMLStreamWriter2.prototype.endline = function(node, options, level) {
  30013. if (node.isLastRootNode && options.state === WriterState.CloseTag) {
  30014. return "";
  30015. } else {
  30016. return XMLStreamWriter2.__super__.endline.call(this, node, options, level);
  30017. }
  30018. };
  30019. XMLStreamWriter2.prototype.document = function(doc, options) {
  30020. var child, i, j, k, len, len1, ref, ref1, results;
  30021. ref = doc.children;
  30022. for (i = j = 0, len = ref.length; j < len; i = ++j) {
  30023. child = ref[i];
  30024. child.isLastRootNode = i === doc.children.length - 1;
  30025. }
  30026. options = this.filterOptions(options);
  30027. ref1 = doc.children;
  30028. results = [];
  30029. for (k = 0, len1 = ref1.length; k < len1; k++) {
  30030. child = ref1[k];
  30031. results.push(this.writeChildNode(child, options, 0));
  30032. }
  30033. return results;
  30034. };
  30035. XMLStreamWriter2.prototype.attribute = function(att, options, level) {
  30036. return this.stream.write(XMLStreamWriter2.__super__.attribute.call(this, att, options, level));
  30037. };
  30038. XMLStreamWriter2.prototype.cdata = function(node, options, level) {
  30039. return this.stream.write(XMLStreamWriter2.__super__.cdata.call(this, node, options, level));
  30040. };
  30041. XMLStreamWriter2.prototype.comment = function(node, options, level) {
  30042. return this.stream.write(XMLStreamWriter2.__super__.comment.call(this, node, options, level));
  30043. };
  30044. XMLStreamWriter2.prototype.declaration = function(node, options, level) {
  30045. return this.stream.write(XMLStreamWriter2.__super__.declaration.call(this, node, options, level));
  30046. };
  30047. XMLStreamWriter2.prototype.docType = function(node, options, level) {
  30048. var child, j, len, ref;
  30049. level || (level = 0);
  30050. this.openNode(node, options, level);
  30051. options.state = WriterState.OpenTag;
  30052. this.stream.write(this.indent(node, options, level));
  30053. this.stream.write("<!DOCTYPE " + node.root().name);
  30054. if (node.pubID && node.sysID) {
  30055. this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
  30056. } else if (node.sysID) {
  30057. this.stream.write(' SYSTEM "' + node.sysID + '"');
  30058. }
  30059. if (node.children.length > 0) {
  30060. this.stream.write(" [");
  30061. this.stream.write(this.endline(node, options, level));
  30062. options.state = WriterState.InsideTag;
  30063. ref = node.children;
  30064. for (j = 0, len = ref.length; j < len; j++) {
  30065. child = ref[j];
  30066. this.writeChildNode(child, options, level + 1);
  30067. }
  30068. options.state = WriterState.CloseTag;
  30069. this.stream.write("]");
  30070. }
  30071. options.state = WriterState.CloseTag;
  30072. this.stream.write(options.spaceBeforeSlash + ">");
  30073. this.stream.write(this.endline(node, options, level));
  30074. options.state = WriterState.None;
  30075. return this.closeNode(node, options, level);
  30076. };
  30077. XMLStreamWriter2.prototype.element = function(node, options, level) {
  30078. var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;
  30079. level || (level = 0);
  30080. this.openNode(node, options, level);
  30081. options.state = WriterState.OpenTag;
  30082. this.stream.write(this.indent(node, options, level) + "<" + node.name);
  30083. ref = node.attribs;
  30084. for (name in ref) {
  30085. if (!hasProp.call(ref, name))
  30086. continue;
  30087. att = ref[name];
  30088. this.attribute(att, options, level);
  30089. }
  30090. childNodeCount = node.children.length;
  30091. firstChildNode = childNodeCount === 0 ? null : node.children[0];
  30092. if (childNodeCount === 0 || node.children.every(function(e) {
  30093. return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
  30094. })) {
  30095. if (options.allowEmpty) {
  30096. this.stream.write(">");
  30097. options.state = WriterState.CloseTag;
  30098. this.stream.write("</" + node.name + ">");
  30099. } else {
  30100. options.state = WriterState.CloseTag;
  30101. this.stream.write(options.spaceBeforeSlash + "/>");
  30102. }
  30103. } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
  30104. this.stream.write(">");
  30105. options.state = WriterState.InsideTag;
  30106. options.suppressPrettyCount++;
  30107. prettySuppressed = true;
  30108. this.writeChildNode(firstChildNode, options, level + 1);
  30109. options.suppressPrettyCount--;
  30110. prettySuppressed = false;
  30111. options.state = WriterState.CloseTag;
  30112. this.stream.write("</" + node.name + ">");
  30113. } else {
  30114. this.stream.write(">" + this.endline(node, options, level));
  30115. options.state = WriterState.InsideTag;
  30116. ref1 = node.children;
  30117. for (j = 0, len = ref1.length; j < len; j++) {
  30118. child = ref1[j];
  30119. this.writeChildNode(child, options, level + 1);
  30120. }
  30121. options.state = WriterState.CloseTag;
  30122. this.stream.write(this.indent(node, options, level) + "</" + node.name + ">");
  30123. }
  30124. this.stream.write(this.endline(node, options, level));
  30125. options.state = WriterState.None;
  30126. return this.closeNode(node, options, level);
  30127. };
  30128. XMLStreamWriter2.prototype.processingInstruction = function(node, options, level) {
  30129. return this.stream.write(XMLStreamWriter2.__super__.processingInstruction.call(this, node, options, level));
  30130. };
  30131. XMLStreamWriter2.prototype.raw = function(node, options, level) {
  30132. return this.stream.write(XMLStreamWriter2.__super__.raw.call(this, node, options, level));
  30133. };
  30134. XMLStreamWriter2.prototype.text = function(node, options, level) {
  30135. return this.stream.write(XMLStreamWriter2.__super__.text.call(this, node, options, level));
  30136. };
  30137. XMLStreamWriter2.prototype.dtdAttList = function(node, options, level) {
  30138. return this.stream.write(XMLStreamWriter2.__super__.dtdAttList.call(this, node, options, level));
  30139. };
  30140. XMLStreamWriter2.prototype.dtdElement = function(node, options, level) {
  30141. return this.stream.write(XMLStreamWriter2.__super__.dtdElement.call(this, node, options, level));
  30142. };
  30143. XMLStreamWriter2.prototype.dtdEntity = function(node, options, level) {
  30144. return this.stream.write(XMLStreamWriter2.__super__.dtdEntity.call(this, node, options, level));
  30145. };
  30146. XMLStreamWriter2.prototype.dtdNotation = function(node, options, level) {
  30147. return this.stream.write(XMLStreamWriter2.__super__.dtdNotation.call(this, node, options, level));
  30148. };
  30149. return XMLStreamWriter2;
  30150. }(XMLWriterBase);
  30151. }).call(this);
  30152. }, { "./NodeType": 428, "./WriterState": 430, "./XMLWriterBase": 458 }], 455: [function(require2, module3, exports3) {
  30153. (function() {
  30154. var XMLStringWriter, XMLWriterBase, extend = function(child, parent) {
  30155. for (var key in parent) {
  30156. if (hasProp.call(parent, key))
  30157. child[key] = parent[key];
  30158. }
  30159. function ctor() {
  30160. this.constructor = child;
  30161. }
  30162. ctor.prototype = parent.prototype;
  30163. child.prototype = new ctor();
  30164. child.__super__ = parent.prototype;
  30165. return child;
  30166. }, hasProp = {}.hasOwnProperty;
  30167. XMLWriterBase = require2("./XMLWriterBase");
  30168. module3.exports = XMLStringWriter = function(superClass) {
  30169. extend(XMLStringWriter2, superClass);
  30170. function XMLStringWriter2(options) {
  30171. XMLStringWriter2.__super__.constructor.call(this, options);
  30172. }
  30173. XMLStringWriter2.prototype.document = function(doc, options) {
  30174. var child, i, len, r, ref;
  30175. options = this.filterOptions(options);
  30176. r = "";
  30177. ref = doc.children;
  30178. for (i = 0, len = ref.length; i < len; i++) {
  30179. child = ref[i];
  30180. r += this.writeChildNode(child, options, 0);
  30181. }
  30182. if (options.pretty && r.slice(-options.newline.length) === options.newline) {
  30183. r = r.slice(0, -options.newline.length);
  30184. }
  30185. return r;
  30186. };
  30187. return XMLStringWriter2;
  30188. }(XMLWriterBase);
  30189. }).call(this);
  30190. }, { "./XMLWriterBase": 458 }], 456: [function(require2, module3, exports3) {
  30191. (function() {
  30192. var XMLStringifier, bind = function(fn, me) {
  30193. return function() {
  30194. return fn.apply(me, arguments);
  30195. };
  30196. }, hasProp = {}.hasOwnProperty;
  30197. module3.exports = XMLStringifier = function() {
  30198. function XMLStringifier2(options) {
  30199. this.assertLegalName = bind(this.assertLegalName, this);
  30200. this.assertLegalChar = bind(this.assertLegalChar, this);
  30201. var key, ref, value;
  30202. options || (options = {});
  30203. this.options = options;
  30204. if (!this.options.version) {
  30205. this.options.version = "1.0";
  30206. }
  30207. ref = options.stringify || {};
  30208. for (key in ref) {
  30209. if (!hasProp.call(ref, key))
  30210. continue;
  30211. value = ref[key];
  30212. this[key] = value;
  30213. }
  30214. }
  30215. XMLStringifier2.prototype.name = function(val) {
  30216. if (this.options.noValidation) {
  30217. return val;
  30218. }
  30219. return this.assertLegalName("" + val || "");
  30220. };
  30221. XMLStringifier2.prototype.text = function(val) {
  30222. if (this.options.noValidation) {
  30223. return val;
  30224. }
  30225. return this.assertLegalChar(this.textEscape("" + val || ""));
  30226. };
  30227. XMLStringifier2.prototype.cdata = function(val) {
  30228. if (this.options.noValidation) {
  30229. return val;
  30230. }
  30231. val = "" + val || "";
  30232. val = val.replace("]]>", "]]]]><![CDATA[>");
  30233. return this.assertLegalChar(val);
  30234. };
  30235. XMLStringifier2.prototype.comment = function(val) {
  30236. if (this.options.noValidation) {
  30237. return val;
  30238. }
  30239. val = "" + val || "";
  30240. if (val.match(/--/)) {
  30241. throw new Error("Comment text cannot contain double-hypen: " + val);
  30242. }
  30243. return this.assertLegalChar(val);
  30244. };
  30245. XMLStringifier2.prototype.raw = function(val) {
  30246. if (this.options.noValidation) {
  30247. return val;
  30248. }
  30249. return "" + val || "";
  30250. };
  30251. XMLStringifier2.prototype.attValue = function(val) {
  30252. if (this.options.noValidation) {
  30253. return val;
  30254. }
  30255. return this.assertLegalChar(this.attEscape(val = "" + val || ""));
  30256. };
  30257. XMLStringifier2.prototype.insTarget = function(val) {
  30258. if (this.options.noValidation) {
  30259. return val;
  30260. }
  30261. return this.assertLegalChar("" + val || "");
  30262. };
  30263. XMLStringifier2.prototype.insValue = function(val) {
  30264. if (this.options.noValidation) {
  30265. return val;
  30266. }
  30267. val = "" + val || "";
  30268. if (val.match(/\?>/)) {
  30269. throw new Error("Invalid processing instruction value: " + val);
  30270. }
  30271. return this.assertLegalChar(val);
  30272. };
  30273. XMLStringifier2.prototype.xmlVersion = function(val) {
  30274. if (this.options.noValidation) {
  30275. return val;
  30276. }
  30277. val = "" + val || "";
  30278. if (!val.match(/1\.[0-9]+/)) {
  30279. throw new Error("Invalid version number: " + val);
  30280. }
  30281. return val;
  30282. };
  30283. XMLStringifier2.prototype.xmlEncoding = function(val) {
  30284. if (this.options.noValidation) {
  30285. return val;
  30286. }
  30287. val = "" + val || "";
  30288. if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
  30289. throw new Error("Invalid encoding: " + val);
  30290. }
  30291. return this.assertLegalChar(val);
  30292. };
  30293. XMLStringifier2.prototype.xmlStandalone = function(val) {
  30294. if (this.options.noValidation) {
  30295. return val;
  30296. }
  30297. if (val) {
  30298. return "yes";
  30299. } else {
  30300. return "no";
  30301. }
  30302. };
  30303. XMLStringifier2.prototype.dtdPubID = function(val) {
  30304. if (this.options.noValidation) {
  30305. return val;
  30306. }
  30307. return this.assertLegalChar("" + val || "");
  30308. };
  30309. XMLStringifier2.prototype.dtdSysID = function(val) {
  30310. if (this.options.noValidation) {
  30311. return val;
  30312. }
  30313. return this.assertLegalChar("" + val || "");
  30314. };
  30315. XMLStringifier2.prototype.dtdElementValue = function(val) {
  30316. if (this.options.noValidation) {
  30317. return val;
  30318. }
  30319. return this.assertLegalChar("" + val || "");
  30320. };
  30321. XMLStringifier2.prototype.dtdAttType = function(val) {
  30322. if (this.options.noValidation) {
  30323. return val;
  30324. }
  30325. return this.assertLegalChar("" + val || "");
  30326. };
  30327. XMLStringifier2.prototype.dtdAttDefault = function(val) {
  30328. if (this.options.noValidation) {
  30329. return val;
  30330. }
  30331. return this.assertLegalChar("" + val || "");
  30332. };
  30333. XMLStringifier2.prototype.dtdEntityValue = function(val) {
  30334. if (this.options.noValidation) {
  30335. return val;
  30336. }
  30337. return this.assertLegalChar("" + val || "");
  30338. };
  30339. XMLStringifier2.prototype.dtdNData = function(val) {
  30340. if (this.options.noValidation) {
  30341. return val;
  30342. }
  30343. return this.assertLegalChar("" + val || "");
  30344. };
  30345. XMLStringifier2.prototype.convertAttKey = "@";
  30346. XMLStringifier2.prototype.convertPIKey = "?";
  30347. XMLStringifier2.prototype.convertTextKey = "#text";
  30348. XMLStringifier2.prototype.convertCDataKey = "#cdata";
  30349. XMLStringifier2.prototype.convertCommentKey = "#comment";
  30350. XMLStringifier2.prototype.convertRawKey = "#raw";
  30351. XMLStringifier2.prototype.assertLegalChar = function(str) {
  30352. var regex, res;
  30353. if (this.options.noValidation) {
  30354. return str;
  30355. }
  30356. regex = "";
  30357. if (this.options.version === "1.0") {
  30358. regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  30359. if (res = str.match(regex)) {
  30360. throw new Error("Invalid character in string: " + str + " at index " + res.index);
  30361. }
  30362. } else if (this.options.version === "1.1") {
  30363. regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  30364. if (res = str.match(regex)) {
  30365. throw new Error("Invalid character in string: " + str + " at index " + res.index);
  30366. }
  30367. }
  30368. return str;
  30369. };
  30370. XMLStringifier2.prototype.assertLegalName = function(str) {
  30371. var regex;
  30372. if (this.options.noValidation) {
  30373. return str;
  30374. }
  30375. this.assertLegalChar(str);
  30376. regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
  30377. if (!str.match(regex)) {
  30378. throw new Error("Invalid character in name");
  30379. }
  30380. return str;
  30381. };
  30382. XMLStringifier2.prototype.textEscape = function(str) {
  30383. var ampregex;
  30384. if (this.options.noValidation) {
  30385. return str;
  30386. }
  30387. ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
  30388. return str.replace(ampregex, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;");
  30389. };
  30390. XMLStringifier2.prototype.attEscape = function(str) {
  30391. var ampregex;
  30392. if (this.options.noValidation) {
  30393. return str;
  30394. }
  30395. ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
  30396. return str.replace(ampregex, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;");
  30397. };
  30398. return XMLStringifier2;
  30399. }();
  30400. }).call(this);
  30401. }, {}], 457: [function(require2, module3, exports3) {
  30402. (function() {
  30403. var NodeType, XMLCharacterData, XMLText, extend = function(child, parent) {
  30404. for (var key in parent) {
  30405. if (hasProp.call(parent, key))
  30406. child[key] = parent[key];
  30407. }
  30408. function ctor() {
  30409. this.constructor = child;
  30410. }
  30411. ctor.prototype = parent.prototype;
  30412. child.prototype = new ctor();
  30413. child.__super__ = parent.prototype;
  30414. return child;
  30415. }, hasProp = {}.hasOwnProperty;
  30416. NodeType = require2("./NodeType");
  30417. XMLCharacterData = require2("./XMLCharacterData");
  30418. module3.exports = XMLText = function(superClass) {
  30419. extend(XMLText2, superClass);
  30420. function XMLText2(parent, text) {
  30421. XMLText2.__super__.constructor.call(this, parent);
  30422. if (text == null) {
  30423. throw new Error("Missing element text. " + this.debugInfo());
  30424. }
  30425. this.name = "#text";
  30426. this.type = NodeType.Text;
  30427. this.value = this.stringify.text(text);
  30428. }
  30429. Object.defineProperty(XMLText2.prototype, "isElementContentWhitespace", {
  30430. get: function() {
  30431. throw new Error("This DOM method is not implemented." + this.debugInfo());
  30432. }
  30433. });
  30434. Object.defineProperty(XMLText2.prototype, "wholeText", {
  30435. get: function() {
  30436. var next, prev, str;
  30437. str = "";
  30438. prev = this.previousSibling;
  30439. while (prev) {
  30440. str = prev.data + str;
  30441. prev = prev.previousSibling;
  30442. }
  30443. str += this.data;
  30444. next = this.nextSibling;
  30445. while (next) {
  30446. str = str + next.data;
  30447. next = next.nextSibling;
  30448. }
  30449. return str;
  30450. }
  30451. });
  30452. XMLText2.prototype.clone = function() {
  30453. return Object.create(this);
  30454. };
  30455. XMLText2.prototype.toString = function(options) {
  30456. return this.options.writer.text(this, this.options.writer.filterOptions(options));
  30457. };
  30458. XMLText2.prototype.splitText = function(offset) {
  30459. throw new Error("This DOM method is not implemented." + this.debugInfo());
  30460. };
  30461. XMLText2.prototype.replaceWholeText = function(content) {
  30462. throw new Error("This DOM method is not implemented." + this.debugInfo());
  30463. };
  30464. return XMLText2;
  30465. }(XMLCharacterData);
  30466. }).call(this);
  30467. }, { "./NodeType": 428, "./XMLCharacterData": 433 }], 458: [function(require2, module3, exports3) {
  30468. (function() {
  30469. var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign, hasProp = {}.hasOwnProperty;
  30470. assign = require2("./Utility").assign;
  30471. NodeType = require2("./NodeType");
  30472. XMLDeclaration = require2("./XMLDeclaration");
  30473. XMLDocType = require2("./XMLDocType");
  30474. XMLCData = require2("./XMLCData");
  30475. XMLComment = require2("./XMLComment");
  30476. XMLElement = require2("./XMLElement");
  30477. XMLRaw = require2("./XMLRaw");
  30478. XMLText = require2("./XMLText");
  30479. XMLProcessingInstruction = require2("./XMLProcessingInstruction");
  30480. XMLDummy = require2("./XMLDummy");
  30481. XMLDTDAttList = require2("./XMLDTDAttList");
  30482. XMLDTDElement = require2("./XMLDTDElement");
  30483. XMLDTDEntity = require2("./XMLDTDEntity");
  30484. XMLDTDNotation = require2("./XMLDTDNotation");
  30485. WriterState = require2("./WriterState");
  30486. module3.exports = XMLWriterBase = function() {
  30487. function XMLWriterBase2(options) {
  30488. var key, ref, value;
  30489. options || (options = {});
  30490. this.options = options;
  30491. ref = options.writer || {};
  30492. for (key in ref) {
  30493. if (!hasProp.call(ref, key))
  30494. continue;
  30495. value = ref[key];
  30496. this["_" + key] = this[key];
  30497. this[key] = value;
  30498. }
  30499. }
  30500. XMLWriterBase2.prototype.filterOptions = function(options) {
  30501. var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
  30502. options || (options = {});
  30503. options = assign({}, this.options, options);
  30504. filteredOptions = {
  30505. writer: this
  30506. };
  30507. filteredOptions.pretty = options.pretty || false;
  30508. filteredOptions.allowEmpty = options.allowEmpty || false;
  30509. filteredOptions.indent = (ref = options.indent) != null ? ref : " ";
  30510. filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : "\n";
  30511. filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
  30512. filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
  30513. filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : "";
  30514. if (filteredOptions.spaceBeforeSlash === true) {
  30515. filteredOptions.spaceBeforeSlash = " ";
  30516. }
  30517. filteredOptions.suppressPrettyCount = 0;
  30518. filteredOptions.user = {};
  30519. filteredOptions.state = WriterState.None;
  30520. return filteredOptions;
  30521. };
  30522. XMLWriterBase2.prototype.indent = function(node, options, level) {
  30523. var indentLevel;
  30524. if (!options.pretty || options.suppressPrettyCount) {
  30525. return "";
  30526. } else if (options.pretty) {
  30527. indentLevel = (level || 0) + options.offset + 1;
  30528. if (indentLevel > 0) {
  30529. return new Array(indentLevel).join(options.indent);
  30530. }
  30531. }
  30532. return "";
  30533. };
  30534. XMLWriterBase2.prototype.endline = function(node, options, level) {
  30535. if (!options.pretty || options.suppressPrettyCount) {
  30536. return "";
  30537. } else {
  30538. return options.newline;
  30539. }
  30540. };
  30541. XMLWriterBase2.prototype.attribute = function(att, options, level) {
  30542. var r;
  30543. this.openAttribute(att, options, level);
  30544. r = " " + att.name + '="' + att.value + '"';
  30545. this.closeAttribute(att, options, level);
  30546. return r;
  30547. };
  30548. XMLWriterBase2.prototype.cdata = function(node, options, level) {
  30549. var r;
  30550. this.openNode(node, options, level);
  30551. options.state = WriterState.OpenTag;
  30552. r = this.indent(node, options, level) + "<![CDATA[";
  30553. options.state = WriterState.InsideTag;
  30554. r += node.value;
  30555. options.state = WriterState.CloseTag;
  30556. r += "]]>" + this.endline(node, options, level);
  30557. options.state = WriterState.None;
  30558. this.closeNode(node, options, level);
  30559. return r;
  30560. };
  30561. XMLWriterBase2.prototype.comment = function(node, options, level) {
  30562. var r;
  30563. this.openNode(node, options, level);
  30564. options.state = WriterState.OpenTag;
  30565. r = this.indent(node, options, level) + "<!-- ";
  30566. options.state = WriterState.InsideTag;
  30567. r += node.value;
  30568. options.state = WriterState.CloseTag;
  30569. r += " -->" + this.endline(node, options, level);
  30570. options.state = WriterState.None;
  30571. this.closeNode(node, options, level);
  30572. return r;
  30573. };
  30574. XMLWriterBase2.prototype.declaration = function(node, options, level) {
  30575. var r;
  30576. this.openNode(node, options, level);
  30577. options.state = WriterState.OpenTag;
  30578. r = this.indent(node, options, level) + "<?xml";
  30579. options.state = WriterState.InsideTag;
  30580. r += ' version="' + node.version + '"';
  30581. if (node.encoding != null) {
  30582. r += ' encoding="' + node.encoding + '"';
  30583. }
  30584. if (node.standalone != null) {
  30585. r += ' standalone="' + node.standalone + '"';
  30586. }
  30587. options.state = WriterState.CloseTag;
  30588. r += options.spaceBeforeSlash + "?>";
  30589. r += this.endline(node, options, level);
  30590. options.state = WriterState.None;
  30591. this.closeNode(node, options, level);
  30592. return r;
  30593. };
  30594. XMLWriterBase2.prototype.docType = function(node, options, level) {
  30595. var child, i, len, r, ref;
  30596. level || (level = 0);
  30597. this.openNode(node, options, level);
  30598. options.state = WriterState.OpenTag;
  30599. r = this.indent(node, options, level);
  30600. r += "<!DOCTYPE " + node.root().name;
  30601. if (node.pubID && node.sysID) {
  30602. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  30603. } else if (node.sysID) {
  30604. r += ' SYSTEM "' + node.sysID + '"';
  30605. }
  30606. if (node.children.length > 0) {
  30607. r += " [";
  30608. r += this.endline(node, options, level);
  30609. options.state = WriterState.InsideTag;
  30610. ref = node.children;
  30611. for (i = 0, len = ref.length; i < len; i++) {
  30612. child = ref[i];
  30613. r += this.writeChildNode(child, options, level + 1);
  30614. }
  30615. options.state = WriterState.CloseTag;
  30616. r += "]";
  30617. }
  30618. options.state = WriterState.CloseTag;
  30619. r += options.spaceBeforeSlash + ">";
  30620. r += this.endline(node, options, level);
  30621. options.state = WriterState.None;
  30622. this.closeNode(node, options, level);
  30623. return r;
  30624. };
  30625. XMLWriterBase2.prototype.element = function(node, options, level) {
  30626. var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
  30627. level || (level = 0);
  30628. prettySuppressed = false;
  30629. r = "";
  30630. this.openNode(node, options, level);
  30631. options.state = WriterState.OpenTag;
  30632. r += this.indent(node, options, level) + "<" + node.name;
  30633. ref = node.attribs;
  30634. for (name in ref) {
  30635. if (!hasProp.call(ref, name))
  30636. continue;
  30637. att = ref[name];
  30638. r += this.attribute(att, options, level);
  30639. }
  30640. childNodeCount = node.children.length;
  30641. firstChildNode = childNodeCount === 0 ? null : node.children[0];
  30642. if (childNodeCount === 0 || node.children.every(function(e) {
  30643. return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
  30644. })) {
  30645. if (options.allowEmpty) {
  30646. r += ">";
  30647. options.state = WriterState.CloseTag;
  30648. r += "</" + node.name + ">" + this.endline(node, options, level);
  30649. } else {
  30650. options.state = WriterState.CloseTag;
  30651. r += options.spaceBeforeSlash + "/>" + this.endline(node, options, level);
  30652. }
  30653. } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
  30654. r += ">";
  30655. options.state = WriterState.InsideTag;
  30656. options.suppressPrettyCount++;
  30657. prettySuppressed = true;
  30658. r += this.writeChildNode(firstChildNode, options, level + 1);
  30659. options.suppressPrettyCount--;
  30660. prettySuppressed = false;
  30661. options.state = WriterState.CloseTag;
  30662. r += "</" + node.name + ">" + this.endline(node, options, level);
  30663. } else {
  30664. if (options.dontPrettyTextNodes) {
  30665. ref1 = node.children;
  30666. for (i = 0, len = ref1.length; i < len; i++) {
  30667. child = ref1[i];
  30668. if ((child.type === NodeType.Text || child.type === NodeType.Raw) && child.value != null) {
  30669. options.suppressPrettyCount++;
  30670. prettySuppressed = true;
  30671. break;
  30672. }
  30673. }
  30674. }
  30675. r += ">" + this.endline(node, options, level);
  30676. options.state = WriterState.InsideTag;
  30677. ref2 = node.children;
  30678. for (j = 0, len1 = ref2.length; j < len1; j++) {
  30679. child = ref2[j];
  30680. r += this.writeChildNode(child, options, level + 1);
  30681. }
  30682. options.state = WriterState.CloseTag;
  30683. r += this.indent(node, options, level) + "</" + node.name + ">";
  30684. if (prettySuppressed) {
  30685. options.suppressPrettyCount--;
  30686. }
  30687. r += this.endline(node, options, level);
  30688. options.state = WriterState.None;
  30689. }
  30690. this.closeNode(node, options, level);
  30691. return r;
  30692. };
  30693. XMLWriterBase2.prototype.writeChildNode = function(node, options, level) {
  30694. switch (node.type) {
  30695. case NodeType.CData:
  30696. return this.cdata(node, options, level);
  30697. case NodeType.Comment:
  30698. return this.comment(node, options, level);
  30699. case NodeType.Element:
  30700. return this.element(node, options, level);
  30701. case NodeType.Raw:
  30702. return this.raw(node, options, level);
  30703. case NodeType.Text:
  30704. return this.text(node, options, level);
  30705. case NodeType.ProcessingInstruction:
  30706. return this.processingInstruction(node, options, level);
  30707. case NodeType.Dummy:
  30708. return "";
  30709. case NodeType.Declaration:
  30710. return this.declaration(node, options, level);
  30711. case NodeType.DocType:
  30712. return this.docType(node, options, level);
  30713. case NodeType.AttributeDeclaration:
  30714. return this.dtdAttList(node, options, level);
  30715. case NodeType.ElementDeclaration:
  30716. return this.dtdElement(node, options, level);
  30717. case NodeType.EntityDeclaration:
  30718. return this.dtdEntity(node, options, level);
  30719. case NodeType.NotationDeclaration:
  30720. return this.dtdNotation(node, options, level);
  30721. default:
  30722. throw new Error("Unknown XML node type: " + node.constructor.name);
  30723. }
  30724. };
  30725. XMLWriterBase2.prototype.processingInstruction = function(node, options, level) {
  30726. var r;
  30727. this.openNode(node, options, level);
  30728. options.state = WriterState.OpenTag;
  30729. r = this.indent(node, options, level) + "<?";
  30730. options.state = WriterState.InsideTag;
  30731. r += node.target;
  30732. if (node.value) {
  30733. r += " " + node.value;
  30734. }
  30735. options.state = WriterState.CloseTag;
  30736. r += options.spaceBeforeSlash + "?>";
  30737. r += this.endline(node, options, level);
  30738. options.state = WriterState.None;
  30739. this.closeNode(node, options, level);
  30740. return r;
  30741. };
  30742. XMLWriterBase2.prototype.raw = function(node, options, level) {
  30743. var r;
  30744. this.openNode(node, options, level);
  30745. options.state = WriterState.OpenTag;
  30746. r = this.indent(node, options, level);
  30747. options.state = WriterState.InsideTag;
  30748. r += node.value;
  30749. options.state = WriterState.CloseTag;
  30750. r += this.endline(node, options, level);
  30751. options.state = WriterState.None;
  30752. this.closeNode(node, options, level);
  30753. return r;
  30754. };
  30755. XMLWriterBase2.prototype.text = function(node, options, level) {
  30756. var r;
  30757. this.openNode(node, options, level);
  30758. options.state = WriterState.OpenTag;
  30759. r = this.indent(node, options, level);
  30760. options.state = WriterState.InsideTag;
  30761. r += node.value;
  30762. options.state = WriterState.CloseTag;
  30763. r += this.endline(node, options, level);
  30764. options.state = WriterState.None;
  30765. this.closeNode(node, options, level);
  30766. return r;
  30767. };
  30768. XMLWriterBase2.prototype.dtdAttList = function(node, options, level) {
  30769. var r;
  30770. this.openNode(node, options, level);
  30771. options.state = WriterState.OpenTag;
  30772. r = this.indent(node, options, level) + "<!ATTLIST";
  30773. options.state = WriterState.InsideTag;
  30774. r += " " + node.elementName + " " + node.attributeName + " " + node.attributeType;
  30775. if (node.defaultValueType !== "#DEFAULT") {
  30776. r += " " + node.defaultValueType;
  30777. }
  30778. if (node.defaultValue) {
  30779. r += ' "' + node.defaultValue + '"';
  30780. }
  30781. options.state = WriterState.CloseTag;
  30782. r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
  30783. options.state = WriterState.None;
  30784. this.closeNode(node, options, level);
  30785. return r;
  30786. };
  30787. XMLWriterBase2.prototype.dtdElement = function(node, options, level) {
  30788. var r;
  30789. this.openNode(node, options, level);
  30790. options.state = WriterState.OpenTag;
  30791. r = this.indent(node, options, level) + "<!ELEMENT";
  30792. options.state = WriterState.InsideTag;
  30793. r += " " + node.name + " " + node.value;
  30794. options.state = WriterState.CloseTag;
  30795. r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
  30796. options.state = WriterState.None;
  30797. this.closeNode(node, options, level);
  30798. return r;
  30799. };
  30800. XMLWriterBase2.prototype.dtdEntity = function(node, options, level) {
  30801. var r;
  30802. this.openNode(node, options, level);
  30803. options.state = WriterState.OpenTag;
  30804. r = this.indent(node, options, level) + "<!ENTITY";
  30805. options.state = WriterState.InsideTag;
  30806. if (node.pe) {
  30807. r += " %";
  30808. }
  30809. r += " " + node.name;
  30810. if (node.value) {
  30811. r += ' "' + node.value + '"';
  30812. } else {
  30813. if (node.pubID && node.sysID) {
  30814. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  30815. } else if (node.sysID) {
  30816. r += ' SYSTEM "' + node.sysID + '"';
  30817. }
  30818. if (node.nData) {
  30819. r += " NDATA " + node.nData;
  30820. }
  30821. }
  30822. options.state = WriterState.CloseTag;
  30823. r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
  30824. options.state = WriterState.None;
  30825. this.closeNode(node, options, level);
  30826. return r;
  30827. };
  30828. XMLWriterBase2.prototype.dtdNotation = function(node, options, level) {
  30829. var r;
  30830. this.openNode(node, options, level);
  30831. options.state = WriterState.OpenTag;
  30832. r = this.indent(node, options, level) + "<!NOTATION";
  30833. options.state = WriterState.InsideTag;
  30834. r += " " + node.name;
  30835. if (node.pubID && node.sysID) {
  30836. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  30837. } else if (node.pubID) {
  30838. r += ' PUBLIC "' + node.pubID + '"';
  30839. } else if (node.sysID) {
  30840. r += ' SYSTEM "' + node.sysID + '"';
  30841. }
  30842. options.state = WriterState.CloseTag;
  30843. r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
  30844. options.state = WriterState.None;
  30845. this.closeNode(node, options, level);
  30846. return r;
  30847. };
  30848. XMLWriterBase2.prototype.openNode = function(node, options, level) {
  30849. };
  30850. XMLWriterBase2.prototype.closeNode = function(node, options, level) {
  30851. };
  30852. XMLWriterBase2.prototype.openAttribute = function(att, options, level) {
  30853. };
  30854. XMLWriterBase2.prototype.closeAttribute = function(att, options, level) {
  30855. };
  30856. return XMLWriterBase2;
  30857. }();
  30858. }).call(this);
  30859. }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLCData": 432, "./XMLComment": 434, "./XMLDTDAttList": 439, "./XMLDTDElement": 440, "./XMLDTDEntity": 441, "./XMLDTDNotation": 442, "./XMLDeclaration": 443, "./XMLDocType": 444, "./XMLDummy": 447, "./XMLElement": 448, "./XMLProcessingInstruction": 452, "./XMLRaw": 453, "./XMLText": 457 }], 459: [function(require2, module3, exports3) {
  30860. (function() {
  30861. var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
  30862. ref = require2("./Utility"), assign = ref.assign, isFunction = ref.isFunction;
  30863. XMLDOMImplementation = require2("./XMLDOMImplementation");
  30864. XMLDocument = require2("./XMLDocument");
  30865. XMLDocumentCB = require2("./XMLDocumentCB");
  30866. XMLStringWriter = require2("./XMLStringWriter");
  30867. XMLStreamWriter = require2("./XMLStreamWriter");
  30868. NodeType = require2("./NodeType");
  30869. WriterState = require2("./WriterState");
  30870. module3.exports.create = function(name, xmldec, doctype, options) {
  30871. var doc, root;
  30872. if (name == null) {
  30873. throw new Error("Root element needs a name.");
  30874. }
  30875. options = assign({}, xmldec, doctype, options);
  30876. doc = new XMLDocument(options);
  30877. root = doc.element(name);
  30878. if (!options.headless) {
  30879. doc.declaration(options);
  30880. if (options.pubID != null || options.sysID != null) {
  30881. doc.dtd(options);
  30882. }
  30883. }
  30884. return root;
  30885. };
  30886. module3.exports.begin = function(options, onData, onEnd) {
  30887. var ref1;
  30888. if (isFunction(options)) {
  30889. ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
  30890. options = {};
  30891. }
  30892. if (onData) {
  30893. return new XMLDocumentCB(options, onData, onEnd);
  30894. } else {
  30895. return new XMLDocument(options);
  30896. }
  30897. };
  30898. module3.exports.stringWriter = function(options) {
  30899. return new XMLStringWriter(options);
  30900. };
  30901. module3.exports.streamWriter = function(stream, options) {
  30902. return new XMLStreamWriter(stream, options);
  30903. };
  30904. module3.exports.implementation = new XMLDOMImplementation();
  30905. module3.exports.nodeType = NodeType;
  30906. module3.exports.writerState = WriterState;
  30907. }).call(this);
  30908. }, { "./NodeType": 428, "./Utility": 429, "./WriterState": 430, "./XMLDOMImplementation": 437, "./XMLDocument": 445, "./XMLDocumentCB": 446, "./XMLStreamWriter": 454, "./XMLStringWriter": 455 }], 460: [function(require2, module3, exports3) {
  30909. module3.exports = extend;
  30910. var hasOwnProperty = Object.prototype.hasOwnProperty;
  30911. function extend() {
  30912. var target = {};
  30913. for (var i = 0; i < arguments.length; i++) {
  30914. var source = arguments[i];
  30915. for (var key in source) {
  30916. if (hasOwnProperty.call(source, key)) {
  30917. target[key] = source[key];
  30918. }
  30919. }
  30920. }
  30921. return target;
  30922. }
  30923. }, {}], 461: [function(require2, module3, exports3) {
  30924. "use strict";
  30925. require2("core-js/modules/es.array.fill.js");
  30926. require2("core-js/modules/es.array.concat.js");
  30927. require2("core-js/modules/es.object.to-string.js");
  30928. require2("core-js/modules/es.regexp.to-string.js");
  30929. require2("core-js/modules/es.array.join.js");
  30930. require2("core-js/modules/es.array.slice.js");
  30931. var Buffer = require2("buffer").Buffer;
  30932. var sha = require2("./sha");
  30933. var md5 = require2("./md5");
  30934. var algorithms = {
  30935. sha1: sha,
  30936. md5
  30937. };
  30938. var blocksize = 64;
  30939. var zeroBuffer = Buffer.alloc(blocksize);
  30940. zeroBuffer.fill(0);
  30941. function hmac(fn, key, data) {
  30942. if (!Buffer.isBuffer(key))
  30943. key = Buffer.from(key);
  30944. if (!Buffer.isBuffer(data))
  30945. data = Buffer.from(data);
  30946. if (key.length > blocksize) {
  30947. key = fn(key);
  30948. } else if (key.length < blocksize) {
  30949. key = Buffer.concat([key, zeroBuffer], blocksize);
  30950. }
  30951. var ipad = Buffer.alloc(blocksize), opad = Buffer.alloc(blocksize);
  30952. for (var i = 0; i < blocksize; i++) {
  30953. ipad[i] = key[i] ^ 54;
  30954. opad[i] = key[i] ^ 92;
  30955. }
  30956. var hash2 = fn(Buffer.concat([ipad, data]));
  30957. return fn(Buffer.concat([opad, hash2]));
  30958. }
  30959. function hash(alg, key) {
  30960. alg = alg || "sha1";
  30961. var fn = algorithms[alg];
  30962. var bufs = [];
  30963. var length = 0;
  30964. if (!fn)
  30965. error("algorithm:", alg, "is not yet supported");
  30966. return {
  30967. update: function update(data) {
  30968. if (!Buffer.isBuffer(data))
  30969. data = Buffer.from(data);
  30970. bufs.push(data);
  30971. length += data.length;
  30972. return this;
  30973. },
  30974. digest: function digest(enc) {
  30975. var buf = Buffer.concat(bufs);
  30976. var r = key ? hmac(fn, key, buf) : fn(buf);
  30977. bufs = null;
  30978. return enc ? r.toString(enc) : r;
  30979. }
  30980. };
  30981. }
  30982. function error() {
  30983. var m = [].slice.call(arguments).join(" ");
  30984. throw new Error([m, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join("\n"));
  30985. }
  30986. exports3.createHash = function(alg) {
  30987. return hash(alg);
  30988. };
  30989. exports3.createHmac = function(alg, key) {
  30990. return hash(alg, key);
  30991. };
  30992. exports3.createCredentials = function() {
  30993. error("sorry,createCredentials is not implemented yet");
  30994. };
  30995. exports3.createCipher = function() {
  30996. error("sorry,createCipher is not implemented yet");
  30997. };
  30998. exports3.createCipheriv = function() {
  30999. error("sorry,createCipheriv is not implemented yet");
  31000. };
  31001. exports3.createDecipher = function() {
  31002. error("sorry,createDecipher is not implemented yet");
  31003. };
  31004. exports3.createDecipheriv = function() {
  31005. error("sorry,createDecipheriv is not implemented yet");
  31006. };
  31007. exports3.createSign = function() {
  31008. error("sorry,createSign is not implemented yet");
  31009. };
  31010. exports3.createVerify = function() {
  31011. error("sorry,createVerify is not implemented yet");
  31012. };
  31013. exports3.createDiffieHellman = function() {
  31014. error("sorry,createDiffieHellman is not implemented yet");
  31015. };
  31016. exports3.pbkdf2 = function() {
  31017. error("sorry,pbkdf2 is not implemented yet");
  31018. };
  31019. }, { "./md5": 463, "./sha": 464, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.fill.js": 273, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.regexp.to-string.js": 301 }], 462: [function(require2, module3, exports3) {
  31020. "use strict";
  31021. require2("core-js/modules/es.array.fill.js");
  31022. require2("core-js/modules/es.array.concat.js");
  31023. var Buffer = require2("buffer").Buffer;
  31024. var intSize = 4;
  31025. var zeroBuffer = Buffer.alloc(intSize);
  31026. zeroBuffer.fill(0);
  31027. var chrsz = 8;
  31028. function toArray(buf, bigEndian) {
  31029. if (buf.length % intSize !== 0) {
  31030. var len = buf.length + (intSize - buf.length % intSize);
  31031. buf = Buffer.concat([buf, zeroBuffer], len);
  31032. }
  31033. var arr = [];
  31034. var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
  31035. for (var i = 0; i < buf.length; i += intSize) {
  31036. arr.push(fn.call(buf, i));
  31037. }
  31038. return arr;
  31039. }
  31040. function toBuffer(arr, size, bigEndian) {
  31041. var buf = Buffer.alloc(size);
  31042. var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
  31043. for (var i = 0; i < arr.length; i++) {
  31044. fn.call(buf, arr[i], i * 4, true);
  31045. }
  31046. return buf;
  31047. }
  31048. function hash(buf, fn, hashSize, bigEndian) {
  31049. if (!Buffer.isBuffer(buf))
  31050. buf = Buffer.from(buf);
  31051. var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
  31052. return toBuffer(arr, hashSize, bigEndian);
  31053. }
  31054. module3.exports = {
  31055. hash
  31056. };
  31057. }, { "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.fill.js": 273 }], 463: [function(require2, module3, exports3) {
  31058. "use strict";
  31059. var helpers = require2("./helpers");
  31060. function md5_vm_test() {
  31061. return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
  31062. }
  31063. function core_md5(x, len) {
  31064. x[len >> 5] |= 128 << len % 32;
  31065. x[(len + 64 >>> 9 << 4) + 14] = len;
  31066. var a = 1732584193;
  31067. var b = -271733879;
  31068. var c = -1732584194;
  31069. var d = 271733878;
  31070. for (var i = 0; i < x.length; i += 16) {
  31071. var olda = a;
  31072. var oldb = b;
  31073. var oldc = c;
  31074. var oldd = d;
  31075. a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
  31076. d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
  31077. c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
  31078. b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
  31079. a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
  31080. d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
  31081. c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
  31082. b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
  31083. a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
  31084. d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
  31085. c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
  31086. b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
  31087. a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
  31088. d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
  31089. c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
  31090. b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
  31091. a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
  31092. d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
  31093. c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
  31094. b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
  31095. a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
  31096. d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
  31097. c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
  31098. b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
  31099. a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
  31100. d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
  31101. c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
  31102. b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
  31103. a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
  31104. d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
  31105. c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
  31106. b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
  31107. a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
  31108. d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
  31109. c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
  31110. b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
  31111. a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
  31112. d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
  31113. c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
  31114. b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
  31115. a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
  31116. d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
  31117. c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
  31118. b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
  31119. a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
  31120. d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
  31121. c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
  31122. b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
  31123. a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
  31124. d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
  31125. c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
  31126. b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
  31127. a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
  31128. d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
  31129. c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
  31130. b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
  31131. a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
  31132. d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
  31133. c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
  31134. b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
  31135. a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
  31136. d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
  31137. c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
  31138. b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
  31139. a = safe_add(a, olda);
  31140. b = safe_add(b, oldb);
  31141. c = safe_add(c, oldc);
  31142. d = safe_add(d, oldd);
  31143. }
  31144. return Array(a, b, c, d);
  31145. }
  31146. function md5_cmn(q, a, b, x, s, t) {
  31147. return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
  31148. }
  31149. function md5_ff(a, b, c, d, x, s, t) {
  31150. return md5_cmn(b & c | ~b & d, a, b, x, s, t);
  31151. }
  31152. function md5_gg(a, b, c, d, x, s, t) {
  31153. return md5_cmn(b & d | c & ~d, a, b, x, s, t);
  31154. }
  31155. function md5_hh(a, b, c, d, x, s, t) {
  31156. return md5_cmn(b ^ c ^ d, a, b, x, s, t);
  31157. }
  31158. function md5_ii(a, b, c, d, x, s, t) {
  31159. return md5_cmn(c ^ (b | ~d), a, b, x, s, t);
  31160. }
  31161. function safe_add(x, y) {
  31162. var lsw = (x & 65535) + (y & 65535);
  31163. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  31164. return msw << 16 | lsw & 65535;
  31165. }
  31166. function bit_rol(num, cnt) {
  31167. return num << cnt | num >>> 32 - cnt;
  31168. }
  31169. module3.exports = function md5(buf) {
  31170. return helpers.hash(buf, core_md5, 16);
  31171. };
  31172. }, { "./helpers": 462 }], 464: [function(require2, module3, exports3) {
  31173. "use strict";
  31174. var helpers = require2("./helpers");
  31175. function core_sha1(x, len) {
  31176. x[len >> 5] |= 128 << 24 - len % 32;
  31177. x[(len + 64 >> 9 << 4) + 15] = len;
  31178. var w = Array(80);
  31179. var a = 1732584193;
  31180. var b = -271733879;
  31181. var c = -1732584194;
  31182. var d = 271733878;
  31183. var e = -1009589776;
  31184. for (var i = 0; i < x.length; i += 16) {
  31185. var olda = a;
  31186. var oldb = b;
  31187. var oldc = c;
  31188. var oldd = d;
  31189. var olde = e;
  31190. for (var j = 0; j < 80; j++) {
  31191. if (j < 16)
  31192. w[j] = x[i + j];
  31193. else
  31194. w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
  31195. var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
  31196. e = d;
  31197. d = c;
  31198. c = rol(b, 30);
  31199. b = a;
  31200. a = t;
  31201. }
  31202. a = safe_add(a, olda);
  31203. b = safe_add(b, oldb);
  31204. c = safe_add(c, oldc);
  31205. d = safe_add(d, oldd);
  31206. e = safe_add(e, olde);
  31207. }
  31208. return Array(a, b, c, d, e);
  31209. }
  31210. function sha1_ft(t, b, c, d) {
  31211. if (t < 20)
  31212. return b & c | ~b & d;
  31213. if (t < 40)
  31214. return b ^ c ^ d;
  31215. if (t < 60)
  31216. return b & c | b & d | c & d;
  31217. return b ^ c ^ d;
  31218. }
  31219. function sha1_kt(t) {
  31220. return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
  31221. }
  31222. function safe_add(x, y) {
  31223. var lsw = (x & 65535) + (y & 65535);
  31224. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  31225. return msw << 16 | lsw & 65535;
  31226. }
  31227. function rol(num, cnt) {
  31228. return num << cnt | num >>> 32 - cnt;
  31229. }
  31230. module3.exports = function sha1(buf) {
  31231. return helpers.hash(buf, core_sha1, 20, true);
  31232. };
  31233. }, { "./helpers": 462 }], 465: [function(require2, module3, exports3) {
  31234. "use strict";
  31235. module3.exports = function() {
  31236. return function() {
  31237. };
  31238. };
  31239. }, {}], 466: [function(require2, module3, exports3) {
  31240. (function(Buffer) {
  31241. (function() {
  31242. "use strict";
  31243. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  31244. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  31245. var _require = require2("stream"), Stream = _require.Stream;
  31246. var _require2 = require2("../lib/common/utils/isArray"), isArray = _require2.isArray;
  31247. module3.exports.string = function isString(obj) {
  31248. return typeof obj === "string";
  31249. };
  31250. module3.exports.array = isArray;
  31251. module3.exports.buffer = Buffer.isBuffer;
  31252. function isStream(obj) {
  31253. return obj instanceof Stream;
  31254. }
  31255. module3.exports.writableStream = function isWritableStream(obj) {
  31256. return isStream(obj) && typeof obj._write === "function" && (0, _typeof2.default)(obj._writableState) === "object";
  31257. };
  31258. }).call(this);
  31259. }).call(this, { "isBuffer": require2("../node_modules/is-buffer/index.js") });
  31260. }, { "../lib/common/utils/isArray": 63, "../node_modules/is-buffer/index.js": 366, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "stream": 398 }], 467: [function(require2, module3, exports3) {
  31261. "use strict";
  31262. var immediate = require2("immediate");
  31263. var process = module3.exports = {};
  31264. process.nextTick = immediate;
  31265. process.title = "browser";
  31266. process.browser = true;
  31267. process.env = {};
  31268. process.argv = [];
  31269. process.version = "";
  31270. process.versions = {};
  31271. function noop() {
  31272. }
  31273. process.on = noop;
  31274. process.addListener = noop;
  31275. process.once = noop;
  31276. process.off = noop;
  31277. process.removeListener = noop;
  31278. process.removeAllListeners = noop;
  31279. process.emit = noop;
  31280. process.prependListener = noop;
  31281. process.prependOnceListener = noop;
  31282. process.listeners = function(name) {
  31283. return [];
  31284. };
  31285. process.binding = function(name) {
  31286. throw new Error("process.binding is not supported");
  31287. };
  31288. process.cwd = function() {
  31289. return "/";
  31290. };
  31291. process.chdir = function(dir) {
  31292. throw new Error("process.chdir is not supported");
  31293. };
  31294. process.umask = function() {
  31295. return 0;
  31296. };
  31297. }, { "immediate": 358 }], 468: [function(require2, module3, exports3) {
  31298. (function(global2) {
  31299. (function() {
  31300. "use strict";
  31301. require2("core-js/modules/es.regexp.exec.js");
  31302. require2("core-js/modules/es.string.search.js");
  31303. var ClientRequest = require2("./lib/request");
  31304. var response = require2("./lib/response");
  31305. var extend = require2("xtend");
  31306. var statusCodes = require2("builtin-status-codes");
  31307. var url = require2("url");
  31308. var http = exports3;
  31309. http.request = function(opts, cb) {
  31310. if (typeof opts === "string")
  31311. opts = url.parse(opts);
  31312. else
  31313. opts = extend(opts);
  31314. var defaultProtocol = global2.location.protocol.search(/^https?:$/) === -1 ? "http:" : "";
  31315. var protocol = opts.protocol || defaultProtocol;
  31316. var host = opts.hostname || opts.host;
  31317. var port = opts.port;
  31318. var path = opts.path || "/";
  31319. if (host && host.indexOf(":") !== -1)
  31320. host = "[" + host + "]";
  31321. opts.url = (host ? protocol + "//" + host : "") + (port ? ":" + port : "") + path;
  31322. opts.method = (opts.method || "GET").toUpperCase();
  31323. opts.headers = opts.headers || {};
  31324. var req = new ClientRequest(opts);
  31325. if (cb)
  31326. req.on("response", cb);
  31327. return req;
  31328. };
  31329. http.get = function get(opts, cb) {
  31330. var req = http.request(opts, cb);
  31331. req.end();
  31332. return req;
  31333. };
  31334. http.ClientRequest = ClientRequest;
  31335. http.IncomingMessage = response.IncomingMessage;
  31336. http.Agent = function() {
  31337. };
  31338. http.Agent.defaultMaxSockets = 4;
  31339. http.globalAgent = new http.Agent();
  31340. http.STATUS_CODES = statusCodes;
  31341. http.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"];
  31342. }).call(this);
  31343. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  31344. }, { "./lib/request": 470, "./lib/response": 471, "builtin-status-codes": 91, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.search.js": 306, "url": 472, "xtend": 460 }], 469: [function(require2, module3, exports3) {
  31345. (function(global2) {
  31346. (function() {
  31347. "use strict";
  31348. require2("core-js/modules/es.object.to-string.js");
  31349. require2("core-js/modules/es.promise.js");
  31350. require2("core-js/modules/es.array-buffer.constructor.js");
  31351. require2("core-js/modules/es.array-buffer.slice.js");
  31352. require2("core-js/modules/es.array.slice.js");
  31353. exports3.fetch = isFunction(global2.fetch) && isFunction(global2.ReadableStream);
  31354. exports3.writableStream = isFunction(global2.WritableStream);
  31355. exports3.abortController = isFunction(global2.AbortController);
  31356. exports3.blobConstructor = false;
  31357. try {
  31358. new Blob([new ArrayBuffer(1)]);
  31359. exports3.blobConstructor = true;
  31360. } catch (e) {
  31361. }
  31362. var xhr;
  31363. function getXHR() {
  31364. if (xhr !== void 0)
  31365. return xhr;
  31366. if (global2.XMLHttpRequest) {
  31367. xhr = new global2.XMLHttpRequest();
  31368. try {
  31369. xhr.open("GET", global2.XDomainRequest ? "/" : "https://example.com");
  31370. } catch (e) {
  31371. xhr = null;
  31372. }
  31373. } else {
  31374. xhr = null;
  31375. }
  31376. return xhr;
  31377. }
  31378. function checkTypeSupport(type) {
  31379. var xhr2 = getXHR();
  31380. if (!xhr2)
  31381. return false;
  31382. try {
  31383. xhr2.responseType = type;
  31384. return xhr2.responseType === type;
  31385. } catch (e) {
  31386. }
  31387. return false;
  31388. }
  31389. var haveArrayBuffer = typeof global2.ArrayBuffer !== "undefined";
  31390. var haveSlice = haveArrayBuffer && isFunction(global2.ArrayBuffer.prototype.slice);
  31391. exports3.arraybuffer = exports3.fetch || haveArrayBuffer && checkTypeSupport("arraybuffer");
  31392. exports3.msstream = !exports3.fetch && haveSlice && checkTypeSupport("ms-stream");
  31393. exports3.mozchunkedarraybuffer = !exports3.fetch && haveArrayBuffer && checkTypeSupport("moz-chunked-arraybuffer");
  31394. exports3.overrideMimeType = exports3.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false);
  31395. exports3.vbArray = isFunction(global2.VBArray);
  31396. function isFunction(value) {
  31397. return typeof value === "function";
  31398. }
  31399. xhr = null;
  31400. }).call(this);
  31401. }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
  31402. }, { "core-js/modules/es.array-buffer.constructor.js": 270, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295 }], 470: [function(require2, module3, exports3) {
  31403. (function(process, global2, Buffer) {
  31404. (function() {
  31405. "use strict";
  31406. require2("core-js/modules/es.object.to-string.js");
  31407. require2("core-js/modules/es.regexp.to-string.js");
  31408. require2("core-js/modules/web.dom-collections.for-each.js");
  31409. require2("core-js/modules/es.object.keys.js");
  31410. require2("core-js/modules/es.array.concat.js");
  31411. require2("core-js/modules/es.array.map.js");
  31412. require2("core-js/modules/es.function.name.js");
  31413. require2("core-js/modules/es.promise.js");
  31414. require2("core-js/modules/es.regexp.exec.js");
  31415. require2("core-js/modules/es.string.split.js");
  31416. var capability = require2("./capability");
  31417. var inherits = require2("inherits");
  31418. var response = require2("./response");
  31419. var stream = require2("readable-stream");
  31420. var toArrayBuffer = require2("to-arraybuffer");
  31421. var IncomingMessage = response.IncomingMessage;
  31422. var rStates = response.readyStates;
  31423. function decideMode(preferBinary, useFetch) {
  31424. if (capability.fetch && useFetch) {
  31425. return "fetch";
  31426. } else if (capability.mozchunkedarraybuffer) {
  31427. return "moz-chunked-arraybuffer";
  31428. } else if (capability.msstream) {
  31429. return "ms-stream";
  31430. } else if (capability.arraybuffer && preferBinary) {
  31431. return "arraybuffer";
  31432. } else if (capability.vbArray && preferBinary) {
  31433. return "text:vbarray";
  31434. } else {
  31435. return "text";
  31436. }
  31437. }
  31438. var ClientRequest = module3.exports = function(opts) {
  31439. var self2 = this;
  31440. stream.Writable.call(self2);
  31441. self2._opts = opts;
  31442. self2._body = [];
  31443. self2._headers = {};
  31444. if (opts.auth)
  31445. self2.setHeader("Authorization", "Basic " + new Buffer(opts.auth).toString("base64"));
  31446. Object.keys(opts.headers).forEach(function(name) {
  31447. self2.setHeader(name, opts.headers[name]);
  31448. });
  31449. var preferBinary;
  31450. var useFetch = true;
  31451. if (opts.mode === "disable-fetch" || "requestTimeout" in opts && !capability.abortController) {
  31452. useFetch = false;
  31453. preferBinary = true;
  31454. } else if (opts.mode === "prefer-streaming") {
  31455. preferBinary = false;
  31456. } else if (opts.mode === "allow-wrong-content-type") {
  31457. preferBinary = !capability.overrideMimeType;
  31458. } else if (!opts.mode || opts.mode === "default" || opts.mode === "prefer-fast") {
  31459. preferBinary = true;
  31460. } else {
  31461. throw new Error("Invalid value for opts.mode");
  31462. }
  31463. self2._mode = decideMode(preferBinary, useFetch);
  31464. self2._fetchTimer = null;
  31465. self2.on("finish", function() {
  31466. self2._onFinish();
  31467. });
  31468. };
  31469. inherits(ClientRequest, stream.Writable);
  31470. ClientRequest.prototype.setHeader = function(name, value) {
  31471. var self2 = this;
  31472. var lowerName = name.toLowerCase();
  31473. if (unsafeHeaders.indexOf(lowerName) !== -1)
  31474. return;
  31475. self2._headers[lowerName] = {
  31476. name,
  31477. value
  31478. };
  31479. };
  31480. ClientRequest.prototype.getHeader = function(name) {
  31481. var header = this._headers[name.toLowerCase()];
  31482. if (header)
  31483. return header.value;
  31484. return null;
  31485. };
  31486. ClientRequest.prototype.removeHeader = function(name) {
  31487. var self2 = this;
  31488. delete self2._headers[name.toLowerCase()];
  31489. };
  31490. ClientRequest.prototype._onFinish = function() {
  31491. var self2 = this;
  31492. if (self2._destroyed)
  31493. return;
  31494. var opts = self2._opts;
  31495. var headersObj = self2._headers;
  31496. var body = null;
  31497. if (opts.method !== "GET" && opts.method !== "HEAD") {
  31498. if (capability.arraybuffer) {
  31499. body = toArrayBuffer(Buffer.concat(self2._body));
  31500. } else if (capability.blobConstructor) {
  31501. body = new global2.Blob(self2._body.map(function(buffer) {
  31502. return toArrayBuffer(buffer);
  31503. }), {
  31504. type: (headersObj["content-type"] || {}).value || ""
  31505. });
  31506. } else {
  31507. body = Buffer.concat(self2._body).toString();
  31508. }
  31509. }
  31510. var headersList = [];
  31511. Object.keys(headersObj).forEach(function(keyName) {
  31512. var name = headersObj[keyName].name;
  31513. var value = headersObj[keyName].value;
  31514. if (Array.isArray(value)) {
  31515. value.forEach(function(v) {
  31516. headersList.push([name, v]);
  31517. });
  31518. } else {
  31519. headersList.push([name, value]);
  31520. }
  31521. });
  31522. if (self2._mode === "fetch") {
  31523. var signal = null;
  31524. var fetchTimer = null;
  31525. if (capability.abortController) {
  31526. var controller = new AbortController();
  31527. signal = controller.signal;
  31528. self2._fetchAbortController = controller;
  31529. if ("requestTimeout" in opts && opts.requestTimeout !== 0) {
  31530. self2._fetchTimer = global2.setTimeout(function() {
  31531. self2.emit("requestTimeout");
  31532. if (self2._fetchAbortController)
  31533. self2._fetchAbortController.abort();
  31534. }, opts.requestTimeout);
  31535. }
  31536. }
  31537. global2.fetch(self2._opts.url, {
  31538. method: self2._opts.method,
  31539. headers: headersList,
  31540. body: body || void 0,
  31541. mode: "cors",
  31542. credentials: opts.withCredentials ? "include" : "same-origin",
  31543. signal
  31544. }).then(function(response2) {
  31545. self2._fetchResponse = response2;
  31546. self2._connect();
  31547. }, function(reason) {
  31548. global2.clearTimeout(self2._fetchTimer);
  31549. if (!self2._destroyed)
  31550. self2.emit("error", reason);
  31551. });
  31552. } else {
  31553. var xhr = self2._xhr = new global2.XMLHttpRequest();
  31554. try {
  31555. xhr.open(self2._opts.method, self2._opts.url, true);
  31556. } catch (err) {
  31557. process.nextTick(function() {
  31558. self2.emit("error", err);
  31559. });
  31560. return;
  31561. }
  31562. if ("responseType" in xhr)
  31563. xhr.responseType = self2._mode.split(":")[0];
  31564. if ("withCredentials" in xhr)
  31565. xhr.withCredentials = !!opts.withCredentials;
  31566. if (self2._mode === "text" && "overrideMimeType" in xhr)
  31567. xhr.overrideMimeType("text/plain; charset=x-user-defined");
  31568. if ("requestTimeout" in opts) {
  31569. xhr.timeout = opts.requestTimeout;
  31570. xhr.ontimeout = function() {
  31571. self2.emit("requestTimeout");
  31572. };
  31573. }
  31574. headersList.forEach(function(header) {
  31575. xhr.setRequestHeader(header[0], header[1]);
  31576. });
  31577. self2._response = null;
  31578. xhr.onreadystatechange = function() {
  31579. switch (xhr.readyState) {
  31580. case rStates.LOADING:
  31581. case rStates.DONE:
  31582. self2._onXHRProgress();
  31583. break;
  31584. }
  31585. };
  31586. if (self2._mode === "moz-chunked-arraybuffer") {
  31587. xhr.onprogress = function() {
  31588. self2._onXHRProgress();
  31589. };
  31590. }
  31591. xhr.onerror = function() {
  31592. if (self2._destroyed)
  31593. return;
  31594. self2.emit("error", new Error("XHR error"));
  31595. };
  31596. try {
  31597. xhr.send(body);
  31598. } catch (err) {
  31599. process.nextTick(function() {
  31600. self2.emit("error", err);
  31601. });
  31602. return;
  31603. }
  31604. }
  31605. };
  31606. function statusValid(xhr) {
  31607. try {
  31608. var status = xhr.status;
  31609. return status !== null && status !== 0;
  31610. } catch (e) {
  31611. return false;
  31612. }
  31613. }
  31614. ClientRequest.prototype._onXHRProgress = function() {
  31615. var self2 = this;
  31616. if (!statusValid(self2._xhr) || self2._destroyed)
  31617. return;
  31618. if (!self2._response)
  31619. self2._connect();
  31620. self2._response._onXHRProgress();
  31621. };
  31622. ClientRequest.prototype._connect = function() {
  31623. var self2 = this;
  31624. if (self2._destroyed)
  31625. return;
  31626. self2._response = new IncomingMessage(self2._xhr, self2._fetchResponse, self2._mode, self2._fetchTimer);
  31627. self2._response.on("error", function(err) {
  31628. self2.emit("error", err);
  31629. });
  31630. self2.emit("response", self2._response);
  31631. };
  31632. ClientRequest.prototype._write = function(chunk, encoding, cb) {
  31633. var self2 = this;
  31634. self2._body.push(chunk);
  31635. cb();
  31636. };
  31637. ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function() {
  31638. var self2 = this;
  31639. self2._destroyed = true;
  31640. global2.clearTimeout(self2._fetchTimer);
  31641. if (self2._response)
  31642. self2._response._destroyed = true;
  31643. if (self2._xhr)
  31644. self2._xhr.abort();
  31645. else if (self2._fetchAbortController)
  31646. self2._fetchAbortController.abort();
  31647. };
  31648. ClientRequest.prototype.end = function(data, encoding, cb) {
  31649. var self2 = this;
  31650. if (typeof data === "function") {
  31651. cb = data;
  31652. data = void 0;
  31653. }
  31654. stream.Writable.prototype.end.call(self2, data, encoding, cb);
  31655. };
  31656. ClientRequest.prototype.flushHeaders = function() {
  31657. };
  31658. ClientRequest.prototype.setTimeout = function() {
  31659. };
  31660. ClientRequest.prototype.setNoDelay = function() {
  31661. };
  31662. ClientRequest.prototype.setSocketKeepAlive = function() {
  31663. };
  31664. var unsafeHeaders = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via"];
  31665. }).call(this);
  31666. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("buffer").Buffer);
  31667. }, { "./capability": 469, "./response": 471, "_process": 467, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.map.js": 280, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.regexp.to-string.js": 301, "core-js/modules/es.string.split.js": 307, "core-js/modules/web.dom-collections.for-each.js": 339, "inherits": 364, "readable-stream": 394, "to-arraybuffer": 415 }], 471: [function(require2, module3, exports3) {
  31668. (function(process, global2, Buffer) {
  31669. (function() {
  31670. "use strict";
  31671. require2("core-js/modules/es.object.to-string.js");
  31672. require2("core-js/modules/web.dom-collections.for-each.js");
  31673. require2("core-js/modules/es.promise.js");
  31674. require2("core-js/modules/es.regexp.exec.js");
  31675. require2("core-js/modules/es.string.split.js");
  31676. require2("core-js/modules/es.string.match.js");
  31677. require2("core-js/modules/es.array.iterator.js");
  31678. require2("core-js/modules/es.array-buffer.slice.js");
  31679. require2("core-js/modules/es.typed-array.uint8-array.js");
  31680. require2("core-js/modules/es.typed-array.copy-within.js");
  31681. require2("core-js/modules/es.typed-array.every.js");
  31682. require2("core-js/modules/es.typed-array.fill.js");
  31683. require2("core-js/modules/es.typed-array.filter.js");
  31684. require2("core-js/modules/es.typed-array.find.js");
  31685. require2("core-js/modules/es.typed-array.find-index.js");
  31686. require2("core-js/modules/es.typed-array.for-each.js");
  31687. require2("core-js/modules/es.typed-array.includes.js");
  31688. require2("core-js/modules/es.typed-array.index-of.js");
  31689. require2("core-js/modules/es.typed-array.iterator.js");
  31690. require2("core-js/modules/es.typed-array.join.js");
  31691. require2("core-js/modules/es.typed-array.last-index-of.js");
  31692. require2("core-js/modules/es.typed-array.map.js");
  31693. require2("core-js/modules/es.typed-array.reduce.js");
  31694. require2("core-js/modules/es.typed-array.reduce-right.js");
  31695. require2("core-js/modules/es.typed-array.reverse.js");
  31696. require2("core-js/modules/es.typed-array.set.js");
  31697. require2("core-js/modules/es.typed-array.slice.js");
  31698. require2("core-js/modules/es.typed-array.some.js");
  31699. require2("core-js/modules/es.typed-array.sort.js");
  31700. require2("core-js/modules/es.typed-array.subarray.js");
  31701. require2("core-js/modules/es.typed-array.to-locale-string.js");
  31702. require2("core-js/modules/es.typed-array.to-string.js");
  31703. require2("core-js/modules/es.array.slice.js");
  31704. var capability = require2("./capability");
  31705. var inherits = require2("inherits");
  31706. var stream = require2("readable-stream");
  31707. var rStates = exports3.readyStates = {
  31708. UNSENT: 0,
  31709. OPENED: 1,
  31710. HEADERS_RECEIVED: 2,
  31711. LOADING: 3,
  31712. DONE: 4
  31713. };
  31714. var IncomingMessage = exports3.IncomingMessage = function(xhr, response, mode, fetchTimer) {
  31715. var self2 = this;
  31716. stream.Readable.call(self2);
  31717. self2._mode = mode;
  31718. self2.headers = {};
  31719. self2.rawHeaders = [];
  31720. self2.trailers = {};
  31721. self2.rawTrailers = [];
  31722. self2.on("end", function() {
  31723. process.nextTick(function() {
  31724. self2.emit("close");
  31725. });
  31726. });
  31727. if (mode === "fetch") {
  31728. var read = function read2() {
  31729. reader.read().then(function(result) {
  31730. if (self2._destroyed)
  31731. return;
  31732. if (result.done) {
  31733. global2.clearTimeout(fetchTimer);
  31734. self2.push(null);
  31735. return;
  31736. }
  31737. self2.push(new Buffer(result.value));
  31738. read2();
  31739. }).catch(function(err) {
  31740. global2.clearTimeout(fetchTimer);
  31741. if (!self2._destroyed)
  31742. self2.emit("error", err);
  31743. });
  31744. };
  31745. self2._fetchResponse = response;
  31746. self2.url = response.url;
  31747. self2.statusCode = response.status;
  31748. self2.statusMessage = response.statusText;
  31749. response.headers.forEach(function(header, key) {
  31750. self2.headers[key.toLowerCase()] = header;
  31751. self2.rawHeaders.push(key, header);
  31752. });
  31753. if (capability.writableStream) {
  31754. var writable = new WritableStream({
  31755. write: function write(chunk) {
  31756. return new Promise(function(resolve, reject) {
  31757. if (self2._destroyed) {
  31758. reject();
  31759. } else if (self2.push(new Buffer(chunk))) {
  31760. resolve();
  31761. } else {
  31762. self2._resumeFetch = resolve;
  31763. }
  31764. });
  31765. },
  31766. close: function close() {
  31767. global2.clearTimeout(fetchTimer);
  31768. if (!self2._destroyed)
  31769. self2.push(null);
  31770. },
  31771. abort: function abort(err) {
  31772. if (!self2._destroyed)
  31773. self2.emit("error", err);
  31774. }
  31775. });
  31776. try {
  31777. response.body.pipeTo(writable).catch(function(err) {
  31778. global2.clearTimeout(fetchTimer);
  31779. if (!self2._destroyed)
  31780. self2.emit("error", err);
  31781. });
  31782. return;
  31783. } catch (e) {
  31784. }
  31785. }
  31786. var reader = response.body.getReader();
  31787. read();
  31788. } else {
  31789. self2._xhr = xhr;
  31790. self2._pos = 0;
  31791. self2.url = xhr.responseURL;
  31792. self2.statusCode = xhr.status;
  31793. self2.statusMessage = xhr.statusText;
  31794. var headers = xhr.getAllResponseHeaders().split(/\r?\n/);
  31795. headers.forEach(function(header) {
  31796. var matches = header.match(/^([^:]+):\s*(.*)/);
  31797. if (matches) {
  31798. var key = matches[1].toLowerCase();
  31799. if (key === "set-cookie") {
  31800. if (self2.headers[key] === void 0) {
  31801. self2.headers[key] = [];
  31802. }
  31803. self2.headers[key].push(matches[2]);
  31804. } else if (self2.headers[key] !== void 0) {
  31805. self2.headers[key] += ", " + matches[2];
  31806. } else {
  31807. self2.headers[key] = matches[2];
  31808. }
  31809. self2.rawHeaders.push(matches[1], matches[2]);
  31810. }
  31811. });
  31812. self2._charset = "x-user-defined";
  31813. if (!capability.overrideMimeType) {
  31814. var mimeType = self2.rawHeaders["mime-type"];
  31815. if (mimeType) {
  31816. var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/);
  31817. if (charsetMatch) {
  31818. self2._charset = charsetMatch[1].toLowerCase();
  31819. }
  31820. }
  31821. if (!self2._charset)
  31822. self2._charset = "utf-8";
  31823. }
  31824. }
  31825. };
  31826. inherits(IncomingMessage, stream.Readable);
  31827. IncomingMessage.prototype._read = function() {
  31828. var self2 = this;
  31829. var resolve = self2._resumeFetch;
  31830. if (resolve) {
  31831. self2._resumeFetch = null;
  31832. resolve();
  31833. }
  31834. };
  31835. IncomingMessage.prototype._onXHRProgress = function() {
  31836. var self2 = this;
  31837. var xhr = self2._xhr;
  31838. var response = null;
  31839. switch (self2._mode) {
  31840. case "text:vbarray":
  31841. if (xhr.readyState !== rStates.DONE)
  31842. break;
  31843. try {
  31844. response = new global2.VBArray(xhr.responseBody).toArray();
  31845. } catch (e) {
  31846. }
  31847. if (response !== null) {
  31848. self2.push(new Buffer(response));
  31849. break;
  31850. }
  31851. case "text":
  31852. try {
  31853. response = xhr.responseText;
  31854. } catch (e) {
  31855. self2._mode = "text:vbarray";
  31856. break;
  31857. }
  31858. if (response.length > self2._pos) {
  31859. var newData = response.substr(self2._pos);
  31860. if (self2._charset === "x-user-defined") {
  31861. var buffer = new Buffer(newData.length);
  31862. for (var i = 0; i < newData.length; i++) {
  31863. buffer[i] = newData.charCodeAt(i) & 255;
  31864. }
  31865. self2.push(buffer);
  31866. } else {
  31867. self2.push(newData, self2._charset);
  31868. }
  31869. self2._pos = response.length;
  31870. }
  31871. break;
  31872. case "arraybuffer":
  31873. if (xhr.readyState !== rStates.DONE || !xhr.response)
  31874. break;
  31875. response = xhr.response;
  31876. self2.push(new Buffer(new Uint8Array(response)));
  31877. break;
  31878. case "moz-chunked-arraybuffer":
  31879. response = xhr.response;
  31880. if (xhr.readyState !== rStates.LOADING || !response)
  31881. break;
  31882. self2.push(new Buffer(new Uint8Array(response)));
  31883. break;
  31884. case "ms-stream":
  31885. response = xhr.response;
  31886. if (xhr.readyState !== rStates.LOADING)
  31887. break;
  31888. var reader = new global2.MSStreamReader();
  31889. reader.onprogress = function() {
  31890. if (reader.result.byteLength > self2._pos) {
  31891. self2.push(new Buffer(new Uint8Array(reader.result.slice(self2._pos))));
  31892. self2._pos = reader.result.byteLength;
  31893. }
  31894. };
  31895. reader.onload = function() {
  31896. self2.push(null);
  31897. };
  31898. reader.readAsArrayBuffer(response);
  31899. break;
  31900. }
  31901. if (self2._xhr.readyState === rStates.DONE && self2._mode !== "ms-stream") {
  31902. self2.push(null);
  31903. }
  31904. };
  31905. }).call(this);
  31906. }).call(this, require2("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require2("buffer").Buffer);
  31907. }, { "./capability": 469, "_process": 467, "buffer": 90, "core-js/modules/es.array-buffer.slice.js": 271, "core-js/modules/es.array.iterator.js": 278, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.match.js": 304, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.typed-array.copy-within.js": 315, "core-js/modules/es.typed-array.every.js": 316, "core-js/modules/es.typed-array.fill.js": 317, "core-js/modules/es.typed-array.filter.js": 318, "core-js/modules/es.typed-array.find-index.js": 319, "core-js/modules/es.typed-array.find.js": 320, "core-js/modules/es.typed-array.for-each.js": 321, "core-js/modules/es.typed-array.includes.js": 322, "core-js/modules/es.typed-array.index-of.js": 323, "core-js/modules/es.typed-array.iterator.js": 324, "core-js/modules/es.typed-array.join.js": 325, "core-js/modules/es.typed-array.last-index-of.js": 326, "core-js/modules/es.typed-array.map.js": 327, "core-js/modules/es.typed-array.reduce-right.js": 328, "core-js/modules/es.typed-array.reduce.js": 329, "core-js/modules/es.typed-array.reverse.js": 330, "core-js/modules/es.typed-array.set.js": 331, "core-js/modules/es.typed-array.slice.js": 332, "core-js/modules/es.typed-array.some.js": 333, "core-js/modules/es.typed-array.sort.js": 334, "core-js/modules/es.typed-array.subarray.js": 335, "core-js/modules/es.typed-array.to-locale-string.js": 336, "core-js/modules/es.typed-array.to-string.js": 337, "core-js/modules/es.typed-array.uint8-array.js": 338, "core-js/modules/web.dom-collections.for-each.js": 339, "inherits": 364, "readable-stream": 394 }], 472: [function(require2, module3, exports3) {
  31908. "use strict";
  31909. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  31910. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  31911. require2("core-js/modules/es.regexp.exec.js");
  31912. require2("core-js/modules/es.string.search.js");
  31913. require2("core-js/modules/es.array.concat.js");
  31914. require2("core-js/modules/es.string.split.js");
  31915. require2("core-js/modules/es.string.replace.js");
  31916. require2("core-js/modules/es.array.join.js");
  31917. require2("core-js/modules/es.string.trim.js");
  31918. require2("core-js/modules/es.string.match.js");
  31919. require2("core-js/modules/es.array.slice.js");
  31920. require2("core-js/modules/es.object.keys.js");
  31921. require2("core-js/modules/es.array.splice.js");
  31922. var punycode = require2("punycode");
  31923. var util = require2("./util");
  31924. exports3.parse = urlParse;
  31925. exports3.resolve = urlResolve;
  31926. exports3.resolveObject = urlResolveObject;
  31927. exports3.format = urlFormat;
  31928. exports3.Url = Url;
  31929. function Url() {
  31930. this.protocol = null;
  31931. this.slashes = null;
  31932. this.auth = null;
  31933. this.host = null;
  31934. this.port = null;
  31935. this.hostname = null;
  31936. this.hash = null;
  31937. this.search = null;
  31938. this.query = null;
  31939. this.pathname = null;
  31940. this.path = null;
  31941. this.href = null;
  31942. }
  31943. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, delims = ["<", ">", '"', "`", " ", "\r", "\n", " "], unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims), autoEscape = ["'"].concat(unwise), nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape), hostEndingChars = ["/", "?", "#"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = {
  31944. javascript: true,
  31945. "javascript:": true
  31946. }, hostlessProtocol = {
  31947. javascript: true,
  31948. "javascript:": true
  31949. }, slashedProtocol = {
  31950. http: true,
  31951. https: true,
  31952. ftp: true,
  31953. gopher: true,
  31954. file: true,
  31955. "http:": true,
  31956. "https:": true,
  31957. "ftp:": true,
  31958. "gopher:": true,
  31959. "file:": true
  31960. }, querystring2 = require2("querystring");
  31961. function urlParse(url, parseQueryString, slashesDenoteHost) {
  31962. if (url && util.isObject(url) && url instanceof Url)
  31963. return url;
  31964. var u = new Url();
  31965. u.parse(url, parseQueryString, slashesDenoteHost);
  31966. return u;
  31967. }
  31968. Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
  31969. if (!util.isString(url)) {
  31970. throw new TypeError("Parameter 'url' must be a string, not " + (0, _typeof2.default)(url));
  31971. }
  31972. var queryIndex = url.indexOf("?"), splitter = queryIndex !== -1 && queryIndex < url.indexOf("#") ? "?" : "#", uSplit = url.split(splitter), slashRegex = /\\/g;
  31973. uSplit[0] = uSplit[0].replace(slashRegex, "/");
  31974. url = uSplit.join(splitter);
  31975. var rest = url;
  31976. rest = rest.trim();
  31977. if (!slashesDenoteHost && url.split("#").length === 1) {
  31978. var simplePath = simplePathPattern.exec(rest);
  31979. if (simplePath) {
  31980. this.path = rest;
  31981. this.href = rest;
  31982. this.pathname = simplePath[1];
  31983. if (simplePath[2]) {
  31984. this.search = simplePath[2];
  31985. if (parseQueryString) {
  31986. this.query = querystring2.parse(this.search.substr(1));
  31987. } else {
  31988. this.query = this.search.substr(1);
  31989. }
  31990. } else if (parseQueryString) {
  31991. this.search = "";
  31992. this.query = {};
  31993. }
  31994. return this;
  31995. }
  31996. }
  31997. var proto = protocolPattern.exec(rest);
  31998. if (proto) {
  31999. proto = proto[0];
  32000. var lowerProto = proto.toLowerCase();
  32001. this.protocol = lowerProto;
  32002. rest = rest.substr(proto.length);
  32003. }
  32004. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32005. var slashes = rest.substr(0, 2) === "//";
  32006. if (slashes && !(proto && hostlessProtocol[proto])) {
  32007. rest = rest.substr(2);
  32008. this.slashes = true;
  32009. }
  32010. }
  32011. if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
  32012. var hostEnd = -1;
  32013. for (var i = 0; i < hostEndingChars.length; i++) {
  32014. var hec = rest.indexOf(hostEndingChars[i]);
  32015. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
  32016. hostEnd = hec;
  32017. }
  32018. var auth, atSign;
  32019. if (hostEnd === -1) {
  32020. atSign = rest.lastIndexOf("@");
  32021. } else {
  32022. atSign = rest.lastIndexOf("@", hostEnd);
  32023. }
  32024. if (atSign !== -1) {
  32025. auth = rest.slice(0, atSign);
  32026. rest = rest.slice(atSign + 1);
  32027. this.auth = decodeURIComponent(auth);
  32028. }
  32029. hostEnd = -1;
  32030. for (var i = 0; i < nonHostChars.length; i++) {
  32031. var hec = rest.indexOf(nonHostChars[i]);
  32032. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
  32033. hostEnd = hec;
  32034. }
  32035. if (hostEnd === -1)
  32036. hostEnd = rest.length;
  32037. this.host = rest.slice(0, hostEnd);
  32038. rest = rest.slice(hostEnd);
  32039. this.parseHost();
  32040. this.hostname = this.hostname || "";
  32041. var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
  32042. if (!ipv6Hostname) {
  32043. var hostparts = this.hostname.split(".");
  32044. for (var i = 0, l = hostparts.length; i < l; i++) {
  32045. var part = hostparts[i];
  32046. if (!part)
  32047. continue;
  32048. if (!part.match(hostnamePartPattern)) {
  32049. var newpart = "";
  32050. for (var j = 0, k = part.length; j < k; j++) {
  32051. if (part.charCodeAt(j) > 127) {
  32052. newpart += "x";
  32053. } else {
  32054. newpart += part[j];
  32055. }
  32056. }
  32057. if (!newpart.match(hostnamePartPattern)) {
  32058. var validParts = hostparts.slice(0, i);
  32059. var notHost = hostparts.slice(i + 1);
  32060. var bit = part.match(hostnamePartStart);
  32061. if (bit) {
  32062. validParts.push(bit[1]);
  32063. notHost.unshift(bit[2]);
  32064. }
  32065. if (notHost.length) {
  32066. rest = "/" + notHost.join(".") + rest;
  32067. }
  32068. this.hostname = validParts.join(".");
  32069. break;
  32070. }
  32071. }
  32072. }
  32073. }
  32074. if (this.hostname.length > hostnameMaxLen) {
  32075. this.hostname = "";
  32076. } else {
  32077. this.hostname = this.hostname.toLowerCase();
  32078. }
  32079. if (!ipv6Hostname) {
  32080. this.hostname = punycode.toASCII(this.hostname);
  32081. }
  32082. var p = this.port ? ":" + this.port : "";
  32083. var h = this.hostname || "";
  32084. this.host = h + p;
  32085. this.href += this.host;
  32086. if (ipv6Hostname) {
  32087. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  32088. if (rest[0] !== "/") {
  32089. rest = "/" + rest;
  32090. }
  32091. }
  32092. }
  32093. if (!unsafeProtocol[lowerProto]) {
  32094. for (var i = 0, l = autoEscape.length; i < l; i++) {
  32095. var ae = autoEscape[i];
  32096. if (rest.indexOf(ae) === -1)
  32097. continue;
  32098. var esc = encodeURIComponent(ae);
  32099. if (esc === ae) {
  32100. esc = escape(ae);
  32101. }
  32102. rest = rest.split(ae).join(esc);
  32103. }
  32104. }
  32105. var hash = rest.indexOf("#");
  32106. if (hash !== -1) {
  32107. this.hash = rest.substr(hash);
  32108. rest = rest.slice(0, hash);
  32109. }
  32110. var qm = rest.indexOf("?");
  32111. if (qm !== -1) {
  32112. this.search = rest.substr(qm);
  32113. this.query = rest.substr(qm + 1);
  32114. if (parseQueryString) {
  32115. this.query = querystring2.parse(this.query);
  32116. }
  32117. rest = rest.slice(0, qm);
  32118. } else if (parseQueryString) {
  32119. this.search = "";
  32120. this.query = {};
  32121. }
  32122. if (rest)
  32123. this.pathname = rest;
  32124. if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
  32125. this.pathname = "/";
  32126. }
  32127. if (this.pathname || this.search) {
  32128. var p = this.pathname || "";
  32129. var s = this.search || "";
  32130. this.path = p + s;
  32131. }
  32132. this.href = this.format();
  32133. return this;
  32134. };
  32135. function urlFormat(obj) {
  32136. if (util.isString(obj))
  32137. obj = urlParse(obj);
  32138. if (!(obj instanceof Url))
  32139. return Url.prototype.format.call(obj);
  32140. return obj.format();
  32141. }
  32142. Url.prototype.format = function() {
  32143. var auth = this.auth || "";
  32144. if (auth) {
  32145. auth = encodeURIComponent(auth);
  32146. auth = auth.replace(/%3A/i, ":");
  32147. auth += "@";
  32148. }
  32149. var protocol = this.protocol || "", pathname = this.pathname || "", hash = this.hash || "", host = false, query = "";
  32150. if (this.host) {
  32151. host = auth + this.host;
  32152. } else if (this.hostname) {
  32153. host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]");
  32154. if (this.port) {
  32155. host += ":" + this.port;
  32156. }
  32157. }
  32158. if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
  32159. query = querystring2.stringify(this.query);
  32160. }
  32161. var search = this.search || query && "?" + query || "";
  32162. if (protocol && protocol.substr(-1) !== ":")
  32163. protocol += ":";
  32164. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
  32165. host = "//" + (host || "");
  32166. if (pathname && pathname.charAt(0) !== "/")
  32167. pathname = "/" + pathname;
  32168. } else if (!host) {
  32169. host = "";
  32170. }
  32171. if (hash && hash.charAt(0) !== "#")
  32172. hash = "#" + hash;
  32173. if (search && search.charAt(0) !== "?")
  32174. search = "?" + search;
  32175. pathname = pathname.replace(/[?#]/g, function(match) {
  32176. return encodeURIComponent(match);
  32177. });
  32178. search = search.replace("#", "%23");
  32179. return protocol + host + pathname + search + hash;
  32180. };
  32181. function urlResolve(source, relative) {
  32182. return urlParse(source, false, true).resolve(relative);
  32183. }
  32184. Url.prototype.resolve = function(relative) {
  32185. return this.resolveObject(urlParse(relative, false, true)).format();
  32186. };
  32187. function urlResolveObject(source, relative) {
  32188. if (!source)
  32189. return relative;
  32190. return urlParse(source, false, true).resolveObject(relative);
  32191. }
  32192. Url.prototype.resolveObject = function(relative) {
  32193. if (util.isString(relative)) {
  32194. var rel = new Url();
  32195. rel.parse(relative, false, true);
  32196. relative = rel;
  32197. }
  32198. var result = new Url();
  32199. var tkeys = Object.keys(this);
  32200. for (var tk = 0; tk < tkeys.length; tk++) {
  32201. var tkey = tkeys[tk];
  32202. result[tkey] = this[tkey];
  32203. }
  32204. result.hash = relative.hash;
  32205. if (relative.href === "") {
  32206. result.href = result.format();
  32207. return result;
  32208. }
  32209. if (relative.slashes && !relative.protocol) {
  32210. var rkeys = Object.keys(relative);
  32211. for (var rk = 0; rk < rkeys.length; rk++) {
  32212. var rkey = rkeys[rk];
  32213. if (rkey !== "protocol")
  32214. result[rkey] = relative[rkey];
  32215. }
  32216. if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
  32217. result.path = result.pathname = "/";
  32218. }
  32219. result.href = result.format();
  32220. return result;
  32221. }
  32222. if (relative.protocol && relative.protocol !== result.protocol) {
  32223. if (!slashedProtocol[relative.protocol]) {
  32224. var keys = Object.keys(relative);
  32225. for (var v = 0; v < keys.length; v++) {
  32226. var k = keys[v];
  32227. result[k] = relative[k];
  32228. }
  32229. result.href = result.format();
  32230. return result;
  32231. }
  32232. result.protocol = relative.protocol;
  32233. if (!relative.host && !hostlessProtocol[relative.protocol]) {
  32234. var relPath = (relative.pathname || "").split("/");
  32235. while (relPath.length && !(relative.host = relPath.shift())) {
  32236. ;
  32237. }
  32238. if (!relative.host)
  32239. relative.host = "";
  32240. if (!relative.hostname)
  32241. relative.hostname = "";
  32242. if (relPath[0] !== "")
  32243. relPath.unshift("");
  32244. if (relPath.length < 2)
  32245. relPath.unshift("");
  32246. result.pathname = relPath.join("/");
  32247. } else {
  32248. result.pathname = relative.pathname;
  32249. }
  32250. result.search = relative.search;
  32251. result.query = relative.query;
  32252. result.host = relative.host || "";
  32253. result.auth = relative.auth;
  32254. result.hostname = relative.hostname || relative.host;
  32255. result.port = relative.port;
  32256. if (result.pathname || result.search) {
  32257. var p = result.pathname || "";
  32258. var s = result.search || "";
  32259. result.path = p + s;
  32260. }
  32261. result.slashes = result.slashes || relative.slashes;
  32262. result.href = result.format();
  32263. return result;
  32264. }
  32265. var isSourceAbs = result.pathname && result.pathname.charAt(0) === "/", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === "/", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split("/") || [], relPath = relative.pathname && relative.pathname.split("/") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];
  32266. if (psychotic) {
  32267. result.hostname = "";
  32268. result.port = null;
  32269. if (result.host) {
  32270. if (srcPath[0] === "")
  32271. srcPath[0] = result.host;
  32272. else
  32273. srcPath.unshift(result.host);
  32274. }
  32275. result.host = "";
  32276. if (relative.protocol) {
  32277. relative.hostname = null;
  32278. relative.port = null;
  32279. if (relative.host) {
  32280. if (relPath[0] === "")
  32281. relPath[0] = relative.host;
  32282. else
  32283. relPath.unshift(relative.host);
  32284. }
  32285. relative.host = null;
  32286. }
  32287. mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
  32288. }
  32289. if (isRelAbs) {
  32290. result.host = relative.host || relative.host === "" ? relative.host : result.host;
  32291. result.hostname = relative.hostname || relative.hostname === "" ? relative.hostname : result.hostname;
  32292. result.search = relative.search;
  32293. result.query = relative.query;
  32294. srcPath = relPath;
  32295. } else if (relPath.length) {
  32296. if (!srcPath)
  32297. srcPath = [];
  32298. srcPath.pop();
  32299. srcPath = srcPath.concat(relPath);
  32300. result.search = relative.search;
  32301. result.query = relative.query;
  32302. } else if (!util.isNullOrUndefined(relative.search)) {
  32303. if (psychotic) {
  32304. result.hostname = result.host = srcPath.shift();
  32305. var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
  32306. if (authInHost) {
  32307. result.auth = authInHost.shift();
  32308. result.host = result.hostname = authInHost.shift();
  32309. }
  32310. }
  32311. result.search = relative.search;
  32312. result.query = relative.query;
  32313. if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  32314. result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
  32315. }
  32316. result.href = result.format();
  32317. return result;
  32318. }
  32319. if (!srcPath.length) {
  32320. result.pathname = null;
  32321. if (result.search) {
  32322. result.path = "/" + result.search;
  32323. } else {
  32324. result.path = null;
  32325. }
  32326. result.href = result.format();
  32327. return result;
  32328. }
  32329. var last = srcPath.slice(-1)[0];
  32330. var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === "." || last === "..") || last === "";
  32331. var up = 0;
  32332. for (var i = srcPath.length; i >= 0; i--) {
  32333. last = srcPath[i];
  32334. if (last === ".") {
  32335. srcPath.splice(i, 1);
  32336. } else if (last === "..") {
  32337. srcPath.splice(i, 1);
  32338. up++;
  32339. } else if (up) {
  32340. srcPath.splice(i, 1);
  32341. up--;
  32342. }
  32343. }
  32344. if (!mustEndAbs && !removeAllDots) {
  32345. for (; up--; up) {
  32346. srcPath.unshift("..");
  32347. }
  32348. }
  32349. if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) {
  32350. srcPath.unshift("");
  32351. }
  32352. if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
  32353. srcPath.push("");
  32354. }
  32355. var isAbsolute = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/";
  32356. if (psychotic) {
  32357. result.hostname = result.host = isAbsolute ? "" : srcPath.length ? srcPath.shift() : "";
  32358. var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
  32359. if (authInHost) {
  32360. result.auth = authInHost.shift();
  32361. result.host = result.hostname = authInHost.shift();
  32362. }
  32363. }
  32364. mustEndAbs = mustEndAbs || result.host && srcPath.length;
  32365. if (mustEndAbs && !isAbsolute) {
  32366. srcPath.unshift("");
  32367. }
  32368. if (!srcPath.length) {
  32369. result.pathname = null;
  32370. result.path = null;
  32371. } else {
  32372. result.pathname = srcPath.join("/");
  32373. }
  32374. if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  32375. result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
  32376. }
  32377. result.auth = relative.auth || result.auth;
  32378. result.slashes = result.slashes || relative.slashes;
  32379. result.href = result.format();
  32380. return result;
  32381. };
  32382. Url.prototype.parseHost = function() {
  32383. var host = this.host;
  32384. var port = portPattern.exec(host);
  32385. if (port) {
  32386. port = port[0];
  32387. if (port !== ":") {
  32388. this.port = port.substr(1);
  32389. }
  32390. host = host.substr(0, host.length - port.length);
  32391. }
  32392. if (host)
  32393. this.hostname = host;
  32394. };
  32395. }, { "./util": 473, "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.array.join.js": 279, "core-js/modules/es.array.slice.js": 281, "core-js/modules/es.array.splice.js": 283, "core-js/modules/es.object.keys.js": 290, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.match.js": 304, "core-js/modules/es.string.replace.js": 305, "core-js/modules/es.string.search.js": 306, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.string.trim.js": 308, "punycode": 382, "querystring": 385 }], 473: [function(require2, module3, exports3) {
  32396. "use strict";
  32397. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  32398. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  32399. module3.exports = {
  32400. isString: function isString(arg) {
  32401. return typeof arg === "string";
  32402. },
  32403. isObject: function isObject(arg) {
  32404. return (0, _typeof2.default)(arg) === "object" && arg !== null;
  32405. },
  32406. isNull: function isNull(arg) {
  32407. return arg === null;
  32408. },
  32409. isNullOrUndefined: function isNullOrUndefined(arg) {
  32410. return arg == null;
  32411. }
  32412. };
  32413. }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79 }], 474: [function(require2, module3, exports3) {
  32414. "use strict";
  32415. require2("core-js/modules/es.number.constructor.js");
  32416. exports3.encodeURIComponent = function(text) {
  32417. try {
  32418. return encodeURIComponent(text);
  32419. } catch (e) {
  32420. return text;
  32421. }
  32422. };
  32423. exports3.escape = require2("escape-html");
  32424. exports3.timestamp = function timestamp(t) {
  32425. if (t) {
  32426. var v = t;
  32427. if (typeof v === "string") {
  32428. v = Number(v);
  32429. }
  32430. if (String(t).length === 10) {
  32431. v *= 1e3;
  32432. }
  32433. return new Date(v);
  32434. }
  32435. return Math.round(Date.now() / 1e3);
  32436. };
  32437. }, { "core-js/modules/es.number.constructor.js": 286, "escape-html": 343 }], 475: [function(require2, module3, exports3) {
  32438. (function(process, Buffer) {
  32439. (function() {
  32440. "use strict";
  32441. var _interopRequireDefault = require2("@babel/runtime/helpers/interopRequireDefault");
  32442. var _typeof2 = _interopRequireDefault(require2("@babel/runtime/helpers/typeof"));
  32443. require2("core-js/modules/es.string.trim.js");
  32444. require2("core-js/modules/es.regexp.exec.js");
  32445. require2("core-js/modules/es.string.split.js");
  32446. require2("core-js/modules/es.object.to-string.js");
  32447. require2("core-js/modules/es.promise.js");
  32448. require2("core-js/modules/es.function.name.js");
  32449. require2("core-js/modules/es.array.concat.js");
  32450. var util = require2("util");
  32451. var urlutil = require2("url");
  32452. var http = require2("http");
  32453. var https = require2("https");
  32454. var debug = require2("debug")("urllib");
  32455. var ms = require2("humanize-ms");
  32456. var REQUEST_ID = 0;
  32457. var MAX_VALUE = Math.pow(2, 31) - 10;
  32458. var PROTO_RE = /^https?:\/\//i;
  32459. function getAgent(agent, defaultAgent) {
  32460. return agent === void 0 ? defaultAgent : agent;
  32461. }
  32462. function parseContentType(str) {
  32463. if (!str) {
  32464. return "";
  32465. }
  32466. return str.split(";")[0].trim().toLowerCase();
  32467. }
  32468. function makeCallback(resolve, reject) {
  32469. return function(err, data, res) {
  32470. if (err) {
  32471. return reject(err);
  32472. }
  32473. resolve({
  32474. data,
  32475. status: res.statusCode,
  32476. headers: res.headers,
  32477. res
  32478. });
  32479. };
  32480. }
  32481. exports3.TIMEOUTS = [ms("300s"), ms("300s")];
  32482. var TEXT_DATA_TYPES = ["json", "text"];
  32483. exports3.request = function request(url, args, callback) {
  32484. if (arguments.length === 2 && typeof args === "function") {
  32485. callback = args;
  32486. args = null;
  32487. }
  32488. if (typeof callback === "function") {
  32489. return exports3.requestWithCallback(url, args, callback);
  32490. }
  32491. return new Promise(function(resolve, reject) {
  32492. exports3.requestWithCallback(url, args, makeCallback(resolve, reject));
  32493. });
  32494. };
  32495. exports3.requestWithCallback = function requestWithCallback(url, args, callback) {
  32496. if (!url || typeof url !== "string" && (0, _typeof2.default)(url) !== "object") {
  32497. var msg = util.format("expect request url to be a string or a http request options, but got %j", url);
  32498. throw new Error(msg);
  32499. }
  32500. if (arguments.length === 2 && typeof args === "function") {
  32501. callback = args;
  32502. args = null;
  32503. }
  32504. args = args || {};
  32505. if (REQUEST_ID >= MAX_VALUE) {
  32506. REQUEST_ID = 0;
  32507. }
  32508. var reqId = ++REQUEST_ID;
  32509. args.requestUrls = args.requestUrls || [];
  32510. var reqMeta = {
  32511. requestId: reqId,
  32512. url,
  32513. args,
  32514. ctx: args.ctx
  32515. };
  32516. if (args.emitter) {
  32517. args.emitter.emit("request", reqMeta);
  32518. }
  32519. args.timeout = args.timeout || exports3.TIMEOUTS;
  32520. args.maxRedirects = args.maxRedirects || 10;
  32521. args.streaming = args.streaming || args.customResponse;
  32522. var requestStartTime = Date.now();
  32523. var parsedUrl;
  32524. if (typeof url === "string") {
  32525. if (!PROTO_RE.test(url)) {
  32526. url = "https://" + url;
  32527. }
  32528. parsedUrl = urlutil.parse(url);
  32529. } else {
  32530. parsedUrl = url;
  32531. }
  32532. var method = (args.type || args.method || parsedUrl.method || "GET").toUpperCase();
  32533. var port = parsedUrl.port || 80;
  32534. var httplib = http;
  32535. var agent = getAgent(args.agent, exports3.agent);
  32536. var fixJSONCtlChars = args.fixJSONCtlChars;
  32537. if (parsedUrl.protocol === "https:") {
  32538. httplib = https;
  32539. agent = getAgent(args.httpsAgent, exports3.httpsAgent);
  32540. if (!parsedUrl.port) {
  32541. port = 443;
  32542. }
  32543. }
  32544. var options = {
  32545. host: parsedUrl.hostname || parsedUrl.host || "localhost",
  32546. path: parsedUrl.path || "/",
  32547. method,
  32548. port,
  32549. agent,
  32550. headers: args.headers || {},
  32551. // default is dns.lookup
  32552. // https://github.com/nodejs/node/blob/master/lib/net.js#L986
  32553. // custom dnslookup require node >= 4.0.0
  32554. // https://github.com/nodejs/node/blob/archived-io.js-v0.12/lib/net.js#L952
  32555. lookup: args.lookup
  32556. };
  32557. if (Array.isArray(args.timeout)) {
  32558. options.requestTimeout = args.timeout[args.timeout.length - 1];
  32559. } else if (typeof args.timeout !== "undefined") {
  32560. options.requestTimeout = args.timeout;
  32561. }
  32562. var auth = args.auth || parsedUrl.auth;
  32563. if (auth) {
  32564. options.auth = auth;
  32565. }
  32566. var body = args.content || args.data;
  32567. var dataAsQueryString = method === "GET" || method === "HEAD" || args.dataAsQueryString;
  32568. if (!args.content) {
  32569. if (body && !(typeof body === "string" || Buffer.isBuffer(body))) {
  32570. if (dataAsQueryString) {
  32571. body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body);
  32572. } else {
  32573. var contentType = options.headers["Content-Type"] || options.headers["content-type"];
  32574. if (!contentType) {
  32575. if (args.contentType === "json") {
  32576. contentType = "application/json";
  32577. } else {
  32578. contentType = "application/x-www-form-urlencoded";
  32579. }
  32580. options.headers["Content-Type"] = contentType;
  32581. }
  32582. if (parseContentType(contentType) === "application/json") {
  32583. body = JSON.stringify(body);
  32584. } else {
  32585. body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body);
  32586. }
  32587. }
  32588. }
  32589. }
  32590. if (dataAsQueryString && body) {
  32591. options.path += (parsedUrl.query ? "&" : "?") + body;
  32592. body = null;
  32593. }
  32594. var requestSize = 0;
  32595. if (body) {
  32596. var length = body.length;
  32597. if (!Buffer.isBuffer(body)) {
  32598. length = Buffer.byteLength(body);
  32599. }
  32600. requestSize = options.headers["Content-Length"] = length;
  32601. }
  32602. if (args.dataType === "json") {
  32603. options.headers.Accept = "application/json";
  32604. }
  32605. if (typeof args.beforeRequest === "function") {
  32606. args.beforeRequest(options);
  32607. }
  32608. var connectTimer = null;
  32609. var responseTimer = null;
  32610. var __err = null;
  32611. var connected = false;
  32612. var keepAliveSocket = false;
  32613. var responseSize = 0;
  32614. var statusCode = -1;
  32615. var responseAborted = false;
  32616. var remoteAddress = "";
  32617. var remotePort = "";
  32618. var timing = null;
  32619. if (args.timing) {
  32620. timing = {
  32621. // socket assigned
  32622. queuing: 0,
  32623. // dns lookup time
  32624. dnslookup: 0,
  32625. // socket connected
  32626. connected: 0,
  32627. // request sent
  32628. requestSent: 0,
  32629. // Time to first byte (TTFB)
  32630. waiting: 0,
  32631. contentDownload: 0
  32632. };
  32633. }
  32634. function cancelConnectTimer() {
  32635. if (connectTimer) {
  32636. clearTimeout(connectTimer);
  32637. connectTimer = null;
  32638. }
  32639. }
  32640. function cancelResponseTimer() {
  32641. if (responseTimer) {
  32642. clearTimeout(responseTimer);
  32643. responseTimer = null;
  32644. }
  32645. }
  32646. function done(err, data, res) {
  32647. cancelResponseTimer();
  32648. if (!callback) {
  32649. console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!", Date(), reqId, process.pid, options.method, url);
  32650. if (err) {
  32651. console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s: %s\nstack: %s", Date(), reqId, process.pid, err.name, err.message, err.stack);
  32652. }
  32653. return;
  32654. }
  32655. var cb = callback;
  32656. callback = null;
  32657. var headers = {};
  32658. if (res) {
  32659. statusCode = res.statusCode;
  32660. headers = res.headers;
  32661. }
  32662. var requestUseTime = Date.now() - requestStartTime;
  32663. if (timing) {
  32664. timing.contentDownload = requestUseTime;
  32665. }
  32666. debug("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j", requestUseTime, responseSize, statusCode, options.method, options.host, options.path, keepAliveSocket, timing);
  32667. var response = {
  32668. status: statusCode,
  32669. statusCode,
  32670. headers,
  32671. size: responseSize,
  32672. aborted: responseAborted,
  32673. rt: requestUseTime,
  32674. keepAliveSocket,
  32675. data,
  32676. requestUrls: args.requestUrls,
  32677. timing,
  32678. remoteAddress,
  32679. remotePort
  32680. };
  32681. if (err) {
  32682. var agentStatus = "";
  32683. if (agent && typeof agent.getCurrentStatus === "function") {
  32684. agentStatus = ", agent status: " + JSON.stringify(agent.getCurrentStatus());
  32685. }
  32686. err.message += ", " + options.method + " " + url + " " + statusCode + " (connected: " + connected + ", keepalive socket: " + keepAliveSocket + agentStatus + ")\nheaders: " + JSON.stringify(headers);
  32687. err.data = data;
  32688. err.path = options.path;
  32689. err.status = statusCode;
  32690. err.headers = headers;
  32691. err.res = response;
  32692. }
  32693. cb(err, data, args.streaming ? res : response);
  32694. if (args.emitter) {
  32695. reqMeta.url = url;
  32696. reqMeta.socket = req && req.connection;
  32697. reqMeta.options = options;
  32698. reqMeta.size = requestSize;
  32699. args.emitter.emit("response", {
  32700. requestId: reqId,
  32701. error: err,
  32702. ctx: args.ctx,
  32703. req: reqMeta,
  32704. res: response
  32705. });
  32706. }
  32707. }
  32708. function handleRedirect(res) {
  32709. var err = null;
  32710. if (args.followRedirect && statuses.redirect[res.statusCode]) {
  32711. args._followRedirectCount = (args._followRedirectCount || 0) + 1;
  32712. var location2 = res.headers.location;
  32713. if (!location2) {
  32714. err = new Error("Got statusCode " + res.statusCode + " but cannot resolve next location from headers");
  32715. err.name = "FollowRedirectError";
  32716. } else if (args._followRedirectCount > args.maxRedirects) {
  32717. err = new Error("Exceeded maxRedirects. Probably stuck in a redirect loop " + url);
  32718. err.name = "MaxRedirectError";
  32719. } else {
  32720. var newUrl = args.formatRedirectUrl ? args.formatRedirectUrl(url, location2) : urlutil.resolve(url, location2);
  32721. debug("Request#%d %s: `redirected` from %s to %s", reqId, options.path, url, newUrl);
  32722. cancelResponseTimer();
  32723. if (args.headers && args.headers.Host && PROTO_RE.test(location2)) {
  32724. args.headers.Host = null;
  32725. }
  32726. var cb = callback;
  32727. callback = null;
  32728. exports3.requestWithCallback(newUrl, args, cb);
  32729. return {
  32730. redirect: true,
  32731. error: null
  32732. };
  32733. }
  32734. }
  32735. return {
  32736. redirect: false,
  32737. error: err
  32738. };
  32739. }
  32740. if (args.gzip) {
  32741. if (!options.headers["Accept-Encoding"] && !options.headers["accept-encoding"]) {
  32742. options.headers["Accept-Encoding"] = "gzip";
  32743. }
  32744. }
  32745. function decodeContent(res, body2, cb) {
  32746. var encoding = res.headers["content-encoding"];
  32747. return cb(null, body2, encoding);
  32748. }
  32749. var writeStream = args.writeStream;
  32750. debug("Request#%d %s %s with headers %j, options.path: %s", reqId, method, url, options.headers, options.path);
  32751. args.requestUrls.push(url);
  32752. function onResponse(res) {
  32753. if (timing) {
  32754. timing.waiting = Date.now() - requestStartTime;
  32755. }
  32756. debug("Request#%d %s `req response` event emit: status %d, headers: %j", reqId, url, res.statusCode, res.headers);
  32757. if (args.streaming) {
  32758. var result = handleRedirect(res);
  32759. if (result.redirect) {
  32760. res.resume();
  32761. return;
  32762. }
  32763. if (result.error) {
  32764. res.resume();
  32765. return done(result.error, null, res);
  32766. }
  32767. return done(null, null, res);
  32768. }
  32769. res.on("close", function() {
  32770. debug("Request#%d %s: `res close` event emit, total size %d", reqId, url, responseSize);
  32771. });
  32772. res.on("error", function() {
  32773. debug("Request#%d %s: `res error` event emit, total size %d", reqId, url, responseSize);
  32774. });
  32775. res.on("aborted", function() {
  32776. responseAborted = true;
  32777. debug("Request#%d %s: `res aborted` event emit, total size %d", reqId, url, responseSize);
  32778. });
  32779. if (writeStream) {
  32780. var _result = handleRedirect(res);
  32781. if (_result.redirect) {
  32782. res.resume();
  32783. return;
  32784. }
  32785. if (_result.error) {
  32786. res.resume();
  32787. writeStream.end();
  32788. return done(_result.error, null, res);
  32789. }
  32790. if (args.consumeWriteStream === false) {
  32791. res.on("end", done.bind(null, null, null, res));
  32792. } else {
  32793. if (false) {
  32794. } else {
  32795. writeStream.on("close", function() {
  32796. debug("Request#%d %s: writeStream close event emitted", reqId, url);
  32797. done(__err || null, null, res);
  32798. });
  32799. }
  32800. }
  32801. return res.pipe(writeStream);
  32802. }
  32803. var chunks = [];
  32804. res.on("data", function(chunk) {
  32805. debug("Request#%d %s: `res data` event emit, size %d", reqId, url, chunk.length);
  32806. responseSize += chunk.length;
  32807. chunks.push(chunk);
  32808. });
  32809. res.on("end", function() {
  32810. var body2 = Buffer.concat(chunks, responseSize);
  32811. debug("Request#%d %s: `res end` event emit, total size %d, _dumped: %s", reqId, url, responseSize, res._dumped);
  32812. if (__err) {
  32813. return done(__err, body2, res);
  32814. }
  32815. var result2 = handleRedirect(res);
  32816. if (result2.error) {
  32817. return done(result2.error, body2, res);
  32818. }
  32819. if (result2.redirect) {
  32820. return;
  32821. }
  32822. decodeContent(res, body2, function(err, data, encoding) {
  32823. if (err) {
  32824. return done(err, body2, res);
  32825. }
  32826. if (!encoding && TEXT_DATA_TYPES.indexOf(args.dataType) >= 0) {
  32827. try {
  32828. data = decodeBodyByCharset(data, res);
  32829. } catch (e) {
  32830. debug("decodeBodyByCharset error: %s", e);
  32831. return done(null, data, res);
  32832. }
  32833. if (args.dataType === "json") {
  32834. if (responseSize === 0) {
  32835. data = null;
  32836. } else {
  32837. var r = parseJSON(data, fixJSONCtlChars);
  32838. if (r.error) {
  32839. err = r.error;
  32840. } else {
  32841. data = r.data;
  32842. }
  32843. }
  32844. }
  32845. }
  32846. if (responseAborted) {
  32847. debug("Request#%d %s: Remote socket was terminated before `response.end()` was called", reqId, url);
  32848. }
  32849. done(err, data, res);
  32850. });
  32851. });
  32852. }
  32853. var connectTimeout, responseTimeout;
  32854. if (Array.isArray(args.timeout)) {
  32855. connectTimeout = ms(args.timeout[0]);
  32856. responseTimeout = ms(args.timeout[1]);
  32857. } else {
  32858. connectTimeout = responseTimeout = ms(args.timeout);
  32859. }
  32860. debug("ConnectTimeout: %d, ResponseTimeout: %d", connectTimeout, responseTimeout);
  32861. function startConnectTimer() {
  32862. debug("Connect timer ticking, timeout: %d", connectTimeout);
  32863. connectTimer = setTimeout(function() {
  32864. connectTimer = null;
  32865. if (statusCode === -1) {
  32866. statusCode = -2;
  32867. }
  32868. var msg2 = "Connect timeout for " + connectTimeout + "ms";
  32869. var errorName = "ConnectionTimeoutError";
  32870. if (!req.socket) {
  32871. errorName = "SocketAssignTimeoutError";
  32872. msg2 += ", working sockets is full";
  32873. }
  32874. __err = new Error(msg2);
  32875. __err.name = errorName;
  32876. __err.requestId = reqId;
  32877. debug("ConnectTimeout: Request#%d %s %s: %s, connected: %s", reqId, url, __err.name, msg2, connected);
  32878. abortRequest();
  32879. }, connectTimeout);
  32880. }
  32881. function startResposneTimer() {
  32882. debug("Response timer ticking, timeout: %d", responseTimeout);
  32883. responseTimer = setTimeout(function() {
  32884. responseTimer = null;
  32885. var msg2 = "Response timeout for " + responseTimeout + "ms";
  32886. var errorName = "ResponseTimeoutError";
  32887. __err = new Error(msg2);
  32888. __err.name = errorName;
  32889. __err.requestId = reqId;
  32890. debug("ResponseTimeout: Request#%d %s %s: %s, connected: %s", reqId, url, __err.name, msg2, connected);
  32891. abortRequest();
  32892. }, responseTimeout);
  32893. }
  32894. var req;
  32895. options.mode = args.mode ? args.mode : "";
  32896. try {
  32897. req = httplib.request(options, onResponse);
  32898. } catch (err) {
  32899. return done(err);
  32900. }
  32901. if (typeof window === "undefined") {
  32902. startConnectTimer();
  32903. } else {
  32904. req.on("requestTimeout", function() {
  32905. if (statusCode === -1) {
  32906. statusCode = -2;
  32907. }
  32908. var msg2 = "Connect timeout for " + connectTimeout + "ms";
  32909. var errorName = "ConnectionTimeoutError";
  32910. __err = new Error(msg2);
  32911. __err.name = errorName;
  32912. __err.requestId = reqId;
  32913. abortRequest();
  32914. });
  32915. }
  32916. function abortRequest() {
  32917. debug("Request#%d %s abort, connected: %s", reqId, url, connected);
  32918. if (!req.socket) {
  32919. __err.noSocket = true;
  32920. done(__err);
  32921. }
  32922. req.abort();
  32923. }
  32924. if (timing) {
  32925. req.on("finish", function() {
  32926. timing.requestSent = Date.now() - requestStartTime;
  32927. });
  32928. }
  32929. req.once("socket", function(socket) {
  32930. if (timing) {
  32931. timing.queuing = Date.now() - requestStartTime;
  32932. }
  32933. var readyState = socket.readyState;
  32934. if (readyState === "opening") {
  32935. socket.once("lookup", function(err, ip, addressType) {
  32936. debug("Request#%d %s lookup: %s, %s, %s", reqId, url, err, ip, addressType);
  32937. if (timing) {
  32938. timing.dnslookup = Date.now() - requestStartTime;
  32939. }
  32940. if (ip) {
  32941. remoteAddress = ip;
  32942. }
  32943. });
  32944. socket.once("connect", function() {
  32945. if (timing) {
  32946. timing.connected = Date.now() - requestStartTime;
  32947. }
  32948. cancelConnectTimer();
  32949. startResposneTimer();
  32950. debug("Request#%d %s new socket connected", reqId, url);
  32951. connected = true;
  32952. if (!remoteAddress) {
  32953. remoteAddress = socket.remoteAddress;
  32954. }
  32955. remotePort = socket.remotePort;
  32956. });
  32957. return;
  32958. }
  32959. debug("Request#%d %s reuse socket connected, readyState: %s", reqId, url, readyState);
  32960. connected = true;
  32961. keepAliveSocket = true;
  32962. if (!remoteAddress) {
  32963. remoteAddress = socket.remoteAddress;
  32964. }
  32965. remotePort = socket.remotePort;
  32966. cancelConnectTimer();
  32967. startResposneTimer();
  32968. });
  32969. req.on("error", function(err) {
  32970. if (err.name === "Error" || err.name === "TypeError") {
  32971. err.name = connected ? "ResponseError" : "RequestError";
  32972. }
  32973. err.message += ' (req "error")';
  32974. debug("Request#%d %s `req error` event emit, %s: %s", reqId, url, err.name, err.message);
  32975. done(__err || err);
  32976. });
  32977. if (writeStream) {
  32978. writeStream.once("error", function(err) {
  32979. err.message += ' (writeStream "error")';
  32980. __err = err;
  32981. debug("Request#%d %s `writeStream error` event emit, %s: %s", reqId, url, err.name, err.message);
  32982. abortRequest();
  32983. });
  32984. }
  32985. if (args.stream) {
  32986. args.stream.pipe(req);
  32987. args.stream.once("error", function(err) {
  32988. err.message += ' (stream "error")';
  32989. __err = err;
  32990. debug("Request#%d %s `readStream error` event emit, %s: %s", reqId, url, err.name, err.message);
  32991. abortRequest();
  32992. });
  32993. } else {
  32994. req.end(body);
  32995. }
  32996. req.requestId = reqId;
  32997. return req;
  32998. };
  32999. }).call(this);
  33000. }).call(this, require2("_process"), require2("buffer").Buffer);
  33001. }, { "@babel/runtime/helpers/interopRequireDefault": 78, "@babel/runtime/helpers/typeof": 79, "_process": 467, "buffer": 90, "core-js/modules/es.array.concat.js": 272, "core-js/modules/es.function.name.js": 284, "core-js/modules/es.object.to-string.js": 291, "core-js/modules/es.promise.js": 295, "core-js/modules/es.regexp.exec.js": 300, "core-js/modules/es.string.split.js": 307, "core-js/modules/es.string.trim.js": 308, "debug": 465, "http": 468, "https": 355, "humanize-ms": 356, "url": 472, "util": 419 }] }, {}, [1])(1);
  33002. });
  33003. })(window);
  33004. }
  33005. });
  33006. export default require_aliyun_oss_sdk();
  33007. /*! Bundled license information:
  33008. ali-oss/dist/aliyun-oss-sdk.js:
  33009. (*!
  33010. * The buffer module from node.js, for the browser.
  33011. *
  33012. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  33013. * @license MIT
  33014. *)
  33015. (*!
  33016. * Bowser - a browser detector
  33017. * https://github.com/ded/bowser
  33018. * MIT License | (c) Dustin Diaz 2015
  33019. *)
  33020. (*!
  33021. * The buffer module from node.js, for the browser.
  33022. *
  33023. * @author Feross Aboukhadijeh <https://feross.org>
  33024. * @license MIT
  33025. *)
  33026. (*!
  33027. * copy-to - index.js
  33028. * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
  33029. * MIT Licensed
  33030. *)
  33031. (*!
  33032. * escape-html
  33033. * Copyright(c) 2012-2013 TJ Holowaychuk
  33034. * Copyright(c) 2015 Andreas Lubbe
  33035. * Copyright(c) 2015 Tiancheng "Timothy" Gu
  33036. * MIT Licensed
  33037. *)
  33038. (*!
  33039. * humanize-ms - index.js
  33040. * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
  33041. * MIT Licensed
  33042. *)
  33043. (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
  33044. (*!
  33045. * Determine if an object is a Buffer
  33046. *
  33047. * @author Feross Aboukhadijeh <https://feross.org>
  33048. * @license MIT
  33049. *)
  33050. (*!
  33051. * merge-descriptors
  33052. * Copyright(c) 2014 Jonathan Ong
  33053. * Copyright(c) 2015 Douglas Christopher Wilson
  33054. * MIT Licensed
  33055. *)
  33056. (*
  33057. object-assign
  33058. (c) Sindre Sorhus
  33059. @license MIT
  33060. *)
  33061. (*!
  33062. * Platform.js v1.3.6
  33063. * Copyright 2014-2020 Benjamin Tan
  33064. * Copyright 2011-2013 John-David Dalton
  33065. * Available under MIT license
  33066. *)
  33067. (*! https://mths.be/punycode v1.4.1 by @mathias *)
  33068. (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
  33069. */
  33070. //# sourceMappingURL=ali-oss.js.map