media-stream-library.dev.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256
  1. var mediaStreamLibrary;mediaStreamLibrary =
  2. /******/ (() => { // webpackBootstrap
  3. /******/ var __webpack_modules__ = ({
  4. /***/ "./lib/components/aacdepay/index.ts":
  5. /*!******************************************!*\
  6. !*** ./lib/components/aacdepay/index.ts ***!
  7. \******************************************/
  8. /*! namespace exports */
  9. /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] */
  10. /*! other exports [not provided] [no usage info] */
  11. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  12. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  13. "use strict";
  14. __webpack_require__.r(__webpack_exports__);
  15. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  16. /* harmony export */ "AACDepay": () => /* binding */ AACDepay
  17. /* harmony export */ });
  18. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  19. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0__);
  20. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  21. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__);
  22. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  23. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  24. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  25. /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/aacdepay/parser.ts");
  26. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
  27. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  28. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  29. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  30. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  31. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  33. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  34. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  35. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  36. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  39. /*
  40. media: [{ type: 'video',
  41. port: '0',
  42. proto: 'RTP/AVP',
  43. fmt: '96',
  44. rtpmap: '96 H264/90000',
  45. fmtp: {
  46. format: '96',
  47. parameters: {
  48. 'packetization-mode': '1',
  49. 'profile-level-id': '4d0029',
  50. 'sprop-parameter-sets': 'Z00AKeKQDwBE/LgLcBAQGkHiRFQ=,aO48gA==',
  51. },
  52. },
  53. control: 'rtsp://hostname/media/media.amp/stream=0?audio=1&video=1',
  54. framerate: '25.000000',
  55. transform: [[1, 0, 0], [0, 0.75, 0], [0, 0, 1]] },
  56. { type: 'audio',
  57. port: '0',
  58. proto: 'RTP/AVP',
  59. fmt: '97',
  60. fmtp: {
  61. parameters: {
  62. bitrate: '32000',
  63. config: '1408',
  64. indexdeltalength: '3',
  65. indexlength: '3',
  66. mode: 'AAC-hbr',
  67. 'profile-level-id': '2',
  68. sizelength: '13',
  69. streamtype: '5'
  70. },
  71. format: '97'
  72. },
  73. rtpmap: '97 MPEG4-GENERIC/16000/1',
  74. control: 'rtsp://hostname/media/media.amp/stream=1?audio=1&video=1' }]
  75. */
  76. var AACDepay = /*#__PURE__*/function (_Tube) {
  77. _inherits(AACDepay, _Tube);
  78. var _super = _createSuper(AACDepay);
  79. function AACDepay() {
  80. _classCallCheck(this, AACDepay);
  81. var AACPayloadType;
  82. var hasHeader;
  83. var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_6__.createTransform)(function (msg, encoding, callback) {
  84. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
  85. // Check if there is an AAC track in the SDP
  86. var validMedia;
  87. var _iterator = _createForOfIteratorHelper(msg.sdp.media),
  88. _step;
  89. try {
  90. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  91. var media = _step.value;
  92. if (media.type === 'audio' && media.fmtp && media.fmtp.parameters && media.fmtp.parameters.mode === 'AAC-hbr' &&
  93. ((media.recvonly !== undefined && media.recvonly == true) || (media.control.indexOf('trackID=') != -1))) { // truen old rtsp
  94. validMedia = media;
  95. }
  96. }
  97. } catch (err) {
  98. _iterator.e(err);
  99. } finally {
  100. _iterator.f();
  101. }
  102. if (validMedia && validMedia.rtpmap !== undefined) {
  103. AACPayloadType = Number(validMedia.rtpmap.payloadType);
  104. var parameters = validMedia.fmtp.parameters; // Required
  105. var sizeLength = Number(parameters.sizelength) || 0;
  106. var indexLength = Number(parameters.indexlength) || 0;
  107. var indexDeltaLength = Number(parameters.indexdeltalength) || 0; // Optionals
  108. var CTSDeltaLength = Number(parameters.ctsdeltalength) || 0;
  109. var DTSDeltaLength = Number(parameters.dtsdeltalength) || 0;
  110. var RandomAccessIndication = Number(parameters.randomaccessindication) || 0;
  111. var StreamStateIndication = Number(parameters.streamstateindication) || 0;
  112. var AuxiliaryDataSizeLength = Number(parameters.auxiliarydatasizelength) || 0;
  113. hasHeader = sizeLength + Math.max(indexLength, indexDeltaLength) + CTSDeltaLength + DTSDeltaLength + RandomAccessIndication + StreamStateIndication + AuxiliaryDataSizeLength > 0;
  114. }
  115. callback(undefined, msg);
  116. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_2__.payloadType)(msg.data) === AACPayloadType) {
  117. (0,_parser__WEBPACK_IMPORTED_MODULE_5__.parse)(msg, hasHeader, this.push.bind(this));
  118. callback();
  119. } else {
  120. // Not a message we should handle
  121. callback(undefined, msg);
  122. }
  123. }); // outgoing will be defaulted to a PassThrough stream
  124. return _super.call(this, incoming);
  125. }
  126. return AACDepay;
  127. }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
  128. /***/ }),
  129. /***/ "./lib/components/aacdepay/parser.ts":
  130. /*!*******************************************!*\
  131. !*** ./lib/components/aacdepay/parser.ts ***!
  132. \*******************************************/
  133. /*! namespace exports */
  134. /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */
  135. /*! other exports [not provided] [no usage info] */
  136. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  137. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  138. "use strict";
  139. __webpack_require__.r(__webpack_exports__);
  140. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  141. /* harmony export */ "parse": () => /* binding */ parse
  142. /* harmony export */ });
  143. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  144. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__);
  145. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  146. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  147. ;
  148. /*
  149. From RFC 3640 https://tools.ietf.org/html/rfc3640
  150. 2.11. Global Structure of Payload Format
  151. The RTP payload following the RTP header, contains three octet-
  152. aligned data sections, of which the first two MAY be empty, see
  153. Figure 1.
  154. +---------+-----------+-----------+---------------+
  155. | RTP | AU Header | Auxiliary | Access Unit |
  156. | Header | Section | Section | Data Section |
  157. +---------+-----------+-----------+---------------+
  158. <----------RTP Packet Payload----------->
  159. Figure 1: Data sections within an RTP packet
  160. Note that auxilary section is empty for AAC-hbr
  161. 3.2.1. The AU Header Section
  162. When present, the AU Header Section consists of the AU-headers-length
  163. field, followed by a number of AU-headers, see Figure 2.
  164. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
  165. |AU-headers-length|AU-header|AU-header| |AU-header|padding|
  166. | | (1) | (2) | | (n) | bits |
  167. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
  168. Figure 2: The AU Header Section
  169. */
  170. function parse(rtp, hasHeader, callback) {
  171. var buffer = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.payload)(rtp.data);
  172. var headerLength = 0;
  173. if (hasHeader) {
  174. var auHeaderLengthInBits = buffer.readUInt16BE(0);
  175. headerLength = 2 + (auHeaderLengthInBits + auHeaderLengthInBits % 8) / 8; // Add padding
  176. }
  177. var packet = {
  178. type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.ELEMENTARY,
  179. data: buffer.slice(headerLength),
  180. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.payloadType)(rtp.data),
  181. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.timestamp)(rtp.data),
  182. ntpTimestamp: rtp.ntpTimestamp
  183. };
  184. callback(packet);
  185. }
  186. /***/ }),
  187. /***/ "./lib/components/auth/digest.ts":
  188. /*!***************************************!*\
  189. !*** ./lib/components/auth/digest.ts ***!
  190. \***************************************/
  191. /*! namespace exports */
  192. /*! export DigestAuth [provided] [no usage info] [missing usage info prevents renaming] */
  193. /*! other exports [not provided] [no usage info] */
  194. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  195. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  196. "use strict";
  197. __webpack_require__.r(__webpack_exports__);
  198. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  199. /* harmony export */ "DigestAuth": () => /* binding */ DigestAuth
  200. /* harmony export */ });
  201. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  202. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  203. /* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.fill */ "./node_modules/core-js/modules/es.array.fill.js");
  204. /* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1__);
  205. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  206. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2__);
  207. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  208. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__);
  209. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  210. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  211. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  212. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__);
  213. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  214. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__);
  215. /* harmony import */ var core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.pad-start */ "./node_modules/core-js/modules/es.string.pad-start.js");
  216. /* harmony import */ var core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_7__);
  217. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  218. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8__);
  219. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.trim */ "./node_modules/core-js/modules/es.string.trim.js");
  220. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9__);
  221. /* harmony import */ var md5_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! md5.js */ "./node_modules/md5.js/index.js");
  222. /* harmony import */ var md5_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(md5_js__WEBPACK_IMPORTED_MODULE_10__);
  223. ;
  224. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  225. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  226. // https://tools.ietf.org/html/rfc2617#section-3.2.1
  227. var DigestAuth = function DigestAuth(params, username, password) {
  228. var _this = this;
  229. _classCallCheck(this, DigestAuth);
  230. _defineProperty(this, "realm", void 0);
  231. _defineProperty(this, "nonce", void 0);
  232. _defineProperty(this, "opaque", void 0);
  233. _defineProperty(this, "algorithm", void 0);
  234. _defineProperty(this, "qop", void 0);
  235. _defineProperty(this, "username", void 0);
  236. _defineProperty(this, "ha1Base", void 0);
  237. _defineProperty(this, "count", void 0);
  238. _defineProperty(this, "nc", function () {
  239. ++_this.count;
  240. return _this.count.toString(16).padStart(8, '0');
  241. });
  242. _defineProperty(this, "cnonce", function () {
  243. return new Array(4).fill(0).map(function () {
  244. return Math.floor(Math.random() * 256);
  245. }).map(function (n) {
  246. return n.toString(16);
  247. }).join('');
  248. });
  249. _defineProperty(this, "ha1", function (cnonce) {
  250. var ha1 = _this.ha1Base;
  251. if (_this.algorithm === 'md5-sess') {
  252. ha1 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(ha1, ":").concat(_this.nonce, ":").concat(cnonce)).digest('hex');
  253. }
  254. return ha1;
  255. });
  256. _defineProperty(this, "ha2", function (method, uri) {
  257. var body = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  258. var ha2 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(method, ":").concat(uri)).digest('hex');
  259. if (_this.algorithm === 'md5-sess') {
  260. var hbody = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update(body).digest('hex');
  261. ha2 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(method, ":").concat(uri, ":").concat(hbody)).digest('hex');
  262. }
  263. return ha2;
  264. });
  265. _defineProperty(this, "authorization", function () {
  266. var method = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'GET';
  267. var uri = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  268. var body = arguments.length > 2 ? arguments[2] : undefined;
  269. // Increase count
  270. var nc = _this.nc();
  271. var cnonce = _this.cnonce();
  272. var ha1 = _this.ha1(cnonce);
  273. var ha2 = _this.ha2(method, uri, body);
  274. var response = _this.qop === undefined ? new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(ha1, ":").concat(_this.nonce, ":").concat(ha2)).digest('hex') : new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(ha1, ":").concat(_this.nonce, ":").concat(nc, ":").concat(cnonce, ":").concat(_this.qop, ":").concat(ha2)).digest('hex');
  275. var authorizationParams = [];
  276. authorizationParams.push("username=\"".concat(_this.username, "\""));
  277. authorizationParams.push("realm=\"".concat(_this.realm, "\""));
  278. authorizationParams.push("nonce=\"".concat(_this.nonce, "\""));
  279. authorizationParams.push("uri=\"".concat(uri, "\""));
  280. if (_this.qop !== undefined) {
  281. authorizationParams.push("qop=".concat(_this.qop));
  282. authorizationParams.push("nc=".concat(nc));
  283. authorizationParams.push("cnonce=\"".concat(cnonce, "\""));
  284. }
  285. authorizationParams.push("response=\"".concat(response, "\""));
  286. if (_this.opaque !== undefined) {
  287. authorizationParams.push("opaque=\"".concat(_this.opaque, "\""));
  288. }
  289. return "Digest ".concat(authorizationParams.join(', '));
  290. });
  291. var realm = params.get('realm');
  292. if (realm === undefined) {
  293. throw new Error('no realm in digest challenge');
  294. }
  295. this.realm = realm;
  296. this.ha1Base = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(username, ":").concat(realm, ":").concat(password)).digest('hex');
  297. var nonce = params.get('nonce');
  298. if (nonce === undefined) {
  299. throw new Error('no nonce in digest challenge');
  300. }
  301. this.nonce = nonce;
  302. this.opaque = params.get('opaque');
  303. var algorithm = params.get('algorithm');
  304. if (algorithm !== undefined) {
  305. if (algorithm === 'md5') {
  306. this.algorithm = 'md5';
  307. } else if (algorithm === 'md5-sess') {
  308. this.algorithm = 'md5-sess';
  309. }
  310. } else {
  311. this.algorithm = 'md5';
  312. }
  313. var qop = params.get('qop');
  314. if (qop !== undefined) {
  315. var possibleQops = qop.split(',').map(function (qopType) {
  316. return qopType.trim();
  317. });
  318. if (possibleQops.some(function (qopValue) {
  319. return qopValue === 'auth';
  320. })) {
  321. this.qop = 'auth';
  322. } else if (possibleQops.some(function (qopValue) {
  323. return qopValue === 'auth-int';
  324. })) {
  325. this.qop = 'auth-int';
  326. }
  327. }
  328. this.count = 0;
  329. this.username = username;
  330. };
  331. /***/ }),
  332. /***/ "./lib/components/auth/index.ts":
  333. /*!**************************************!*\
  334. !*** ./lib/components/auth/index.ts ***!
  335. \**************************************/
  336. /*! namespace exports */
  337. /*! export Auth [provided] [no usage info] [missing usage info prevents renaming] */
  338. /*! other exports [not provided] [no usage info] */
  339. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  340. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  341. "use strict";
  342. __webpack_require__.r(__webpack_exports__);
  343. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  344. /* harmony export */ "Auth": () => /* binding */ Auth
  345. /* harmony export */ });
  346. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js");
  347. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__);
  348. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  349. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__);
  350. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  351. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__);
  352. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  353. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_3__);
  354. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  355. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4__);
  356. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  357. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__);
  358. /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
  359. /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
  360. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  361. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  362. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
  363. /* harmony import */ var _digest__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./digest */ "./lib/components/auth/digest.ts");
  364. /* harmony import */ var _www_authenticate__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./www-authenticate */ "./lib/components/auth/www-authenticate.ts");
  365. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  366. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  367. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  368. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  369. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  370. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  371. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  372. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  373. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  374. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  375. var UNAUTHORIZED = 401;
  376. var DEFAULT_CONFIG = {
  377. username: 'root',
  378. password: 'pass'
  379. };
  380. /*
  381. * This component currently only supports Basic authentication
  382. * It should be placed between the RTSP parser and the RTSP Session.
  383. */
  384. var Auth = /*#__PURE__*/function (_Tube) {
  385. _inherits(Auth, _Tube);
  386. var _super = _createSuper(Auth);
  387. function Auth() {
  388. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  389. _classCallCheck(this, Auth);
  390. var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_6__.merge)(DEFAULT_CONFIG, config),
  391. username = _merge.username,
  392. password = _merge.password;
  393. if (username === undefined || password === undefined) {
  394. throw new Error('need username and password');
  395. }
  396. var lastSentMessage;
  397. var authHeader;
  398. var outgoing = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_10__.createTransform)(function (msg, encoding, callback) {
  399. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.RTSP) {
  400. lastSentMessage = msg;
  401. if (authHeader && msg.headers) {
  402. msg.headers.Authorization = authHeader;
  403. }
  404. }
  405. callback(undefined, msg);
  406. });
  407. var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_10__.createTransform)(function (msg, encoding, callback) {
  408. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.RTSP && (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_7__.statusCode)(msg.data) === UNAUTHORIZED) {
  409. var headers = msg.data.toString().split('\n');
  410. var wwwAuth = headers.find(function (header) {
  411. return /WWW-Auth/i.test(header);
  412. });
  413. if (wwwAuth === undefined) {
  414. throw new Error('cannot find WWW-Authenticate header');
  415. }
  416. var challenge = (0,_www_authenticate__WEBPACK_IMPORTED_MODULE_12__.parseWWWAuthenticate)(wwwAuth);
  417. if (challenge.type === 'basic') {
  418. authHeader = 'Basic ' + Buffer.from(username + ':' + password).toString('base64');
  419. } else if (challenge.type === 'digest') {
  420. var digest = new _digest__WEBPACK_IMPORTED_MODULE_11__.DigestAuth(challenge.params, username, password);
  421. authHeader = digest.authorization(lastSentMessage.method, lastSentMessage.uri);
  422. } else {
  423. // unkown authentication type, give up
  424. return;
  425. } // Retry last RTSP message
  426. // Write will fire our outgoing transform function.
  427. outgoing.write(lastSentMessage, function () {
  428. return callback();
  429. });
  430. } else {
  431. // Not a message we should handle
  432. callback(undefined, msg);
  433. }
  434. });
  435. return _super.call(this, incoming, outgoing);
  436. }
  437. return Auth;
  438. }(_component__WEBPACK_IMPORTED_MODULE_8__.Tube);
  439. /***/ }),
  440. /***/ "./lib/components/auth/www-authenticate.ts":
  441. /*!*************************************************!*\
  442. !*** ./lib/components/auth/www-authenticate.ts ***!
  443. \*************************************************/
  444. /*! namespace exports */
  445. /*! export parseWWWAuthenticate [provided] [no usage info] [missing usage info prevents renaming] */
  446. /*! other exports [not provided] [no usage info] */
  447. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  448. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  449. "use strict";
  450. __webpack_require__.r(__webpack_exports__);
  451. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  452. /* harmony export */ "parseWWWAuthenticate": () => /* binding */ parseWWWAuthenticate
  453. /* harmony export */ });
  454. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  455. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);
  456. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  457. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__);
  458. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  459. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__);
  460. /* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.map */ "./node_modules/core-js/modules/es.map.js");
  461. /* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_3__);
  462. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  463. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  464. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  465. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__);
  466. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  467. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_6__);
  468. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  469. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7__);
  470. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  471. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8__);
  472. ;
  473. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  474. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  475. function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
  476. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  477. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  478. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  479. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  480. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  481. var parseWWWAuthenticate = function parseWWWAuthenticate(header) {
  482. var _header$split = header.split(' '),
  483. _header$split2 = _toArray(_header$split),
  484. type = _header$split2[1],
  485. challenge = _header$split2.slice(2);
  486. var pairs = [];
  487. var re = /\s*([^=]+)=\"([^\"]*)\",?/gm;
  488. var match;
  489. do {
  490. match = re.exec(challenge.join(' '));
  491. if (match !== null) {
  492. var _match = match,
  493. _match2 = _slicedToArray(_match, 3),
  494. key = _match2[1],
  495. value = _match2[2];
  496. pairs.push([key, value]);
  497. }
  498. } while (match !== null);
  499. var params = new Map(pairs);
  500. return {
  501. type: type.toLowerCase(),
  502. params: params
  503. };
  504. };
  505. /***/ }),
  506. /***/ "./lib/components/basicdepay/index.ts":
  507. /*!********************************************!*\
  508. !*** ./lib/components/basicdepay/index.ts ***!
  509. \********************************************/
  510. /*! namespace exports */
  511. /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] */
  512. /*! other exports [not provided] [no usage info] */
  513. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  514. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  515. "use strict";
  516. __webpack_require__.r(__webpack_exports__);
  517. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  518. /* harmony export */ "BasicDepay": () => /* binding */ BasicDepay
  519. /* harmony export */ });
  520. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  521. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  522. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  523. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__);
  524. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  525. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  526. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  527. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
  528. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  529. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  530. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  531. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  532. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  533. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  534. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  535. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  536. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  537. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  538. var BasicDepay = /*#__PURE__*/function (_Tube) {
  539. _inherits(BasicDepay, _Tube);
  540. var _super = _createSuper(BasicDepay);
  541. function BasicDepay(rtpPayloadType) {
  542. _classCallCheck(this, BasicDepay);
  543. if (rtpPayloadType === undefined) {
  544. throw new Error('you must supply a payload type to BasicDepayComponent');
  545. }
  546. var buffer = Buffer.alloc(0);
  547. var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_5__.createTransform)(function (msg, encoding, callback) {
  548. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data) === rtpPayloadType) {
  549. var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payload)(msg.data);
  550. buffer = Buffer.concat([buffer, rtpPayload]);
  551. if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.marker)(msg.data)) {
  552. if (buffer.length > 0) {
  553. this.push({
  554. data: buffer,
  555. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.timestamp)(msg.data),
  556. ntpTimestamp: msg.ntpTimestamp,
  557. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data),
  558. type: _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.ELEMENTARY
  559. });
  560. }
  561. buffer = Buffer.alloc(0);
  562. }
  563. callback();
  564. } else {
  565. // Not a message we should handle
  566. callback(undefined, msg);
  567. }
  568. }); // outgoing will be defaulted to a PassThrough stream
  569. return _super.call(this, incoming);
  570. }
  571. return BasicDepay;
  572. }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
  573. /***/ }),
  574. /***/ "./lib/components/canvas/index.ts":
  575. /*!****************************************!*\
  576. !*** ./lib/components/canvas/index.ts ***!
  577. \****************************************/
  578. /*! namespace exports */
  579. /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] */
  580. /*! other exports [not provided] [no usage info] */
  581. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  583. "use strict";
  584. __webpack_require__.r(__webpack_exports__);
  585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  586. /* harmony export */ "CanvasSink": () => /* binding */ CanvasSink
  587. /* harmony export */ });
  588. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js");
  589. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__);
  590. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  591. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__);
  592. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  593. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__);
  594. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  595. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_3__);
  596. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  597. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_4__);
  598. /* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.url */ "./node_modules/core-js/modules/web.url.js");
  599. /* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_5__);
  600. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  601. /* harmony import */ var _utils_clock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/clock */ "./lib/utils/clock.ts");
  602. /* harmony import */ var _utils_scheduler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/scheduler */ "./lib/utils/scheduler.ts");
  603. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  604. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  605. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_10__);
  606. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  607. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  608. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  609. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  610. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  611. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  612. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  613. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  614. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  615. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  616. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  617. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  618. var resetInfo = function resetInfo(info) {
  619. info.bitrate = 0;
  620. info.framerate = 0;
  621. info.renderedFrames = 0;
  622. };
  623. var generateUpdateInfo = function generateUpdateInfo(clockrate) {
  624. var cumulativeByteLength = 0;
  625. var cumulativeDuration = 0;
  626. var cumulativeFrames = 0;
  627. return function (info, _ref) {
  628. var byteLength = _ref.byteLength,
  629. duration = _ref.duration;
  630. cumulativeByteLength += byteLength;
  631. cumulativeDuration += duration;
  632. cumulativeFrames++; // Update the cumulative number size (bytes) and duration (ticks), and if
  633. // the duration exceeds the clockrate (meaning longer than 1 second of info),
  634. // then compute a new bitrate and reset cumulative size and duration.
  635. if (cumulativeDuration >= clockrate) {
  636. var bits = 8 * cumulativeByteLength;
  637. var frames = cumulativeFrames;
  638. var seconds = cumulativeDuration / clockrate;
  639. info.bitrate = bits / seconds;
  640. info.framerate = frames / seconds;
  641. cumulativeByteLength = 0;
  642. cumulativeDuration = 0;
  643. cumulativeFrames = 0;
  644. }
  645. };
  646. };
  647. /**
  648. * Canvas component
  649. *
  650. * Draws an incoming stream of JPEG images onto a <canvas> element.
  651. * The RTP timestamps are used to schedule the drawing of the images.
  652. * An instance can be used as a 'clock' itself, e.g. with a scheduler.
  653. *
  654. * The following handlers can be set on a component instance:
  655. * - onCanplay: will be called when the first frame is ready and
  656. * the correct frame size has been set on the canvas.
  657. * At this point, the clock can be started by calling
  658. * `.play()` method on the component.
  659. * - onSync: will be called when the presentation time offset is
  660. * known, with the latter as argument (in UNIX milliseconds)
  661. *
  662. * @class CanvasComponent
  663. * @extends {Component}
  664. */
  665. var CanvasSink = /*#__PURE__*/function (_Sink) {
  666. _inherits(CanvasSink, _Sink);
  667. var _super = _createSuper(CanvasSink);
  668. /**
  669. * Creates an instance of CanvasComponent.
  670. * @param { HTMLCanvasElement } el - An HTML < canvas > element
  671. * @memberof CanvasComponent
  672. */
  673. function CanvasSink(el) {
  674. var _this;
  675. _classCallCheck(this, CanvasSink);
  676. if (el === undefined) {
  677. throw new Error('canvas element argument missing');
  678. }
  679. var firstTimestamp = 0;
  680. var lastTimestamp = 0;
  681. var clockrate = 0;
  682. var info = {
  683. bitrate: 0,
  684. framerate: 0,
  685. renderedFrames: 0
  686. };
  687. var updateInfo; // The createImageBitmap function is supported in Chrome and Firefox
  688. // (https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap)
  689. // Note: drawImage can also be used instead of transferFromImageBitmap, but it caused
  690. // very large memory use in Chrome (goes up to ~2-3GB, then drops again).
  691. // Do do not call el.getContext twice, safari returns null for second call
  692. var ctx = null;
  693. if (window.createImageBitmap !== undefined) {
  694. ctx = el.getContext('bitmaprenderer');
  695. }
  696. if (ctx === null) {
  697. ctx = el.getContext('2d');
  698. } // Set up the drawing callback to be used by the scheduler,
  699. // it receives a blob of a JPEG image.
  700. var drawImageBlob;
  701. if (ctx === null) {
  702. drawImageBlob = function drawImageBlob() {
  703. /** NOOP */
  704. };
  705. } else if ('transferFromImageBitmap' in ctx) {
  706. var ctxBitmaprenderer = ctx;
  707. drawImageBlob = function drawImageBlob(_ref2) {
  708. var blob = _ref2.blob;
  709. info.renderedFrames++;
  710. window.createImageBitmap(blob).then(function (imageBitmap) {
  711. ctxBitmaprenderer.transferFromImageBitmap(imageBitmap);
  712. }).catch(function () {
  713. /** ignore */
  714. });
  715. };
  716. } else {
  717. var ctx2d = ctx;
  718. var img = new Image();
  719. img.onload = function () {
  720. ctx2d.drawImage(img, 0, 0);
  721. };
  722. drawImageBlob = function drawImageBlob(_ref3) {
  723. var blob = _ref3.blob;
  724. info.renderedFrames++;
  725. var url = window.URL.createObjectURL(blob);
  726. img.src = url;
  727. };
  728. } // Because we don't have an element that plays video for us,
  729. // we have to use our own clock. The clock can be started/stopped
  730. // with the `play` and `pause` methods, and has a `currentTime`
  731. // property that keeps track of the presentation time.
  732. // The scheduler will use the clock (instead of e.g. a video element)
  733. // to determine when to display the JPEG images.
  734. var clock = new _utils_clock__WEBPACK_IMPORTED_MODULE_7__.Clock();
  735. var scheduler = new _utils_scheduler__WEBPACK_IMPORTED_MODULE_8__.Scheduler(clock, drawImageBlob);
  736. var ntpPresentationTime = 0;
  737. var onCanplay = function onCanplay() {
  738. _this.onCanplay && _this.onCanplay();
  739. };
  740. var onSync = function onSync(ntpPresentationTime) {
  741. _this.onSync && _this.onSync(ntpPresentationTime);
  742. }; // Set up an incoming stream and attach it to the image drawing function.
  743. var incoming = new stream__WEBPACK_IMPORTED_MODULE_10__.Writable({
  744. objectMode: true,
  745. write: function write(msg, encoding, callback) {
  746. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.SDP) {
  747. // start of a new movie, reset timers
  748. clock.reset();
  749. scheduler.reset(); // Initialize first timestamp and clockrate
  750. firstTimestamp = 0;
  751. var jpegMedia = msg.sdp.media.find(function (media) {
  752. return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'JPEG';
  753. });
  754. if (jpegMedia !== undefined && jpegMedia.rtpmap !== undefined) {
  755. clockrate = jpegMedia.rtpmap.clockrate; // Initialize the framerate/bitrate data
  756. resetInfo(info);
  757. updateInfo = generateUpdateInfo(clockrate);
  758. }
  759. callback();
  760. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.JPEG) {
  761. var timestamp = msg.timestamp,
  762. ntpTimestamp = msg.ntpTimestamp; // If first frame, store its timestamp, initialize
  763. // the scheduler with 0 and start the clock.
  764. // Also set the proper size on the canvas.
  765. if (!firstTimestamp) {
  766. // Initialize timing
  767. firstTimestamp = timestamp;
  768. lastTimestamp = timestamp; // Initialize frame size
  769. var _msg$framesize = msg.framesize,
  770. width = _msg$framesize.width,
  771. height = _msg$framesize.height;
  772. el.width = width;
  773. el.height = height; // Notify that we can play at this point
  774. scheduler.init(0);
  775. } // Compute millisecond presentation time (with offset 0
  776. // as we initialized the scheduler with 0).
  777. var presentationTime = 1000 * (timestamp - firstTimestamp) / clockrate;
  778. var blob = new window.Blob([msg.data], {
  779. type: 'image/jpeg'
  780. }); // If the actual UTC time of the start of presentation isn't known yet,
  781. // and we do have an ntpTimestamp, then compute it here and notify.
  782. if (!ntpPresentationTime && ntpTimestamp) {
  783. ntpPresentationTime = ntpTimestamp - presentationTime;
  784. onSync(ntpPresentationTime);
  785. }
  786. scheduler.run({
  787. ntpTimestamp: presentationTime,
  788. blob: blob
  789. }); // Notify that we can now start the clock.
  790. if (timestamp === firstTimestamp) {
  791. onCanplay();
  792. } // Update bitrate/framerate
  793. updateInfo(info, {
  794. byteLength: msg.data.length,
  795. duration: timestamp - lastTimestamp
  796. });
  797. lastTimestamp = timestamp;
  798. callback();
  799. } else {
  800. callback();
  801. }
  802. }
  803. }); // Set up an outgoing stream.
  804. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_10__.Readable({
  805. objectMode: true,
  806. read: function read() {//
  807. }
  808. }); // When an error is sent on the outgoing stream, whine about it.
  809. outgoing.on('error', function () {
  810. console.warn('outgoing stream broke somewhere');
  811. });
  812. _this = _super.call(this, incoming, outgoing);
  813. _defineProperty(_assertThisInitialized(_this), "onCanplay", void 0);
  814. _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
  815. _defineProperty(_assertThisInitialized(_this), "_clock", void 0);
  816. _defineProperty(_assertThisInitialized(_this), "_scheduler", void 0);
  817. _defineProperty(_assertThisInitialized(_this), "_info", void 0);
  818. _this._clock = clock;
  819. _this._scheduler = scheduler;
  820. _this._info = info;
  821. _this.onCanplay = undefined;
  822. _this.onSync = undefined;
  823. return _this;
  824. }
  825. /**
  826. * Retrieve the current presentation time (seconds)
  827. *
  828. * @readonly
  829. * @memberof CanvasComponent
  830. */
  831. _createClass(CanvasSink, [{
  832. key: "currentTime",
  833. get: function get() {
  834. return this._clock.currentTime;
  835. }
  836. /**
  837. * Pause the presentation.
  838. *
  839. * @memberof CanvasComponent
  840. */
  841. }, {
  842. key: "pause",
  843. value: function pause() {
  844. this._scheduler.suspend();
  845. this._clock.pause();
  846. }
  847. /**
  848. * Start the presentation.
  849. *
  850. * @memberof CanvasComponent
  851. */
  852. }, {
  853. key: "play",
  854. value: function play() {
  855. this._clock.play();
  856. this._scheduler.resume();
  857. }
  858. }, {
  859. key: "bitrate",
  860. get: function get() {
  861. return this._info.bitrate;
  862. }
  863. }, {
  864. key: "framerate",
  865. get: function get() {
  866. return this._info.framerate;
  867. }
  868. }]);
  869. return CanvasSink;
  870. }(_component__WEBPACK_IMPORTED_MODULE_6__.Sink);
  871. /***/ }),
  872. /***/ "./lib/components/component.ts":
  873. /*!*************************************!*\
  874. !*** ./lib/components/component.ts ***!
  875. \*************************************/
  876. /*! namespace exports */
  877. /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] */
  878. /*! export Source [provided] [no usage info] [missing usage info prevents renaming] */
  879. /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] */
  880. /*! other exports [not provided] [no usage info] */
  881. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  883. "use strict";
  884. __webpack_require__.r(__webpack_exports__);
  885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  886. /* harmony export */ "Source": () => /* binding */ Source,
  887. /* harmony export */ "Tube": () => /* binding */ Tube,
  888. /* harmony export */ "Sink": () => /* binding */ Sink
  889. /* harmony export */ });
  890. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  891. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__);
  892. /* harmony import */ var _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/stream-factory */ "./lib/components/helpers/stream-factory.ts");
  893. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  894. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  895. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  896. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  897. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  898. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  899. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  900. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  901. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  902. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  903. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  904. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  905. var AbstractComponent = function AbstractComponent() {
  906. _classCallCheck(this, AbstractComponent);
  907. _defineProperty(this, "incoming", void 0);
  908. _defineProperty(this, "outgoing", void 0);
  909. _defineProperty(this, "next", void 0);
  910. _defineProperty(this, "prev", void 0);
  911. _defineProperty(this, "_incomingErrorHandler", void 0);
  912. _defineProperty(this, "_outgoingErrorHandler", void 0);
  913. };
  914. var Source = /*#__PURE__*/function (_AbstractComponent) {
  915. _inherits(Source, _AbstractComponent);
  916. var _super = _createSuper(Source);
  917. function Source() {
  918. var _this;
  919. var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.Readable({
  920. objectMode: true
  921. });
  922. var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.Writable({
  923. objectMode: true
  924. });
  925. _classCallCheck(this, Source);
  926. _this = _super.call(this);
  927. _defineProperty(_assertThisInitialized(_this), "incoming", void 0);
  928. _defineProperty(_assertThisInitialized(_this), "outgoing", void 0);
  929. _defineProperty(_assertThisInitialized(_this), "next", void 0);
  930. _defineProperty(_assertThisInitialized(_this), "prev", void 0);
  931. _this.incoming = incoming;
  932. _this.outgoing = outgoing;
  933. _this.next = null;
  934. _this.prev = null;
  935. return _this;
  936. }
  937. /**
  938. * Attach another component so the the 'down' stream flows into the
  939. * next component 'down' stream and the 'up' stream of the other component
  940. * flows into the 'up' stream of this component. This is what establishes the
  941. * meaning of 'up' and 'down'.
  942. * @param {Component} next - The component to connect.
  943. * @return {Component} - A reference to the connected component.
  944. *
  945. * -------------- pipe --------------
  946. * <- | outgoing | <- | outgoing | <-
  947. * | this | | next |
  948. * -> | incoming | -> | incoming | ->
  949. * -------------- pipe --------------
  950. */
  951. _createClass(Source, [{
  952. key: "connect",
  953. value: function connect(next) {
  954. var _this2 = this;
  955. // If the next component is not there, we want to return this component
  956. // so that it is possible to continue to chain. If there is a next component,
  957. // but this component already has a next one, or the next one already has a
  958. // previous component, throw an error.
  959. if (next === null) {
  960. return this;
  961. } else if (this.next !== null || next.prev !== null) {
  962. throw new Error('connection failed: component(s) already connected');
  963. }
  964. if (!this.incoming.readable || !this.outgoing.writable) {
  965. throw new Error('connection failed: this component not compatible');
  966. }
  967. if (!next.incoming.writable || !next.outgoing.readable) {
  968. throw new Error('connection failed: next component not compatible');
  969. }
  970. try {
  971. this.incoming.pipe(next.incoming);
  972. next.outgoing.pipe(this.outgoing);
  973. } catch (e) {
  974. throw new Error("connection failed: ".concat(e.message));
  975. }
  976. /**
  977. * Propagate errors back upstream, this assures an error will be propagated
  978. * to all previous streams (but not further than any endpoints). What happens
  979. * when an error is emitted on a stream is up to the stream's implementation.
  980. */
  981. var incomingErrorHandler = function incomingErrorHandler(err) {
  982. _this2.incoming.emit('error', err);
  983. };
  984. next.incoming.on('error', incomingErrorHandler);
  985. var outgoingErrorHandler = function outgoingErrorHandler(err) {
  986. next.outgoing.emit('error', err);
  987. };
  988. this.outgoing.on('error', outgoingErrorHandler); // Keep a bidirectional linked list of components by storing
  989. // a reference to the next component and the listeners that we set up.
  990. this.next = next;
  991. next.prev = this;
  992. this._incomingErrorHandler = incomingErrorHandler;
  993. this._outgoingErrorHandler = outgoingErrorHandler;
  994. return next;
  995. }
  996. /**
  997. * Disconnect the next connected component. When there is no next component
  998. * the function will just do nothing.
  999. * @return {Component} - A reference to this component.
  1000. */
  1001. }, {
  1002. key: "disconnect",
  1003. value: function disconnect() {
  1004. var next = this.next;
  1005. if (next !== null) {
  1006. this.incoming.unpipe(next.incoming);
  1007. next.outgoing.unpipe(this.outgoing);
  1008. if (typeof this._incomingErrorHandler !== 'undefined') {
  1009. next.incoming.removeListener('error', this._incomingErrorHandler);
  1010. }
  1011. if (typeof this._outgoingErrorHandler !== 'undefined') {
  1012. this.outgoing.removeListener('error', this._outgoingErrorHandler);
  1013. }
  1014. this.next = null;
  1015. next.prev = null;
  1016. delete this._incomingErrorHandler;
  1017. delete this._outgoingErrorHandler;
  1018. }
  1019. return this;
  1020. }
  1021. }], [{
  1022. key: "fromMessages",
  1023. value:
  1024. /**
  1025. * Set up a component that emits incoming messages.
  1026. * @param {Array} messages List of objects (with data property) to emit.
  1027. * @return {Component}
  1028. */
  1029. function fromMessages(messages) {
  1030. var component = new Source(_helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.producer(messages), _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.consumer());
  1031. return component;
  1032. }
  1033. }]);
  1034. return Source;
  1035. }(AbstractComponent);
  1036. var Tube = /*#__PURE__*/function (_Source) {
  1037. _inherits(Tube, _Source);
  1038. var _super2 = _createSuper(Tube);
  1039. function Tube() {
  1040. var _this3;
  1041. var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough({
  1042. objectMode: true
  1043. });
  1044. var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough({
  1045. objectMode: true
  1046. });
  1047. _classCallCheck(this, Tube);
  1048. _this3 = _super2.call(this, incoming, outgoing);
  1049. _defineProperty(_assertThisInitialized(_this3), "incoming", void 0);
  1050. _defineProperty(_assertThisInitialized(_this3), "outgoing", void 0);
  1051. _this3.incoming = incoming;
  1052. _this3.outgoing = outgoing;
  1053. return _this3;
  1054. }
  1055. _createClass(Tube, null, [{
  1056. key: "fromHandlers",
  1057. value: function fromHandlers(fnIncoming, fnOutgoing) {
  1058. var incomingStream = fnIncoming ? _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.peeker(fnIncoming) : undefined;
  1059. var outgoingStream = fnOutgoing ? _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.peeker(fnOutgoing) : undefined;
  1060. return new Tube(incomingStream, outgoingStream);
  1061. }
  1062. }]);
  1063. return Tube;
  1064. }(Source);
  1065. var Sink = /*#__PURE__*/function (_AbstractComponent2) {
  1066. _inherits(Sink, _AbstractComponent2);
  1067. var _super3 = _createSuper(Sink);
  1068. function Sink() {
  1069. var _this4;
  1070. var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.Writable({
  1071. objectMode: true
  1072. });
  1073. var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.Readable({
  1074. objectMode: true
  1075. });
  1076. _classCallCheck(this, Sink);
  1077. _this4 = _super3.call(this);
  1078. _defineProperty(_assertThisInitialized(_this4), "incoming", void 0);
  1079. _defineProperty(_assertThisInitialized(_this4), "outgoing", void 0);
  1080. _defineProperty(_assertThisInitialized(_this4), "next", void 0);
  1081. _defineProperty(_assertThisInitialized(_this4), "prev", void 0);
  1082. _this4.incoming = incoming;
  1083. _this4.outgoing = outgoing;
  1084. _this4.next = null;
  1085. _this4.prev = null;
  1086. return _this4;
  1087. }
  1088. _createClass(Sink, [{
  1089. key: "connect",
  1090. value: function connect() {
  1091. throw new Error('connection failed: attempting to connect after a sink');
  1092. }
  1093. }, {
  1094. key: "disconnect",
  1095. value: function disconnect() {
  1096. return this;
  1097. }
  1098. }], [{
  1099. key: "fromHandler",
  1100. value:
  1101. /**
  1102. * Set up a component that swallows incoming data (calling fn on it).
  1103. * To print data, you would use fn = console.log.
  1104. * @param {Function} fn The callback to use for the incoming data.
  1105. * @return {Component}
  1106. */
  1107. function fromHandler(fn) {
  1108. var component = new Sink(_helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.consumer(fn), _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.producer(undefined)); // A sink should propagate when stream is ending.
  1109. component.incoming.on('finish', function () {
  1110. component.outgoing.push(null);
  1111. });
  1112. return component;
  1113. }
  1114. }]);
  1115. return Sink;
  1116. }(AbstractComponent);
  1117. /***/ }),
  1118. /***/ "./lib/components/dataCatcherDepay/index.ts":
  1119. /*!**************************************************!*\
  1120. !*** ./lib/components/dataCatcherDepay/index.ts ***!
  1121. \**************************************************/
  1122. /*! namespace exports */
  1123. /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] */
  1124. /*! other exports [not provided] [no usage info] */
  1125. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1126. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1127. "use strict";
  1128. __webpack_require__.r(__webpack_exports__);
  1129. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1130. /* harmony export */ "dataCatcherDepay": () => /* binding */ dataCatcherDepay
  1131. /* harmony export */ });
  1132. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  1133. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  1134. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  1135. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1136. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  1137. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
  1138. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1139. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1140. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1141. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1142. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1143. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1144. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1145. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1146. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1147. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1148. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1149. var dataCatcherDepay = /*#__PURE__*/function (_Tube) {
  1150. _inherits(dataCatcherDepay, _Tube);
  1151. var _super = _createSuper(dataCatcherDepay);
  1152. function dataCatcherDepay(rtpPayloadType) {
  1153. var _this;
  1154. _classCallCheck(this, dataCatcherDepay);
  1155. if (rtpPayloadType === undefined) {
  1156. throw new Error('you must supply a payload type to BasicDepayComponent');
  1157. }
  1158. var onDataCallback = function onDataCallback(msg) {
  1159. _this.onDataCallback && _this.onDataCallback(msg);
  1160. };
  1161. var buffer = Buffer.alloc(0);
  1162. var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_4__.createTransform)(function (msg, encoding, callback) {
  1163. var ptype = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(msg.data);
  1164. if ( // msg.type === MessageType.RTP &&
  1165. ptype === rtpPayloadType || rtpPayloadType == -1) {
  1166. var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(msg.data);
  1167. buffer = Buffer.concat([buffer, rtpPayload]);
  1168. /* var mrkr = marker(msg.data);
  1169. if (mrkr) {
  1170. */
  1171. if (buffer.length > 0) {
  1172. var catchmsg = {
  1173. data: buffer,
  1174. rawdata: msg.data,
  1175. header: msg.header,
  1176. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(msg.data),
  1177. ntpTimestamp: msg.ntpTimestamp,
  1178. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(msg.data),
  1179. type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.UNKNOWN
  1180. };
  1181. onDataCallback && onDataCallback(catchmsg);
  1182. }
  1183. buffer = Buffer.alloc(0);
  1184. /* }
  1185. */
  1186. callback(undefined, msg);
  1187. } else {
  1188. // Not a message we should handle
  1189. callback(undefined, msg);
  1190. }
  1191. }); // outgoing will be defaulted to a PassThrough stream
  1192. _this = _super.call(this, incoming);
  1193. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  1194. return _this;
  1195. }
  1196. return dataCatcherDepay;
  1197. }(_component__WEBPACK_IMPORTED_MODULE_1__.Tube);
  1198. /***/ }),
  1199. /***/ "./lib/components/g711toPCM/index.ts":
  1200. /*!*******************************************!*\
  1201. !*** ./lib/components/g711toPCM/index.ts ***!
  1202. \*******************************************/
  1203. /*! namespace exports */
  1204. /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] */
  1205. /*! other exports [not provided] [no usage info] */
  1206. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1207. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1208. "use strict";
  1209. __webpack_require__.r(__webpack_exports__);
  1210. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1211. /* harmony export */ "g711toPCM": () => /* binding */ g711toPCM
  1212. /* harmony export */ });
  1213. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  1214. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  1215. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js");
  1216. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_1__);
  1217. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  1218. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2__);
  1219. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  1220. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__);
  1221. /* harmony import */ var core_js_modules_es_typed_array_int16_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.typed-array.int16-array */ "./node_modules/core-js/modules/es.typed-array.int16-array.js");
  1222. /* harmony import */ var core_js_modules_es_typed_array_int16_array__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_int16_array__WEBPACK_IMPORTED_MODULE_4__);
  1223. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.typed-array.copy-within */ "./node_modules/core-js/modules/es.typed-array.copy-within.js");
  1224. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__);
  1225. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.typed-array.every */ "./node_modules/core-js/modules/es.typed-array.every.js");
  1226. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__);
  1227. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.typed-array.fill */ "./node_modules/core-js/modules/es.typed-array.fill.js");
  1228. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__);
  1229. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.typed-array.filter */ "./node_modules/core-js/modules/es.typed-array.filter.js");
  1230. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__);
  1231. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.typed-array.find */ "./node_modules/core-js/modules/es.typed-array.find.js");
  1232. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__);
  1233. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.typed-array.find-index */ "./node_modules/core-js/modules/es.typed-array.find-index.js");
  1234. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__);
  1235. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.typed-array.for-each */ "./node_modules/core-js/modules/es.typed-array.for-each.js");
  1236. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__);
  1237. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.typed-array.includes */ "./node_modules/core-js/modules/es.typed-array.includes.js");
  1238. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__);
  1239. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.typed-array.index-of */ "./node_modules/core-js/modules/es.typed-array.index-of.js");
  1240. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__);
  1241. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.typed-array.iterator */ "./node_modules/core-js/modules/es.typed-array.iterator.js");
  1242. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__);
  1243. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.typed-array.join */ "./node_modules/core-js/modules/es.typed-array.join.js");
  1244. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__);
  1245. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.typed-array.last-index-of */ "./node_modules/core-js/modules/es.typed-array.last-index-of.js");
  1246. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__);
  1247. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.typed-array.map */ "./node_modules/core-js/modules/es.typed-array.map.js");
  1248. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__);
  1249. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce */ "./node_modules/core-js/modules/es.typed-array.reduce.js");
  1250. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__);
  1251. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce-right */ "./node_modules/core-js/modules/es.typed-array.reduce-right.js");
  1252. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__);
  1253. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.typed-array.reverse */ "./node_modules/core-js/modules/es.typed-array.reverse.js");
  1254. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__);
  1255. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.typed-array.set */ "./node_modules/core-js/modules/es.typed-array.set.js");
  1256. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__);
  1257. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.typed-array.slice */ "./node_modules/core-js/modules/es.typed-array.slice.js");
  1258. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__);
  1259. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.typed-array.some */ "./node_modules/core-js/modules/es.typed-array.some.js");
  1260. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__);
  1261. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.typed-array.sort */ "./node_modules/core-js/modules/es.typed-array.sort.js");
  1262. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__);
  1263. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.typed-array.subarray */ "./node_modules/core-js/modules/es.typed-array.subarray.js");
  1264. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__);
  1265. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string */ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js");
  1266. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__);
  1267. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-string */ "./node_modules/core-js/modules/es.typed-array.to-string.js");
  1268. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__);
  1269. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  1270. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1271. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  1272. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
  1273. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1274. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1275. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1276. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1277. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1278. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1279. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1280. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1281. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1282. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1283. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1284. var g711toPCM = /*#__PURE__*/function (_Tube) {
  1285. _inherits(g711toPCM, _Tube);
  1286. var _super = _createSuper(g711toPCM);
  1287. function g711toPCM() {
  1288. var _this;
  1289. _classCallCheck(this, g711toPCM);
  1290. var rtpPayloadType = 0; //pcmu aka ulaw aka g711
  1291. var onDataCallback = function onDataCallback(msg) {
  1292. _this.onDataCallback && _this.onDataCallback(msg);
  1293. };
  1294. function mulaw_decode(num) {
  1295. var MULAW_BIAS = 33;
  1296. var sign = 0;
  1297. var position = 0;
  1298. var decoded = 0;
  1299. num = ~num;
  1300. if (num & 0x80) {
  1301. num &= ~(1 << 7);
  1302. sign = -1;
  1303. }
  1304. position = ((num & 0xf0) >> 4) + 5;
  1305. decoded = (1 << position | (num & 0x0F) << position - 4 | 1 << position - 5) - MULAW_BIAS;
  1306. return sign == 0 ? decoded : -decoded;
  1307. }
  1308. var buffer = Buffer.alloc(0);
  1309. var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_31__.createTransform)(function (msg, encoding, callback) {
  1310. var ptype = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payloadType)(msg.data);
  1311. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.SDP) {
  1312. var pcmu = msg.sdp.media.find(function (media) {
  1313. return media.type === 'audio' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'PCMU';
  1314. });
  1315. if (pcmu !== undefined && pcmu.rtpmap !== undefined) {
  1316. rtpPayloadType = pcmu.rtpmap.payloadType;
  1317. pcmu.rtpmap.encodingName = 'PCM';
  1318. }
  1319. callback(undefined, msg);
  1320. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.RTP && ptype === rtpPayloadType) {
  1321. var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payload)(msg.data);
  1322. buffer = Buffer.concat([buffer, rtpPayload]);
  1323. if (buffer.length > 0) {
  1324. var decodedBuffer = new Int16Array(buffer.length);
  1325. for (var i = 0; i < buffer.length; i++) {
  1326. decodedBuffer[i] = mulaw_decode(buffer[i]);
  1327. }
  1328. var catchmsg = {
  1329. data: decodedBuffer,
  1330. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.timestamp)(msg.data),
  1331. ntpTimestamp: msg.ntpTimestamp,
  1332. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payloadType)(msg.data),
  1333. type: _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.PCM
  1334. };
  1335. onDataCallback && onDataCallback(catchmsg); //send decoded data
  1336. callback(undefined, catchmsg);
  1337. decodedBuffer = new Int16Array(0);
  1338. } else {
  1339. //send as is
  1340. callback(undefined, msg);
  1341. }
  1342. buffer = Buffer.alloc(0);
  1343. } else {
  1344. // Not a message we should handle
  1345. callback(undefined, msg);
  1346. }
  1347. }); // outgoing will be defaulted to a PassThrough stream
  1348. _this = _super.call(this, incoming);
  1349. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  1350. return _this;
  1351. }
  1352. return g711toPCM;
  1353. }(_component__WEBPACK_IMPORTED_MODULE_28__.Tube);
  1354. /***/ }),
  1355. /***/ "./lib/components/h264depay/index.ts":
  1356. /*!*******************************************!*\
  1357. !*** ./lib/components/h264depay/index.ts ***!
  1358. \*******************************************/
  1359. /*! namespace exports */
  1360. /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] */
  1361. /*! other exports [not provided] [no usage info] */
  1362. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1363. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1364. "use strict";
  1365. __webpack_require__.r(__webpack_exports__);
  1366. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1367. /* harmony export */ "H264Depay": () => /* binding */ H264Depay
  1368. /* harmony export */ });
  1369. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js");
  1370. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__);
  1371. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  1372. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  1373. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_2__);
  1374. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1375. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  1376. /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/h264depay/parser.ts");
  1377. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1378. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1379. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1380. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1381. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1382. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1383. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1384. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1385. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1386. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1387. var H264Depay = /*#__PURE__*/function (_Tube) {
  1388. _inherits(H264Depay, _Tube);
  1389. var _super = _createSuper(H264Depay);
  1390. function H264Depay() {
  1391. var _this;
  1392. _classCallCheck(this, H264Depay);
  1393. var h264PayloadType;
  1394. var idrFound = false;
  1395. var h264DepayParser = new _parser__WEBPACK_IMPORTED_MODULE_5__.H264DepayParser();
  1396. var onDataCallback = function onDataCallback(msg) {
  1397. _this.onDataCallback && _this.onDataCallback(msg);
  1398. }; // Incoming
  1399. var incoming = new stream__WEBPACK_IMPORTED_MODULE_2__.Transform({
  1400. objectMode: true,
  1401. transform: function transform(msg, encoding, callback) {
  1402. // Get correct payload types from sdp to identify video and audio
  1403. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.SDP) {
  1404. var h264Media = msg.sdp.media.find(function (media) {
  1405. return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'H264';
  1406. });
  1407. if (h264Media !== undefined && h264Media.rtpmap !== undefined) {
  1408. h264PayloadType = h264Media.rtpmap.payloadType;
  1409. }
  1410. callback(undefined, msg); // Pass on the original SDP message
  1411. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data) === h264PayloadType) {
  1412. var h264Message = h264DepayParser.parse(msg); // Skip if not a full H264 frame, or when there hasn't been an I-frame yet
  1413. if (h264Message === null || !idrFound && h264Message.nalType !== _parser__WEBPACK_IMPORTED_MODULE_5__.NAL_TYPES.IDR_PICTURE) {
  1414. callback();
  1415. return;
  1416. }
  1417. idrFound = true;
  1418. onDataCallback && onDataCallback(h264Message);
  1419. callback(undefined, h264Message);
  1420. } else {
  1421. // Not a message we should handle
  1422. callback(undefined, msg);
  1423. }
  1424. }
  1425. }); // outgoing will be defaulted to a PassThrough stream
  1426. _this = _super.call(this, incoming);
  1427. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  1428. return _this;
  1429. }
  1430. return H264Depay;
  1431. }(_component__WEBPACK_IMPORTED_MODULE_1__.Tube);
  1432. /***/ }),
  1433. /***/ "./lib/components/h264depay/parser.ts":
  1434. /*!********************************************!*\
  1435. !*** ./lib/components/h264depay/parser.ts ***!
  1436. \********************************************/
  1437. /*! namespace exports */
  1438. /*! export H264DepayParser [provided] [no usage info] [missing usage info prevents renaming] */
  1439. /*! export NAL_TYPES [provided] [no usage info] [missing usage info prevents renaming] */
  1440. /*! other exports [not provided] [no usage info] */
  1441. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1442. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1443. "use strict";
  1444. __webpack_require__.r(__webpack_exports__);
  1445. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1446. /* harmony export */ "NAL_TYPES": () => /* binding */ NAL_TYPES,
  1447. /* harmony export */ "H264DepayParser": () => /* binding */ H264DepayParser
  1448. /* harmony export */ });
  1449. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  1450. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  1451. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  1452. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  1453. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1454. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  1455. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  1456. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_4__);
  1457. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1458. ;
  1459. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1460. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1461. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1462. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1463. var NAL_TYPES;
  1464. /*
  1465. First byte in payload (rtp payload header):
  1466. +---------------+
  1467. |0|1|2|3|4|5|6|7|
  1468. +-+-+-+-+-+-+-+-+
  1469. |F|NRI| Type |
  1470. +---------------+
  1471. 2nd byte in payload: FU header (if type in first byte is 28)
  1472. +---------------+
  1473. |0|1|2|3|4|5|6|7|
  1474. +-+-+-+-+-+-+-+-+
  1475. |S|E|R| Type | S = start, E = end
  1476. +---------------+
  1477. */
  1478. (function (NAL_TYPES) {
  1479. NAL_TYPES[NAL_TYPES["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  1480. NAL_TYPES[NAL_TYPES["NON_IDR_PICTURE"] = 1] = "NON_IDR_PICTURE";
  1481. NAL_TYPES[NAL_TYPES["IDR_PICTURE"] = 5] = "IDR_PICTURE";
  1482. NAL_TYPES[NAL_TYPES["SPS"] = 7] = "SPS";
  1483. NAL_TYPES[NAL_TYPES["PPS"] = 8] = "PPS";
  1484. })(NAL_TYPES || (NAL_TYPES = {}));
  1485. var h264Debug = debug__WEBPACK_IMPORTED_MODULE_4___default()('msl:h264depay');
  1486. var H264DepayParser = /*#__PURE__*/function () {
  1487. function H264DepayParser() {
  1488. _classCallCheck(this, H264DepayParser);
  1489. _defineProperty(this, "_buffer", void 0);
  1490. this._buffer = Buffer.alloc(0);
  1491. }
  1492. _createClass(H264DepayParser, [{
  1493. key: "parse",
  1494. value: function parse(rtp) {
  1495. var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(rtp.data);
  1496. var type = rtpPayload[0] & 0x1f;
  1497. if (type === 28) {
  1498. /* FU-A NALU */
  1499. var fuIndicator = rtpPayload[0];
  1500. var fuHeader = rtpPayload[1];
  1501. var startBit = !!(fuHeader >> 7);
  1502. var nalType = fuHeader & 0x1f;
  1503. var nal = fuIndicator & 0xe0 | nalType;
  1504. var stopBit = fuHeader & 64;
  1505. if (startBit) {
  1506. this._buffer = Buffer.concat([Buffer.from([0, 0, 0, 0, nal]), rtpPayload.slice(2)]);
  1507. return null;
  1508. } else if (stopBit) {
  1509. /* receieved end bit */
  1510. var h264frame = Buffer.concat([this._buffer, rtpPayload.slice(2)]);
  1511. h264frame.writeUInt32BE(h264frame.length - 4, 0);
  1512. var msg = {
  1513. data: h264frame,
  1514. type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.H264,
  1515. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(rtp.data),
  1516. ntpTimestamp: rtp.ntpTimestamp,
  1517. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(rtp.data),
  1518. nalType: nalType
  1519. };
  1520. this._buffer = Buffer.alloc(0);
  1521. return msg;
  1522. } else {
  1523. // Put the received data on the buffer and cut the header bytes
  1524. this._buffer = Buffer.concat([this._buffer, rtpPayload.slice(2)]);
  1525. return null;
  1526. }
  1527. } else if ((type === NAL_TYPES.NON_IDR_PICTURE || type === NAL_TYPES.IDR_PICTURE) && this._buffer.length === 0) {
  1528. /* Single NALU */
  1529. var _h264frame = Buffer.concat([Buffer.from([0, 0, 0, 0]), rtpPayload]);
  1530. _h264frame.writeUInt32BE(_h264frame.length - 4, 0);
  1531. var _msg = {
  1532. data: _h264frame,
  1533. type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.H264,
  1534. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(rtp.data),
  1535. ntpTimestamp: rtp.ntpTimestamp,
  1536. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(rtp.data),
  1537. nalType: type
  1538. };
  1539. this._buffer = Buffer.alloc(0);
  1540. return _msg;
  1541. } else {
  1542. h264Debug("H264depayComponent can only extract types 1,5 and 28, got ".concat(type));
  1543. this._buffer = Buffer.alloc(0);
  1544. return null;
  1545. }
  1546. }
  1547. }]);
  1548. return H264DepayParser;
  1549. }();
  1550. /***/ }),
  1551. /***/ "./lib/components/helpers/stream-factory.ts":
  1552. /*!**************************************************!*\
  1553. !*** ./lib/components/helpers/stream-factory.ts ***!
  1554. \**************************************************/
  1555. /*! namespace exports */
  1556. /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
  1557. /*! other exports [not provided] [no usage info] */
  1558. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1560. "use strict";
  1561. __webpack_require__.r(__webpack_exports__);
  1562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1563. /* harmony export */ "default": () => /* binding */ StreamFactory
  1564. /* harmony export */ });
  1565. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  1566. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__);
  1567. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  1568. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  1569. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  1570. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__);
  1571. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  1572. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
  1573. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1574. ;
  1575. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1576. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1577. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1578. var StreamFactory = /*#__PURE__*/function () {
  1579. function StreamFactory() {
  1580. _classCallCheck(this, StreamFactory);
  1581. }
  1582. _createClass(StreamFactory, null, [{
  1583. key: "consumer",
  1584. value:
  1585. /**
  1586. * Creates a writable stream that sends all messages written to the stream
  1587. * to a callback function and then considers it written.
  1588. * @param {Function} fn The callback to be invoked on the message
  1589. */
  1590. function consumer() {
  1591. var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
  1592. /* */
  1593. };
  1594. return new stream__WEBPACK_IMPORTED_MODULE_3__.Writable({
  1595. objectMode: true,
  1596. write: function write(msg, encoding, callback) {
  1597. fn(msg);
  1598. callback();
  1599. }
  1600. });
  1601. }
  1602. }, {
  1603. key: "peeker",
  1604. value: function peeker(fn) {
  1605. if (typeof fn !== 'function') {
  1606. throw new Error('you must supply a function');
  1607. }
  1608. return new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  1609. objectMode: true,
  1610. transform: function transform(msg, encoding, callback) {
  1611. fn(msg);
  1612. callback(undefined, msg);
  1613. }
  1614. });
  1615. }
  1616. /**
  1617. * Creates a readable stream that sends a message for each element of an array.
  1618. * @param {Array} arr The array with elements to be turned into a stream.
  1619. */
  1620. }, {
  1621. key: "producer",
  1622. value: function producer(messages) {
  1623. var counter = 0;
  1624. return new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({
  1625. objectMode: true,
  1626. read: function read() {
  1627. if (messages !== undefined) {
  1628. if (counter < messages.length) {
  1629. this.push(messages[counter++]);
  1630. } else {
  1631. // End the stream
  1632. this.push(null);
  1633. }
  1634. }
  1635. }
  1636. });
  1637. }
  1638. }, {
  1639. key: "recorder",
  1640. value: function recorder(type, fileStream) {
  1641. return new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  1642. objectMode: true,
  1643. transform: function transform(msg, encoding, callback) {
  1644. var timestamp = Date.now(); // Replace binary data with base64 string
  1645. var message = Object.assign({}, msg, {
  1646. data: msg.data.toString('base64')
  1647. });
  1648. fileStream.write(JSON.stringify({
  1649. type: type,
  1650. timestamp: timestamp,
  1651. message: message
  1652. }, null, 2));
  1653. fileStream.write(',\n');
  1654. callback(undefined, msg);
  1655. }
  1656. });
  1657. }
  1658. /**
  1659. * Yield binary messages from JSON packet array until depleted.
  1660. * @return {Generator} Returns a JSON packet iterator.
  1661. */
  1662. }, {
  1663. key: "replayer",
  1664. value: function replayer(packets) {
  1665. var packetCounter = 0;
  1666. var lastTimestamp = packets[0].timestamp;
  1667. return new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({
  1668. objectMode: true,
  1669. read: function read() {
  1670. var packet = packets[packetCounter++];
  1671. if (packet) {
  1672. var type = packet.type,
  1673. timestamp = packet.timestamp,
  1674. message = packet.message;
  1675. var delay = timestamp - lastTimestamp;
  1676. lastTimestamp = timestamp;
  1677. if (message) {
  1678. var data = message.data ? Buffer.from(message.data, 'base64') : Buffer.alloc(0);
  1679. var _msg = Object.assign({}, message, {
  1680. data: data
  1681. });
  1682. this.push({
  1683. type: type,
  1684. delay: delay,
  1685. msg: _msg
  1686. });
  1687. } else {
  1688. this.push({
  1689. type: type,
  1690. delay: delay,
  1691. msg: null
  1692. });
  1693. }
  1694. } else {
  1695. this.push(null);
  1696. }
  1697. }
  1698. });
  1699. }
  1700. }]);
  1701. return StreamFactory;
  1702. }();
  1703. /***/ }),
  1704. /***/ "./lib/components/http-source/index.ts":
  1705. /*!*********************************************!*\
  1706. !*** ./lib/components/http-source/index.ts ***!
  1707. \*********************************************/
  1708. /*! namespace exports */
  1709. /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] */
  1710. /*! other exports [not provided] [no usage info] */
  1711. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1713. "use strict";
  1714. __webpack_require__.r(__webpack_exports__);
  1715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1716. /* harmony export */ "HttpSource": () => /* binding */ HttpSource
  1717. /* harmony export */ });
  1718. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  1719. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__);
  1720. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/core-js/modules/es.promise.js");
  1721. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__);
  1722. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  1723. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);
  1724. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  1725. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  1726. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_4__);
  1727. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1728. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1729. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1730. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1731. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1732. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1733. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1734. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1735. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1736. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1737. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1738. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1739. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1740. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1741. var debug = debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:http-source');
  1742. var HttpSource = /*#__PURE__*/function (_Source) {
  1743. _inherits(HttpSource, _Source);
  1744. var _super = _createSuper(HttpSource);
  1745. /**
  1746. * Create an HTTP component.
  1747. *
  1748. * The constructor sets a single readable stream from a fetch.
  1749. */
  1750. function HttpSource(config) {
  1751. var _this;
  1752. _classCallCheck(this, HttpSource);
  1753. var uri = config.uri,
  1754. headers = config.headers;
  1755. /**
  1756. * Set up an incoming stream and attach it to the socket.
  1757. */
  1758. var incoming = new stream__WEBPACK_IMPORTED_MODULE_4__.Readable({
  1759. objectMode: true,
  1760. read: function read() {//
  1761. }
  1762. }); // When an error is sent on the incoming stream, close the socket.
  1763. incoming.on('error', function (e) {
  1764. console.warn('closing socket due to incoming error', e);
  1765. _this._reader && _this._reader.cancel();
  1766. });
  1767. /**
  1768. * initialize the component.
  1769. */
  1770. _this = _super.call(this, incoming); // When a read is requested, continue to pull data
  1771. _defineProperty(_assertThisInitialized(_this), "uri", void 0);
  1772. _defineProperty(_assertThisInitialized(_this), "headers", void 0);
  1773. _defineProperty(_assertThisInitialized(_this), "length", void 0);
  1774. _defineProperty(_assertThisInitialized(_this), "_reader", void 0);
  1775. incoming._read = function () {
  1776. _this._pull();
  1777. };
  1778. _this.uri = uri;
  1779. _this.headers = headers;
  1780. return _this;
  1781. }
  1782. _createClass(HttpSource, [{
  1783. key: "play",
  1784. value: function play() {
  1785. var _this2 = this;
  1786. if (this.uri === undefined) {
  1787. throw new Error('cannot start playing when there is no URI');
  1788. }
  1789. this.length = 0;
  1790. fetch(this.uri, {
  1791. headers: this.headers
  1792. }).then(function (rsp) {
  1793. if (rsp.body === null) {
  1794. throw new Error('empty response body');
  1795. }
  1796. _this2._reader = rsp.body.getReader();
  1797. _this2._pull();
  1798. }).catch(function (err) {
  1799. throw new Error(err);
  1800. });
  1801. }
  1802. }, {
  1803. key: "_pull",
  1804. value: function _pull() {
  1805. var _this3 = this;
  1806. if (this._reader === undefined) {
  1807. return;
  1808. }
  1809. this._reader.read().then(function (_ref) {
  1810. var done = _ref.done,
  1811. value = _ref.value;
  1812. if (done) {
  1813. debug('fetch completed, total downloaded: ', _this3.length, ' bytes');
  1814. _this3.incoming.push(null);
  1815. return;
  1816. }
  1817. if (value === undefined) {
  1818. throw new Error('expected value to be defined');
  1819. }
  1820. if (_this3.length === undefined) {
  1821. throw new Error('expected length to be defined');
  1822. }
  1823. _this3.length += value.length;
  1824. var buffer = Buffer.from(value);
  1825. if (!_this3.incoming.push({
  1826. data: buffer,
  1827. type: _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.RAW
  1828. })) {
  1829. // Something happened down stream that it is no longer processing the
  1830. // incoming data, and the stream buffer got full.
  1831. // This could be because we are downloading too much data at once,
  1832. // or because the downstream is frozen. The latter is most likely
  1833. // when dealing with a live stream (as in that case we would expect
  1834. // downstream to be able to handle the data).
  1835. debug('downstream back pressure: pausing read');
  1836. } else {
  1837. // It's ok to read more data
  1838. _this3._pull();
  1839. }
  1840. });
  1841. }
  1842. }]);
  1843. return HttpSource;
  1844. }(_component__WEBPACK_IMPORTED_MODULE_3__.Source);
  1845. /***/ }),
  1846. /***/ "./lib/components/http-tunnel-source/index.ts":
  1847. /*!****************************************************!*\
  1848. !*** ./lib/components/http-tunnel-source/index.ts ***!
  1849. \****************************************************/
  1850. /*! namespace exports */
  1851. /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] */
  1852. /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] */
  1853. /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] */
  1854. /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] */
  1855. /*! other exports [not provided] [no usage info] */
  1856. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  1857. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1858. "use strict";
  1859. __webpack_require__.r(__webpack_exports__);
  1860. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1861. /* harmony export */ "base64ArrayBuffer": () => /* binding */ base64ArrayBuffer,
  1862. /* harmony export */ "init_connection": () => /* binding */ init_connection,
  1863. /* harmony export */ "send_command": () => /* binding */ send_command,
  1864. /* harmony export */ "HTTPTunnelSource": () => /* binding */ HTTPTunnelSource
  1865. /* harmony export */ });
  1866. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  1867. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);
  1868. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  1869. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  1870. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/core-js/modules/es.promise.js");
  1871. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__);
  1872. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  1873. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__);
  1874. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.typed-array.uint8-array */ "./node_modules/core-js/modules/es.typed-array.uint8-array.js");
  1875. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4__);
  1876. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.typed-array.copy-within */ "./node_modules/core-js/modules/es.typed-array.copy-within.js");
  1877. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__);
  1878. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.typed-array.every */ "./node_modules/core-js/modules/es.typed-array.every.js");
  1879. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__);
  1880. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.typed-array.fill */ "./node_modules/core-js/modules/es.typed-array.fill.js");
  1881. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__);
  1882. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.typed-array.filter */ "./node_modules/core-js/modules/es.typed-array.filter.js");
  1883. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__);
  1884. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.typed-array.find */ "./node_modules/core-js/modules/es.typed-array.find.js");
  1885. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__);
  1886. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.typed-array.find-index */ "./node_modules/core-js/modules/es.typed-array.find-index.js");
  1887. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__);
  1888. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.typed-array.for-each */ "./node_modules/core-js/modules/es.typed-array.for-each.js");
  1889. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__);
  1890. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.typed-array.includes */ "./node_modules/core-js/modules/es.typed-array.includes.js");
  1891. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__);
  1892. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.typed-array.index-of */ "./node_modules/core-js/modules/es.typed-array.index-of.js");
  1893. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__);
  1894. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.typed-array.iterator */ "./node_modules/core-js/modules/es.typed-array.iterator.js");
  1895. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__);
  1896. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.typed-array.join */ "./node_modules/core-js/modules/es.typed-array.join.js");
  1897. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__);
  1898. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.typed-array.last-index-of */ "./node_modules/core-js/modules/es.typed-array.last-index-of.js");
  1899. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__);
  1900. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.typed-array.map */ "./node_modules/core-js/modules/es.typed-array.map.js");
  1901. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__);
  1902. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce */ "./node_modules/core-js/modules/es.typed-array.reduce.js");
  1903. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__);
  1904. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce-right */ "./node_modules/core-js/modules/es.typed-array.reduce-right.js");
  1905. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__);
  1906. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.typed-array.reverse */ "./node_modules/core-js/modules/es.typed-array.reverse.js");
  1907. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__);
  1908. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.typed-array.set */ "./node_modules/core-js/modules/es.typed-array.set.js");
  1909. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__);
  1910. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.typed-array.slice */ "./node_modules/core-js/modules/es.typed-array.slice.js");
  1911. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__);
  1912. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.typed-array.some */ "./node_modules/core-js/modules/es.typed-array.some.js");
  1913. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__);
  1914. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.typed-array.sort */ "./node_modules/core-js/modules/es.typed-array.sort.js");
  1915. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__);
  1916. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.typed-array.subarray */ "./node_modules/core-js/modules/es.typed-array.subarray.js");
  1917. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__);
  1918. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string */ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js");
  1919. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__);
  1920. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-string */ "./node_modules/core-js/modules/es.typed-array.to-string.js");
  1921. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__);
  1922. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  1923. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_28__);
  1924. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  1925. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  1926. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_30__);
  1927. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  1928. /* harmony import */ var _openhttptunnel__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./openhttptunnel */ "./lib/components/http-tunnel-source/openhttptunnel.ts");
  1929. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  1930. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1931. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1932. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1933. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1934. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1935. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1936. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1937. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1938. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1939. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1940. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1941. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  1942. // Named status codes for CloseEvent, see:
  1943. // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
  1944. var CLOSE_GOING_AWAY = 1001; // Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
  1945. // use window.btoa' step. According to my tests, this appears to be a faster approach:
  1946. // http://jsperf.com/encoding-xhr-image-data/5
  1947. /*
  1948. MIT LICENSE
  1949. Copyright 2011 Jon Leighton
  1950. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  1951. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  1952. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  1953. */
  1954. function base64ArrayBuffer(arrayBuffer) {
  1955. var base64 = '';
  1956. var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  1957. var bytes = new Uint8Array(arrayBuffer);
  1958. var byteLength = bytes.byteLength;
  1959. var byteRemainder = byteLength % 3;
  1960. var mainLength = byteLength - byteRemainder;
  1961. var a, b, c, d;
  1962. var chunk; // Main loop deals with bytes in chunks of 3
  1963. for (var i = 0; i < mainLength; i = i + 3) {
  1964. // Combine the three bytes into a single integer
  1965. chunk = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; // Use bitmasks to extract 6-bit segments from the triplet
  1966. a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
  1967. b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
  1968. c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
  1969. d = chunk & 63; // 63 = 2^6 - 1
  1970. // Convert the raw binary segments to the appropriate ASCII encoding
  1971. base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
  1972. } // Deal with the remaining bytes and padding
  1973. if (byteRemainder == 1) {
  1974. chunk = bytes[mainLength];
  1975. a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
  1976. // Set the 4 least significant bits to zero
  1977. b = (chunk & 3) << 4; // 3 = 2^2 - 1
  1978. base64 += encodings[a] + encodings[b] + '==';
  1979. } else if (byteRemainder == 2) {
  1980. chunk = bytes[mainLength] << 8 | bytes[mainLength + 1];
  1981. a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
  1982. b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
  1983. // Set the 2 least significant bits to zero
  1984. c = (chunk & 15) << 2; // 15 = 2^4 - 1
  1985. base64 += encodings[a] + encodings[b] + encodings[c] + '=';
  1986. }
  1987. return base64;
  1988. }
  1989. function init_connection(uri, signal, sessioncookie) {
  1990. var response = fetch(uri, {
  1991. method: 'GET',
  1992. signal: signal,
  1993. mode: 'same-origin',
  1994. // no-cors, *cors, same-origin
  1995. cache: 'no-cache',
  1996. // *default, no-cache, reload, force-cache, only-if-cached
  1997. credentials: 'include',
  1998. headers: {
  1999. 'x-sessioncookie': sessioncookie,
  2000. 'Accept': 'application/x-rtsp-tunnelled',
  2001. 'Pragma': 'no-cache',
  2002. 'Cache-Control': 'no-cache',
  2003. 'Accept-Encoding': '' // 'Require': 'www.onvif.org/ver20/backchannel'
  2004. }
  2005. }).catch(function (error) {
  2006. return console.error('Connection error:', error);
  2007. });
  2008. return response;
  2009. }
  2010. function send_command(command, uri, sessioncookie) {
  2011. var xhr = new XMLHttpRequest();
  2012. xhr.open('POST', uri);
  2013. xhr.setRequestHeader('x-sessioncookie', sessioncookie);
  2014. xhr.setRequestHeader('Content-Type', 'application/x-rtsp-tunnelled');
  2015. xhr.setRequestHeader('Pragma', 'no-cache'); //xhr.setRequestHeader('Content-Length', '32767');
  2016. xhr.setRequestHeader('Expires', 'Sun, 9 Jan 1972 00:00:00 GMT'); // xhr.setRequestHeader('Require', 'www.onvif.org/ver20/backchannel');
  2017. xhr.send(command);
  2018. xhr.send(command);
  2019. xhr.onload = function () {
  2020. if (xhr.status != 200) {// alert(`Error ${xhr.status}: ${xhr.statusText}`); // 404: Not Found
  2021. } else {//alert(`OnLoad, receive ${xhr.response.length} bytes`);
  2022. }
  2023. };
  2024. xhr.onprogress = function (event) {
  2025. if (event.lengthComputable) {//alert(`onprogress ${event.loaded} ?? ${event.total} onprogress`);
  2026. } else {//alert(`onprogress ${event.loaded} bytes`); // 1111 ? 111 Content-Length
  2027. }
  2028. };
  2029. xhr.onerror = function () {};
  2030. }
  2031. var HTTPTunnelSource = /*#__PURE__*/function (_Source) {
  2032. _inherits(HTTPTunnelSource, _Source);
  2033. var _super = _createSuper(HTTPTunnelSource);
  2034. /**
  2035. * Create a HTTPTunnelSource component.
  2036. *
  2037. * The constructor sets up GET request .
  2038. *
  2039. */
  2040. function HTTPTunnelSource(config) {
  2041. var _this;
  2042. _classCallCheck(this, HTTPTunnelSource);
  2043. /**
  2044. * Set up an incoming stream and attach it to the socket.
  2045. * @type {Readable}
  2046. */
  2047. var incoming = new stream__WEBPACK_IMPORTED_MODULE_30__.Readable({
  2048. objectMode: true,
  2049. read: function read() {//
  2050. }
  2051. });
  2052. /*
  2053. (HTTP GET)
  2054. |----<<<< data <<<<< ----|
  2055. /client -----| |---- server
  2056. |-- >>>> data >>>>-------|
  2057. / (HTTP POST)
  2058. */
  2059. // Make GET request
  2060. // all command responses and media data come to this socket
  2061. var consume = function consume(responseReader) {
  2062. return responseReader.read().then(function (result) {
  2063. if (result.done) {
  2064. return;
  2065. }
  2066. var chunk = result.value;
  2067. var buffer = Buffer.from(chunk.buffer);
  2068. incoming.push({
  2069. data: buffer,
  2070. type: _message__WEBPACK_IMPORTED_MODULE_31__.MessageType.RAW
  2071. });
  2072. return consume(responseReader);
  2073. });
  2074. };
  2075. var controller = new AbortController();
  2076. var signal = controller.signal;
  2077. var sessioncookie = Math.floor(Math.random() * 99999);
  2078. init_connection(config.uri, signal, sessioncookie.toString()).then(function (response) {
  2079. return consume(response.body.getReader());
  2080. }).then(function (data) {
  2081. console.log(data);
  2082. });
  2083. /**
  2084. * Set up outgoing stream using POST command.
  2085. * @type {Writable}
  2086. */
  2087. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_30__.Writable({
  2088. objectMode: true,
  2089. write: function write(msg, encoding, callback) {
  2090. try {
  2091. var t = null;
  2092. if (msg.constructor === Uint8Array) {
  2093. var a = base64ArrayBuffer(msg.subarray(0, 3));
  2094. var b = base64ArrayBuffer(msg.subarray(4));
  2095. t = a + b;
  2096. } else {
  2097. t = btoa(msg.data);
  2098. }
  2099. send_command(t, config.uri, sessioncookie.toString());
  2100. } catch (e) {
  2101. console.warn('message lost during send:', msg);
  2102. }
  2103. callback();
  2104. }
  2105. }); // When an error happens on the outgoing stream, just warn.
  2106. outgoing.on('error', function (e) {
  2107. console.warn('error during send, ignoring:', e);
  2108. }); // When there is no more data going to be written, close!
  2109. outgoing.on('finish', function () {
  2110. controller.abort();
  2111. debug__WEBPACK_IMPORTED_MODULE_28___default()('msl:http_tunnel:outgoing')('finish');
  2112. });
  2113. /**
  2114. * initialize the component.
  2115. */
  2116. _this = _super.call(this, incoming, outgoing);
  2117. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  2118. return _this;
  2119. }
  2120. /**
  2121. * Expose http_tunnel opener as a class method that returns a promise which
  2122. * resolves with a new HTTPTunnelSource.
  2123. */
  2124. _createClass(HTTPTunnelSource, null, [{
  2125. key: "open",
  2126. value: function open(config) {
  2127. return (0,_openhttptunnel__WEBPACK_IMPORTED_MODULE_32__.openHTTPTunnnel)(config).then(function (http_socket) {
  2128. return new HTTPTunnelSource(config);
  2129. });
  2130. }
  2131. }]);
  2132. return HTTPTunnelSource;
  2133. }(_component__WEBPACK_IMPORTED_MODULE_29__.Source);
  2134. /***/ }),
  2135. /***/ "./lib/components/http-tunnel-source/openhttptunnel.ts":
  2136. /*!*************************************************************!*\
  2137. !*** ./lib/components/http-tunnel-source/openhttptunnel.ts ***!
  2138. \*************************************************************/
  2139. /*! namespace exports */
  2140. /*! export openHTTPTunnnel [provided] [no usage info] [missing usage info prevents renaming] */
  2141. /*! other exports [not provided] [no usage info] */
  2142. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2143. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2144. "use strict";
  2145. __webpack_require__.r(__webpack_exports__);
  2146. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2147. /* harmony export */ "openHTTPTunnnel": () => /* binding */ openHTTPTunnnel
  2148. /* harmony export */ });
  2149. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  2150. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  2151. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  2152. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  2153. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/core-js/modules/es.promise.js");
  2154. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__);
  2155. /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
  2156. ;
  2157. // Time in milliseconds we want to wait for a HTTP request to open
  2158. var HTTP_TUNNEL_TIMEOUT = 10007;
  2159. // Default configuration
  2160. var defaultConfig = function defaultConfig() {
  2161. var host = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.host;
  2162. var scheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.protocol;
  2163. var Scheme = scheme === 'https:' ? 'https:' : 'http:';
  2164. return {
  2165. uri: "".concat(Scheme, "//").concat(host, "/rtsp_tunnnel"),
  2166. protocol: 'binary',
  2167. timeout: HTTP_TUNNEL_TIMEOUT
  2168. };
  2169. };
  2170. /**
  2171. * Open a new WebSocket, fallback to token-auth on failure and retry.
  2172. * @param {Object} [config={}] WebSocket configuration.
  2173. * @param {String} [config.host] Specify different host
  2174. * @param {String} [config.sheme] Specify different scheme.
  2175. * @param {String} [config.uri] Full uri for websocket connection
  2176. * @param {String} [config.protocol] protocol
  2177. * @param {Number} [config.timeout] HTTP connection timeout for GET request
  2178. * @return {Promise} Resolves with WebSocket, rejects with error.
  2179. */
  2180. var openHTTPTunnnel = function openHTTPTunnnel() {
  2181. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2182. var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_3__.merge)(defaultConfig(config.host, config.scheme), config),
  2183. uri = _merge.uri,
  2184. protocol = _merge.protocol,
  2185. timeout = _merge.timeout;
  2186. if (uri === undefined) {
  2187. throw new Error('http_tunnel: internal error');
  2188. }
  2189. return new Promise(function (resolve, reject) {
  2190. try {
  2191. // We will need to have
  2192. /*
  2193. let response = fetch( uri,
  2194. {
  2195. method: 'GET',
  2196. mode: 'same-origin', // no-cors, *cors, same-origin
  2197. cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
  2198. credentials: 'include',
  2199. headers:{
  2200. 'x-sessioncookie': '10095',
  2201. 'Accept': 'application/x-rtsp-tunnelled',
  2202. 'Pragma': 'no-cache',
  2203. 'Cache-Control': 'no-cache',
  2204. 'Accept-Encoding': '',
  2205. 'Require': 'www.onvif.org/ver20/backchannel'
  2206. }
  2207. }).catch(error =>
  2208. reject(error.message)
  2209. );
  2210. return response;
  2211. */
  2212. //clearTimeout(countdown)
  2213. resolve(null);
  2214. } catch (e) {
  2215. reject(e);
  2216. }
  2217. });
  2218. };
  2219. /***/ }),
  2220. /***/ "./lib/components/index.browser.ts":
  2221. /*!*****************************************!*\
  2222. !*** ./lib/components/index.browser.ts ***!
  2223. \*****************************************/
  2224. /*! namespace exports */
  2225. /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
  2226. /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
  2227. /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
  2228. /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
  2229. /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
  2230. /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
  2231. /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
  2232. /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
  2233. /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/message.ts .MessageType */
  2234. /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
  2235. /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
  2236. /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
  2237. /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
  2238. /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
  2239. /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
  2240. /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
  2241. /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Sink */
  2242. /*! export Source [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Source */
  2243. /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Tube */
  2244. /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
  2245. /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
  2246. /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
  2247. /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
  2248. /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
  2249. /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
  2250. /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
  2251. /*! other exports [not provided] [no usage info] */
  2252. /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
  2253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2254. "use strict";
  2255. __webpack_require__.r(__webpack_exports__);
  2256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2257. /* harmony export */ "Sink": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Sink,
  2258. /* harmony export */ "Source": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Source,
  2259. /* harmony export */ "Tube": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Tube,
  2260. /* harmony export */ "AACDepay": () => /* reexport safe */ _aacdepay__WEBPACK_IMPORTED_MODULE_1__.AACDepay,
  2261. /* harmony export */ "BasicDepay": () => /* reexport safe */ _basicdepay__WEBPACK_IMPORTED_MODULE_2__.BasicDepay,
  2262. /* harmony export */ "CanvasSink": () => /* reexport safe */ _canvas__WEBPACK_IMPORTED_MODULE_3__.CanvasSink,
  2263. /* harmony export */ "H264Depay": () => /* reexport safe */ _h264depay__WEBPACK_IMPORTED_MODULE_4__.H264Depay,
  2264. /* harmony export */ "HttpSource": () => /* reexport safe */ _http_source__WEBPACK_IMPORTED_MODULE_5__.HttpSource,
  2265. /* harmony export */ "Inspector": () => /* reexport safe */ _inspector__WEBPACK_IMPORTED_MODULE_6__.Inspector,
  2266. /* harmony export */ "JPEGDepay": () => /* reexport safe */ _jpegdepay__WEBPACK_IMPORTED_MODULE_7__.JPEGDepay,
  2267. /* harmony export */ "MessageType": () => /* reexport safe */ _message__WEBPACK_IMPORTED_MODULE_8__.MessageType,
  2268. /* harmony export */ "createTransform": () => /* reexport safe */ _messageStreams__WEBPACK_IMPORTED_MODULE_9__.createTransform,
  2269. /* harmony export */ "Mp4Capture": () => /* reexport safe */ _mp4capture__WEBPACK_IMPORTED_MODULE_10__.Mp4Capture,
  2270. /* harmony export */ "Mp4Muxer": () => /* reexport safe */ _mp4muxer__WEBPACK_IMPORTED_MODULE_11__.Mp4Muxer,
  2271. /* harmony export */ "MseSink": () => /* reexport safe */ _mse__WEBPACK_IMPORTED_MODULE_12__.MseSink,
  2272. /* harmony export */ "ONVIFDepay": () => /* reexport safe */ _onvifdepay__WEBPACK_IMPORTED_MODULE_13__.ONVIFDepay,
  2273. /* harmony export */ "RtspParser": () => /* reexport safe */ _rtsp_parser__WEBPACK_IMPORTED_MODULE_14__.RtspParser,
  2274. /* harmony export */ "RTSP_METHOD": () => /* reexport safe */ _rtsp_session__WEBPACK_IMPORTED_MODULE_15__.RTSP_METHOD,
  2275. /* harmony export */ "RtspSession": () => /* reexport safe */ _rtsp_session__WEBPACK_IMPORTED_MODULE_15__.RtspSession,
  2276. /* harmony export */ "WSSource": () => /* reexport safe */ _ws_source__WEBPACK_IMPORTED_MODULE_16__.WSSource,
  2277. /* harmony export */ "dataCatcherDepay": () => /* reexport safe */ _dataCatcherDepay__WEBPACK_IMPORTED_MODULE_17__.dataCatcherDepay,
  2278. /* harmony export */ "g711toPCM": () => /* reexport safe */ _g711toPCM__WEBPACK_IMPORTED_MODULE_18__.g711toPCM,
  2279. /* harmony export */ "HTTPTunnelSource": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.HTTPTunnelSource,
  2280. /* harmony export */ "base64ArrayBuffer": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.base64ArrayBuffer,
  2281. /* harmony export */ "init_connection": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.init_connection,
  2282. /* harmony export */ "send_command": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.send_command
  2283. /* harmony export */ });
  2284. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component */ "./lib/components/component.ts");
  2285. /* harmony import */ var _aacdepay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./aacdepay */ "./lib/components/aacdepay/index.ts");
  2286. /* harmony import */ var _basicdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basicdepay */ "./lib/components/basicdepay/index.ts");
  2287. /* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./canvas */ "./lib/components/canvas/index.ts");
  2288. /* harmony import */ var _h264depay__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./h264depay */ "./lib/components/h264depay/index.ts");
  2289. /* harmony import */ var _http_source__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./http-source */ "./lib/components/http-source/index.ts");
  2290. /* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inspector */ "./lib/components/inspector/index.ts");
  2291. /* harmony import */ var _jpegdepay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jpegdepay */ "./lib/components/jpegdepay/index.ts");
  2292. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./message */ "./lib/components/message.ts");
  2293. /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./messageStreams */ "./lib/components/messageStreams.ts");
  2294. /* harmony import */ var _mp4capture__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mp4capture */ "./lib/components/mp4capture/index.ts");
  2295. /* harmony import */ var _mp4muxer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./mp4muxer */ "./lib/components/mp4muxer/index.ts");
  2296. /* harmony import */ var _mse__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./mse */ "./lib/components/mse/index.ts");
  2297. /* harmony import */ var _onvifdepay__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./onvifdepay */ "./lib/components/onvifdepay/index.ts");
  2298. /* harmony import */ var _rtsp_parser__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rtsp-parser */ "./lib/components/rtsp-parser/index.ts");
  2299. /* harmony import */ var _rtsp_session__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./rtsp-session */ "./lib/components/rtsp-session/index.ts");
  2300. /* harmony import */ var _ws_source__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ws-source */ "./lib/components/ws-source/index.ts");
  2301. /* harmony import */ var _dataCatcherDepay__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./dataCatcherDepay */ "./lib/components/dataCatcherDepay/index.ts");
  2302. /* harmony import */ var _g711toPCM__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./g711toPCM */ "./lib/components/g711toPCM/index.ts");
  2303. /* harmony import */ var _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./http-tunnel-source */ "./lib/components/http-tunnel-source/index.ts");
  2304. /***/ }),
  2305. /***/ "./lib/components/inspector/index.ts":
  2306. /*!*******************************************!*\
  2307. !*** ./lib/components/inspector/index.ts ***!
  2308. \*******************************************/
  2309. /*! namespace exports */
  2310. /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] */
  2311. /*! other exports [not provided] [no usage info] */
  2312. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2314. "use strict";
  2315. __webpack_require__.r(__webpack_exports__);
  2316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2317. /* harmony export */ "Inspector": () => /* binding */ Inspector
  2318. /* harmony export */ });
  2319. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  2320. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  2321. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  2322. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_1__);
  2323. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  2324. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  2325. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
  2326. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2327. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2328. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2329. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2330. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  2331. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2332. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2333. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  2334. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2335. var generateLogger = function generateLogger(prefix, type) {
  2336. var lastTimestamp = Date.now();
  2337. var log = function log(msg) {
  2338. var timestamp = Date.now();
  2339. console.log("".concat(prefix, ": +").concat(timestamp - lastTimestamp, "ms"), msg);
  2340. lastTimestamp = timestamp;
  2341. };
  2342. if (type === undefined) {
  2343. return log;
  2344. } else {
  2345. return function (msg) {
  2346. return msg.type === type && log(msg);
  2347. };
  2348. }
  2349. };
  2350. /**
  2351. * Component that logs whatever is passing through.
  2352. */
  2353. var Inspector = /*#__PURE__*/function (_Tube) {
  2354. _inherits(Inspector, _Tube);
  2355. var _super = _createSuper(Inspector);
  2356. /**
  2357. * Create a new inspector component.
  2358. * @argument {String} type The type of message to log (default is to log all).
  2359. * @return {undefined}
  2360. */
  2361. function Inspector(type) {
  2362. _classCallCheck(this, Inspector);
  2363. var incomingLogger = generateLogger('incoming', type);
  2364. var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  2365. objectMode: true,
  2366. transform: function transform(msg, encoding, callback) {
  2367. incomingLogger(msg);
  2368. callback(undefined, msg);
  2369. }
  2370. });
  2371. var outgoingLogger = generateLogger('outgoing', type);
  2372. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  2373. objectMode: true,
  2374. transform: function transform(msg, encoding, callback) {
  2375. outgoingLogger(msg);
  2376. callback(undefined, msg);
  2377. }
  2378. });
  2379. return _super.call(this, incoming, outgoing);
  2380. }
  2381. return Inspector;
  2382. }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
  2383. /***/ }),
  2384. /***/ "./lib/components/jpegdepay/headers.ts":
  2385. /*!*********************************************!*\
  2386. !*** ./lib/components/jpegdepay/headers.ts ***!
  2387. \*********************************************/
  2388. /*! namespace exports */
  2389. /*! export makeFrameHeader [provided] [no usage info] [missing usage info prevents renaming] */
  2390. /*! export makeHuffmanHeader [provided] [no usage info] [missing usage info prevents renaming] */
  2391. /*! export makeImageHeader [provided] [no usage info] [missing usage info prevents renaming] */
  2392. /*! export makeQuantHeader [provided] [no usage info] [missing usage info prevents renaming] */
  2393. /*! export makeScanHeader [provided] [no usage info] [missing usage info prevents renaming] */
  2394. /*! other exports [not provided] [no usage info] */
  2395. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2396. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2397. "use strict";
  2398. __webpack_require__.r(__webpack_exports__);
  2399. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2400. /* harmony export */ "makeImageHeader": () => /* binding */ makeImageHeader,
  2401. /* harmony export */ "makeQuantHeader": () => /* binding */ makeQuantHeader,
  2402. /* harmony export */ "makeFrameHeader": () => /* binding */ makeFrameHeader,
  2403. /* harmony export */ "makeHuffmanHeader": () => /* binding */ makeHuffmanHeader,
  2404. /* harmony export */ "makeScanHeader": () => /* binding */ makeScanHeader
  2405. /* harmony export */ });
  2406. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  2407. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  2408. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  2409. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1__);
  2410. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  2411. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__);
  2412. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  2413. ;
  2414. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  2415. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  2416. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  2417. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  2418. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  2419. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  2420. /**
  2421. * Generate frame and scan headers that can be prepended to the
  2422. * RTP/JPEG data payload to produce a JPEG compressed image in
  2423. * interchange format.
  2424. *
  2425. * For detailed information, check Appendix A of:
  2426. * https://tools.ietf.org/html/rfc2435
  2427. */
  2428. function makeImageHeader() {
  2429. return Buffer.from([0xff, 0xd8]);
  2430. }
  2431. function makeQuantHeader(precision, qTable) {
  2432. var lumSize = precision & 1 ? 128 : 64;
  2433. var chmSize = precision & 2 ? 128 : 64;
  2434. if (qTable.length !== lumSize + chmSize) {
  2435. throw new Error('invalid quantization table');
  2436. }
  2437. var lumaPrefix = Buffer.from([0xff, 0xdb, 0, lumSize + 3, 0]);
  2438. var chromaPrefix = Buffer.from([0xff, 0xdb, 0, chmSize + 3, 1]);
  2439. return Buffer.concat([lumaPrefix, qTable.slice(0, lumSize), chromaPrefix, qTable.slice(lumSize)]);
  2440. }
  2441. function makeFrameHeader(width, height, type) {
  2442. return Buffer.from([0xff, 0xc0, // SOF_0 (Start Of Frame)
  2443. 0, 17, 8, height >> 8, height, width >> 8, width, 3, 0, type === 0 ? 0x21 : 0x22, 0, 1, 0x11, 1, 2, 0x11, 1]);
  2444. } // prettier-ignore
  2445. var LUM_DC_CODELENS = [0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]; // prettier-ignore
  2446. var LUM_DC_SYMBOLS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // prettier-ignore
  2447. var LUM_AC_CODELENS = [0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d]; // prettier-ignore
  2448. var LUM_AC_SYMBOLS = [0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa]; // prettier-ignore
  2449. var CHM_DC_CODELENS = [0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; // prettier-ignore
  2450. var CHM_DC_SYMBOLS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // prettier-ignore
  2451. var CHM_AC_CODELENS = [0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77]; // prettier-ignore
  2452. var CHM_AC_SYMBOLS = [0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa];
  2453. function makeHuffmanHeader() {
  2454. var LUM_DC_BUFFER = [[0xff, 0xc4, 0, 3 + LUM_DC_CODELENS.length + LUM_DC_SYMBOLS.length, 0 << 4 | 0], LUM_DC_CODELENS, LUM_DC_SYMBOLS];
  2455. var LUM_AC_BUFFER = [[0xff, 0xc4, 0, 3 + LUM_AC_CODELENS.length + LUM_AC_SYMBOLS.length, 1 << 4 | 0], LUM_AC_CODELENS, LUM_AC_SYMBOLS];
  2456. var CHM_DC_BUFFER = [[0xff, 0xc4, 0, 3 + CHM_DC_CODELENS.length + CHM_DC_SYMBOLS.length, 0 << 4 | 1], CHM_DC_CODELENS, CHM_DC_SYMBOLS];
  2457. var CHM_AC_BUFFER = [[0xff, 0xc4, 0, 3 + CHM_AC_CODELENS.length + CHM_AC_SYMBOLS.length, 1 << 4 | 1], CHM_AC_CODELENS, CHM_AC_SYMBOLS];
  2458. return Buffer.concat([].concat(_toConsumableArray(LUM_DC_BUFFER.map(Buffer.from)), _toConsumableArray(LUM_AC_BUFFER.map(Buffer.from)), _toConsumableArray(CHM_DC_BUFFER.map(Buffer.from)), _toConsumableArray(CHM_AC_BUFFER.map(Buffer.from))));
  2459. }
  2460. function makeScanHeader() {
  2461. return Buffer.from([0xff, 0xda, // SOS (Start Of Scan)
  2462. 0, 12, 3, 0, 0, 1, 0x11, 2, 0x11, 0, 63, 0]);
  2463. }
  2464. /***/ }),
  2465. /***/ "./lib/components/jpegdepay/index.ts":
  2466. /*!*******************************************!*\
  2467. !*** ./lib/components/jpegdepay/index.ts ***!
  2468. \*******************************************/
  2469. /*! namespace exports */
  2470. /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] */
  2471. /*! other exports [not provided] [no usage info] */
  2472. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2473. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2474. "use strict";
  2475. __webpack_require__.r(__webpack_exports__);
  2476. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2477. /* harmony export */ "JPEGDepay": () => /* binding */ JPEGDepay
  2478. /* harmony export */ });
  2479. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js");
  2480. /* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_0__);
  2481. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  2482. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__);
  2483. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  2484. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2__);
  2485. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  2486. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  2487. /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/jpegdepay/parser.ts");
  2488. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  2489. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_6__);
  2490. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  2491. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2492. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  2493. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  2494. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  2495. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  2496. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  2497. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  2498. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2499. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2500. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2501. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  2502. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2503. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2504. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  2505. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2506. var JPEGDepay = /*#__PURE__*/function (_Tube) {
  2507. _inherits(JPEGDepay, _Tube);
  2508. var _super = _createSuper(JPEGDepay);
  2509. function JPEGDepay() {
  2510. _classCallCheck(this, JPEGDepay);
  2511. var jpegPayloadType;
  2512. var packets = [];
  2513. var jpegDepay;
  2514. var incoming = new stream__WEBPACK_IMPORTED_MODULE_6__.Transform({
  2515. objectMode: true,
  2516. transform: function transform(msg, encoding, callback) {
  2517. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
  2518. var jpegMedia = msg.sdp.media.find(function (media) {
  2519. return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'JPEG';
  2520. });
  2521. if (jpegMedia !== undefined && jpegMedia.rtpmap !== undefined) {
  2522. jpegPayloadType = Number(jpegMedia.rtpmap.payloadType);
  2523. var framesize = jpegMedia.framesize; // `framesize` is an SDP field that is present in e.g. Camera's
  2524. // and is used because the width and height that can be sent inside
  2525. // the JPEG header are both limited to 2040.
  2526. // If present, we use this width and height as the default values
  2527. // to be used by the jpeg depay function, otherwise we ignore this
  2528. // and let the JPEG header inside the RTP packets determine this.
  2529. if (framesize !== undefined) {
  2530. var _framesize = _slicedToArray(framesize, 2),
  2531. width = _framesize[0],
  2532. height = _framesize[1]; // msg.framesize = { width, height }
  2533. jpegDepay = (0,_parser__WEBPACK_IMPORTED_MODULE_5__.jpegDepayFactory)(width, height);
  2534. } else {
  2535. jpegDepay = (0,_parser__WEBPACK_IMPORTED_MODULE_5__.jpegDepayFactory)();
  2536. }
  2537. }
  2538. callback(undefined, msg);
  2539. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.payloadType)(msg.data) === jpegPayloadType) {
  2540. packets.push(msg.data); // JPEG over RTP uses the RTP marker bit to indicate end
  2541. // of fragmentation. At this point, the packets can be used
  2542. // to reconstruct a JPEG frame.
  2543. if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.marker)(msg.data) && packets.length > 0) {
  2544. var jpegFrame = jpegDepay(packets);
  2545. this.push({
  2546. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.timestamp)(msg.data),
  2547. ntpTimestamp: msg.ntpTimestamp,
  2548. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.payloadType)(msg.data),
  2549. data: jpegFrame.data,
  2550. framesize: jpegFrame.size,
  2551. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.JPEG
  2552. });
  2553. packets = [];
  2554. }
  2555. callback();
  2556. } else {
  2557. // Not a message we should handle
  2558. callback(undefined, msg);
  2559. }
  2560. }
  2561. }); // outgoing will be defaulted to a PassThrough stream
  2562. return _super.call(this, incoming);
  2563. }
  2564. return JPEGDepay;
  2565. }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
  2566. /***/ }),
  2567. /***/ "./lib/components/jpegdepay/make-qtable.ts":
  2568. /*!*************************************************!*\
  2569. !*** ./lib/components/jpegdepay/make-qtable.ts ***!
  2570. \*************************************************/
  2571. /*! namespace exports */
  2572. /*! export makeQtable [provided] [no usage info] [missing usage info prevents renaming] */
  2573. /*! other exports [not provided] [no usage info] */
  2574. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2576. "use strict";
  2577. __webpack_require__.r(__webpack_exports__);
  2578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2579. /* harmony export */ "makeQtable": () => /* binding */ makeQtable
  2580. /* harmony export */ });
  2581. /* harmony import */ var _utils_clamp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/clamp */ "./lib/utils/clamp.ts");
  2582. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  2583. ;
  2584. /**
  2585. * @function makeQtable
  2586. * Creating a quantization table from a Q factor
  2587. * Example Code from RFC 2435 Appendix A ported to TypeScript
  2588. *
  2589. * Default luminance/chrominance quantization tables in RFC example are not in zig-zag order.
  2590. * The RFC does not mention that default tables should be in zig-zag ordering,
  2591. * but they say that about the included tables. RFC sample code appears to have a mistake.
  2592. * All the tested cameras and LGPL projects use zig-zag default tables.
  2593. * So we use zig-zaged tables from ISO/IEC 10918-1 Annex K Section K.1
  2594. * @see https://tools.ietf.org/html/rfc2435
  2595. * @see https://www.iso.org/standard/18902.html
  2596. */
  2597. // prettier-ignore
  2598. var jpegLumaQuantizer = [16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40, 26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61, 60, 57, 51, 56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80, 109, 81, 87, 95, 98, 103, 104, 103, 62, 77, 113, 121, 112, 100, 120, 92, 101, 103, 99]; // prettier-ignore
  2599. var jpeChromaQuantizer = [17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
  2600. function makeQtable(Q) {
  2601. var factor = (0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(Q, 1, 99);
  2602. var buffer = Buffer.alloc(128);
  2603. var S = Q < 50 ? Math.floor(5000 / factor) : 200 - factor * 2;
  2604. for (var i = 0; i < 64; i++) {
  2605. var lq = Math.floor((jpegLumaQuantizer[i] * S + 50) / 100);
  2606. var cq = Math.floor((jpeChromaQuantizer[i] * S + 50) / 100);
  2607. buffer.writeUInt8((0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(lq, 1, 255), i);
  2608. buffer.writeUInt8((0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(cq, 1, 255), i + 64);
  2609. }
  2610. return buffer;
  2611. }
  2612. /***/ }),
  2613. /***/ "./lib/components/jpegdepay/parser.ts":
  2614. /*!********************************************!*\
  2615. !*** ./lib/components/jpegdepay/parser.ts ***!
  2616. \********************************************/
  2617. /*! namespace exports */
  2618. /*! export jpegDepayFactory [provided] [no usage info] [missing usage info prevents renaming] */
  2619. /*! other exports [not provided] [no usage info] */
  2620. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2621. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2622. "use strict";
  2623. __webpack_require__.r(__webpack_exports__);
  2624. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2625. /* harmony export */ "jpegDepayFactory": () => /* binding */ jpegDepayFactory
  2626. /* harmony export */ });
  2627. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  2628. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  2629. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  2630. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  2631. /* harmony import */ var _headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headers */ "./lib/components/jpegdepay/headers.ts");
  2632. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  2633. /* harmony import */ var _make_qtable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./make-qtable */ "./lib/components/jpegdepay/make-qtable.ts");
  2634. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  2635. ;
  2636. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  2637. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  2638. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  2639. /**
  2640. * Each packet contains a special JPEG header which immediately follows
  2641. * the RTP header. The first 8 bytes of this header, called the "main
  2642. * JPEG header", are as follows:*
  2643. * 0 1 2 3
  2644. * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2645. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2646. * | Type-specific | Fragment Offset |
  2647. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2648. * | Type | Q | Width | Height |
  2649. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2650. */
  2651. /**
  2652. * Restart Marker header: when using types 64-127
  2653. * 0 1 2 3
  2654. * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2655. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2656. * | Restart Interval |F|L| Restart Count |
  2657. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2658. */
  2659. /**
  2660. * Quantization Table header: when using Q values 128-255
  2661. * 0 1 2 3
  2662. * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2663. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2664. * | MBZ | Precision | Length |
  2665. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2666. * | Quantization Table Data |
  2667. * | ... |
  2668. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2669. */
  2670. function jpegDepayFactory() {
  2671. var defaultWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  2672. var defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  2673. var IMAGE_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeImageHeader)();
  2674. var HUFFMAN_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeHuffmanHeader)();
  2675. var SCAN_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeScanHeader)();
  2676. return function jpegDepay(packets) {
  2677. var metadata;
  2678. var fragments = [];
  2679. var _iterator = _createForOfIteratorHelper(packets),
  2680. _step;
  2681. try {
  2682. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2683. var packet = _step.value;
  2684. var fragment = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(packet); // Parse and extract JPEG header.
  2685. var typeSpecific = fragment.readUInt8(0);
  2686. var fragmentOffset = fragment.readUInt8(1) << 16 | fragment.readUInt8(2) << 8 | fragment.readUInt8(3);
  2687. var _type = fragment.readUInt8(4);
  2688. var Q = fragment.readUInt8(5);
  2689. var _width = fragment.readUInt8(6) * 8 || defaultWidth;
  2690. var _height = fragment.readUInt8(7) * 8 || defaultHeight;
  2691. fragment = fragment.slice(8); // Parse and extract Restart Marker header if present.
  2692. var DRI = 0;
  2693. if (_type >= 64 && _type <= 127) {
  2694. DRI = fragment.readUInt16BE(0);
  2695. fragment = fragment.slice(4);
  2696. } // Parse and extract Quantization Table header if present.
  2697. if (Q >= 128 && fragmentOffset === 0) {
  2698. // const MBZ = fragment.readUInt8()
  2699. var _precision = fragment.readUInt8(1);
  2700. var length = fragment.readUInt16BE(2);
  2701. var _qTable = fragment.slice(4, 4 + length);
  2702. metadata = {
  2703. typeSpecific: typeSpecific,
  2704. type: _type,
  2705. width: _width,
  2706. height: _height,
  2707. DRI: DRI,
  2708. precision: _precision,
  2709. qTable: _qTable
  2710. };
  2711. fragment = fragment.slice(4 + length);
  2712. } // Compute Quantization Table
  2713. else if (Q < 128 && fragmentOffset === 0) {
  2714. var _precision2 = 0;
  2715. var _qTable2 = (0,_make_qtable__WEBPACK_IMPORTED_MODULE_4__.makeQtable)(Q);
  2716. metadata = {
  2717. typeSpecific: typeSpecific,
  2718. type: _type,
  2719. width: _width,
  2720. height: _height,
  2721. DRI: DRI,
  2722. precision: _precision2,
  2723. qTable: _qTable2
  2724. };
  2725. }
  2726. fragments.push(fragment);
  2727. }
  2728. } catch (err) {
  2729. _iterator.e(err);
  2730. } finally {
  2731. _iterator.f();
  2732. }
  2733. if (metadata === undefined) {
  2734. throw new Error('no quantization header present');
  2735. }
  2736. var _metadata = metadata,
  2737. precision = _metadata.precision,
  2738. qTable = _metadata.qTable,
  2739. type = _metadata.type,
  2740. width = _metadata.width,
  2741. height = _metadata.height;
  2742. var quantHeader = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeQuantHeader)(precision, qTable);
  2743. if (metadata.DRI !== 0) {
  2744. throw new Error('not implemented: DRI');
  2745. }
  2746. var frameHeader = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeFrameHeader)(width, height, type);
  2747. return {
  2748. size: {
  2749. width: width,
  2750. height: height
  2751. },
  2752. data: Buffer.concat([IMAGE_HEADER, quantHeader, frameHeader, HUFFMAN_HEADER, SCAN_HEADER].concat(fragments))
  2753. };
  2754. };
  2755. }
  2756. /***/ }),
  2757. /***/ "./lib/components/message.ts":
  2758. /*!***********************************!*\
  2759. !*** ./lib/components/message.ts ***!
  2760. \***********************************/
  2761. /*! namespace exports */
  2762. /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] */
  2763. /*! other exports [not provided] [no usage info] */
  2764. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2765. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2766. "use strict";
  2767. __webpack_require__.r(__webpack_exports__);
  2768. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2769. /* harmony export */ "MessageType": () => /* binding */ MessageType
  2770. /* harmony export */ });
  2771. var MessageType;
  2772. (function (MessageType) {
  2773. MessageType[MessageType["UNKNOWN"] = 0] = "UNKNOWN";
  2774. MessageType[MessageType["RAW"] = 1] = "RAW";
  2775. MessageType[MessageType["RTP"] = 2] = "RTP";
  2776. MessageType[MessageType["RTCP"] = 3] = "RTCP";
  2777. MessageType[MessageType["RTSP"] = 4] = "RTSP";
  2778. MessageType[MessageType["SDP"] = 5] = "SDP";
  2779. MessageType[MessageType["ELEMENTARY"] = 6] = "ELEMENTARY";
  2780. MessageType[MessageType["H264"] = 7] = "H264";
  2781. MessageType[MessageType["ISOM"] = 8] = "ISOM";
  2782. MessageType[MessageType["XML"] = 9] = "XML";
  2783. MessageType[MessageType["JPEG"] = 10] = "JPEG";
  2784. MessageType[MessageType["PCM"] = 11] = "PCM";
  2785. })(MessageType || (MessageType = {}));
  2786. /***/ }),
  2787. /***/ "./lib/components/messageStreams.ts":
  2788. /*!******************************************!*\
  2789. !*** ./lib/components/messageStreams.ts ***!
  2790. \******************************************/
  2791. /*! namespace exports */
  2792. /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] */
  2793. /*! other exports [not provided] [no usage info] */
  2794. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2796. "use strict";
  2797. __webpack_require__.r(__webpack_exports__);
  2798. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2799. /* harmony export */ "createTransform": () => /* binding */ createTransform
  2800. /* harmony export */ });
  2801. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  2802. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__);
  2803. ;
  2804. var createTransform = function createTransform(transform) {
  2805. return new stream__WEBPACK_IMPORTED_MODULE_0__.Transform({
  2806. objectMode: true,
  2807. transform: transform
  2808. });
  2809. };
  2810. /***/ }),
  2811. /***/ "./lib/components/mp4-parser/index.ts":
  2812. /*!********************************************!*\
  2813. !*** ./lib/components/mp4-parser/index.ts ***!
  2814. \********************************************/
  2815. /*! namespace exports */
  2816. /*! export Mp4Parser [provided] [no usage info] [missing usage info prevents renaming] */
  2817. /*! other exports [not provided] [no usage info] */
  2818. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2820. "use strict";
  2821. __webpack_require__.r(__webpack_exports__);
  2822. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2823. /* harmony export */ "Mp4Parser": () => /* binding */ Mp4Parser
  2824. /* harmony export */ });
  2825. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  2826. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__);
  2827. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  2828. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1__);
  2829. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  2830. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  2831. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
  2832. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  2833. /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/mp4-parser/parser.ts");
  2834. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2835. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2836. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2837. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2838. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  2839. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2840. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2841. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  2842. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2843. /**
  2844. * A component that converts raw binary MP4 data into ISOM boxes.
  2845. * @extends {Component}
  2846. */
  2847. var Mp4Parser = /*#__PURE__*/function (_Tube) {
  2848. _inherits(Mp4Parser, _Tube);
  2849. var _super = _createSuper(Mp4Parser);
  2850. /**
  2851. * Create a new RTSP parser component.
  2852. */
  2853. function Mp4Parser() {
  2854. _classCallCheck(this, Mp4Parser);
  2855. var parser = new _parser__WEBPACK_IMPORTED_MODULE_5__.Parser(); // Incoming stream
  2856. var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  2857. objectMode: true,
  2858. transform: function transform(msg, _, callback) {
  2859. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW) {
  2860. parser.parse(msg.data).forEach(function (message) {
  2861. return incoming.push(message);
  2862. });
  2863. callback();
  2864. } else {
  2865. // Not a message we should handle
  2866. callback(undefined, msg);
  2867. }
  2868. }
  2869. });
  2870. return _super.call(this, incoming);
  2871. }
  2872. return Mp4Parser;
  2873. }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
  2874. /***/ }),
  2875. /***/ "./lib/components/mp4-parser/parser.ts":
  2876. /*!*********************************************!*\
  2877. !*** ./lib/components/mp4-parser/parser.ts ***!
  2878. \*********************************************/
  2879. /*! namespace exports */
  2880. /*! export Parser [provided] [no usage info] [missing usage info prevents renaming] */
  2881. /*! other exports [not provided] [no usage info] */
  2882. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  2883. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2884. "use strict";
  2885. __webpack_require__.r(__webpack_exports__);
  2886. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2887. /* harmony export */ "Parser": () => /* binding */ Parser
  2888. /* harmony export */ });
  2889. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  2890. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  2891. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  2892. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__);
  2893. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  2894. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_2__);
  2895. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  2896. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__);
  2897. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.set */ "./node_modules/core-js/modules/es.set.js");
  2898. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_4__);
  2899. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  2900. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__);
  2901. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  2902. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__);
  2903. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  2904. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_7__);
  2905. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  2906. /* harmony import */ var _utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/protocols/isom */ "./lib/utils/protocols/isom.ts");
  2907. /* harmony import */ var _mp4muxer_helpers_isom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../mp4muxer/helpers/isom */ "./lib/components/mp4muxer/helpers/isom.ts");
  2908. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  2909. ;
  2910. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2911. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2912. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2913. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  2914. var debug = debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:mp4-parser'); // Identify boxes that conforms to an ISO BMFF byte stream:
  2915. // - header boxes: ftyp + moov
  2916. // - segment boxes: [stype] + moof + mdat + [[mdat]...]
  2917. var ISO_BMFF_BOX_TYPES = new Set(['ftyp', 'moov', 'styp', 'moof', 'mdat']);
  2918. /**
  2919. * Extract type and size information from the box header
  2920. * (8-byte section at beginning of the box).
  2921. */
  2922. var mp4BoxInfo = function mp4BoxInfo(chunks) {
  2923. var header = Buffer.alloc(_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.BOX_HEADER_BYTES);
  2924. var i = 0;
  2925. var bytesRead = 0;
  2926. while (bytesRead < header.length) {
  2927. var chunk = chunks[i++];
  2928. var bytesToRead = Math.min(chunk.length, header.length - bytesRead);
  2929. chunk.copy(header, bytesRead, 0, bytesToRead);
  2930. bytesRead += bytesToRead;
  2931. }
  2932. var size = header.readUInt32BE(0);
  2933. var type = (0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(header);
  2934. return {
  2935. type: type,
  2936. size: size
  2937. };
  2938. };
  2939. /**
  2940. * Parser class with a public method that takes a data chunk and returns the
  2941. * next box, or null of there is no complete box. The parser keeps track of the
  2942. * added chunks internally in an array and only concatenates chunks when data is
  2943. * needed to construct a message.
  2944. * @type {[type]}
  2945. */
  2946. var Parser = /*#__PURE__*/function () {
  2947. /**
  2948. * Create a new Parser object.
  2949. */
  2950. function Parser() {
  2951. _classCallCheck(this, Parser);
  2952. _defineProperty(this, "_chunks", []);
  2953. _defineProperty(this, "_length", 0);
  2954. _defineProperty(this, "_box", void 0);
  2955. _defineProperty(this, "_ftyp", void 0);
  2956. this._init();
  2957. }
  2958. /**
  2959. * Initialize the internal properties to their default starting
  2960. * values.
  2961. */
  2962. _createClass(Parser, [{
  2963. key: "_init",
  2964. value: function _init() {
  2965. this._chunks = [];
  2966. this._length = 0;
  2967. }
  2968. }, {
  2969. key: "_push",
  2970. value: function _push(chunk) {
  2971. this._chunks.push(chunk);
  2972. this._length += chunk.length;
  2973. }
  2974. /**
  2975. * Extract MP4 boxes.
  2976. * @return {Array} An array of messages, possibly empty.
  2977. */
  2978. }, {
  2979. key: "_parseBox",
  2980. value: function _parseBox() {
  2981. // Skip as long as we don't have the first 8 bytes
  2982. if (this._length < _utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.BOX_HEADER_BYTES) {
  2983. return null;
  2984. } // Enough bytes to construct the header and extract packet info.
  2985. if (!this._box) {
  2986. this._box = mp4BoxInfo(this._chunks);
  2987. } // As long as we don't have enough chunks, skip.
  2988. if (this._length < this._box.size) {
  2989. return null;
  2990. } // We have enough data to extract a box.
  2991. // The buffer package has a problem that it doesn't optimize concatenation
  2992. // of an array with only one buffer, check for that (prevents performance issue)
  2993. var buffer = this._chunks.length === 1 ? this._chunks[0] : Buffer.concat(this._chunks);
  2994. var box = buffer.slice(0, this._box.size);
  2995. var trailing = buffer.slice(this._box.size); // Prepare next bit.
  2996. this._init();
  2997. this._push(trailing); // Ignore invalid boxes
  2998. if (!ISO_BMFF_BOX_TYPES.has(this._box.type)) {
  2999. console.warn("ignored non-ISO BMFF Byte Stream box type: ".concat(this._box.type, " (").concat(this._box.size, " bytes)"));
  3000. return Buffer.alloc(0);
  3001. }
  3002. delete this._box;
  3003. return box;
  3004. }
  3005. /**
  3006. * Add the next chunk of data to the parser and extract messages.
  3007. * If no message can be extracted, an empty array is returned, otherwise
  3008. * an array of messages is returned.
  3009. * @param {Buffer} chunk The next piece of data.
  3010. * @return {Array} An array of messages, possibly empty.
  3011. */
  3012. }, {
  3013. key: "parse",
  3014. value: function parse(chunk) {
  3015. this._push(chunk);
  3016. var messages = [];
  3017. var done = false;
  3018. while (!done) {
  3019. var data = this._parseBox();
  3020. if (data !== null) {
  3021. if ((0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(data) === 'ftyp') {
  3022. this._ftyp = data;
  3023. } else if ((0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(data) === 'moov') {
  3024. var _this$_ftyp;
  3025. var moov = new _mp4muxer_helpers_isom__WEBPACK_IMPORTED_MODULE_10__.Container('moov');
  3026. var tracks = moov.parse(data);
  3027. debug('MP4 tracks: ', tracks);
  3028. messages.push({
  3029. type: _message__WEBPACK_IMPORTED_MODULE_8__.MessageType.ISOM,
  3030. data: Buffer.concat([(_this$_ftyp = this._ftyp) !== null && _this$_ftyp !== void 0 ? _this$_ftyp : Buffer.alloc(0), data]),
  3031. tracks: tracks
  3032. });
  3033. } else {
  3034. messages.push({
  3035. type: _message__WEBPACK_IMPORTED_MODULE_8__.MessageType.ISOM,
  3036. data: data
  3037. });
  3038. }
  3039. } else {
  3040. done = true;
  3041. }
  3042. }
  3043. return messages;
  3044. }
  3045. }]);
  3046. return Parser;
  3047. }();
  3048. /***/ }),
  3049. /***/ "./lib/components/mp4capture/index.ts":
  3050. /*!********************************************!*\
  3051. !*** ./lib/components/mp4capture/index.ts ***!
  3052. \********************************************/
  3053. /*! namespace exports */
  3054. /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] */
  3055. /*! other exports [not provided] [no usage info] */
  3056. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3057. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3058. "use strict";
  3059. __webpack_require__.r(__webpack_exports__);
  3060. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3061. /* harmony export */ "Mp4Capture": () => /* binding */ Mp4Capture
  3062. /* harmony export */ });
  3063. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  3064. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__);
  3065. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  3066. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);
  3067. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  3068. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  3069. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
  3070. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  3071. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  3072. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3073. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3074. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3075. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3076. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3077. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3078. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  3079. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3080. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3081. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  3082. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3083. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  3084. var MAX_CAPTURE_BYTES = 225000000; // 5 min at a rate of 6 Mbit/s
  3085. /**
  3086. * Component that records MP4 data.
  3087. *
  3088. * @extends Component
  3089. */
  3090. var Mp4Capture = /*#__PURE__*/function (_Tube) {
  3091. _inherits(Mp4Capture, _Tube);
  3092. var _super = _createSuper(Mp4Capture);
  3093. /**
  3094. * Create a new mp4muxer component.
  3095. * @return {undefined}
  3096. */
  3097. function Mp4Capture() {
  3098. var _this;
  3099. var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MAX_CAPTURE_BYTES;
  3100. _classCallCheck(this, Mp4Capture);
  3101. var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  3102. objectMode: true,
  3103. transform: function transform(msg, encoding, callback) {
  3104. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
  3105. // Arrival of SDP indicates new movie, start recording if active.
  3106. if (_this._active) {
  3107. _this._capture = true;
  3108. }
  3109. } else if (_this._capture && msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.ISOM) {
  3110. // MP4 box has arrived, record if appropriate
  3111. if (_this._bufferOffset < _this._buffer.byteLength - msg.data.byteLength) {
  3112. msg.data.copy(_this._buffer, _this._bufferOffset);
  3113. _this._bufferOffset += msg.data.byteLength;
  3114. } else {
  3115. _this.stop();
  3116. }
  3117. } // Always pass on all messages
  3118. callback(undefined, msg);
  3119. }
  3120. }); // Stop any recording when the stream is closed.
  3121. incoming.on('finish', function () {
  3122. _this.stop();
  3123. });
  3124. _this = _super.call(this, incoming);
  3125. _defineProperty(_assertThisInitialized(_this), "_active", void 0);
  3126. _defineProperty(_assertThisInitialized(_this), "_capture", void 0);
  3127. _defineProperty(_assertThisInitialized(_this), "_captureCallback", void 0);
  3128. _defineProperty(_assertThisInitialized(_this), "_bufferOffset", void 0);
  3129. _defineProperty(_assertThisInitialized(_this), "_bufferSize", void 0);
  3130. _defineProperty(_assertThisInitialized(_this), "_buffer", void 0);
  3131. _this._buffer = Buffer.allocUnsafe(0);
  3132. _this._bufferSize = maxSize;
  3133. _this._bufferOffset = 0;
  3134. _this._active = false;
  3135. _this._capture = false;
  3136. _this._captureCallback = function () {
  3137. /** noop */
  3138. };
  3139. return _this;
  3140. }
  3141. /**
  3142. * Activate video capture. The capture will begin when a new movie starts,
  3143. * and will terminate when the movie ends or when the buffer is full. On
  3144. * termination, the callback you passed will be called with the captured
  3145. * data as argument.
  3146. * @public
  3147. * @param {Function} callback Will be called when data is captured.
  3148. * @return {undefined}
  3149. */
  3150. _createClass(Mp4Capture, [{
  3151. key: "start",
  3152. value: function start(callback) {
  3153. if (!this._active) {
  3154. debug__WEBPACK_IMPORTED_MODULE_1___default()('msl:capture:start')(callback);
  3155. this._captureCallback = callback;
  3156. this._buffer = Buffer.allocUnsafe(this._bufferSize);
  3157. this._bufferOffset = 0;
  3158. this._active = true;
  3159. }
  3160. }
  3161. /**
  3162. * Deactivate video capture. This ends an ongoing capture and prevents
  3163. * any further capturing.
  3164. * @public
  3165. * @return {undefined}
  3166. */
  3167. }, {
  3168. key: "stop",
  3169. value: function stop() {
  3170. if (this._active) {
  3171. debug__WEBPACK_IMPORTED_MODULE_1___default()('msl:capture:stop')("captured bytes: ".concat(this._bufferOffset));
  3172. try {
  3173. this._captureCallback(this._buffer.slice(0, this._bufferOffset));
  3174. } catch (e) {
  3175. console.error(e);
  3176. }
  3177. this._buffer = Buffer.allocUnsafe(0);
  3178. this._bufferOffset = 0;
  3179. this._active = false;
  3180. this._capture = false;
  3181. }
  3182. }
  3183. }]);
  3184. return Mp4Capture;
  3185. }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
  3186. /***/ }),
  3187. /***/ "./lib/components/mp4muxer/helpers/aacSettings.ts":
  3188. /*!********************************************************!*\
  3189. !*** ./lib/components/mp4muxer/helpers/aacSettings.ts ***!
  3190. \********************************************************/
  3191. /*! namespace exports */
  3192. /*! export aacSettings [provided] [no usage info] [missing usage info prevents renaming] */
  3193. /*! other exports [not provided] [no usage info] */
  3194. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3195. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3196. "use strict";
  3197. __webpack_require__.r(__webpack_exports__);
  3198. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3199. /* harmony export */ "aacSettings": () => /* binding */ aacSettings
  3200. /* harmony export */ });
  3201. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  3202. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_0__);
  3203. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  3204. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  3205. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  3206. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__);
  3207. /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
  3208. ;
  3209. // All audio object types defined in ISO/IEC 14496-3 pp. 40
  3210. var AUDIO_OBJECT_TYPE_NAMES = {
  3211. 1: 'AAC Main',
  3212. 2: 'AAC LC'
  3213. }; // All frequencies defined in ISO/IEC 14496-3 pp. 42
  3214. var FREQUENCY_VALUES = {
  3215. 0: '96 kHz',
  3216. 1: '88.2 kHz',
  3217. 2: '64 kHz',
  3218. 3: '48 kHz',
  3219. 4: '44.1 kHz',
  3220. 5: '32 kHz',
  3221. 6: '24 kHz',
  3222. 7: '22.05 kHz',
  3223. 8: '16 kHz',
  3224. 9: '12 kHz',
  3225. 10: '11.025 kHz',
  3226. 11: '8 kHz',
  3227. 12: '7.35 kHz'
  3228. }; // All channels defined in ISO/IEC 14496-3 pp. 42
  3229. var CHANNEL_CONFIG_NAMES = {
  3230. 1: 'Mono',
  3231. 2: 'Stereo'
  3232. };
  3233. var aacEncodingName = function aacEncodingName(audioConfigBytes) {
  3234. var audioObjectType = audioConfigBytes >>> 11 & 0x001f;
  3235. var frequencyIndex = audioConfigBytes >>> 7 & 0x000f;
  3236. var channelConfig = audioConfigBytes >>> 3 & 0x000f;
  3237. var audioType = AUDIO_OBJECT_TYPE_NAMES[audioObjectType] || "AAC (".concat(audioObjectType, ")");
  3238. var samplingRate = FREQUENCY_VALUES[frequencyIndex] || 'unknown';
  3239. var channels = CHANNEL_CONFIG_NAMES[channelConfig] || channelConfig.toString();
  3240. return {
  3241. coding: audioType,
  3242. samplingRate: samplingRate,
  3243. channels: channels
  3244. };
  3245. };
  3246. var aacSettings = function aacSettings(media, date, trackId) {
  3247. /*
  3248. * Example SDP media segment for MPEG4-GENERIC audio:
  3249. *
  3250. {
  3251. "type": "audio",
  3252. "port": "0",
  3253. "proto": "RTP/AVP",
  3254. "fmt": "97",
  3255. "connectionData": {
  3256. "netType": "IN",
  3257. "addrType": "IP4",
  3258. "connectionAddress": "0.0.0.0"
  3259. },
  3260. "bwtype": "AS",
  3261. "bandwidth": "32",
  3262. "rtpmap": {
  3263. "payloadType": "97",
  3264. "encodingName": "MPEG4-GENERIC",
  3265. "clockrate": "16000",
  3266. "encodingParameters": "1"
  3267. },
  3268. "fmtp": {
  3269. "format": "97",
  3270. "parameters": {
  3271. "streamtype": "5",
  3272. "profile-level-id": "2",
  3273. "mode": "AAC-hbr",
  3274. "config": "1408",
  3275. "sizelength": "13",
  3276. "indexlength": "3",
  3277. "indexdeltalength": "3",
  3278. "bitrate": "32000"
  3279. }
  3280. },
  3281. "control": "rtsp://hostname/media/media.amp/stream=1?audio=1"
  3282. }
  3283. */
  3284. var bitrate = Number(media.fmtp.parameters.bitrate) || 320000;
  3285. var audioConfigBytes = parseInt(media.fmtp.parameters.config, 16);
  3286. var audioObjectType = audioConfigBytes >>> 11 & 0x001f;
  3287. return {
  3288. tkhd: {
  3289. track_ID: trackId,
  3290. creation_time: date,
  3291. modification_time: date,
  3292. width: 0,
  3293. height: 0,
  3294. volume: 1
  3295. },
  3296. mdhd: {
  3297. timescale: Number(media.rtpmap.clockrate),
  3298. creation_time: date,
  3299. modification_time: date,
  3300. duration: 0
  3301. },
  3302. hdlr: {
  3303. handler_type: 'soun',
  3304. name: 'SoundHandler\0' // 00 soundhandler, add 00 if things screws up
  3305. },
  3306. mediaHeaderBox: new _isom__WEBPACK_IMPORTED_MODULE_3__.Box('smhd'),
  3307. sampleEntryBox: new _isom__WEBPACK_IMPORTED_MODULE_3__.Container('mp4a', {
  3308. samplerate: media.rtpmap.clockrate << 16 >>> 0 // FIXME: Is this correct?
  3309. }, new _isom__WEBPACK_IMPORTED_MODULE_3__.Box('esds', {
  3310. audioConfigBytes: audioConfigBytes,
  3311. // Converting from hex string to int
  3312. maxBitRate: bitrate,
  3313. avgBitRate: bitrate
  3314. })),
  3315. /*
  3316. https://wiki.multimedia.cx/index.php/Understanding_AAC
  3317. AAC is a variable bitrate (VBR) block-based codec where each block decodes
  3318. to 1024 time-domain samples, which means that a single block (or frame?) is
  3319. 1024 ticks long, which we take as default here.
  3320. */
  3321. defaultFrameDuration: 1024,
  3322. // MIME type
  3323. mime: "mp4a.40.".concat(audioObjectType),
  3324. codec: aacEncodingName(audioConfigBytes)
  3325. };
  3326. };
  3327. /***/ }),
  3328. /***/ "./lib/components/mp4muxer/helpers/boxbuilder.ts":
  3329. /*!*******************************************************!*\
  3330. !*** ./lib/components/mp4muxer/helpers/boxbuilder.ts ***!
  3331. \*******************************************************/
  3332. /*! namespace exports */
  3333. /*! export BoxBuilder [provided] [no usage info] [missing usage info prevents renaming] */
  3334. /*! other exports [not provided] [no usage info] */
  3335. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3336. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3337. "use strict";
  3338. __webpack_require__.r(__webpack_exports__);
  3339. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3340. /* harmony export */ "BoxBuilder": () => /* binding */ BoxBuilder
  3341. /* harmony export */ });
  3342. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  3343. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_0__);
  3344. /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
  3345. /* harmony import */ var _aacSettings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./aacSettings */ "./lib/components/mp4muxer/helpers/aacSettings.ts");
  3346. /* harmony import */ var _h264Settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./h264Settings */ "./lib/components/mp4muxer/helpers/h264Settings.ts");
  3347. ;
  3348. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3349. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3350. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3351. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  3352. var formatDefaults = {
  3353. 'MPEG4-GENERIC': _aacSettings__WEBPACK_IMPORTED_MODULE_2__.aacSettings,
  3354. H264: _h264Settings__WEBPACK_IMPORTED_MODULE_3__.h264Settings
  3355. };
  3356. var createTrackData = function createTrackData() {
  3357. return {
  3358. lastTimestamp: 0,
  3359. baseMediaDecodeTime: 0,
  3360. defaultFrameDuration: 0,
  3361. clockrate: 0,
  3362. bitrate: 0,
  3363. framerate: 0,
  3364. cumulativeByteLength: 0,
  3365. cumulativeDuration: 0,
  3366. cumulativeFrames: 0
  3367. };
  3368. };
  3369. var updateRateInfo = function updateRateInfo(trackData, _ref) {
  3370. var byteLength = _ref.byteLength,
  3371. duration = _ref.duration;
  3372. trackData.cumulativeByteLength += byteLength;
  3373. trackData.cumulativeDuration += duration;
  3374. trackData.cumulativeFrames++; // Update the cumulative number size (bytes) and duration (ticks), and if
  3375. // the duration exceeds the clockrate (meaning longer than 1 second of data),
  3376. // then compute a new bitrate and reset cumulative size and duration.
  3377. if (trackData.cumulativeDuration >= trackData.clockrate) {
  3378. var bits = 8 * trackData.cumulativeByteLength;
  3379. var frames = trackData.cumulativeFrames;
  3380. var seconds = trackData.cumulativeDuration / trackData.clockrate;
  3381. trackData.bitrate = bits / seconds;
  3382. trackData.framerate = frames / seconds;
  3383. trackData.cumulativeByteLength = 0;
  3384. trackData.cumulativeDuration = 0;
  3385. trackData.cumulativeFrames = 0;
  3386. }
  3387. };
  3388. /**
  3389. * Create boxes for a stream initiated by an sdp object
  3390. *
  3391. * @class BoxBuilder
  3392. */
  3393. var BoxBuilder = /*#__PURE__*/function () {
  3394. function BoxBuilder() {
  3395. _classCallCheck(this, BoxBuilder);
  3396. _defineProperty(this, "trackIdMap", void 0);
  3397. _defineProperty(this, "sequenceNumber", void 0);
  3398. _defineProperty(this, "ntpPresentationTime", void 0);
  3399. _defineProperty(this, "trackData", void 0);
  3400. _defineProperty(this, "videoTrackId", void 0);
  3401. this.trackIdMap = {};
  3402. this.sequenceNumber = 0;
  3403. this.ntpPresentationTime = 0;
  3404. this.trackData = [];
  3405. }
  3406. _createClass(BoxBuilder, [{
  3407. key: "trak",
  3408. value: function trak(settings) {
  3409. var trak = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('trak');
  3410. var mdia = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('mdia');
  3411. var minf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('minf');
  3412. var dinf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('dinf');
  3413. var dref = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('dref');
  3414. var stbl = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('stbl');
  3415. dref.set('entry_count', 1);
  3416. trak.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('tkhd', settings.tkhd), mdia.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mdhd', settings.mdhd), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('hdlr', settings.hdlr), minf.append(settings.mediaHeaderBox, // vmhd or smhd box (video or sound)
  3417. dinf.append(dref.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('url '))), stbl.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('stsd', undefined, settings.sampleEntryBox), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('stts'), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('stsc'), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('stco'), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('stsz'), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('stss')))));
  3418. return trak;
  3419. }
  3420. /**
  3421. * Creates a Moov box from the provided options.
  3422. * @method moov
  3423. * @param {Object} mvhdSettings settings for the movie header box
  3424. * @param {Object[]} tracks track specific settings
  3425. * @return {Moov} Moov object
  3426. */
  3427. }, {
  3428. key: "moov",
  3429. value: function moov(sdp, date) {
  3430. var _this = this;
  3431. var moov = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('moov');
  3432. moov.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mvhd', {
  3433. creation_time: date,
  3434. modification_time: date,
  3435. duration: 0
  3436. }));
  3437. var mvex = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('mvex'); // For each of the media segments in the SDP structure, we will set up
  3438. // a track in the MP4 file. For each track, a 'trak' box is added to the
  3439. // 'moov' box and a 'trex' box is added to the 'mvex' box.
  3440. this.trackIdMap = {};
  3441. this.sequenceNumber = 0;
  3442. this.ntpPresentationTime = 0;
  3443. var trackId = 0;
  3444. this.trackData = [];
  3445. sdp.media.forEach(function (media) {
  3446. if (media.rtpmap === undefined) {
  3447. return;
  3448. }
  3449. var payloadType = media.rtpmap.payloadType;
  3450. var encoding = media.rtpmap.encodingName;
  3451. if (formatDefaults[encoding] !== undefined) {
  3452. // We know how to handle this encoding, add a new track for it, and
  3453. // register the track for this payloadType.
  3454. _this.trackIdMap[payloadType] = ++trackId; // Mark the video track
  3455. if (media.type.toLowerCase() === 'video') {
  3456. _this.videoTrackId = trackId;
  3457. } // Extract the settings from the SDP media information based on
  3458. // the encoding name (H264, MPEG4-GENERIC, ...).
  3459. var settings = formatDefaults[encoding](media, date, trackId);
  3460. media.mime = settings.mime; // add MIME type to the SDP media
  3461. media.codec = settings.codec; // add human readable codec string to the SDP media
  3462. var trackData = createTrackData();
  3463. trackData.clockrate = media.rtpmap.clockrate; // Set default frame duration (in ticks) for later use
  3464. trackData.defaultFrameDuration = settings.defaultFrameDuration;
  3465. _this.trackData.push(trackData);
  3466. var trak = _this.trak(settings);
  3467. moov.append(trak);
  3468. mvex.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('trex', {
  3469. track_ID: trackId
  3470. }));
  3471. }
  3472. });
  3473. moov.append(mvex);
  3474. return moov;
  3475. }
  3476. /**
  3477. * Boxes that carry actual elementary stream fragment metadata + data.
  3478. */
  3479. /**
  3480. * Creates a moof box from the provided fragment metadata.
  3481. * @method moof
  3482. * @param {Object} options options containing, sequencenumber, base time, trun settings, samples
  3483. * @return {Moof} Moof object
  3484. */
  3485. }, {
  3486. key: "moof",
  3487. value: function moof(metadata) {
  3488. var trackId = metadata.trackId,
  3489. timestamp = metadata.timestamp,
  3490. byteLength = metadata.byteLength;
  3491. var trackOffset = trackId - 1;
  3492. var trackData = this.trackData[trackOffset]; // The RTP timestamps are unsigned 32 bit and will overflow
  3493. // at some point. We can guard against the overflow by ORing with 0,
  3494. // which will bring any difference back into signed 32-bit domain.
  3495. var duration = trackData.lastTimestamp !== 0 ? timestamp - trackData.lastTimestamp | 0 : trackData.defaultFrameDuration;
  3496. trackData.lastTimestamp = timestamp;
  3497. if (duration < 0) duration = trackData.defaultFrameDuration;
  3498. var moof = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('moof');
  3499. var traf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('traf');
  3500. var trun = new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('trun', {
  3501. sample_duration: duration,
  3502. sample_size: byteLength,
  3503. first_sample_flags: 0x40
  3504. });
  3505. moof.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mfhd', {
  3506. sequence_number: this.sequenceNumber++
  3507. }), traf.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('tfhd', {
  3508. track_ID: trackId
  3509. }), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('tfdt', {
  3510. baseMediaDecodeTime: trackData.baseMediaDecodeTime
  3511. }), trun));
  3512. trackData.baseMediaDecodeTime += duration; // Correct the trun data offset
  3513. trun.set('data_offset', moof.byteLength + 8);
  3514. updateRateInfo(trackData, {
  3515. byteLength: byteLength,
  3516. duration: duration
  3517. });
  3518. return moof;
  3519. }
  3520. /**
  3521. * Creates an mdat box containing the elementary stream data.
  3522. * @param {[type]} data [description]
  3523. * @return [type] [description]
  3524. */
  3525. }, {
  3526. key: "mdat",
  3527. value: function mdat(data) {
  3528. var box = new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mdat');
  3529. box.add('data', data);
  3530. return box;
  3531. }
  3532. }, {
  3533. key: "setPresentationTime",
  3534. value: function setPresentationTime(trackId, ntpTimestamp) {
  3535. // Before updating the baseMediaDecodeTime, we check if
  3536. // there is already a base NTP time to use as a reference
  3537. // for computing presentation times.
  3538. if (!this.ntpPresentationTime && ntpTimestamp && trackId === this.videoTrackId) {
  3539. var trackOffset = trackId - 1;
  3540. var trackData = this.trackData[trackOffset];
  3541. this.ntpPresentationTime = ntpTimestamp - 1000 * (trackData.baseMediaDecodeTime / trackData.clockrate);
  3542. }
  3543. }
  3544. }]);
  3545. return BoxBuilder;
  3546. }();
  3547. /***/ }),
  3548. /***/ "./lib/components/mp4muxer/helpers/bufferreader.ts":
  3549. /*!*********************************************************!*\
  3550. !*** ./lib/components/mp4muxer/helpers/bufferreader.ts ***!
  3551. \*********************************************************/
  3552. /*! namespace exports */
  3553. /*! export BufferReader [provided] [no usage info] [missing usage info prevents renaming] */
  3554. /*! other exports [not provided] [no usage info] */
  3555. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3556. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3557. "use strict";
  3558. __webpack_require__.r(__webpack_exports__);
  3559. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3560. /* harmony export */ "BufferReader": () => /* binding */ BufferReader
  3561. /* harmony export */ });
  3562. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  3563. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);
  3564. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  3565. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  3566. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.typed-array.uint8-array */ "./node_modules/core-js/modules/es.typed-array.uint8-array.js");
  3567. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_2__);
  3568. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.typed-array.copy-within */ "./node_modules/core-js/modules/es.typed-array.copy-within.js");
  3569. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_3__);
  3570. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.typed-array.every */ "./node_modules/core-js/modules/es.typed-array.every.js");
  3571. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_4__);
  3572. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.typed-array.fill */ "./node_modules/core-js/modules/es.typed-array.fill.js");
  3573. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_5__);
  3574. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.typed-array.filter */ "./node_modules/core-js/modules/es.typed-array.filter.js");
  3575. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_6__);
  3576. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.typed-array.find */ "./node_modules/core-js/modules/es.typed-array.find.js");
  3577. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_7__);
  3578. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.typed-array.find-index */ "./node_modules/core-js/modules/es.typed-array.find-index.js");
  3579. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_8__);
  3580. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.typed-array.for-each */ "./node_modules/core-js/modules/es.typed-array.for-each.js");
  3581. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_9__);
  3582. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.typed-array.includes */ "./node_modules/core-js/modules/es.typed-array.includes.js");
  3583. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_10__);
  3584. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.typed-array.index-of */ "./node_modules/core-js/modules/es.typed-array.index-of.js");
  3585. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_11__);
  3586. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.typed-array.iterator */ "./node_modules/core-js/modules/es.typed-array.iterator.js");
  3587. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_12__);
  3588. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.typed-array.join */ "./node_modules/core-js/modules/es.typed-array.join.js");
  3589. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_13__);
  3590. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.typed-array.last-index-of */ "./node_modules/core-js/modules/es.typed-array.last-index-of.js");
  3591. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_14__);
  3592. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.typed-array.map */ "./node_modules/core-js/modules/es.typed-array.map.js");
  3593. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_15__);
  3594. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce */ "./node_modules/core-js/modules/es.typed-array.reduce.js");
  3595. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_16__);
  3596. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce-right */ "./node_modules/core-js/modules/es.typed-array.reduce-right.js");
  3597. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_17__);
  3598. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.typed-array.reverse */ "./node_modules/core-js/modules/es.typed-array.reverse.js");
  3599. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_18__);
  3600. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.typed-array.set */ "./node_modules/core-js/modules/es.typed-array.set.js");
  3601. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_19__);
  3602. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.typed-array.slice */ "./node_modules/core-js/modules/es.typed-array.slice.js");
  3603. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_20__);
  3604. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.typed-array.some */ "./node_modules/core-js/modules/es.typed-array.some.js");
  3605. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_21__);
  3606. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.typed-array.sort */ "./node_modules/core-js/modules/es.typed-array.sort.js");
  3607. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_22__);
  3608. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.typed-array.subarray */ "./node_modules/core-js/modules/es.typed-array.subarray.js");
  3609. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_23__);
  3610. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string */ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js");
  3611. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_24__);
  3612. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-string */ "./node_modules/core-js/modules/es.typed-array.to-string.js");
  3613. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_25__);
  3614. ;
  3615. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3616. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3617. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3618. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  3619. /**
  3620. * Defines functions for reading from a binary buffer. Works similair to the
  3621. * DataView object, but uses bitshifts instead for performance.
  3622. * @class BufferReader
  3623. * @constructor
  3624. * @param {ArrayBuffer} buffer An ArrayBuffer to be read from.
  3625. */
  3626. var BufferReader = /*#__PURE__*/function () {
  3627. function BufferReader(buffer) {
  3628. _classCallCheck(this, BufferReader);
  3629. _defineProperty(this, "_buffer", void 0);
  3630. _defineProperty(this, "_dataView", void 0);
  3631. _defineProperty(this, "_offset", void 0);
  3632. _defineProperty(this, "_bitpos", void 0);
  3633. _defineProperty(this, "_byte", void 0);
  3634. this._buffer = buffer;
  3635. this._dataView = new DataView(this._buffer);
  3636. this._offset = 0;
  3637. this._bitpos = 0;
  3638. this._byte = 0;
  3639. }
  3640. /**
  3641. * Reads 8-bit of data from the buffer.
  3642. * @method readUint8
  3643. * @param {Number} offset Index in the buffer.
  3644. * @return {Number} An unsigned 8-bit integer.
  3645. */
  3646. _createClass(BufferReader, [{
  3647. key: "readUint8",
  3648. value: function readUint8(offset) {
  3649. return this._dataView.getUint8(offset);
  3650. }
  3651. /**
  3652. * Reads 16-bit of data from the buffer.
  3653. * @method readUint16
  3654. * @param {Number} offset Index in the buffer.
  3655. * @return {Number} An unsigned 16-bit integer.
  3656. */
  3657. }, {
  3658. key: "readUint16",
  3659. value: function readUint16(offset) {
  3660. return this._dataView.getUint16(offset);
  3661. }
  3662. /**
  3663. * Reads 32-bit of data from the buffer.
  3664. * @method readUint32
  3665. * @param {Number} offset Index in the buffer.
  3666. * @return {Number} An unsigned 32-bit integer.
  3667. */
  3668. }, {
  3669. key: "readUint32",
  3670. value: function readUint32(offset) {
  3671. return this._dataView.getUint32(offset);
  3672. }
  3673. /**
  3674. * Reads the next byte of data from the buffer and increaments the offset.
  3675. * @method readNext
  3676. * @return {Number} An unsigned 8-bit integer.
  3677. */
  3678. }, {
  3679. key: "readNext",
  3680. value: function readNext() {
  3681. var value = this.readUint8(this._offset);
  3682. this._offset += 1;
  3683. return value;
  3684. }
  3685. }, {
  3686. key: "readBits",
  3687. value: function readBits(length) {
  3688. if (length > 32 || length === 0) {
  3689. throw new Error('length has to be between 0 - 31 bits');
  3690. }
  3691. var result = 0;
  3692. for (var i = 1; i <= length; ++i) {
  3693. if (this._bitpos === 0) {
  3694. /* Previous byte all read out. Get a new one. */
  3695. this._byte = this.readNext();
  3696. }
  3697. /* Shift result one left to make room for another bit,
  3698. then add the next bit on the stream. */
  3699. result = result << 1 | this._byte >> 8 - ++this._bitpos & 0x01;
  3700. this._bitpos %= 8;
  3701. }
  3702. return result;
  3703. }
  3704. }, {
  3705. key: "readUnsignedExpGolomb",
  3706. value: function readUnsignedExpGolomb() {
  3707. var bitsToRead = 0;
  3708. while (this.readBits(1) !== 1) {
  3709. bitsToRead++;
  3710. }
  3711. if (bitsToRead === 0) {
  3712. return 0;
  3713. /* Easy peasy, just a single 1. This is 0 in exp golomb */
  3714. }
  3715. if (bitsToRead >= 31) {
  3716. throw new Error('read unsigned exponential Golomb: internal error');
  3717. }
  3718. /* Read all bits part of this number */
  3719. var n = this.readBits(bitsToRead);
  3720. /* Move in the 1 read by while-statement above */
  3721. n |= 0x1 << bitsToRead;
  3722. return n - 1;
  3723. /* Because result in exp golomb is one larger */
  3724. }
  3725. }, {
  3726. key: "readSignedExpGolomb",
  3727. value: function readSignedExpGolomb() {
  3728. var r = this.readUnsignedExpGolomb();
  3729. if (r & 0x01) {
  3730. r = r + 1 >> 1;
  3731. } else {
  3732. r = -(r >> 1);
  3733. }
  3734. return r;
  3735. }
  3736. /**
  3737. * Returns the size of the buffer
  3738. * @method readSize
  3739. * @return {Number} The buffer size.
  3740. */
  3741. }, {
  3742. key: "size",
  3743. value: function size() {
  3744. return this._buffer.byteLength;
  3745. }
  3746. /**
  3747. * Returns an instance of the buffer as an unsigned 8-bit integer array.
  3748. * @method getUint8Array
  3749. * @return {Uint8Array} Unsigned 8-bit integer representation of the buffer
  3750. */
  3751. }, {
  3752. key: "getUint8Array",
  3753. value: function getUint8Array() {
  3754. return new Uint8Array(this._buffer);
  3755. }
  3756. /**
  3757. * Returns the buffer object
  3758. * @method getArrayBuffer
  3759. * @return {ArrayBuffer} The buffer used the BufferReader
  3760. */
  3761. }, {
  3762. key: "getArrayBuffer",
  3763. value: function getArrayBuffer() {
  3764. return this._buffer;
  3765. }
  3766. }]);
  3767. return BufferReader;
  3768. }();
  3769. /***/ }),
  3770. /***/ "./lib/components/mp4muxer/helpers/h264Settings.ts":
  3771. /*!*********************************************************!*\
  3772. !*** ./lib/components/mp4muxer/helpers/h264Settings.ts ***!
  3773. \*********************************************************/
  3774. /*! namespace exports */
  3775. /*! export h264Settings [provided] [no usage info] [missing usage info prevents renaming] */
  3776. /*! other exports [not provided] [no usage info] */
  3777. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3779. "use strict";
  3780. __webpack_require__.r(__webpack_exports__);
  3781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3782. /* harmony export */ "h264Settings": () => /* binding */ h264Settings
  3783. /* harmony export */ });
  3784. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  3785. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__);
  3786. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  3787. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  3788. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  3789. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__);
  3790. /* harmony import */ var core_js_modules_es_number_to_fixed__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.number.to-fixed */ "./node_modules/core-js/modules/es.number.to-fixed.js");
  3791. /* harmony import */ var core_js_modules_es_number_to_fixed__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_to_fixed__WEBPACK_IMPORTED_MODULE_3__);
  3792. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  3793. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  3794. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  3795. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__);
  3796. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  3797. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__);
  3798. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  3799. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_7__);
  3800. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./lib/components/mp4muxer/helpers/utils.ts");
  3801. /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
  3802. /* harmony import */ var _spsparser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./spsparser */ "./lib/components/mp4muxer/helpers/spsparser.ts");
  3803. ;
  3804. var PROFILE_NAMES = {
  3805. 66: 'Baseline',
  3806. 77: 'Main',
  3807. 100: 'High'
  3808. };
  3809. var h264EncodingName = function h264EncodingName(profileLevelId) {
  3810. var profileCode = parseInt(profileLevelId.substr(0, 2), 16);
  3811. var levelCode = parseInt(profileLevelId.substr(4, 2), 16);
  3812. var profile = PROFILE_NAMES[profileCode] || profileCode.toString();
  3813. var level = (levelCode / 10).toFixed(1);
  3814. return {
  3815. coding: 'H.264',
  3816. profile: profile,
  3817. level: level
  3818. };
  3819. };
  3820. var h264Settings = function h264Settings(media, date, trackId) {
  3821. /*
  3822. * Example SDP media segment for H264 audio:
  3823. *
  3824. {
  3825. "type": "video",
  3826. "port": "0",
  3827. "proto": "RTP/AVP",
  3828. "fmt": "96",
  3829. "connectionData": {
  3830. "netType": "IN",
  3831. "addrType": "IP4",
  3832. "connectionAddress": "0.0.0.0"
  3833. },
  3834. "bwtype": "AS",
  3835. "bandwidth": "50000",
  3836. "rtpmap": {
  3837. "payloadType": "96",
  3838. "encodingName": "H264",
  3839. "clockrate": "90000"
  3840. },
  3841. "fmtp": {
  3842. "format": "96",
  3843. "parameters": {
  3844. "packetization-mode": "1",
  3845. "profile-level-id": "4d0029",
  3846. "sprop-parameter-sets": "Z00AKeKQDwBE/LgLcBAQGkHiRFQ=,aO48gA=="
  3847. }
  3848. },
  3849. "control": "rtsp://hostname/media/media.amp/stream=0?audio=1",
  3850. "framerate": "25.000000",
  3851. "transform": [[1,0,0],[0,1,0],[0,0,1]]
  3852. },
  3853. */
  3854. var profileLevelId = media.fmtp.parameters['profile-level-id'];
  3855. var parameterSets = media.fmtp.parameters['sprop-parameter-sets'].split(',').map(_utils__WEBPACK_IMPORTED_MODULE_8__.base64DecToArr); // We assume the first set is _the_ SPS (no support for multiple).
  3856. var sps = parameterSets.slice(0, 1); // The remaining sets are all PPS to support more than one.
  3857. var pps = parameterSets.slice(1);
  3858. var parsedSps = new _spsparser__WEBPACK_IMPORTED_MODULE_10__.SPSParser(sps[0].buffer).parse(); // If media framerate is missing in SDP, it is not possible to calculate
  3859. // the frame duration. Use a fallback value (90000 Hz / 25 fps)
  3860. var FALLBACK_FRAME_DURATION = 3600;
  3861. return {
  3862. mediaHeaderBox: new _isom__WEBPACK_IMPORTED_MODULE_9__.Box('vmhd'),
  3863. sampleEntryBox: new _isom__WEBPACK_IMPORTED_MODULE_9__.Container('avc1', {
  3864. width: parsedSps.width,
  3865. height: parsedSps.height
  3866. }, new _isom__WEBPACK_IMPORTED_MODULE_9__.Box('avcC', {
  3867. AVCProfileIndication: sps[0][1],
  3868. profile_compatibility: sps[0][2],
  3869. AVCLevelIndication: sps[0][3],
  3870. sequenceParameterSets: sps,
  3871. pictureParameterSets: pps
  3872. })),
  3873. tkhd: {
  3874. track_ID: trackId,
  3875. creation_time: date,
  3876. modification_time: date,
  3877. width: parsedSps.width << 16,
  3878. height: parsedSps.height << 16,
  3879. volume: 0
  3880. },
  3881. hdlr: {},
  3882. mdhd: {
  3883. timescale: media.rtpmap.clockrate,
  3884. creation_time: date,
  3885. modification_time: date,
  3886. duration: 0
  3887. },
  3888. // (ticks / s) / (frames / s) = ticks / frame, e.g. frame duration in ticks
  3889. defaultFrameDuration: media.framerate !== undefined && media.framerate > 0 ? Number(media.rtpmap.clockrate) / Number(media.framerate) || FALLBACK_FRAME_DURATION : FALLBACK_FRAME_DURATION,
  3890. // MIME type
  3891. mime: "avc1.".concat(profileLevelId),
  3892. codec: h264EncodingName(profileLevelId)
  3893. };
  3894. };
  3895. /***/ }),
  3896. /***/ "./lib/components/mp4muxer/helpers/isom.ts":
  3897. /*!*************************************************!*\
  3898. !*** ./lib/components/mp4muxer/helpers/isom.ts ***!
  3899. \*************************************************/
  3900. /*! namespace exports */
  3901. /*! export Box [provided] [no usage info] [missing usage info prevents renaming] */
  3902. /*! export Container [provided] [no usage info] [missing usage info prevents renaming] */
  3903. /*! other exports [not provided] [no usage info] */
  3904. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  3905. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  3906. "use strict";
  3907. __webpack_require__.r(__webpack_exports__);
  3908. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  3909. /* harmony export */ "Box": () => /* binding */ Box,
  3910. /* harmony export */ "Container": () => /* binding */ Container
  3911. /* harmony export */ });
  3912. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  3913. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  3914. /* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.fill */ "./node_modules/core-js/modules/es.array.fill.js");
  3915. /* harmony import */ var core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_fill__WEBPACK_IMPORTED_MODULE_1__);
  3916. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  3917. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_2__);
  3918. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  3919. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_3__);
  3920. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  3921. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_4__);
  3922. /* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.map */ "./node_modules/core-js/modules/es.map.js");
  3923. /* harmony import */ var core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_map__WEBPACK_IMPORTED_MODULE_5__);
  3924. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  3925. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_6__);
  3926. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  3927. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_7__);
  3928. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  3929. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_8__);
  3930. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.set */ "./node_modules/core-js/modules/es.set.js");
  3931. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_9__);
  3932. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  3933. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_10__);
  3934. /* harmony import */ var core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.string.pad-start */ "./node_modules/core-js/modules/es.string.pad-start.js");
  3935. /* harmony import */ var core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_pad_start__WEBPACK_IMPORTED_MODULE_11__);
  3936. /* harmony import */ var core_js_modules_es_string_repeat__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.repeat */ "./node_modules/core-js/modules/es.string.repeat.js");
  3937. /* harmony import */ var core_js_modules_es_string_repeat__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_repeat__WEBPACK_IMPORTED_MODULE_12__);
  3938. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  3939. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_13__);
  3940. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  3941. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3942. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  3943. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  3944. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  3945. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  3946. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  3947. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  3948. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  3949. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  3950. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  3951. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  3952. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  3953. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3954. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3955. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3956. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3957. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  3958. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3959. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3960. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  3961. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3962. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3963. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  3964. // Elements: parts of a box that hold values.
  3965. // They should have a:
  3966. // - byteLength
  3967. // - value (can be accessed from outside to set/retrieve)
  3968. // - store(buffer, offset) -> write the value to a buffer
  3969. // - load(buffer, offset) -> read data and store in value
  3970. var CONTAINER_TYPES = new Set(['moov']); // Constants
  3971. var UINT32_RANGE = Math.pow(2, 32);
  3972. var BoxElement = function BoxElement(size) {
  3973. _classCallCheck(this, BoxElement);
  3974. _defineProperty(this, "byteLength", void 0);
  3975. _defineProperty(this, "value", void 0);
  3976. this.byteLength = size;
  3977. };
  3978. var Empty = /*#__PURE__*/function (_BoxElement) {
  3979. _inherits(Empty, _BoxElement);
  3980. var _super = _createSuper(Empty);
  3981. function Empty() {
  3982. var _this;
  3983. var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  3984. _classCallCheck(this, Empty);
  3985. _this = _super.call(this, size);
  3986. _defineProperty(_assertThisInitialized(_this), "copy", function (buffer, offset) {
  3987. buffer.fill(0, offset, offset + _this.byteLength);
  3988. });
  3989. return _this;
  3990. }
  3991. _createClass(Empty, [{
  3992. key: "load",
  3993. value: function load() {
  3994. /** noop */
  3995. }
  3996. }]);
  3997. return Empty;
  3998. }(BoxElement);
  3999. var CharArray = /*#__PURE__*/function (_BoxElement2) {
  4000. _inherits(CharArray, _BoxElement2);
  4001. var _super2 = _createSuper(CharArray);
  4002. function CharArray(s) {
  4003. var _this2;
  4004. _classCallCheck(this, CharArray);
  4005. _this2 = _super2.call(this, s.length);
  4006. _defineProperty(_assertThisInitialized(_this2), "value", void 0);
  4007. _defineProperty(_assertThisInitialized(_this2), "copy", function (buffer, offset) {
  4008. for (var i = 0; i < _this2.byteLength; i += 1) {
  4009. buffer[offset + i] = _this2.value.charCodeAt(i);
  4010. }
  4011. });
  4012. _defineProperty(_assertThisInitialized(_this2), "load", function (buffer, offset) {
  4013. _this2.value = buffer.slice(offset, offset + _this2.byteLength).toString('ascii');
  4014. });
  4015. _this2.value = s;
  4016. return _this2;
  4017. }
  4018. return CharArray;
  4019. }(BoxElement);
  4020. var UInt8 = /*#__PURE__*/function (_BoxElement3) {
  4021. _inherits(UInt8, _BoxElement3);
  4022. var _super3 = _createSuper(UInt8);
  4023. function UInt8() {
  4024. var _this3;
  4025. var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4026. _classCallCheck(this, UInt8);
  4027. _this3 = _super3.call(this, 1);
  4028. _defineProperty(_assertThisInitialized(_this3), "value", void 0);
  4029. _defineProperty(_assertThisInitialized(_this3), "copy", function (buffer, offset) {
  4030. buffer.writeUInt8(_this3.value, offset);
  4031. });
  4032. _defineProperty(_assertThisInitialized(_this3), "load", function (buffer, offset) {
  4033. _this3.value = buffer.readUInt8(offset);
  4034. });
  4035. _this3.value = scalar;
  4036. return _this3;
  4037. }
  4038. return UInt8;
  4039. }(BoxElement);
  4040. var UInt8Array = /*#__PURE__*/function (_BoxElement4) {
  4041. _inherits(UInt8Array, _BoxElement4);
  4042. var _super4 = _createSuper(UInt8Array);
  4043. function UInt8Array(array) {
  4044. var _this4;
  4045. _classCallCheck(this, UInt8Array);
  4046. _this4 = _super4.call(this, array.length);
  4047. _defineProperty(_assertThisInitialized(_this4), "value", void 0);
  4048. _defineProperty(_assertThisInitialized(_this4), "copy", function (buffer, offset) {
  4049. for (var i = 0; i < _this4.value.length; ++i) {
  4050. buffer.writeUInt8(_this4.value[i], offset + i);
  4051. }
  4052. });
  4053. _defineProperty(_assertThisInitialized(_this4), "load", function (buffer, offset) {
  4054. for (var i = 0; i < _this4.value.length; ++i) {
  4055. _this4.value[i] = buffer.readUInt8(offset + i);
  4056. }
  4057. });
  4058. _this4.value = array;
  4059. return _this4;
  4060. }
  4061. return UInt8Array;
  4062. }(BoxElement);
  4063. var UInt16BE = /*#__PURE__*/function (_BoxElement5) {
  4064. _inherits(UInt16BE, _BoxElement5);
  4065. var _super5 = _createSuper(UInt16BE);
  4066. function UInt16BE() {
  4067. var _this5;
  4068. var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4069. _classCallCheck(this, UInt16BE);
  4070. _this5 = _super5.call(this, 2);
  4071. _defineProperty(_assertThisInitialized(_this5), "value", void 0);
  4072. _defineProperty(_assertThisInitialized(_this5), "copy", function (buffer, offset) {
  4073. buffer.writeUInt16BE(_this5.value, offset);
  4074. });
  4075. _defineProperty(_assertThisInitialized(_this5), "load", function (buffer, offset) {
  4076. _this5.value = buffer.readUInt16BE(offset);
  4077. });
  4078. _this5.value = scalar;
  4079. return _this5;
  4080. }
  4081. return UInt16BE;
  4082. }(BoxElement);
  4083. var UInt24BE = /*#__PURE__*/function (_BoxElement6) {
  4084. _inherits(UInt24BE, _BoxElement6);
  4085. var _super6 = _createSuper(UInt24BE);
  4086. function UInt24BE() {
  4087. var _this6;
  4088. var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4089. _classCallCheck(this, UInt24BE);
  4090. _this6 = _super6.call(this, 3);
  4091. _defineProperty(_assertThisInitialized(_this6), "value", void 0);
  4092. _defineProperty(_assertThisInitialized(_this6), "copy", function (buffer, offset) {
  4093. buffer.writeUInt8(_this6.value >> 16 & 0xff, offset);
  4094. buffer.writeUInt8(_this6.value >> 8 & 0xff, offset + 1);
  4095. buffer.writeUInt8(_this6.value & 0xff, offset + 2);
  4096. });
  4097. _defineProperty(_assertThisInitialized(_this6), "load", function (buffer, offset) {
  4098. _this6.value = buffer.readUInt8(offset) << 16 + buffer.readUInt8(offset + 1) << 8 + buffer.readUInt8(offset + 2);
  4099. });
  4100. _this6.value = scalar;
  4101. return _this6;
  4102. }
  4103. return UInt24BE;
  4104. }(BoxElement);
  4105. var UInt16BEArray = /*#__PURE__*/function (_BoxElement7) {
  4106. _inherits(UInt16BEArray, _BoxElement7);
  4107. var _super7 = _createSuper(UInt16BEArray);
  4108. function UInt16BEArray(array) {
  4109. var _this7;
  4110. _classCallCheck(this, UInt16BEArray);
  4111. _this7 = _super7.call(this, array.length * 2);
  4112. _defineProperty(_assertThisInitialized(_this7), "value", void 0);
  4113. _defineProperty(_assertThisInitialized(_this7), "copy", function (buffer, offset) {
  4114. for (var i = 0; i < _this7.value.length; ++i) {
  4115. buffer.writeUInt16BE(_this7.value[i], offset + 2 * i);
  4116. }
  4117. });
  4118. _defineProperty(_assertThisInitialized(_this7), "load", function (buffer, offset) {
  4119. for (var i = 0; i < _this7.value.length; ++i) {
  4120. _this7.value[i] = buffer.readUInt16BE(offset + 2 * i);
  4121. }
  4122. });
  4123. _this7.value = array;
  4124. return _this7;
  4125. }
  4126. return UInt16BEArray;
  4127. }(BoxElement);
  4128. var UInt32BE = /*#__PURE__*/function (_BoxElement8) {
  4129. _inherits(UInt32BE, _BoxElement8);
  4130. var _super8 = _createSuper(UInt32BE);
  4131. function UInt32BE() {
  4132. var _this8;
  4133. var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4134. _classCallCheck(this, UInt32BE);
  4135. _this8 = _super8.call(this, 4);
  4136. _defineProperty(_assertThisInitialized(_this8), "value", void 0);
  4137. _defineProperty(_assertThisInitialized(_this8), "copy", function (buffer, offset) {
  4138. buffer.writeUInt32BE(_this8.value, offset);
  4139. });
  4140. _defineProperty(_assertThisInitialized(_this8), "load", function (buffer, offset) {
  4141. _this8.value = buffer.readUInt32BE(offset);
  4142. });
  4143. _this8.value = scalar;
  4144. return _this8;
  4145. }
  4146. return UInt32BE;
  4147. }(BoxElement);
  4148. var UInt32BEArray = /*#__PURE__*/function (_BoxElement9) {
  4149. _inherits(UInt32BEArray, _BoxElement9);
  4150. var _super9 = _createSuper(UInt32BEArray);
  4151. function UInt32BEArray(array) {
  4152. var _this9;
  4153. _classCallCheck(this, UInt32BEArray);
  4154. _this9 = _super9.call(this, array.length * 4);
  4155. _defineProperty(_assertThisInitialized(_this9), "value", void 0);
  4156. _defineProperty(_assertThisInitialized(_this9), "copy", function (buffer, offset) {
  4157. for (var i = 0; i < _this9.value.length; ++i) {
  4158. buffer.writeUInt32BE(_this9.value[i], offset + 4 * i);
  4159. }
  4160. });
  4161. _defineProperty(_assertThisInitialized(_this9), "load", function (buffer, offset) {
  4162. for (var i = 0; i < _this9.value.length; ++i) {
  4163. _this9.value[i] = buffer.readUInt32BE(offset + 4 * i);
  4164. }
  4165. });
  4166. _this9.value = array;
  4167. return _this9;
  4168. }
  4169. return UInt32BEArray;
  4170. }(BoxElement);
  4171. var UInt64BE = /*#__PURE__*/function (_BoxElement10) {
  4172. _inherits(UInt64BE, _BoxElement10);
  4173. var _super10 = _createSuper(UInt64BE);
  4174. function UInt64BE() {
  4175. var _this10;
  4176. var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4177. _classCallCheck(this, UInt64BE);
  4178. _this10 = _super10.call(this, 8);
  4179. _defineProperty(_assertThisInitialized(_this10), "value", void 0);
  4180. _defineProperty(_assertThisInitialized(_this10), "copy", function (buffer, offset) {
  4181. var high = _this10.value / UINT32_RANGE | 0;
  4182. var low = _this10.value - high * UINT32_RANGE;
  4183. buffer.writeUInt32BE(high, offset);
  4184. buffer.writeUInt32BE(low, offset + 4);
  4185. });
  4186. _defineProperty(_assertThisInitialized(_this10), "load", function (buffer, offset) {
  4187. var high = buffer.readUInt32BE(offset);
  4188. var low = buffer.readUInt32BE(offset + 4);
  4189. _this10.value = high * UINT32_RANGE + low;
  4190. });
  4191. _this10.value = scalar;
  4192. return _this10;
  4193. }
  4194. return UInt64BE;
  4195. }(BoxElement);
  4196. /**
  4197. * Class factory for a parameter set element. A parameter set groups a size,
  4198. * and an array of parameter sets consisting each of a size and a byte array.
  4199. * These elements are used by the avcC box.
  4200. * @param {Number} [sizeMask=0x00] A bit mask to use for the size.
  4201. * @return {Class} An element type that groups parameter sets.
  4202. */
  4203. var createParameterSetArrayClass = function createParameterSetArrayClass() {
  4204. var sizeMask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x00;
  4205. return /*#__PURE__*/function (_BoxElement11) {
  4206. _inherits(ParameterSetArray, _BoxElement11);
  4207. var _super11 = _createSuper(ParameterSetArray);
  4208. /**
  4209. * Takes an array of byte-arrays
  4210. * @param {array} array The array of byte arrays
  4211. * @return {[type]} [description]
  4212. */
  4213. function ParameterSetArray(array) {
  4214. var _this11;
  4215. _classCallCheck(this, ParameterSetArray);
  4216. _this11 = _super11.call(this, 0); // this.setLengths = array.map((byteArray) => byteArray.length);
  4217. _defineProperty(_assertThisInitialized(_this11), "value", void 0);
  4218. _defineProperty(_assertThisInitialized(_this11), "copy", function (buffer, offset) {
  4219. var i = 0;
  4220. var _iterator = _createForOfIteratorHelper(_this11.value),
  4221. _step;
  4222. try {
  4223. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  4224. var element = _step.value;
  4225. element.copy(buffer, offset + i);
  4226. i += element.byteLength;
  4227. }
  4228. } catch (err) {
  4229. _iterator.e(err);
  4230. } finally {
  4231. _iterator.f();
  4232. }
  4233. });
  4234. _defineProperty(_assertThisInitialized(_this11), "load", function () {
  4235. /** noop */
  4236. });
  4237. _this11.value = array.reduce(function (flatArray, byteArray) {
  4238. return flatArray.concat(new UInt16BE(byteArray.length), new UInt8Array(byteArray));
  4239. }, [new UInt8(sizeMask | array.length)]);
  4240. _this11.byteLength = _this11.value.reduce(function (total, element) {
  4241. return total + element.byteLength;
  4242. }, 0);
  4243. return _this11;
  4244. }
  4245. return ParameterSetArray;
  4246. }(BoxElement);
  4247. };
  4248. /**
  4249. * Specifications for a selection of ISO BMFF box types.
  4250. *
  4251. * Most of these are defined in ISO/IEC 14496-12,
  4252. * For specific boxes like avc1/avcC/mp4a/esds the exact document is specified
  4253. * with the appropriate box/descriptor.
  4254. *
  4255. * To add a new box, follow the same pattern: you need an object with at least
  4256. * the property 'box' (which is 'Box' or 'FullBox') and for non-container boxes
  4257. * you need also a 'body' property specifying the elements that the box contains.
  4258. * The values assigned to each element in the spec are used as default.
  4259. */
  4260. var BOXSPEC = {
  4261. // File Type Box
  4262. ftyp: {
  4263. container: 'file',
  4264. mandatory: true,
  4265. quantity: 'one',
  4266. box: 'Box',
  4267. is_container: true,
  4268. body: [['major_brand', CharArray, 'isom'], ['minor_version', UInt32BE, 0], ['compatible_brands', CharArray, 'mp41'] // ['compatible_brands1', CharArray, 'iso2'],
  4269. // ['compatible_brands2', CharArray, 'dash'],
  4270. ]
  4271. },
  4272. // Movie Container
  4273. moov: {
  4274. container: 'file',
  4275. mandatory: true,
  4276. quantity: 'one',
  4277. box: 'Box',
  4278. is_container: true
  4279. },
  4280. // Movie Data Box
  4281. mdat: {
  4282. container: 'file',
  4283. mandatory: false,
  4284. quantity: 'any',
  4285. box: 'Box',
  4286. is_container: false,
  4287. body: []
  4288. },
  4289. // Movie Header Box
  4290. mvhd: {
  4291. container: 'moov',
  4292. mandatory: true,
  4293. quantity: 'one',
  4294. box: 'FullBox',
  4295. is_container: false,
  4296. body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['timescale', UInt32BE, 1000], // time-scale for entire presentation, default = milliseconds
  4297. ['duration', UInt32BE, 0xffffffff], // length of entire presentation, default = undetermined
  4298. ['rate', UInt32BE, 0x00010000], // fixed point 16.16, preferred playback rate, default = 1.0
  4299. ['volume', UInt16BE, 0x0100], // fixed point 8.8, preferred playback volume, default = 1.0
  4300. ['reserved', Empty, 10], // transformation matrix, default = unity
  4301. ['matrix', UInt32BEArray, [0x00010000, 0, 0, 0, 0x00010000, 0, 0, 0, 0x40000000]], ['pre_defined', Empty, 24], ['next_track_ID', UInt32BE, 0xffffffff] // next unused track ID, default = unknown
  4302. ]
  4303. },
  4304. // Track Container
  4305. trak: {
  4306. container: 'moov',
  4307. mandatory: true,
  4308. quantity: 'one+',
  4309. box: 'Box',
  4310. is_container: true
  4311. },
  4312. // Track Header Box
  4313. tkhd: {
  4314. container: 'trak',
  4315. mandatory: true,
  4316. quantity: 'one',
  4317. box: 'FullBox',
  4318. is_container: false,
  4319. // Flag values for the track header:
  4320. // 0x000001 Track_enabled: track enabled (otherwise ignored)
  4321. // 0x000002 Track_in_movie: track used in presentation
  4322. // 0x000004 Track_in_preview: used when previewing presentation
  4323. config: {
  4324. flags: 0x000003 // track enabled and used in presentation
  4325. },
  4326. body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['track_ID', UInt32BE, 1], // Track identifier, cannot be 0
  4327. ['reserved', Empty, 4], ['duration', UInt32BE, 0], // Duration of track using timescale of mvhd box
  4328. ['reserved2', Empty, 8], ['layer', UInt16BE, 0], // Front-to-back ordering, lower is closer to viewer
  4329. ['alternate_group', UInt16BE, 0], // Possible grouping of tracks
  4330. ['volume', UInt16BE, 0x0100], // Track's relative audio volume 8.8 fixed point
  4331. ['reserved3', Empty, 2], ['matrix', UInt32BEArray, [0x00010000, 0, 0, 0, 0x00010000, 0, 0, 0, 0x40000000]], ['width', UInt32BE, 0], // Visual presentation width, 16.16 fixed point
  4332. ['height', UInt32BE, 0] // Visual presentation height, 16.16 fixed point
  4333. ]
  4334. },
  4335. // Track Reference Box
  4336. tref: {
  4337. container: 'trak',
  4338. mandatory: false,
  4339. quantity: 'one-',
  4340. box: 'Box',
  4341. is_container: false
  4342. },
  4343. // Media Container
  4344. mdia: {
  4345. container: 'trak',
  4346. mandatory: false,
  4347. quantity: 'one',
  4348. box: 'Box',
  4349. is_container: true
  4350. },
  4351. // Media Header Box
  4352. mdhd: {
  4353. container: 'mdia',
  4354. mandatory: false,
  4355. quantity: 'one',
  4356. box: 'FullBox',
  4357. is_container: false,
  4358. body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['timescale', UInt32BE, 1000], // time-scale for entire presentation, default = milliseconds
  4359. ['duration', UInt32BE, 0xffffffff], // length of entire presentation, default = undetermined
  4360. ['language', UInt16BE, 0], // ISO 639-2 lanugage code, three lower-case letters, stored as
  4361. ['pre_defined', UInt16BE, 0]]
  4362. },
  4363. // Handler Reference Box
  4364. hdlr: {
  4365. container: 'mdia',
  4366. mandatory: true,
  4367. quantity: 'one',
  4368. box: 'FullBox',
  4369. is_container: false,
  4370. body: [['predefined', UInt32BE, 0], ['handler_type', CharArray, 'vide'], // 'vide', 'soun', or 'hint'
  4371. ['reserved', Empty, 12], ['name', CharArray, 'VideoHandler\0']]
  4372. },
  4373. // Media Information Container
  4374. minf: {
  4375. container: 'mdia',
  4376. mandatory: true,
  4377. quantity: 'one',
  4378. box: 'Box',
  4379. is_container: true
  4380. },
  4381. // Video Media Header Box
  4382. vmhd: {
  4383. container: 'minf',
  4384. mandatory: true,
  4385. quantity: 'one',
  4386. box: 'FullBox',
  4387. is_container: false,
  4388. config: {
  4389. flags: 0x000001
  4390. },
  4391. body: [['graphicsmode', UInt16BE, 0], // Composition mode of the video track, 0 = overwrite
  4392. ['opcolor', UInt16BEArray, [0, 0, 0]] // Red green blue, for use by graphics modes
  4393. ]
  4394. },
  4395. // Sound Media Header Box
  4396. smhd: {
  4397. container: 'minf',
  4398. mandatory: true,
  4399. quantity: 'one',
  4400. box: 'FullBox',
  4401. is_container: false,
  4402. body: [// Place mono track in stereo space:
  4403. // 8.8 fixed point, 0 = center, -1.0 = left, 1.0 = right
  4404. ['balance', UInt16BE, 0x0000], ['reserved', UInt16BE]]
  4405. },
  4406. // Data Information Container
  4407. dinf: {
  4408. container: 'minf',
  4409. mandatory: true,
  4410. quantity: 'one',
  4411. box: 'Box',
  4412. is_container: true
  4413. },
  4414. // Data Reference Box
  4415. dref: {
  4416. // When adding elements to this box, update the entry_count value!
  4417. container: 'dinf',
  4418. mandatory: true,
  4419. quantity: 'one',
  4420. box: 'FullBox',
  4421. is_container: true,
  4422. body: [['entry_count', UInt32BE, 0] // Number of entries.
  4423. ]
  4424. },
  4425. 'url ': {
  4426. container: 'dref',
  4427. mandatory: true,
  4428. quantity: 'one+',
  4429. box: 'FullBox',
  4430. is_container: false,
  4431. // Flag values:
  4432. // 0x000001 Local reference, which means empty URL
  4433. config: {
  4434. flags: 0x000001
  4435. },
  4436. body: [// ['location', CharArray, ''],
  4437. ]
  4438. },
  4439. // Sample Table Container
  4440. stbl: {
  4441. container: 'minf',
  4442. mandatory: true,
  4443. quantity: 'one',
  4444. box: 'Box',
  4445. is_container: true
  4446. },
  4447. // Decoding Time to Sample Box
  4448. stts: {
  4449. container: 'stbl',
  4450. mandatory: true,
  4451. quantity: 'one',
  4452. box: 'FullBox',
  4453. is_container: false,
  4454. body: [['entry_count', UInt32BE, 0] // For each entry these two elements:
  4455. // ['sample_count', UInt32BE, 0], // Number of consecutive samples with same delta
  4456. // ['sample_delta', UInt32BE, 0], // Delta of each sample
  4457. ]
  4458. },
  4459. stsd: {
  4460. container: 'stbl',
  4461. mandatory: true,
  4462. quantity: 'one',
  4463. box: 'FullBox',
  4464. is_container: true,
  4465. body: [['entry_count', UInt32BE, 1] // For each entry, one of these three boxes depending on the handler:
  4466. // VisualSampleEntry, AudioSampleEntry, HintSampleEntry
  4467. ]
  4468. },
  4469. /*
  4470. ISO/IEC 14496-12:2005(E) 8.16.2 (pp. 28)
  4471. aligned(8) abstract class SampleEntry (unsigned int(32) format)
  4472. extends Box(format){
  4473. const unsigned int(8)[6] reserved = 0;
  4474. unsigned int(16) data_reference_index;
  4475. }
  4476. class VisualSampleEntry(codingname) extends SampleEntry (codingname){
  4477. unsigned int(16) pre_defined = 0;
  4478. const unsigned int(16) reserved = 0;
  4479. unsigned int(32)[3] pre_defined = 0;
  4480. unsigned int(16) width;
  4481. unsigned int(16) height;
  4482. template unsigned int(32) horizresolution = 0x00480000; // 72 dpi
  4483. template unsigned int(32) vertresolution = 0x00480000; // 72 dpi
  4484. const unsigned int(32) reserved = 0;
  4485. template unsigned int(16) frame_count = 1;
  4486. string[32] compressorname;
  4487. template unsigned int(16) depth = 0x0018;
  4488. int(16) pre_defined = -1;
  4489. }
  4490. ISO/IEC 14496-15:2004(E) 5.3.4.1 (pp. 14)
  4491. class AVCSampleEntry() extends VisualSampleEntry (‘avc1’){
  4492. AVCConfigurationBox config;
  4493. MPEG4BitRateBox (); // optional
  4494. MPEG4ExtensionDescriptorsBox (); // optional
  4495. }
  4496. */
  4497. avc1: {
  4498. container: 'stsd',
  4499. mandatory: false,
  4500. quantity: 'one',
  4501. box: 'Box',
  4502. is_container: true,
  4503. body: [['reserved', Empty, 6], ['data_reference_index', UInt16BE, 1], ['pre_defined', UInt16BE, 0], ['reserved2', Empty, 2], ['pre_defined2', UInt32BEArray, [0, 0, 0]], ['width', UInt16BE, 1920], ['height', UInt16BE, 1080], ['horizresolution', UInt32BE, 0x00480000], ['vertresolution', UInt32BE, 0x00480000], ['reserved3', UInt32BE, 0], ['frame_count', UInt16BE, 1], ['compressorname', UInt8Array, Buffer.alloc(32)], ['depth', UInt16BE, 0x0018], ['pre_defined3', UInt16BE, 0xffff]]
  4504. },
  4505. /*
  4506. class AVCConfigurationBox extends Box(‘avcC’) {
  4507. AVCDecoderConfigurationRecord() AVCConfig;
  4508. }
  4509. ISO/IEC 14496-15:2004(E) 5.2.4.1.1 (pp. 12)
  4510. aligned(8) class AVCDecoderConfigurationRecord {
  4511. unsigned int(8) configurationVersion = 1;
  4512. unsigned int(8) AVCProfileIndication;
  4513. unsigned int(8) profile_compatibility;
  4514. unsigned int(8) AVCLevelIndication;
  4515. bit(6) reserved = ‘111111’b;
  4516. unsigned int(2) lengthSizeMinusOne;
  4517. bit(3) reserved = ‘111’b;
  4518. unsigned int(5) numOfSequenceParameterSets;
  4519. for (i=0; i< numOfSequenceParameterSets; i++) {
  4520. unsigned int(16) sequenceParameterSetLength ;
  4521. bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;
  4522. }
  4523. unsigned int(8) numOfPictureParameterSets;
  4524. for (i=0; i< numOfPictureParameterSets; i++) {
  4525. unsigned int(16) pictureParameterSetLength;
  4526. bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;
  4527. }
  4528. }
  4529. */
  4530. avcC: {
  4531. container: 'avc1',
  4532. mandatory: false,
  4533. quantity: 'one',
  4534. box: 'Box',
  4535. is_container: false,
  4536. body: [['configurationVersion', UInt8, 1], ['AVCProfileIndication', UInt8, 0x4d], ['profile_compatibility', UInt8, 0x00], ['AVCLevelIndication', UInt8, 0x29], // size = reserved 0b111111 + 0b11 NALUnitLength (0b11 = 4-byte)
  4537. ['lengthSizeMinusOne', UInt8, 255], // Example SPS (length 20):
  4538. // [0x67, 0x4d, 0x00, 0x29, 0xe2, 0x90, 0x0f, 0x00,
  4539. // 0x44, 0xfc, 0xb8, 0x0b, 0x70, 0x10, 0x10, 0x1a,
  4540. // 0x41, 0xe2, 0x44, 0x54]
  4541. // number of sets = reserved 0b111 + number of SPS (0b00001 = 1)
  4542. // ['numOfSequenceParameterSets', UInt8, 0b11100001],
  4543. // ['sequenceParameterSetLength', UInt16BE, 0], // Lenght in bytes of the SPS that follows
  4544. // ['sequenceParameterSetNALUnit', UInt8Array, []],
  4545. // These are packed in a single custom element:
  4546. ['sequenceParameterSets', createParameterSetArrayClass(0xe0), []], // Example PPS (length 4):
  4547. // [0x68, 0xee, 0x3c, 0x80]
  4548. // ['numOfPictureParameterSets', UInt8, 1], // number of PPS
  4549. // ['pictureParameterSetLength', UInt16BE, 0], // Length in bytes of the PPS that follows
  4550. // ['pictureParameterSetNALUnit', UInt8Array, []]
  4551. // These are packed in a single custom element:
  4552. ['pictureParameterSets', createParameterSetArrayClass(), []]]
  4553. },
  4554. /*
  4555. ISO/IEC 14496-12:2005(E) 8.16.2 (pp. 28)
  4556. aligned(8) abstract class SampleEntry (unsigned int(32) format)
  4557. extends Box(format){
  4558. const unsigned int(8)[6] reserved = 0;
  4559. unsigned int(16) data_reference_index;
  4560. }
  4561. class AudioSampleEntry(codingname) extends SampleEntry (codingname){
  4562. const unsigned int(32)[2] reserved = 0;
  4563. template unsigned int(16) channelcount = 2;
  4564. template unsigned int(16) samplesize = 16;
  4565. unsigned int(16) pre_defined = 0;
  4566. const unsigned int(16) reserved = 0 ;
  4567. template unsigned int(32) samplerate = {timescale of media}<<16;
  4568. }
  4569. */
  4570. mp4a: {
  4571. container: 'stsd',
  4572. mandatory: false,
  4573. quantity: 'one',
  4574. box: 'Box',
  4575. is_container: true,
  4576. body: [['reserved', Empty, 6], ['data_reference_index', UInt16BE, 1], ['reserved2', UInt32BEArray, [0, 0]], ['channelcount', UInt16BE, 2], ['samplesize', UInt16BE, 16], ['pre_defined', UInt16BE, 0], ['reserved3', UInt16BE, 0], ['samplerate', UInt32BE, 0] // 16.16 bit floating point
  4577. ]
  4578. },
  4579. /* Elementary stream descriptor
  4580. basic box that holds only an ESDescriptor
  4581. reference: 'https://developer.apple.com/library/content/documentation/QuickTime/
  4582. QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-124774'
  4583. Descriptors have a tag that identifies them, specified in ISO/IEC 14496-1 8.3.12
  4584. ISO/IEC 14496-1 8.3.3 (pp. 24) ES_Descriptor
  4585. aligned(8) class ES_Descriptor : bit(8) tag=ES_DescrTag {
  4586. bit(8) length;
  4587. bit(16) ES_ID;
  4588. bit(1) streamDependenceFlag;
  4589. bit(1) URL_Flag;
  4590. const bit(1) reserved=1;
  4591. bit(5) streamPriority;
  4592. if (streamDependenceFlag)
  4593. bit(16) dependsOn_ES_ID;
  4594. if (URL_Flag)
  4595. bit(8) URLstring[length-3-(streamDependencFlag*2)];
  4596. ExtensionDescriptor extDescr[0 .. 255];
  4597. LanguageDescriptor langDescr[0 .. 1];
  4598. DecoderConfigDescriptor decConfigDescr;
  4599. SLConfigDescriptor slConfigDescr;
  4600. IPI_DescPointer ipiPtr[0 .. 1];
  4601. IP_IdentificationDataSet ipIDS[0 .. 1];
  4602. QoS_Descriptor qosDescr[0 .. 1];
  4603. }
  4604. aligned(8) class DecoderConfigDescriptor
  4605. : bit(8) tag=DecoderConfigDescrTag {
  4606. bit(8) length;
  4607. bit(8) objectProfileIndication;
  4608. bit(6) streamType;
  4609. bit(1) upStream;
  4610. const bit(1) reserved=1;
  4611. bit(24) bufferSizeDB;
  4612. bit(32) maxBitrate;
  4613. bit(32) avgBitrate;
  4614. DecoderSpecificInfo decSpecificInfo[];
  4615. }
  4616. aligned(8) class DecoderSpecificInfoShort extends DecoderSpecificInfo
  4617. : bit(8) tag=DecSpecificInfoShortTag
  4618. {
  4619. bit(8) length;
  4620. bit(8) specificInfo[length];
  4621. }
  4622. aligned(8) class SLConfigDescriptor : bit(8) tag=SLConfigDescrTag {
  4623. bit(8) length;
  4624. bit(8) predefined;
  4625. if (predefined==0) {
  4626. bit(1) useAccessUnitStartFlag;
  4627. bit(1) useAccessUnitEndFlag;
  4628. bit(1) useRandomAccessPointFlag;
  4629. bit(1) usePaddingFlag;
  4630. bit(1) useTimeStampsFlag;
  4631. bit(1) useWallClockTimeStampFlag;
  4632. bit(1) useIdleFlag;
  4633. bit(1) durationFlag;
  4634. bit(32) timeStampResolution;
  4635. bit(32) OCRResolution;
  4636. bit(8) timeStampLength; // must be less than 64
  4637. bit(8) OCRLength;
  4638. // must be less than 64
  4639. bit(8) AU_Length;
  4640. // must be less than 32
  4641. bit(8) instantBitrateLength;
  4642. bit(4) degradationPriorityLength;
  4643. bit(4) seqNumLength;
  4644. if (durationFlag) {
  4645. bit(32) timeScale;
  4646. bit(16) accessUnitDuration;
  4647. bit(16) compositionUnitDuration;
  4648. }
  4649. if (!useTimeStampsFlag) {
  4650. if (useWallClockTimeStampFlag)
  4651. double(64) wallClockTimeStamp;
  4652. bit(timeStampLength) startDecodingTimeStamp;
  4653. bit(timeStampLength) startCompositionTimeStamp;
  4654. }
  4655. }
  4656. aligned(8) bit(1) OCRstreamFlag;
  4657. const bit(7) reserved=0b1111.111;
  4658. if (OCRstreamFlag)
  4659. bit(16) OCR_ES_Id;
  4660. }
  4661. */
  4662. esds: {
  4663. container: 'mp4a',
  4664. mandatory: false,
  4665. quantity: 'one',
  4666. box: 'FullBox',
  4667. is_container: false,
  4668. body: [['ES_DescrTag', UInt8, 3], // length of the remainder of this descriptor in byte,
  4669. // excluding trailing embedded descriptors.
  4670. ['ES_DescrLength', UInt8, 25], ['ES_ID', UInt16BE, 1], ['flagsAndStreamPriority', UInt8, 0], ['DecoderConfigDescrTag', UInt8, 4], // length of the remainder of this descriptor in bytes,
  4671. // excluding trailing embedded descriptors.
  4672. ['DecoderConfigDescrLength', UInt8, 17], ['objectProfileIndication', UInt8, 0x40], ['streamTypeUpstreamReserved', UInt8, 0x15], ['bufferSizeDB', UInt8Array, [0, 0, 0]], ['maxBitRate', UInt32BE, 0], ['avgBitRate', UInt32BE, 0], ['DecSpecificInfoShortTag', UInt8, 5], ['DecSpecificInfoShortLength', UInt8, 2], ['audioConfigBytes', UInt16BE, 0], ['SLConfigDescrTag', UInt8, 6], ['SLConfigDescrLength', UInt8, 1], ['SLConfigDescrPredefined', UInt8, 0x02] // ISO use
  4673. ]
  4674. },
  4675. // Sample Size Box
  4676. stsz: {
  4677. container: 'stbl',
  4678. mandatory: true,
  4679. quantity: 'one',
  4680. box: 'FullBox',
  4681. is_container: false,
  4682. body: [['sample_size', UInt32BE, 0], ['sample_count', UInt32BE, 0] // For each sample up to sample_count, append an entry_size:
  4683. // ['entry_size', UInt32BE, ],
  4684. ]
  4685. },
  4686. // Sample To Chunk Box
  4687. stsc: {
  4688. container: 'stbl',
  4689. mandatory: true,
  4690. quantity: 'one',
  4691. box: 'FullBox',
  4692. is_container: false,
  4693. body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append these elements:
  4694. // ['first_chunk', UInt32BE, ],
  4695. // ['samples_per_chunk', UInt32BE, ],
  4696. // ['samples_description_index', UInt32BE, ],
  4697. ]
  4698. },
  4699. // Chunk Offset Box
  4700. stco: {
  4701. container: 'stbl',
  4702. mandatory: true,
  4703. quantity: 'one',
  4704. box: 'FullBox',
  4705. is_container: false,
  4706. body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append an element:
  4707. // ['chunk_offset', UInt32BE, ],
  4708. ]
  4709. },
  4710. // Sync Sample Box
  4711. stss: {
  4712. container: 'stbl',
  4713. mandatory: false,
  4714. quantity: 'one-',
  4715. box: 'FullBox',
  4716. is_container: false,
  4717. body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append an element:
  4718. // ['sample_number', UInt32BE, ],
  4719. ]
  4720. },
  4721. // Edit Box
  4722. edts: {
  4723. container: 'trak',
  4724. mandatory: false,
  4725. quantity: 'one-',
  4726. box: 'Box',
  4727. is_container: true
  4728. },
  4729. // Edit List Box
  4730. elst: {
  4731. container: 'edts',
  4732. mandatory: false,
  4733. quantity: 'one-',
  4734. box: 'FullBox',
  4735. is_container: false,
  4736. body: [['entry_count', UInt32BE, 1], ['segment_duration', UInt32BE, 0], ['media_time', UInt32BE, 0xffffffff], ['media_rate_integer', UInt16BE, 1], ['media_rate_fraction', UInt16BE, 0]]
  4737. },
  4738. mvex: {
  4739. container: 'moov',
  4740. mandatory: false,
  4741. quantity: 'one-',
  4742. box: 'Box',
  4743. is_container: true
  4744. },
  4745. mehd: {
  4746. container: 'mvex',
  4747. mandatory: false,
  4748. quantity: 'one-',
  4749. box: 'FullBox',
  4750. is_container: false,
  4751. body: [['fragment_duration', UInt32BE, 0] // Total duration of movie
  4752. ]
  4753. },
  4754. trex: {
  4755. container: 'mvex',
  4756. mandatory: true,
  4757. quantity: 'one+',
  4758. box: 'FullBox',
  4759. is_container: false,
  4760. body: [['track_ID', UInt32BE, 1], // The track to which this data is applicable
  4761. ['default_sample_description_index', UInt32BE, 1], ['default_sample_duration', UInt32BE, 0], ['default_sample_size', UInt32BE, 0], ['default_sample_flags', UInt32BE, 0]]
  4762. },
  4763. moof: {
  4764. container: 'file',
  4765. mandatory: false,
  4766. quantity: 'zero+',
  4767. box: 'Box',
  4768. is_container: false
  4769. },
  4770. mfhd: {
  4771. container: 'moof',
  4772. mandatory: true,
  4773. quantity: 'one',
  4774. box: 'FullBox',
  4775. is_container: false,
  4776. body: [['sequence_number', UInt32BE, 0] // A number associated with this fragment
  4777. ]
  4778. },
  4779. traf: {
  4780. container: 'moof',
  4781. mandatory: false,
  4782. quantity: 'zero+',
  4783. box: 'Box',
  4784. is_container: true
  4785. },
  4786. tfhd: {
  4787. container: 'traf',
  4788. mandatory: true,
  4789. quantity: 'one',
  4790. box: 'FullBox',
  4791. is_container: false,
  4792. // Flag values for the track fragment header:
  4793. // 0x000001 base-data-offset-present
  4794. // 0x000002 sample-description-index-present
  4795. // 0x000008 default-sample-duration-present
  4796. // 0x000010 default-sample-size-present
  4797. // 0x000020 default-sample-flags-present
  4798. // 0x010000 duration-is-empty
  4799. // 0x020000 default-base-is-moof
  4800. config: {
  4801. flags: 0x000020 // default sample flags present
  4802. },
  4803. body: [['track_ID', UInt32BE, 1], // The track to which this data is applicable
  4804. // ['base_data_offset', UInt64BE, 0],
  4805. // ['default_sample_description_index', UInt32BE, 0],
  4806. // ['default_sample_duration', UInt32BE, 0],
  4807. // ['default_sample_size', UInt32BE, 0],
  4808. ['default_sample_flags', UInt32BE, 0]]
  4809. },
  4810. tfdt: {
  4811. container: 'traf',
  4812. mandatory: false,
  4813. quantity: 'one-',
  4814. box: 'FullBox',
  4815. is_container: false,
  4816. config: {
  4817. version: 1 // Version 1 uses 64-bit value for baseMediaDecodeTime
  4818. },
  4819. body: [['baseMediaDecodeTime', UInt64BE, 0]]
  4820. },
  4821. trun: {
  4822. container: 'traf',
  4823. mandatory: false,
  4824. quantity: 'zero+',
  4825. box: 'FullBox',
  4826. is_container: false,
  4827. // Flag values for the track fragment header:
  4828. // 0x000001 data-offset-present
  4829. // 0x000004 first-sample-flags-present
  4830. // 0x000100 sample-duration-present
  4831. // 0x000200 sample-size-present
  4832. // 0x000400 sample-flags-present
  4833. // 0x000800 sample-composition-time-offsets-present
  4834. config: {
  4835. flags: 0x000305 // default sample flags present
  4836. },
  4837. body: [['sample_count', UInt32BE, 1], // How many samples there are
  4838. ['data_offset', UInt32BE, 0], ['first_sample_flags', UInt32BE, 0], ['sample_duration', UInt32BE, 0], ['sample_size', UInt32BE, 0] // ['sample_flags', UInt32BE, 0],
  4839. // ['sample_composition_time_offset', UInt32BE, 0],
  4840. ]
  4841. },
  4842. // Unknown Box, used for parsing
  4843. '....': {
  4844. box: 'Box',
  4845. is_container: false,
  4846. body: []
  4847. },
  4848. // File Box, special box without any headers
  4849. file: {
  4850. box: 'None',
  4851. is_container: true,
  4852. mandatory: true,
  4853. quantity: 'one'
  4854. }
  4855. };
  4856. /**
  4857. * Helper functions to generate some standard elements that are needed by
  4858. * all types of boxes.
  4859. * All boxes have a length and type, where so-called full boxes have an
  4860. * additional 4-bytes (1-byte version and 3-byte flags fields).
  4861. */
  4862. var Header = /*#__PURE__*/function () {
  4863. function Header() {
  4864. _classCallCheck(this, Header);
  4865. }
  4866. _createClass(Header, null, [{
  4867. key: "None",
  4868. value: function None() {
  4869. return [];
  4870. }
  4871. }, {
  4872. key: "Box",
  4873. value: function Box(type) {
  4874. return [['size', UInt32BE, 0], ['type', CharArray, type]];
  4875. }
  4876. }, {
  4877. key: "FullBox",
  4878. value: function FullBox(type) {
  4879. return [].concat(this.Box(type), [['version', UInt8, 0x00], ['flags', UInt24BE, 0x000000]]);
  4880. }
  4881. }]);
  4882. return Header;
  4883. }();
  4884. /**
  4885. * Box class.
  4886. *
  4887. * Defines a box as an entity similar to a C struct, where the struct is
  4888. * represented by a Map of elements.
  4889. * Each element is an object with at least:
  4890. * - a 'byteLength' property (size of element in bytes)
  4891. * - a 'copy' method (BufferMutation signature)
  4892. */
  4893. var Box = /*#__PURE__*/function (_BoxElement12) {
  4894. _inherits(Box, _BoxElement12);
  4895. var _super12 = _createSuper(Box);
  4896. /**
  4897. * Create a new Box.
  4898. * @param {String} type 4-character ASCII string
  4899. * @param {Object} config Configuration holding (key: value) fields
  4900. */
  4901. function Box(type, config) {
  4902. var _this12;
  4903. _classCallCheck(this, Box);
  4904. _this12 = _super12.call(this, 0);
  4905. _defineProperty(_assertThisInitialized(_this12), "type", void 0);
  4906. _defineProperty(_assertThisInitialized(_this12), "config", void 0);
  4907. _defineProperty(_assertThisInitialized(_this12), "struct", void 0);
  4908. _this12.type = type;
  4909. var spec = BOXSPEC[_this12.type];
  4910. if (spec === undefined) {
  4911. throw new Error("unknown box type: ".concat(type));
  4912. }
  4913. _this12.config = Object.assign({}, spec.config, config);
  4914. var header = Header[spec.box](_this12.type);
  4915. var body = spec.body || []; // Uglify changes the name of the original class, so this doesn't work.
  4916. // TODO: find a better way to check for this.
  4917. // if (spec.body === undefined && this.constructor.name !== 'Container') {
  4918. // throw new Error(`Body missing but '${type}' is not a container box`);
  4919. // }
  4920. // Initialize all elements, an element is something with a byteLength
  4921. _this12.struct = new Map();
  4922. var offset = 0;
  4923. var _iterator2 = _createForOfIteratorHelper([].concat(header, body)),
  4924. _step2;
  4925. try {
  4926. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  4927. var _step2$value = _slicedToArray(_step2.value, 3),
  4928. _key = _step2$value[0],
  4929. Type = _step2$value[1],
  4930. defaultValue = _step2$value[2];
  4931. if (_this12.has(_key)) {
  4932. throw new Error('Trying to add existing key');
  4933. }
  4934. var value = defaultValue;
  4935. if (_this12.config[_key]) {
  4936. value = _this12.config[_key];
  4937. }
  4938. var element = new Type(value);
  4939. _this12.struct.set(_key, {
  4940. offset: offset,
  4941. element: element
  4942. });
  4943. offset += element.byteLength;
  4944. }
  4945. } catch (err) {
  4946. _iterator2.e(err);
  4947. } finally {
  4948. _iterator2.f();
  4949. }
  4950. _this12.byteLength = offset;
  4951. return _this12;
  4952. }
  4953. /**
  4954. * Get access to an element based on it's name.
  4955. * @param {String} key The element's name
  4956. * @return {Element} Object with 'byteLength' property and 'copy' method
  4957. */
  4958. _createClass(Box, [{
  4959. key: "element",
  4960. value: function element(key) {
  4961. var value = this.struct.get(key);
  4962. if (value === undefined) {
  4963. throw new Error('invalid key');
  4964. }
  4965. return value.element;
  4966. }
  4967. /**
  4968. * Set an element's value.
  4969. * @param {String} key The element's name
  4970. * @param {Number|Array} value The element's (new) value
  4971. * @return {undefined}
  4972. */
  4973. }, {
  4974. key: "set",
  4975. value: function set(key, value) {
  4976. this.element(key).value = value;
  4977. }
  4978. /**
  4979. * Get an element's value.
  4980. * @param {String} key The element's name
  4981. * @return {Number|Array} The element's value
  4982. */
  4983. }, {
  4984. key: "get",
  4985. value: function get(key) {
  4986. return this.element(key).value;
  4987. }
  4988. /**
  4989. * Get an element's offset.
  4990. * @param {String} key The element's name
  4991. * @return {Number} The element's offset
  4992. */
  4993. }, {
  4994. key: "offset",
  4995. value: function offset(key) {
  4996. var value = this.struct.get(key);
  4997. if (value === undefined) {
  4998. throw new Error('invalid key');
  4999. }
  5000. return value.offset;
  5001. }
  5002. /**
  5003. * Check if a certain element exists
  5004. * @param {String} key The element's name
  5005. * @return {Boolean} true if the element is known, false if not
  5006. */
  5007. }, {
  5008. key: "has",
  5009. value: function has(key) {
  5010. return this.struct.has(key);
  5011. }
  5012. /**
  5013. * Add a new element to the box.
  5014. * @param {String} key A _new_ non-existing element name.
  5015. * @param {Object} element Something with a 'byteLength' property and 'copy' method.
  5016. * @return {Box} this box, so that 'add' can be used in a chain
  5017. */
  5018. }, {
  5019. key: "add",
  5020. value: function add(key, element) {
  5021. if (this.has(key)) {
  5022. throw new Error('Trying to add existing key');
  5023. }
  5024. this.struct.set(key, {
  5025. offset: this.byteLength,
  5026. element: element
  5027. });
  5028. this.byteLength += element.byteLength;
  5029. return this;
  5030. }
  5031. /**
  5032. * Create a buffer and copy all element values to it.
  5033. * @return {Buffer} Data representing the box.
  5034. */
  5035. }, {
  5036. key: "buffer",
  5037. value: function buffer() {
  5038. var buffer = Buffer.allocUnsafe(this.byteLength);
  5039. this.copy(buffer);
  5040. return buffer;
  5041. }
  5042. /**
  5043. * Copy all values of the box into an existing buffer.
  5044. * @param {Buffer} buffer The target buffer to accept the box data
  5045. * @param {Number} [offset=0] The number of bytes into the target to start at.
  5046. * @return {undefined}
  5047. */
  5048. }, {
  5049. key: "copy",
  5050. value: function copy(buffer) {
  5051. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  5052. // Before writing, make sure the size property is set correctly.
  5053. this.set('size', this.byteLength);
  5054. var _iterator3 = _createForOfIteratorHelper(this.struct.values()),
  5055. _step3;
  5056. try {
  5057. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  5058. var entry = _step3.value;
  5059. entry.element.copy(buffer, offset + entry.offset);
  5060. }
  5061. } catch (err) {
  5062. _iterator3.e(err);
  5063. } finally {
  5064. _iterator3.f();
  5065. }
  5066. }
  5067. /**
  5068. * Read element values from a box's data representation.
  5069. * @param {buffer} buffer The source buffer with box data
  5070. * @param {Number} [offset=0] The number of bytes into the source to start at.
  5071. * @return {undefined}
  5072. */
  5073. }, {
  5074. key: "load",
  5075. value: function load(buffer) {
  5076. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  5077. var _iterator4 = _createForOfIteratorHelper(this.struct.values()),
  5078. _step4;
  5079. try {
  5080. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  5081. var entry = _step4.value;
  5082. if (entry.element.load !== undefined) {
  5083. entry.element.load(buffer, offset + entry.offset);
  5084. }
  5085. }
  5086. } catch (err) {
  5087. _iterator4.e(err);
  5088. } finally {
  5089. _iterator4.f();
  5090. }
  5091. }
  5092. /**
  5093. * Pretty-format an entire box as an element/box hierarchy.
  5094. * @param {Number} [indent=0] How large an indentation to use for the hierarchy
  5095. * @return {undefined}
  5096. */
  5097. }, {
  5098. key: "format",
  5099. value: function format() {
  5100. var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  5101. var lines = [' '.repeat(indent) + "[".concat(this.type, "] (").concat(this.byteLength, ")")];
  5102. var _iterator5 = _createForOfIteratorHelper(this.struct),
  5103. _step5;
  5104. try {
  5105. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  5106. var _step5$value = _slicedToArray(_step5.value, 2),
  5107. _key2 = _step5$value[0],
  5108. entry = _step5$value[1];
  5109. var element = entry.element;
  5110. if (element.format !== undefined) {
  5111. lines.push(element.format(indent + 2));
  5112. } else {
  5113. lines.push(' '.repeat(indent + 2) + "".concat(_key2, " = ").concat(element.value, " (").concat(element.byteLength, ")"));
  5114. }
  5115. }
  5116. } catch (err) {
  5117. _iterator5.e(err);
  5118. } finally {
  5119. _iterator5.f();
  5120. }
  5121. return lines.join('\n');
  5122. }
  5123. /**
  5124. * Pretty-print an entire box as an element/box hierarchy.
  5125. * @param {Number} [indent=0] How large an indentation to use for the hierarchy
  5126. * @return {undefined}
  5127. */
  5128. }, {
  5129. key: "print",
  5130. value: function print(indent) {
  5131. console.warn(this.format(indent));
  5132. }
  5133. }]);
  5134. return Box;
  5135. }(BoxElement);
  5136. /**
  5137. * Container class
  5138. *
  5139. * special box with an 'add' method which allows appending of other boxes,
  5140. * and a 'parse' method to extract contained boxes.
  5141. */
  5142. var Container = /*#__PURE__*/function (_Box) {
  5143. _inherits(Container, _Box);
  5144. var _super13 = _createSuper(Container);
  5145. /**
  5146. * Create a new container box
  5147. * @param {String} type 4-character ASCII string
  5148. * @param {Object} config Configuration holding (key: value) fields
  5149. * @param {Box} boxes One or more boxes to append.
  5150. */
  5151. function Container(type, config) {
  5152. var _this14;
  5153. var _this13;
  5154. _classCallCheck(this, Container);
  5155. _this13 = _super13.call(this, type, config);
  5156. _defineProperty(_assertThisInitialized(_this13), "boxSize", void 0);
  5157. _this13.boxSize = 0;
  5158. for (var _len = arguments.length, boxes = new Array(_len > 2 ? _len - 2 : 0), _key3 = 2; _key3 < _len; _key3++) {
  5159. boxes[_key3 - 2] = arguments[_key3];
  5160. }
  5161. (_this14 = _this13).append.apply(_this14, boxes);
  5162. return _this13;
  5163. }
  5164. /**
  5165. * Add one or more boxes to the container.
  5166. * @param {Box} boxes The box(es) to append
  5167. * @return {Box} this container, so that add can be used in a chain
  5168. */
  5169. _createClass(Container, [{
  5170. key: "append",
  5171. value: function append() {
  5172. for (var _len2 = arguments.length, boxes = new Array(_len2), _key4 = 0; _key4 < _len2; _key4++) {
  5173. boxes[_key4] = arguments[_key4];
  5174. }
  5175. for (var _i2 = 0, _boxes = boxes; _i2 < _boxes.length; _i2++) {
  5176. var box = _boxes[_i2];
  5177. this.add("box_".concat(this.boxSize++), box);
  5178. }
  5179. return this;
  5180. }
  5181. /**
  5182. * Parse a container box by looking for boxes that it contains, and
  5183. * recursively proceed when it is another container.
  5184. *
  5185. * FIXME: this cannot properly handle different versions of the FullBox,
  5186. * currenlty the loader is hardcoded to the version used in this file.
  5187. * Also, appearance of an esds box is assumed to be AAC audio information,
  5188. * while the avcC box signals H.264 video information.
  5189. *
  5190. * @param {Buffer} data The data to parse.
  5191. * @return {undefined}
  5192. */
  5193. }, {
  5194. key: "parse",
  5195. value: function parse(data) {
  5196. var tracks = [];
  5197. while (data.byteLength > 0) {
  5198. var type = new CharArray('....');
  5199. type.load(data, 4);
  5200. var boxType = type.value;
  5201. var spec = BOXSPEC[boxType];
  5202. var box = void 0;
  5203. if (spec !== undefined) {
  5204. if (spec.is_container) {
  5205. box = new Container(boxType);
  5206. box.load(data);
  5207. var boxTracks = box.parse(data.slice(box.byteLength, box.get('size')));
  5208. tracks.push.apply(tracks, _toConsumableArray(boxTracks));
  5209. } else {
  5210. box = new Box(boxType);
  5211. box.load(data); // Handle 2 kinds of tracks with streaming MP4: video or audio
  5212. if (boxType === 'avcC') {
  5213. var profile = box.element('AVCProfileIndication').value.toString(16).padStart(2, 0);
  5214. var compat = box.element('profile_compatibility').value.toString(16).padStart(2, 0);
  5215. var level = box.element('AVCLevelIndication').value.toString(16).padStart(2, 0);
  5216. tracks.push({
  5217. type: 'video',
  5218. mime: "avc1.".concat(profile).concat(compat).concat(level)
  5219. });
  5220. } else if (boxType === 'esds') {
  5221. var audioConfigBytes = box.element('audioConfigBytes').value;
  5222. var objectTypeIndication = audioConfigBytes >>> 11 & 0x001f;
  5223. tracks.push({
  5224. type: 'audio',
  5225. mime: "mp4a.40.".concat(objectTypeIndication)
  5226. });
  5227. }
  5228. }
  5229. } else {
  5230. box = new Box('....');
  5231. box.load(data);
  5232. box.type = box.get('type');
  5233. }
  5234. this.append(box);
  5235. data = data.slice(box.get('size'));
  5236. }
  5237. return tracks;
  5238. }
  5239. }]);
  5240. return Container;
  5241. }(Box);
  5242. /***/ }),
  5243. /***/ "./lib/components/mp4muxer/helpers/spsparser.ts":
  5244. /*!******************************************************!*\
  5245. !*** ./lib/components/mp4muxer/helpers/spsparser.ts ***!
  5246. \******************************************************/
  5247. /*! namespace exports */
  5248. /*! export SPSParser [provided] [no usage info] [missing usage info prevents renaming] */
  5249. /*! other exports [not provided] [no usage info] */
  5250. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5252. "use strict";
  5253. __webpack_require__.r(__webpack_exports__);
  5254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5255. /* harmony export */ "SPSParser": () => /* binding */ SPSParser
  5256. /* harmony export */ });
  5257. /* harmony import */ var _bufferreader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bufferreader */ "./lib/components/mp4muxer/helpers/bufferreader.ts");
  5258. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5259. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5260. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5261. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5262. /**
  5263. * Defines functions for writing to a binary buffer.
  5264. * @class BufferWriter
  5265. * @constructor
  5266. * @param {Number} size The size of the buffer.
  5267. */
  5268. var SPSParser = /*#__PURE__*/function () {
  5269. function SPSParser(buffer) {
  5270. _classCallCheck(this, SPSParser);
  5271. _defineProperty(this, "reader", void 0);
  5272. this.reader = new _bufferreader__WEBPACK_IMPORTED_MODULE_0__.BufferReader(buffer);
  5273. }
  5274. _createClass(SPSParser, [{
  5275. key: "parse",
  5276. value: function parse() {
  5277. // nalhdr
  5278. this.reader.readNext();
  5279. var profile = this.reader.readNext(); // constraints
  5280. this.reader.readNext();
  5281. var level = this.reader.readNext(); // seqParameterSetId
  5282. this.reader.readUnsignedExpGolomb();
  5283. if ([100, 110, 122, 244, 44, 83, 86, 118].indexOf(profile) >= 0) {
  5284. var chromaFormat = this.reader.readUnsignedExpGolomb();
  5285. if (chromaFormat === 3) {
  5286. // Separate color plane flag
  5287. this.reader.readBits(1);
  5288. } // bitDepthLumaMinus8
  5289. this.reader.readUnsignedExpGolomb(); // bitDepthChromaMinus8
  5290. this.reader.readUnsignedExpGolomb(); // qpPrimeYZeroTransformBypassFlag
  5291. this.reader.readBits(1);
  5292. var seqScalingMatrix = this.reader.readBits(1);
  5293. if (seqScalingMatrix) {
  5294. for (var k = 0; k < (chromaFormat !== 3 ? 8 : 12); k++) {
  5295. // seqScalingListPresentFlag
  5296. this.reader.readBits(1); // TODO: More logic goes here..
  5297. }
  5298. }
  5299. } // log2MaxFrameNumMinus4
  5300. this.reader.readUnsignedExpGolomb();
  5301. var picOrderCntType = this.reader.readUnsignedExpGolomb();
  5302. if (picOrderCntType === 0) {
  5303. // log2MaxPicOrderCntLsbMinus4
  5304. this.reader.readUnsignedExpGolomb();
  5305. } else if (picOrderCntType === 1) {
  5306. var numRefFramesInPic = 0;
  5307. this.reader.readBits(1);
  5308. this.reader.readSignedExpGolomb();
  5309. this.reader.readSignedExpGolomb();
  5310. numRefFramesInPic = this.reader.readUnsignedExpGolomb();
  5311. for (var i = 0; i < numRefFramesInPic; i++) {
  5312. this.reader.readSignedExpGolomb();
  5313. }
  5314. } // maxNumRefFrames
  5315. this.reader.readUnsignedExpGolomb(); // gapsInFrameNumValueAllowedFlag
  5316. this.reader.readBits(1);
  5317. var picWidthInMbsMinus1 = this.reader.readUnsignedExpGolomb();
  5318. var picHeightInMapUnitsMinus1 = this.reader.readUnsignedExpGolomb();
  5319. var picFrameMbsOnlyFlag = this.reader.readBits(1); // direct8x8InferenceFlag
  5320. this.reader.readBits(1);
  5321. var frameCroppingFlag = this.reader.readBits(1);
  5322. var frameCropLeftOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
  5323. var frameCropRightOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
  5324. var frameCropTopOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
  5325. var frameCropBottomOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
  5326. var w = (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2;
  5327. var h = (2 - picFrameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2;
  5328. return {
  5329. profile: profile,
  5330. level: level / 10.0,
  5331. width: w,
  5332. height: h
  5333. };
  5334. }
  5335. }]);
  5336. return SPSParser;
  5337. }();
  5338. /***/ }),
  5339. /***/ "./lib/components/mp4muxer/helpers/utils.ts":
  5340. /*!**************************************************!*\
  5341. !*** ./lib/components/mp4muxer/helpers/utils.ts ***!
  5342. \**************************************************/
  5343. /*! namespace exports */
  5344. /*! export b64ToUint6 [provided] [no usage info] [missing usage info prevents renaming] */
  5345. /*! export base64DecToArr [provided] [no usage info] [missing usage info prevents renaming] */
  5346. /*! other exports [not provided] [no usage info] */
  5347. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5348. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5349. "use strict";
  5350. __webpack_require__.r(__webpack_exports__);
  5351. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5352. /* harmony export */ "b64ToUint6": () => /* binding */ b64ToUint6,
  5353. /* harmony export */ "base64DecToArr": () => /* binding */ base64DecToArr
  5354. /* harmony export */ });
  5355. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  5356. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);
  5357. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  5358. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  5359. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  5360. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__);
  5361. /* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.replace */ "./node_modules/core-js/modules/es.string.replace.js");
  5362. /* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__);
  5363. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.typed-array.uint8-array */ "./node_modules/core-js/modules/es.typed-array.uint8-array.js");
  5364. /* harmony import */ var core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_uint8_array__WEBPACK_IMPORTED_MODULE_4__);
  5365. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.typed-array.copy-within */ "./node_modules/core-js/modules/es.typed-array.copy-within.js");
  5366. /* harmony import */ var core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_copy_within__WEBPACK_IMPORTED_MODULE_5__);
  5367. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.typed-array.every */ "./node_modules/core-js/modules/es.typed-array.every.js");
  5368. /* harmony import */ var core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_every__WEBPACK_IMPORTED_MODULE_6__);
  5369. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.typed-array.fill */ "./node_modules/core-js/modules/es.typed-array.fill.js");
  5370. /* harmony import */ var core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_fill__WEBPACK_IMPORTED_MODULE_7__);
  5371. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.typed-array.filter */ "./node_modules/core-js/modules/es.typed-array.filter.js");
  5372. /* harmony import */ var core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_filter__WEBPACK_IMPORTED_MODULE_8__);
  5373. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.typed-array.find */ "./node_modules/core-js/modules/es.typed-array.find.js");
  5374. /* harmony import */ var core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find__WEBPACK_IMPORTED_MODULE_9__);
  5375. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.typed-array.find-index */ "./node_modules/core-js/modules/es.typed-array.find-index.js");
  5376. /* harmony import */ var core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_find_index__WEBPACK_IMPORTED_MODULE_10__);
  5377. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.typed-array.for-each */ "./node_modules/core-js/modules/es.typed-array.for-each.js");
  5378. /* harmony import */ var core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_for_each__WEBPACK_IMPORTED_MODULE_11__);
  5379. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.typed-array.includes */ "./node_modules/core-js/modules/es.typed-array.includes.js");
  5380. /* harmony import */ var core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_includes__WEBPACK_IMPORTED_MODULE_12__);
  5381. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.typed-array.index-of */ "./node_modules/core-js/modules/es.typed-array.index-of.js");
  5382. /* harmony import */ var core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_index_of__WEBPACK_IMPORTED_MODULE_13__);
  5383. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.typed-array.iterator */ "./node_modules/core-js/modules/es.typed-array.iterator.js");
  5384. /* harmony import */ var core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_iterator__WEBPACK_IMPORTED_MODULE_14__);
  5385. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.typed-array.join */ "./node_modules/core-js/modules/es.typed-array.join.js");
  5386. /* harmony import */ var core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_join__WEBPACK_IMPORTED_MODULE_15__);
  5387. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.typed-array.last-index-of */ "./node_modules/core-js/modules/es.typed-array.last-index-of.js");
  5388. /* harmony import */ var core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_last_index_of__WEBPACK_IMPORTED_MODULE_16__);
  5389. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.typed-array.map */ "./node_modules/core-js/modules/es.typed-array.map.js");
  5390. /* harmony import */ var core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_map__WEBPACK_IMPORTED_MODULE_17__);
  5391. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce */ "./node_modules/core-js/modules/es.typed-array.reduce.js");
  5392. /* harmony import */ var core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce__WEBPACK_IMPORTED_MODULE_18__);
  5393. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.typed-array.reduce-right */ "./node_modules/core-js/modules/es.typed-array.reduce-right.js");
  5394. /* harmony import */ var core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reduce_right__WEBPACK_IMPORTED_MODULE_19__);
  5395. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.typed-array.reverse */ "./node_modules/core-js/modules/es.typed-array.reverse.js");
  5396. /* harmony import */ var core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_reverse__WEBPACK_IMPORTED_MODULE_20__);
  5397. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.typed-array.set */ "./node_modules/core-js/modules/es.typed-array.set.js");
  5398. /* harmony import */ var core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_set__WEBPACK_IMPORTED_MODULE_21__);
  5399. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.typed-array.slice */ "./node_modules/core-js/modules/es.typed-array.slice.js");
  5400. /* harmony import */ var core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_slice__WEBPACK_IMPORTED_MODULE_22__);
  5401. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.typed-array.some */ "./node_modules/core-js/modules/es.typed-array.some.js");
  5402. /* harmony import */ var core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_some__WEBPACK_IMPORTED_MODULE_23__);
  5403. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.typed-array.sort */ "./node_modules/core-js/modules/es.typed-array.sort.js");
  5404. /* harmony import */ var core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_sort__WEBPACK_IMPORTED_MODULE_24__);
  5405. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.typed-array.subarray */ "./node_modules/core-js/modules/es.typed-array.subarray.js");
  5406. /* harmony import */ var core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_subarray__WEBPACK_IMPORTED_MODULE_25__);
  5407. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string */ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js");
  5408. /* harmony import */ var core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_locale_string__WEBPACK_IMPORTED_MODULE_26__);
  5409. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.typed-array.to-string */ "./node_modules/core-js/modules/es.typed-array.to-string.js");
  5410. /* harmony import */ var core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_typed_array_to_string__WEBPACK_IMPORTED_MODULE_27__);
  5411. ;
  5412. function b64ToUint6(nChr) {
  5413. return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0;
  5414. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
  5415. function base64DecToArr(sBase64, nBlocksSize) {
  5416. var sB64Enc = sBase64.replace(/[^A-Za-z0-9+/]/g, '');
  5417. var nInLen = sB64Enc.length;
  5418. var nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2;
  5419. var taBytes = new Uint8Array(nOutLen);
  5420. var nMod3;
  5421. var nMod4;
  5422. var nUint24 = 0;
  5423. var nOutIdx = 0;
  5424. for (var nInIdx = 0; nInIdx < nInLen; nInIdx++) {
  5425. nMod4 = nInIdx & 3;
  5426. nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;
  5427. if (nMod4 === 3 || nInLen - nInIdx === 1) {
  5428. for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
  5429. taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
  5430. }
  5431. nUint24 = 0;
  5432. }
  5433. }
  5434. return taBytes;
  5435. }
  5436. /***/ }),
  5437. /***/ "./lib/components/mp4muxer/index.ts":
  5438. /*!******************************************!*\
  5439. !*** ./lib/components/mp4muxer/index.ts ***!
  5440. \******************************************/
  5441. /*! namespace exports */
  5442. /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] */
  5443. /*! other exports [not provided] [no usage info] */
  5444. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5445. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5446. "use strict";
  5447. __webpack_require__.r(__webpack_exports__);
  5448. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5449. /* harmony export */ "Mp4Muxer": () => /* binding */ Mp4Muxer
  5450. /* harmony export */ });
  5451. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  5452. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__);
  5453. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  5454. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  5455. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);
  5456. /* harmony import */ var _helpers_isom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/isom */ "./lib/components/mp4muxer/helpers/isom.ts");
  5457. /* harmony import */ var _helpers_boxbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/boxbuilder */ "./lib/components/mp4muxer/helpers/boxbuilder.ts");
  5458. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  5459. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_5__);
  5460. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  5461. /* harmony import */ var _h264depay_parser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../h264depay/parser */ "./lib/components/h264depay/parser.ts");
  5462. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  5463. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5464. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5465. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5466. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5467. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5468. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5469. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  5470. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5471. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5472. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  5473. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5474. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5475. /**
  5476. * Component that converts elementary stream data into MP4 boxes honouring
  5477. * the ISO BMFF Byte Stream (Some extra restrictions are involved).
  5478. */
  5479. var Mp4Muxer = /*#__PURE__*/function (_Tube) {
  5480. _inherits(Mp4Muxer, _Tube);
  5481. var _super = _createSuper(Mp4Muxer);
  5482. /**
  5483. * Create a new mp4muxer component.
  5484. * @return {undefined}
  5485. */
  5486. function Mp4Muxer() {
  5487. var _this;
  5488. _classCallCheck(this, Mp4Muxer);
  5489. var boxBuilder = new _helpers_boxbuilder__WEBPACK_IMPORTED_MODULE_4__.BoxBuilder();
  5490. var onSync = function onSync(ntpPresentationTime) {
  5491. _this.onSync && _this.onSync(ntpPresentationTime);
  5492. };
  5493. var incoming = new stream__WEBPACK_IMPORTED_MODULE_5__.Transform({
  5494. objectMode: true,
  5495. transform: function transform(msg, encoding, callback) {
  5496. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.SDP) {
  5497. /**
  5498. * Arrival of SDP signals the beginning of a new movie.
  5499. * Set up the ftyp and moov boxes.
  5500. */
  5501. // Why is this here? These should be default inside the mvhd box?
  5502. var now = Math.floor(new Date().getTime() / 1000 + 2082852000);
  5503. var ftyp = new _helpers_isom__WEBPACK_IMPORTED_MODULE_3__.Box('ftyp');
  5504. var moov = boxBuilder.moov(msg.sdp, now);
  5505. var data = Buffer.allocUnsafe(ftyp.byteLength + moov.byteLength);
  5506. ftyp.copy(data, 0);
  5507. moov.copy(data, ftyp.byteLength);
  5508. debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:mp4:isom')("ftyp: ".concat(ftyp.format()));
  5509. debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:mp4:isom')("moov: ".concat(moov.format())); // Set up a list of tracks that contain info about
  5510. // the type of media, encoding, and codec are present.
  5511. var tracks = msg.sdp.media.map(function (media) {
  5512. var isrecv = media.sendonly !== undefined ? false : true;
  5513. return {
  5514. type: media.type,
  5515. encoding: media.rtpmap && media.rtpmap.encodingName,
  5516. mime: media.mime,
  5517. codec: media.codec,
  5518. isrecv: isrecv
  5519. };
  5520. });
  5521. this.push({
  5522. type: _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ISOM,
  5523. data: data,
  5524. tracks: tracks,
  5525. ftyp: ftyp,
  5526. moov: moov
  5527. });
  5528. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ELEMENTARY || msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.H264) {
  5529. /**
  5530. * Otherwise we are getting some elementary stream data.
  5531. * Set up the moof and mdat boxes.
  5532. */
  5533. var payloadType = msg.payloadType,
  5534. timestamp = msg.timestamp,
  5535. ntpTimestamp = msg.ntpTimestamp;
  5536. var trackId = boxBuilder.trackIdMap[payloadType];
  5537. if (trackId) {
  5538. if (!boxBuilder.ntpPresentationTime) {
  5539. boxBuilder.setPresentationTime(trackId, ntpTimestamp);
  5540. if (boxBuilder.ntpPresentationTime) {
  5541. onSync(boxBuilder.ntpPresentationTime);
  5542. }
  5543. }
  5544. var checkpointTime = undefined;
  5545. var idrPicture = msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.H264 ? msg.nalType === _h264depay_parser__WEBPACK_IMPORTED_MODULE_7__.NAL_TYPES.IDR_PICTURE : undefined;
  5546. if (boxBuilder.ntpPresentationTime && idrPicture && msg.ntpTimestamp !== undefined) {
  5547. checkpointTime = (msg.ntpTimestamp - boxBuilder.ntpPresentationTime) / 1000;
  5548. }
  5549. var byteLength = msg.data.byteLength;
  5550. var moof = boxBuilder.moof({
  5551. trackId: trackId,
  5552. timestamp: timestamp,
  5553. byteLength: byteLength
  5554. });
  5555. var mdat = boxBuilder.mdat(msg.data);
  5556. var _data = Buffer.allocUnsafe(moof.byteLength + mdat.byteLength);
  5557. moof.copy(_data, 0);
  5558. mdat.copy(_data, moof.byteLength);
  5559. this.push({
  5560. type: _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ISOM,
  5561. data: _data,
  5562. moof: moof,
  5563. mdat: mdat,
  5564. ntpTimestamp: ntpTimestamp,
  5565. checkpointTime: checkpointTime,
  5566. idrPicture: idrPicture
  5567. });
  5568. }
  5569. } else {
  5570. // No message type we recognize, pass it on.
  5571. this.push(msg);
  5572. }
  5573. callback();
  5574. }
  5575. });
  5576. _this = _super.call(this, incoming);
  5577. _defineProperty(_assertThisInitialized(_this), "boxBuilder", void 0);
  5578. _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
  5579. _this.boxBuilder = boxBuilder;
  5580. return _this;
  5581. }
  5582. _createClass(Mp4Muxer, [{
  5583. key: "bitrate",
  5584. get: function get() {
  5585. return this.boxBuilder.trackData && this.boxBuilder.trackData.map(function (data) {
  5586. return data.bitrate;
  5587. });
  5588. }
  5589. }, {
  5590. key: "framerate",
  5591. get: function get() {
  5592. return this.boxBuilder.trackData && this.boxBuilder.trackData.map(function (data) {
  5593. return data.framerate;
  5594. });
  5595. }
  5596. }, {
  5597. key: "ntpPresentationTime",
  5598. get: function get() {
  5599. return this.boxBuilder.ntpPresentationTime;
  5600. }
  5601. }]);
  5602. return Mp4Muxer;
  5603. }(_component__WEBPACK_IMPORTED_MODULE_6__.Tube);
  5604. /***/ }),
  5605. /***/ "./lib/components/mse/index.ts":
  5606. /*!*************************************!*\
  5607. !*** ./lib/components/mse/index.ts ***!
  5608. \*************************************/
  5609. /*! namespace exports */
  5610. /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] */
  5611. /*! other exports [not provided] [no usage info] */
  5612. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5613. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5614. "use strict";
  5615. __webpack_require__.r(__webpack_exports__);
  5616. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5617. /* harmony export */ "MseSink": () => /* binding */ MseSink
  5618. /* harmony export */ });
  5619. /* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/core-js/modules/es.array.filter.js");
  5620. /* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__);
  5621. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  5622. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__);
  5623. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  5624. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_2__);
  5625. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  5626. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__);
  5627. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  5628. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  5629. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  5630. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__);
  5631. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  5632. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__);
  5633. /* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.url */ "./node_modules/core-js/modules/web.url.js");
  5634. /* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_7__);
  5635. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  5636. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_8__);
  5637. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  5638. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  5639. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_10__);
  5640. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  5641. /* harmony import */ var _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/protocols/rtcp */ "./lib/utils/protocols/rtcp.ts");
  5642. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5643. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5644. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5645. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5646. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5647. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5648. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  5649. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5650. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5651. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  5652. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5653. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5654. var TRIGGER_THRESHOLD = 100;
  5655. var debug = debug__WEBPACK_IMPORTED_MODULE_8___default()('msl:mse');
  5656. var MseSink = /*#__PURE__*/function (_Sink) {
  5657. _inherits(MseSink, _Sink);
  5658. var _super = _createSuper(MseSink);
  5659. /**
  5660. * Create a Media component.
  5661. *
  5662. * The constructor sets up two streams and connects them to the MediaSource.
  5663. *
  5664. * @param {MediaSource} mse - A media source.
  5665. */
  5666. function MseSink(el) {
  5667. var _this;
  5668. _classCallCheck(this, MseSink);
  5669. if (el === undefined) {
  5670. throw new Error('video element argument missing');
  5671. }
  5672. var mse;
  5673. var sourceBuffer;
  5674. /**
  5675. * Set up an incoming stream and attach it to the sourceBuffer.
  5676. */
  5677. var incoming = new stream__WEBPACK_IMPORTED_MODULE_10__.Writable({
  5678. objectMode: true,
  5679. write: function write(msg, _, callback) {
  5680. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_11__.MessageType.ISOM) {
  5681. // ISO BMFF Byte Stream data to be added to the source buffer
  5682. _this._done = callback;
  5683. if (msg.tracks !== undefined) {
  5684. var _tracks = msg.tracks; // Start a new movie (new SDP info available)
  5685. _this._lastCheckpointTime = 0; // Start a new mediaSource and prepare it with a sourceBuffer.
  5686. // When ready, this component's .onSourceOpen callback will be called
  5687. // with the mediaSource, and a list of valid/ignored media.
  5688. mse = new MediaSource();
  5689. el.src = window.URL.createObjectURL(mse);
  5690. var handler = function handler() {
  5691. window.URL.revokeObjectURL(el.src);
  5692. mse.removeEventListener('sourceopen', handler);
  5693. _this.onSourceOpen && _this.onSourceOpen(mse, _tracks); // MIME codecs: https://tools.ietf.org/html/rfc6381
  5694. var mimeCodecs = _tracks.map(function (track) {
  5695. return track.mime;
  5696. }).filter(function (mime) {
  5697. return mime;
  5698. });
  5699. var codecs = mimeCodecs.length !== 0 ? mimeCodecs.join(', ') : 'avc1.640029, mp4a.40.2';
  5700. sourceBuffer = _this.addSourceBuffer(el, mse, "video/mp4; codecs=\"".concat(codecs, "\""));
  5701. sourceBuffer.onerror = function (e) {
  5702. console.error('error on SourceBuffer: ', e);
  5703. incoming.emit('error');
  5704. };
  5705. try {
  5706. sourceBuffer.appendBuffer(msg.data);
  5707. _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
  5708. } catch (err) {
  5709. console.error('failed to append to SourceBuffer: ', err, msg);
  5710. }
  5711. };
  5712. mse.addEventListener('sourceopen', handler);
  5713. } else {
  5714. // Continue current movie
  5715. _this._lastCheckpointTime = msg.checkpointTime !== undefined ? msg.checkpointTime : _this._lastCheckpointTime;
  5716. try {
  5717. sourceBuffer.appendBuffer(msg.data);
  5718. _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
  5719. } catch (e) {
  5720. console.error('failed to append to SourceBuffer: ', e, msg);
  5721. }
  5722. }
  5723. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_11__.MessageType.RTCP) {
  5724. if ((0,_utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__.packetType)(msg.data) === _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__.BYE.packetType) {
  5725. mse.readyState === 'open' && mse.endOfStream();
  5726. }
  5727. callback();
  5728. } else {
  5729. callback();
  5730. }
  5731. }
  5732. });
  5733. incoming.on('finish', function () {
  5734. console.warn('incoming stream finished: end stream');
  5735. mse && mse.readyState === 'open' && mse.endOfStream();
  5736. }); // When an error is sent on the incoming stream, close it.
  5737. incoming.on('error', function () {
  5738. console.error('error on incoming stream: end stream');
  5739. if (sourceBuffer.updating) {
  5740. sourceBuffer.addEventListener('updateend', function () {
  5741. mse.readyState === 'open' && mse.endOfStream();
  5742. });
  5743. } else {
  5744. mse.readyState === 'open' && mse.endOfStream();
  5745. }
  5746. });
  5747. /**
  5748. * Set up outgoing stream.
  5749. */
  5750. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_10__.Readable({
  5751. objectMode: true,
  5752. read: function read() {//
  5753. }
  5754. }); // When an error is sent on the outgoing stream, whine about it.
  5755. outgoing.on('error', function () {
  5756. console.warn('outgoing stream broke somewhere');
  5757. });
  5758. /**
  5759. * initialize the component.
  5760. */
  5761. _this = _super.call(this, incoming, outgoing);
  5762. _defineProperty(_assertThisInitialized(_this), "_videoEl", void 0);
  5763. _defineProperty(_assertThisInitialized(_this), "_done", void 0);
  5764. _defineProperty(_assertThisInitialized(_this), "_lastCheckpointTime", void 0);
  5765. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  5766. _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
  5767. _this._videoEl = el;
  5768. _this._lastCheckpointTime = 0;
  5769. return _this;
  5770. }
  5771. /**
  5772. * Add a new sourceBuffer to the mediaSource and remove old ones.
  5773. * @param {HTMLMediaElement} el The media element holding the media source.
  5774. * @param {MediaSource} mse The media source the buffer should be attached to.
  5775. * @param {String} [mimeType='video/mp4; codecs="avc1.4D0029, mp4a.40.2"'] [description]
  5776. */
  5777. _createClass(MseSink, [{
  5778. key: "addSourceBuffer",
  5779. value: function addSourceBuffer(el, mse, mimeType) {
  5780. var _this2 = this;
  5781. var sourceBuffer = mse.addSourceBuffer(mimeType);
  5782. var trigger = 0;
  5783. var onUpdateEndHandler = function onUpdateEndHandler() {
  5784. ++trigger;
  5785. if (trigger > TRIGGER_THRESHOLD && sourceBuffer.buffered.length) {
  5786. trigger = 0;
  5787. var index = sourceBuffer.buffered.length - 1;
  5788. var start = sourceBuffer.buffered.start(index);
  5789. var end = Math.min(el.currentTime, _this2._lastCheckpointTime) - 10;
  5790. try {
  5791. // remove all material up to 10 seconds before current time
  5792. if (end > start) {
  5793. sourceBuffer.remove(start, end);
  5794. return; // this._done() will be called on the next updateend event!
  5795. }
  5796. } catch (e) {
  5797. console.warn(e);
  5798. }
  5799. }
  5800. _this2._done && _this2._done();
  5801. };
  5802. sourceBuffer.addEventListener('updateend', onUpdateEndHandler);
  5803. return sourceBuffer;
  5804. }
  5805. }, {
  5806. key: "currentTime",
  5807. get: function get() {
  5808. return this._videoEl.currentTime;
  5809. }
  5810. }, {
  5811. key: "play",
  5812. value: function play() {
  5813. return this._videoEl.play();
  5814. }
  5815. }, {
  5816. key: "pause",
  5817. value: function pause() {
  5818. return this._videoEl.pause();
  5819. }
  5820. }]);
  5821. return MseSink;
  5822. }(_component__WEBPACK_IMPORTED_MODULE_9__.Sink);
  5823. /***/ }),
  5824. /***/ "./lib/components/onvifdepay/index.ts":
  5825. /*!********************************************!*\
  5826. !*** ./lib/components/onvifdepay/index.ts ***!
  5827. \********************************************/
  5828. /*! namespace exports */
  5829. /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] */
  5830. /*! other exports [not provided] [no usage info] */
  5831. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5833. "use strict";
  5834. __webpack_require__.r(__webpack_exports__);
  5835. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5836. /* harmony export */ "ONVIFDepay": () => /* binding */ ONVIFDepay
  5837. /* harmony export */ });
  5838. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  5839. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  5840. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  5841. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__);
  5842. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  5843. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_2__);
  5844. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  5845. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  5846. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_4__);
  5847. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  5848. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  5849. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  5850. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5851. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  5852. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  5853. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  5854. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5855. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5856. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5857. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  5858. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5859. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5860. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  5861. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5862. var ONVIFDepay = /*#__PURE__*/function (_Tube) {
  5863. _inherits(ONVIFDepay, _Tube);
  5864. var _super = _createSuper(ONVIFDepay);
  5865. function ONVIFDepay() {
  5866. _classCallCheck(this, ONVIFDepay);
  5867. var XMLPayloadType;
  5868. var packets = [];
  5869. var incoming = new stream__WEBPACK_IMPORTED_MODULE_4__.Transform({
  5870. objectMode: true,
  5871. transform: function transform(msg, encoding, callback) {
  5872. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.SDP) {
  5873. var validMedia;
  5874. var _iterator = _createForOfIteratorHelper(msg.sdp.media),
  5875. _step;
  5876. try {
  5877. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5878. var media = _step.value;
  5879. if (media.type === 'application' && media.rtpmap && media.rtpmap.encodingName === 'VND.ONVIF.METADATA') {
  5880. validMedia = media;
  5881. }
  5882. }
  5883. } catch (err) {
  5884. _iterator.e(err);
  5885. } finally {
  5886. _iterator.f();
  5887. }
  5888. if (validMedia && validMedia.rtpmap) {
  5889. XMLPayloadType = Number(validMedia.rtpmap.payloadType);
  5890. }
  5891. callback(undefined, msg);
  5892. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payloadType)(msg.data) === XMLPayloadType) {
  5893. // Add payload to packet stack
  5894. packets.push((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payload)(msg.data)); // XML over RTP uses the RTP marker bit to indicate end
  5895. // of fragmentation. At this point, the packets can be used
  5896. // to reconstruct an XML packet.
  5897. if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.marker)(msg.data) && packets.length > 0) {
  5898. var xmlMsg = {
  5899. timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.timestamp)(msg.data),
  5900. ntpTimestamp: msg.ntpTimestamp,
  5901. payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payloadType)(msg.data),
  5902. data: Buffer.concat(packets),
  5903. type: _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.XML
  5904. };
  5905. callback(undefined, xmlMsg);
  5906. packets = [];
  5907. return;
  5908. }
  5909. callback();
  5910. } else {
  5911. // Not a message we should handle
  5912. callback(undefined, msg);
  5913. }
  5914. }
  5915. }); // outgoing will be defaulted to a PassThrough stream
  5916. return _super.call(this, incoming);
  5917. }
  5918. return ONVIFDepay;
  5919. }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
  5920. /***/ }),
  5921. /***/ "./lib/components/rtsp-parser/builder.ts":
  5922. /*!***********************************************!*\
  5923. !*** ./lib/components/rtsp-parser/builder.ts ***!
  5924. \***********************************************/
  5925. /*! namespace exports */
  5926. /*! export builder [provided] [no usage info] [missing usage info prevents renaming] */
  5927. /*! other exports [not provided] [no usage info] */
  5928. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5929. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5930. "use strict";
  5931. __webpack_require__.r(__webpack_exports__);
  5932. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5933. /* harmony export */ "builder": () => /* binding */ builder
  5934. /* harmony export */ });
  5935. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  5936. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  5937. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  5938. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__);
  5939. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  5940. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_2__);
  5941. /* harmony import */ var core_js_modules_es_object_entries__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.entries */ "./node_modules/core-js/modules/es.object.entries.js");
  5942. /* harmony import */ var core_js_modules_es_object_entries__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_entries__WEBPACK_IMPORTED_MODULE_3__);
  5943. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  5944. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_4__);
  5945. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  5946. ;
  5947. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  5948. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  5949. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  5950. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  5951. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  5952. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  5953. var DEFAULT_PROTOCOL = 'RTSP/1.0';
  5954. var builder = function builder(msg) {
  5955. if (!msg.method || !msg.uri) {
  5956. throw new Error('message needs to contain a method and a uri');
  5957. }
  5958. var protocol = msg.protocol || DEFAULT_PROTOCOL;
  5959. var headers = msg.headers || {};
  5960. var messageString = ["".concat(msg.method, " ").concat(msg.uri, " ").concat(protocol), Object.entries(headers).map(function (_ref) {
  5961. var _ref2 = _slicedToArray(_ref, 2),
  5962. key = _ref2[0],
  5963. value = _ref2[1];
  5964. return key + ': ' + value;
  5965. }).join('\r\n'), '\r\n'].join('\r\n');
  5966. debug__WEBPACK_IMPORTED_MODULE_4___default()('msl:rtsp:outgoing')(messageString);
  5967. return Buffer.from(messageString);
  5968. };
  5969. /***/ }),
  5970. /***/ "./lib/components/rtsp-parser/index.ts":
  5971. /*!*********************************************!*\
  5972. !*** ./lib/components/rtsp-parser/index.ts ***!
  5973. \*********************************************/
  5974. /*! namespace exports */
  5975. /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] */
  5976. /*! other exports [not provided] [no usage info] */
  5977. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  5978. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  5979. "use strict";
  5980. __webpack_require__.r(__webpack_exports__);
  5981. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5982. /* harmony export */ "RtspParser": () => /* binding */ RtspParser
  5983. /* harmony export */ });
  5984. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  5985. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__);
  5986. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  5987. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_1__);
  5988. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  5989. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  5990. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
  5991. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  5992. /* harmony import */ var _builder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./builder */ "./lib/components/rtsp-parser/builder.ts");
  5993. /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser */ "./lib/components/rtsp-parser/parser.ts");
  5994. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5995. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5996. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5997. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5998. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  5999. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6000. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6001. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  6002. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6003. /**
  6004. * A component that converts raw binary data into RTP/RTSP/RTCP packets on the
  6005. * incoming stream, and converts RTSP commands to raw binary data on the outgoing
  6006. * stream. The component is agnostic of any RTSP session details (you need an
  6007. * RTSP session component in the pipeline).
  6008. * @extends {Component}
  6009. */
  6010. var RtspParser = /*#__PURE__*/function (_Tube) {
  6011. _inherits(RtspParser, _Tube);
  6012. var _super = _createSuper(RtspParser);
  6013. /**
  6014. * Create a new RTSP parser component.
  6015. * @return {undefined}
  6016. */
  6017. function RtspParser() {
  6018. _classCallCheck(this, RtspParser);
  6019. var parser = new _parser__WEBPACK_IMPORTED_MODULE_6__.Parser(); // Incoming stream
  6020. var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  6021. objectMode: true,
  6022. transform: function transform(msg, encoding, callback) {
  6023. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW) {
  6024. try {
  6025. parser.parse(msg.data).forEach(function (message) {
  6026. return incoming.push(message);
  6027. });
  6028. callback();
  6029. } catch (e) {
  6030. callback(e);
  6031. }
  6032. } else {
  6033. // Not a message we should handle
  6034. callback(undefined, msg);
  6035. }
  6036. }
  6037. }); // Outgoing stream
  6038. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
  6039. objectMode: true,
  6040. transform: function transform(msg, encoding, callback) {
  6041. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP) {
  6042. var data = (0,_builder__WEBPACK_IMPORTED_MODULE_5__.builder)(msg);
  6043. callback(undefined, {
  6044. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW,
  6045. data: data
  6046. });
  6047. } else {
  6048. // don't touch other types
  6049. callback(undefined, msg);
  6050. }
  6051. }
  6052. });
  6053. return _super.call(this, incoming, outgoing);
  6054. }
  6055. return RtspParser;
  6056. }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
  6057. /***/ }),
  6058. /***/ "./lib/components/rtsp-parser/parser.ts":
  6059. /*!**********************************************!*\
  6060. !*** ./lib/components/rtsp-parser/parser.ts ***!
  6061. \**********************************************/
  6062. /*! namespace exports */
  6063. /*! export Parser [provided] [no usage info] [missing usage info prevents renaming] */
  6064. /*! other exports [not provided] [no usage info] */
  6065. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  6066. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  6067. "use strict";
  6068. __webpack_require__.r(__webpack_exports__);
  6069. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  6070. /* harmony export */ "Parser": () => /* binding */ Parser
  6071. /* harmony export */ });
  6072. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  6073. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  6074. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  6075. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  6076. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  6077. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__);
  6078. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  6079. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__);
  6080. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  6081. /* harmony import */ var _utils_protocols_sdp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/protocols/sdp */ "./lib/utils/protocols/sdp.ts");
  6082. /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
  6083. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  6084. ;
  6085. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6086. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6087. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6088. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  6089. /**
  6090. * The different possible internal parser states.
  6091. */
  6092. var STATE;
  6093. (function (STATE) {
  6094. STATE[STATE["IDLE"] = 0] = "IDLE";
  6095. STATE[STATE["INTERLEAVED"] = 1] = "INTERLEAVED";
  6096. STATE[STATE["RTSP"] = 2] = "RTSP";
  6097. })(STATE || (STATE = {}));
  6098. var INTERLEAVED_HEADER_BYTES = 4;
  6099. var ASCII_DOLLAR = 0x24;
  6100. /**
  6101. * Extract packet information from the interleaved header
  6102. * (4-byte section before the RTP packet).
  6103. * @param {Array} chunks Buffers constituting the data.
  6104. * @return {Object} Packet information (channel, begin, end).
  6105. */
  6106. var rtpPacketInfo = function rtpPacketInfo(chunks) {
  6107. var header = Buffer.alloc(INTERLEAVED_HEADER_BYTES);
  6108. var i = 0;
  6109. var bytesRead = 0;
  6110. while (bytesRead < header.length) {
  6111. var chunk = chunks[i++];
  6112. var bytesToRead = Math.min(chunk.length, header.length - bytesRead);
  6113. chunk.copy(header, bytesRead, 0, bytesToRead);
  6114. bytesRead += bytesToRead;
  6115. }
  6116. var channel = header[1];
  6117. var begin = header.length;
  6118. var length = header.readUInt16BE(2);
  6119. var end = begin + length;
  6120. return {
  6121. channel: channel,
  6122. begin: begin,
  6123. end: end
  6124. };
  6125. };
  6126. /**
  6127. * Parser class with a public method that takes a data chunk and
  6128. * returns an array of RTP/RTSP/RTCP message objects. The parser
  6129. * keeps track of the added chunks internally in an array and only
  6130. * concatenates chunks when data is needed to construct a message.
  6131. * @type {[type]}
  6132. */
  6133. var Parser = /*#__PURE__*/function () {
  6134. /**
  6135. * Create a new Parser object.
  6136. * @return {undefined}
  6137. */
  6138. function Parser() {
  6139. _classCallCheck(this, Parser);
  6140. _defineProperty(this, "_chunks", []);
  6141. _defineProperty(this, "_length", 0);
  6142. _defineProperty(this, "_state", STATE.IDLE);
  6143. _defineProperty(this, "_packet", void 0);
  6144. this._init();
  6145. }
  6146. /**
  6147. * Initialize the internal properties to their default starting
  6148. * values.
  6149. * @return {undefined}
  6150. */
  6151. _createClass(Parser, [{
  6152. key: "_init",
  6153. value: function _init() {
  6154. this._chunks = [];
  6155. this._length = 0;
  6156. this._state = STATE.IDLE;
  6157. }
  6158. }, {
  6159. key: "_push",
  6160. value: function _push(chunk) {
  6161. this._chunks.push(chunk);
  6162. this._length += chunk.length;
  6163. }
  6164. /**
  6165. * Extract RTSP messages.
  6166. * @return {Array} An array of messages, possibly empty.
  6167. */
  6168. }, {
  6169. key: "_parseRtsp",
  6170. value: function _parseRtsp() {
  6171. var messages = [];
  6172. var buffer = Buffer.concat(this._chunks);
  6173. var chunkBodyOffset = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_6__.bodyOffset)(buffer); // If last added chunk does not have the end of the header, return.
  6174. if (chunkBodyOffset === -1) {
  6175. return messages;
  6176. }
  6177. var rtspHeaderLength = chunkBodyOffset;
  6178. var contentLength = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_6__.extractHeaderValue)(buffer, 'Content-Length');
  6179. if (contentLength && parseInt(contentLength) > buffer.length - rtspHeaderLength) {
  6180. // we do not have the whole body
  6181. return messages;
  6182. }
  6183. this._init(); // resets this._chunks and this._length
  6184. if (rtspHeaderLength === buffer.length || buffer[rtspHeaderLength] === ASCII_DOLLAR) {
  6185. // No body in this chunk, assume there is no body?
  6186. var packet = buffer.slice(0, rtspHeaderLength);
  6187. messages.push({
  6188. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP,
  6189. data: packet
  6190. }); // Add the remaining data to the chunk stack.
  6191. var trailing = buffer.slice(rtspHeaderLength);
  6192. this._push(trailing);
  6193. } else {
  6194. // Body is assumed to be the remaining data of the last chunk.
  6195. var _packet = buffer;
  6196. var body = buffer.slice(rtspHeaderLength);
  6197. messages.push({
  6198. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP,
  6199. data: _packet
  6200. });
  6201. messages.push((0,_utils_protocols_sdp__WEBPACK_IMPORTED_MODULE_5__.messageFromBuffer)(body));
  6202. }
  6203. return messages;
  6204. }
  6205. /**
  6206. * Extract RTP/RTCP messages.
  6207. * @return {Array} An array of messages, possibly empty.
  6208. */
  6209. }, {
  6210. key: "_parseInterleaved",
  6211. value: function _parseInterleaved() {
  6212. var messages = []; // Skip as long as we don't have the first 4 bytes
  6213. if (this._length < INTERLEAVED_HEADER_BYTES) {
  6214. return messages;
  6215. } // Enough bytes to construct the header and extract packet info.
  6216. if (!this._packet) {
  6217. this._packet = rtpPacketInfo(this._chunks);
  6218. } // As long as we don't have enough chunks, skip.
  6219. if (this._length < this._packet.end) {
  6220. return messages;
  6221. } // We have enough data to extract the packet.
  6222. var buffer = Buffer.concat(this._chunks);
  6223. var packet = buffer.slice(this._packet.begin, this._packet.end);
  6224. var header = buffer.slice(0, this._packet.begin);
  6225. var trailing = buffer.slice(this._packet.end);
  6226. var channel = this._packet.channel;
  6227. delete this._packet; // Prepare next bit.
  6228. this._init();
  6229. this._push(trailing); // Extract messages
  6230. if (channel % 2 === 0) {
  6231. // Even channels 0, 2, ...
  6232. messages.push({
  6233. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP,
  6234. data: packet,
  6235. header: header,
  6236. channel: channel
  6237. });
  6238. } else {
  6239. // Odd channels 1, 3, ...
  6240. var rtcpPackets = packet;
  6241. do {
  6242. // RTCP packets can be packed together, unbundle them:
  6243. var rtcpByteSize = rtcpPackets.readUInt16BE(2) * 4 + 4;
  6244. var data = rtcpPackets.slice(0, rtcpByteSize);
  6245. messages.push({
  6246. type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTCP,
  6247. data: data,
  6248. header: header,
  6249. channel: channel
  6250. });
  6251. rtcpPackets = rtcpPackets.slice(rtcpByteSize);
  6252. } while (rtcpPackets.length > 0);
  6253. }
  6254. return messages;
  6255. }
  6256. /**
  6257. * Set the internal state based on the type of the first chunk
  6258. * @param {[type]} chunk [description]
  6259. */
  6260. }, {
  6261. key: "_setState",
  6262. value: function _setState() {
  6263. // Remove leading 0-sized chunks.
  6264. while (this._chunks.length > 0 && this._chunks[0].length === 0) {
  6265. this._chunks.shift();
  6266. }
  6267. var firstChunk = this._chunks[0];
  6268. if (this._chunks.length === 0) {
  6269. this._state = STATE.IDLE;
  6270. } else if (firstChunk[0] === ASCII_DOLLAR) {
  6271. this._state = STATE.INTERLEAVED;
  6272. } else if (firstChunk.toString('ascii', 0, 4) === 'RTSP') {
  6273. this._state = STATE.RTSP;
  6274. } else {
  6275. throw new Error("Unknown chunk of length ".concat(firstChunk.length));
  6276. }
  6277. }
  6278. /**
  6279. * Add the next chunk of data to the parser and extract messages.
  6280. * If no message can be extracted, an empty array is returned, otherwise
  6281. * an array of messages is returned.
  6282. * @param {Buffer} chunk The next piece of data.
  6283. * @return {Array} An array of messages, possibly empty.
  6284. */
  6285. }, {
  6286. key: "parse",
  6287. value: function parse(chunk) {
  6288. this._push(chunk);
  6289. if (this._state === STATE.IDLE) {
  6290. this._setState();
  6291. }
  6292. var messages = [];
  6293. var done = false;
  6294. while (!done) {
  6295. var extracted = [];
  6296. switch (this._state) {
  6297. case STATE.IDLE:
  6298. break;
  6299. case STATE.INTERLEAVED:
  6300. extracted = this._parseInterleaved();
  6301. break;
  6302. case STATE.RTSP:
  6303. extracted = this._parseRtsp();
  6304. break;
  6305. default:
  6306. throw new Error('internal error: unknown state');
  6307. }
  6308. if (extracted.length > 0) {
  6309. messages = messages.concat(extracted);
  6310. } else {
  6311. done = true;
  6312. }
  6313. this._setState();
  6314. }
  6315. return messages;
  6316. }
  6317. }]);
  6318. return Parser;
  6319. }();
  6320. /***/ }),
  6321. /***/ "./lib/components/rtsp-session/index.ts":
  6322. /*!**********************************************!*\
  6323. !*** ./lib/components/rtsp-session/index.ts ***!
  6324. \**********************************************/
  6325. /*! namespace exports */
  6326. /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] */
  6327. /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] */
  6328. /*! other exports [not provided] [no usage info] */
  6329. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  6330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  6331. "use strict";
  6332. __webpack_require__.r(__webpack_exports__);
  6333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  6334. /* harmony export */ "RTSP_METHOD": () => /* binding */ RTSP_METHOD,
  6335. /* harmony export */ "RtspSession": () => /* binding */ RtspSession
  6336. /* harmony export */ });
  6337. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  6338. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  6339. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js");
  6340. /* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__);
  6341. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  6342. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__);
  6343. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  6344. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3__);
  6345. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  6346. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  6347. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  6348. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5__);
  6349. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  6350. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6__);
  6351. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  6352. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_7__);
  6353. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  6354. /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
  6355. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  6356. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  6357. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_11__);
  6358. /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
  6359. /* harmony import */ var _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/protocols/rtcp */ "./lib/utils/protocols/rtcp.ts");
  6360. /* harmony import */ var _utils_protocols_ntp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/protocols/ntp */ "./lib/utils/protocols/ntp.ts");
  6361. /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
  6362. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  6363. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6364. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6365. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6366. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6367. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6368. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6369. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  6370. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6371. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6372. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  6373. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6374. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  6375. function isAbsolute(url) {
  6376. return /^[^:]+:\/\//.test(url);
  6377. }
  6378. var STATE;
  6379. (function (STATE) {
  6380. STATE["IDLE"] = "idle";
  6381. STATE["PLAYING"] = "playing";
  6382. STATE["PAUSED"] = "paused";
  6383. })(STATE || (STATE = {}));
  6384. var RTSP_METHOD;
  6385. (function (RTSP_METHOD) {
  6386. RTSP_METHOD["OPTIONS"] = "OPTIONS";
  6387. RTSP_METHOD["DESCRIBE"] = "DESCRIBE";
  6388. RTSP_METHOD["SETUP"] = "SETUP";
  6389. RTSP_METHOD["PLAY"] = "PLAY";
  6390. RTSP_METHOD["PAUSE"] = "PAUSE";
  6391. RTSP_METHOD["TEARDOWN"] = "TEARDOWN";
  6392. })(RTSP_METHOD || (RTSP_METHOD = {}));
  6393. var MIN_SESSION_TIMEOUT = 5; // minimum timeout for a rtsp session in seconds
  6394. // Default RTSP configuration
  6395. var defaultConfig = function defaultConfig() {
  6396. var hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof window === 'undefined' ? '' : window.location.hostname;
  6397. var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6398. var uri = parameters.length > 0 ? "rtsp://".concat(hostname, "/media/media.amp?").concat(parameters.join('&')) : "rtsp://".concat(hostname, "/media/media.amp");
  6399. return {
  6400. uri: uri
  6401. };
  6402. };
  6403. /**
  6404. * A component that sets up a command queue in order to interact with the RTSP
  6405. * server. Allows control over the RTSP session by listening to incoming messages
  6406. * and sending request on the outgoing stream.
  6407. *
  6408. * The following handlers can be set on the component:
  6409. * - onSdp: will be called when an SDP object is sent with the object as argument
  6410. * - onPlay: will be called when an RTSP PLAY response is sent with the media range
  6411. * as argument. The latter is an array [start, stop], where start is "now"
  6412. * (for live) or a time in seconds, and stop is undefined (for live or
  6413. * ongoing streams) or a time in seconds.
  6414. * @extends {Component}
  6415. */
  6416. var RtspSession = /*#__PURE__*/function (_Tube) {
  6417. _inherits(RtspSession, _Tube);
  6418. var _super = _createSuper(RtspSession);
  6419. /**
  6420. * Create a new RTSP session controller component.
  6421. * @param {Object} [config={}] Details about the session.
  6422. * @param {String} [config.hostname] The RTSP server hostname
  6423. * @param {String[]} [config.parameters] The RTSP URI parameters
  6424. * @param {String} [config.uri] The full RTSP URI (overrides any hostname/parameters)
  6425. * @param {Object} [config.defaultHeaders] Default headers to use (for all methods).
  6426. * @param {Object} [config.headers] Headers to use (mapped to each method).
  6427. * @return {undefined}
  6428. */
  6429. function RtspSession() {
  6430. var _this;
  6431. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6432. _classCallCheck(this, RtspSession);
  6433. var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_9__.merge)(defaultConfig(config.hostname, config.parameters), config),
  6434. uri = _merge.uri,
  6435. headers = _merge.headers,
  6436. defaultHeaders = _merge.defaultHeaders;
  6437. var incoming = new stream__WEBPACK_IMPORTED_MODULE_11__.Transform({
  6438. objectMode: true,
  6439. transform: function transform(msg, encoding, callback) {
  6440. if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTSP) {
  6441. _this._onRtsp(msg);
  6442. callback(); // Consumes the RTSP packages
  6443. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTCP) {
  6444. _this._onRtcp(msg);
  6445. callback(undefined, msg);
  6446. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTP) {
  6447. _this._onRtp(msg);
  6448. callback(undefined, msg);
  6449. } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.SDP) {
  6450. var sdpmedia = [];
  6451. for (var i = 0; i < msg.sdp.media.length; i++) {
  6452. if ((msg.sdp.media[i].recvonly && msg.sdp.media[i].recvonly === true) ||
  6453. (msg.sdp.media[i].control.indexOf('trackID=') != -1)) { // truen old rtsp
  6454. sdpmedia.push(msg.sdp.media[i]);
  6455. } else {
  6456. if (msg.sdp.media[i].control.indexOf("audioback") != -1 || msg.sdp.media[i].control.indexOf("backchannel") != -1) {
  6457. _this.audioback_chnl = i * 2;
  6458. _this.audioback_control = msg.sdp.media[i].control;
  6459. }
  6460. }
  6461. }
  6462. delete msg.sdp.media;
  6463. msg.sdp.media = sdpmedia;
  6464. _this._onSdp(msg); // Execute externally registered SDP handler
  6465. msg.sdp.rawdata = msg.data;
  6466. _this.onSdp && _this.onSdp(msg.sdp); // Pass SDP forward
  6467. callback(undefined, msg);
  6468. } else {
  6469. // Not a message we should handle
  6470. callback(undefined, msg);
  6471. }
  6472. }
  6473. });
  6474. incoming.on('end', function () {
  6475. // Incoming was ended, assume that outgoing is closed as well
  6476. _this._outgoingClosed = true;
  6477. });
  6478. _this = _super.call(this, incoming);
  6479. _defineProperty(_assertThisInitialized(_this), "uri", void 0);
  6480. _defineProperty(_assertThisInitialized(_this), "headers", void 0);
  6481. _defineProperty(_assertThisInitialized(_this), "defaultHeaders", void 0);
  6482. _defineProperty(_assertThisInitialized(_this), "t0", void 0);
  6483. _defineProperty(_assertThisInitialized(_this), "n0", void 0);
  6484. _defineProperty(_assertThisInitialized(_this), "clockrates", void 0);
  6485. _defineProperty(_assertThisInitialized(_this), "startTime", void 0);
  6486. _defineProperty(_assertThisInitialized(_this), "onSdp", void 0);
  6487. _defineProperty(_assertThisInitialized(_this), "onError", void 0);
  6488. _defineProperty(_assertThisInitialized(_this), "onPlay", void 0);
  6489. _defineProperty(_assertThisInitialized(_this), "_outgoingClosed", void 0);
  6490. _defineProperty(_assertThisInitialized(_this), "_sequence", void 0);
  6491. _defineProperty(_assertThisInitialized(_this), "_retry", void 0);
  6492. _defineProperty(_assertThisInitialized(_this), "_callStack", void 0);
  6493. _defineProperty(_assertThisInitialized(_this), "_callHistory", void 0);
  6494. _defineProperty(_assertThisInitialized(_this), "_state", void 0);
  6495. _defineProperty(_assertThisInitialized(_this), "_waiting", void 0);
  6496. _defineProperty(_assertThisInitialized(_this), "_contentBase", void 0);
  6497. _defineProperty(_assertThisInitialized(_this), "_sessionId", void 0);
  6498. _defineProperty(_assertThisInitialized(_this), "_renewSessionInterval", void 0);
  6499. _this._outgoingClosed = false;
  6500. _this._reset();
  6501. _this.update(uri, headers, defaultHeaders);
  6502. return _this;
  6503. }
  6504. /**
  6505. * Update the cached RTSP uri and headers.
  6506. * @param {String} uri The RTSP URI.
  6507. * @param {Object} headers Maps commands to headers.
  6508. * @param {Object} [defaultHeaders={}] Default headers.
  6509. * @return {[type]} [description]
  6510. */
  6511. _createClass(RtspSession, [{
  6512. key: "update",
  6513. value: function update(uri) {
  6514. var _Object$assign;
  6515. var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6516. var defaultHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  6517. if (uri === undefined) {
  6518. throw new Error('You must supply an uri when creating a RtspSessionComponent');
  6519. }
  6520. this.uri = uri;
  6521. this.defaultHeaders = defaultHeaders;
  6522. this.headers = Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, RTSP_METHOD.OPTIONS, {}), _defineProperty(_Object$assign, RTSP_METHOD.PLAY, {
  6523. Require: 'www.onvif.org/ver20/backchannel'
  6524. }), _defineProperty(_Object$assign, RTSP_METHOD.SETUP, {
  6525. Blocksize: '64000',
  6526. Require: 'www.onvif.org/ver20/backchannel'
  6527. }), _defineProperty(_Object$assign, RTSP_METHOD.DESCRIBE, {
  6528. Accept: 'application/sdp',
  6529. Require: 'www.onvif.org/ver20/backchannel'
  6530. }), _defineProperty(_Object$assign, RTSP_METHOD.PAUSE, {}), _Object$assign), headers);
  6531. }
  6532. /**
  6533. * Restore the initial values to the state they were in before any RTSP
  6534. * connection was made.
  6535. */
  6536. }, {
  6537. key: "_reset",
  6538. value: function _reset() {
  6539. this._sequence = 1;
  6540. this._retry = function () {
  6541. return console.error("No request sent, can't retry");
  6542. };
  6543. this._callStack = [];
  6544. this._callHistory = [];
  6545. this._state = STATE.IDLE;
  6546. this._waiting = false;
  6547. this._contentBase = null;
  6548. this._sessionId = null;
  6549. if (this._renewSessionInterval !== null) {
  6550. clearInterval(this._renewSessionInterval);
  6551. }
  6552. this._renewSessionInterval = null;
  6553. this.t0 = undefined;
  6554. this.n0 = undefined;
  6555. this.clockrates = undefined;
  6556. }
  6557. /**
  6558. * Handles incoming RTSP messages and send the next command in the queue.
  6559. * @param {Object} msg An incoming RTSP message.
  6560. * @return {undefined}
  6561. */
  6562. }, {
  6563. key: "_onRtsp",
  6564. value: function _onRtsp(msg) {
  6565. var _this2 = this;
  6566. this._waiting = false;
  6567. var status = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.statusCode)(msg.data);
  6568. var ended = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.connectionEnded)(msg.data);
  6569. var seq = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sequence)(msg.data);
  6570. if (seq === null) {
  6571. throw new Error('rtsp: expected sequence number');
  6572. }
  6573. if (this._callHistory === undefined) {
  6574. throw new Error('rtsp: internal error');
  6575. }
  6576. var method = this._callHistory[seq - 1];
  6577. debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:incoming')("".concat(msg.data));
  6578. if (!this._sessionId && !ended) {
  6579. // Response on first SETUP
  6580. this._sessionId = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sessionId)(msg.data);
  6581. var _sessionTimeout = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sessionTimeout)(msg.data);
  6582. if (_sessionTimeout !== null) {
  6583. // The server specified that sessions will timeout if not renewed.
  6584. // In order to keep it alive we need periodically send a RTSP_OPTIONS message
  6585. if (this._renewSessionInterval !== null) {
  6586. clearInterval(this._renewSessionInterval);
  6587. }
  6588. this._renewSessionInterval = setInterval(function () {
  6589. _this2._enqueue({
  6590. method: RTSP_METHOD.OPTIONS
  6591. });
  6592. _this2._dequeue();
  6593. }, Math.max(MIN_SESSION_TIMEOUT, _sessionTimeout - 5) * 1000);
  6594. }
  6595. }
  6596. if (!this._contentBase) {
  6597. this._contentBase = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.contentBase)(msg.data);
  6598. }
  6599. if (status >= 400) {
  6600. // TODO: Retry in certain cases?
  6601. this.onError && this.onError(new Error(msg.data.toString('ascii')));
  6602. }
  6603. if (method === RTSP_METHOD.PLAY) {
  6604. // When starting to play, send the actual range to an external handler.
  6605. this.onPlay && this.onPlay((0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.range)(msg.data));
  6606. }
  6607. if (ended) {
  6608. debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:incoming')("RTSP Session ".concat(this._sessionId, " ended with statusCode: ").concat(status));
  6609. this._sessionId = null;
  6610. }
  6611. this._dequeue();
  6612. }
  6613. }, {
  6614. key: "_onRtcp",
  6615. value: function _onRtcp(msg) {
  6616. if (this.t0 === undefined || this.n0 === undefined) {
  6617. throw new Error('rtsp: internal error');
  6618. }
  6619. if ((0,_utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.packetType)(msg.data) === _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.packetType) {
  6620. var rtpChannel = msg.channel - 1;
  6621. this.t0[rtpChannel] = _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.rtpTimestamp(msg.data);
  6622. this.n0[rtpChannel] = (0,_utils_protocols_ntp__WEBPACK_IMPORTED_MODULE_14__.getTime)(_utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.ntpMost(msg.data), _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.ntpLeast(msg.data));
  6623. }
  6624. }
  6625. }, {
  6626. key: "_onRtp",
  6627. value: function _onRtp(msg) {
  6628. if (this.t0 === undefined || this.n0 === undefined || this.clockrates === undefined) {
  6629. throw new Error('rtsp: internal error');
  6630. }
  6631. var rtpChannel = msg.channel;
  6632. var t0 = this.t0[rtpChannel];
  6633. var n0 = this.n0[rtpChannel];
  6634. if (typeof t0 !== 'undefined' && typeof n0 !== 'undefined') {
  6635. var clockrate = this.clockrates[rtpChannel];
  6636. var t = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_15__.timestamp)(msg.data); // The RTP timestamps are unsigned 32 bit and will overflow
  6637. // at some point. We can guard against the overflow by ORing with 0,
  6638. // which will bring any difference back into signed 32-bit domain.
  6639. var dt = t - t0 | 0;
  6640. msg.ntpTimestamp = dt / clockrate * 1000 + n0;
  6641. }
  6642. }
  6643. /**
  6644. * Handles incoming SDP messages, reply with SETUP and optionally PLAY.
  6645. * @param {Object} msg An incoming SDP message.
  6646. * @return {undefined}
  6647. */
  6648. }, {
  6649. key: "_onSdp",
  6650. value: function _onSdp(msg) {
  6651. var _this3 = this;
  6652. this.n0 = {};
  6653. this.t0 = {};
  6654. this.clockrates = {};
  6655. msg.sdp.media.forEach(function (media, index) {
  6656. var uri = media.control; // We should actually be able to handle
  6657. // non-dynamic payload types, but ignored for now.
  6658. if (media.rtpmap === undefined) {
  6659. //return
  6660. if (media.fmt == 0) {
  6661. //PCMU
  6662. media.rtpmap = {
  6663. clockrate: 8000,
  6664. encodingName: "PCMU",
  6665. payloadType: 0
  6666. };
  6667. }
  6668. }
  6669. var clockrate = media.rtpmap.clockrate;
  6670. var rtp = index * 2;
  6671. var rtcp = rtp + 1; // TODO: investigate if we can make sure this is defined
  6672. if (uri === undefined) {
  6673. return;
  6674. }
  6675. if (!isAbsolute(uri)) {
  6676. uri = _this3._contentBase + uri;
  6677. }
  6678. if (uri.indexOf("audioback") != -1) {
  6679. _this3.audioback_chnl = rtp;
  6680. }
  6681. _this3._enqueue({
  6682. method: RTSP_METHOD.SETUP,
  6683. headers: {
  6684. Transport: 'RTP/AVP/TCP;unicast;interleaved=' + rtp + '-' + rtcp
  6685. },
  6686. uri: uri
  6687. }); // TODO: see if we can get rid of this check somehow
  6688. if (_this3.clockrates === undefined) {
  6689. return;
  6690. }
  6691. _this3.clockrates[rtp] = clockrate;
  6692. });
  6693. if (this.audioback_chnl) {
  6694. var uri = this.audioback_control;
  6695. console.log("audioback_chnl = ", this.audioback_chnl);
  6696. if (!isAbsolute(uri)) {
  6697. uri = this._contentBase + uri;
  6698. }
  6699. this._enqueue({
  6700. method: RTSP_METHOD.SETUP,
  6701. headers: {
  6702. Transport: 'RTP/AVP/TCP;unicast;interleaved=' + this.audioback_chnl + '-' + (this.audioback_chnl + 1)
  6703. },
  6704. uri: uri
  6705. });
  6706. }
  6707. if (this._state === STATE.PLAYING) {
  6708. this._enqueue({
  6709. method: RTSP_METHOD.PLAY,
  6710. headers: {
  6711. Range: "npt=".concat(this.startTime || 0, "-")
  6712. }
  6713. });
  6714. }
  6715. this._dequeue();
  6716. }
  6717. /**
  6718. * Set up command queue in order to start playing, i.e. PLAY optionally
  6719. * preceeded by OPTIONS/DESCRIBE commands. If not waiting, immediately
  6720. * start sending.
  6721. * @param {Number} startTime Time (seconds) at which to start playing
  6722. * @return {undefined}
  6723. */
  6724. }, {
  6725. key: "play",
  6726. value: function play() {
  6727. var startTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  6728. if (this._state === STATE.IDLE) {
  6729. this.startTime = Number(startTime) || 0;
  6730. this._enqueue({
  6731. method: RTSP_METHOD.OPTIONS
  6732. });
  6733. this._enqueue({
  6734. method: RTSP_METHOD.DESCRIBE
  6735. });
  6736. } else if (this._state === STATE.PAUSED) {
  6737. if (this._sessionId === null || this._sessionId === undefined) {
  6738. throw new Error('rtsp: internal error');
  6739. }
  6740. this._enqueue({
  6741. method: RTSP_METHOD.PLAY,
  6742. headers: {
  6743. Session: this._sessionId
  6744. }
  6745. });
  6746. }
  6747. this._state = STATE.PLAYING;
  6748. this._dequeue();
  6749. }
  6750. /**
  6751. * Queue a pause command, and send if not waiting.
  6752. * @return {undefined}
  6753. */
  6754. }, {
  6755. key: "pause",
  6756. value: function pause() {
  6757. this._enqueue({
  6758. method: RTSP_METHOD.PAUSE
  6759. });
  6760. this._state = STATE.PAUSED;
  6761. this._dequeue();
  6762. }
  6763. /**
  6764. * End the session if there is one, otherwise just cancel
  6765. * any outstanding calls on the stack.
  6766. * @return {undefined}
  6767. */
  6768. }, {
  6769. key: "stop",
  6770. value: function stop() {
  6771. if (this._sessionId) {
  6772. this._enqueue({
  6773. method: RTSP_METHOD.TEARDOWN
  6774. });
  6775. } else {
  6776. this._callStack = [];
  6777. }
  6778. this._state = STATE.IDLE;
  6779. if (this._renewSessionInterval !== null) {
  6780. clearInterval(this._renewSessionInterval);
  6781. this._renewSessionInterval = null;
  6782. }
  6783. this._dequeue();
  6784. }
  6785. /**
  6786. * Pushes an RTSP request onto the outgoing stream.
  6787. * @param {Object} options The details about the command to send.
  6788. * @return {undefined}
  6789. */
  6790. }, {
  6791. key: "send",
  6792. value: function send(cmd) {
  6793. var method = cmd.method,
  6794. headers = cmd.headers,
  6795. uri = cmd.uri;
  6796. if (method === undefined) {
  6797. throw new Error('missing method when send request');
  6798. }
  6799. this._waiting = true;
  6800. this._retry = this.send.bind(this, cmd);
  6801. if (this._sequence === undefined || this.headers === undefined || this._callHistory === undefined) {
  6802. throw new Error('rtsp: internal error');
  6803. }
  6804. var message = Object.assign({
  6805. type: _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTSP,
  6806. uri: uri || this.uri,
  6807. data: Buffer.alloc(0) // data is a mandatory field. Not used by session -> parser messages.
  6808. }, {
  6809. method: method,
  6810. headers: headers
  6811. }, {
  6812. headers: Object.assign({
  6813. CSeq: this._sequence++
  6814. }, this.defaultHeaders, // default headers (for all methods)
  6815. this.headers[method], // preset headers for this method
  6816. headers // headers that came with the invokation
  6817. )
  6818. });
  6819. this._sessionId && (message.headers.Session = this._sessionId);
  6820. this._callHistory.push(method);
  6821. if (!this._outgoingClosed) {
  6822. this.outgoing.push(message);
  6823. } else {
  6824. // If the socket is closed, dont attempt to send any data
  6825. debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:outgoing')("Unable to send ".concat(method, ", connection closed"));
  6826. }
  6827. }
  6828. /**
  6829. * Push one or more commands onto the call stack.
  6830. * @param {...Object} commands One or more commands.
  6831. * @return {undefined}
  6832. */
  6833. }, {
  6834. key: "_enqueue",
  6835. value: function _enqueue(cmd) {
  6836. if (this._callStack === undefined) {
  6837. throw new Error('rtsp: internal error');
  6838. }
  6839. this._callStack.push(cmd);
  6840. }
  6841. /**
  6842. * If possible, send the next command on the call stack.
  6843. * @return {undefined}
  6844. */
  6845. }, {
  6846. key: "_dequeue",
  6847. value: function _dequeue() {
  6848. if (this._callStack === undefined) {
  6849. throw new Error('rtsp: internal error');
  6850. }
  6851. if (!this._waiting && this._callStack.length > 0) {
  6852. var cmd = this._callStack.shift();
  6853. if (cmd !== undefined) {
  6854. this.send(cmd);
  6855. }
  6856. }
  6857. }
  6858. }]);
  6859. return RtspSession;
  6860. }(_component__WEBPACK_IMPORTED_MODULE_8__.Tube);
  6861. /***/ }),
  6862. /***/ "./lib/components/ws-source/index.ts":
  6863. /*!*******************************************!*\
  6864. !*** ./lib/components/ws-source/index.ts ***!
  6865. \*******************************************/
  6866. /*! namespace exports */
  6867. /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] */
  6868. /*! other exports [not provided] [no usage info] */
  6869. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  6870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  6871. "use strict";
  6872. __webpack_require__.r(__webpack_exports__);
  6873. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  6874. /* harmony export */ "WSSource": () => /* binding */ WSSource
  6875. /* harmony export */ });
  6876. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
  6877. /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);
  6878. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
  6879. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
  6880. /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_2__);
  6881. /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
  6882. /* harmony import */ var _openwebsocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./openwebsocket */ "./lib/components/ws-source/openwebsocket.ts");
  6883. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  6884. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6885. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6886. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6887. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6888. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6889. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6890. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  6891. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6892. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6893. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  6894. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6895. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  6896. // Named status codes for CloseEvent, see:
  6897. // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
  6898. var CLOSE_GOING_AWAY = 1001;
  6899. var WSSource = /*#__PURE__*/function (_Source) {
  6900. _inherits(WSSource, _Source);
  6901. var _super = _createSuper(WSSource);
  6902. /**
  6903. * Create a WebSocket component.
  6904. *
  6905. * The constructor sets up two streams and connects them to the socket as
  6906. * soon as the socket is available (and open).
  6907. *
  6908. * @param {Object} socket - an open WebSocket.
  6909. */
  6910. function WSSource(socket) {
  6911. var _this;
  6912. _classCallCheck(this, WSSource);
  6913. if (socket === undefined) {
  6914. throw new Error('socket argument missing');
  6915. }
  6916. /**
  6917. * Set up an incoming stream and attach it to the socket.
  6918. * @type {Readable}
  6919. */
  6920. var incoming = new stream__WEBPACK_IMPORTED_MODULE_2__.Readable({
  6921. objectMode: true,
  6922. read: function read() {//
  6923. }
  6924. });
  6925. socket.onmessage = function (msg) {
  6926. var buffer = Buffer.from(msg.data);
  6927. if (!incoming.push({
  6928. data: buffer,
  6929. type: _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RAW
  6930. })) {
  6931. // Something happened down stream that it is no longer processing the
  6932. // incoming data, and the stream buffer got full. In this case it is
  6933. // best to just close the socket instead of throwing away data in the
  6934. // hope that the situation will get resolved.
  6935. if (socket.readyState === WebSocket.OPEN) {
  6936. debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:incoming')('downstream frozen');
  6937. socket.close();
  6938. }
  6939. }
  6940. }; // When an error is sent on the incoming stream, close the socket.
  6941. incoming.on('error', function (e) {
  6942. console.warn('closing socket due to incoming error', e);
  6943. socket.close();
  6944. });
  6945. /**
  6946. * Set up outgoing stream and attach it to the socket.
  6947. * @type {Writable}
  6948. */
  6949. var outgoing = new stream__WEBPACK_IMPORTED_MODULE_2__.Writable({
  6950. objectMode: true,
  6951. write: function write(msg, encoding, callback) {
  6952. try {
  6953. socket.send(msg.data);
  6954. } catch (e) {
  6955. console.warn('message lost during send:', msg);
  6956. }
  6957. callback();
  6958. }
  6959. }); // When an error happens on the outgoing stream, just warn.
  6960. outgoing.on('error', function (e) {
  6961. console.warn('error during websocket send, ignoring:', e);
  6962. }); // When there is no more data going to be written, close!
  6963. outgoing.on('finish', function () {
  6964. debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:outgoing')('finish');
  6965. if (socket.readyState !== WebSocket.CLOSED) {
  6966. socket.close();
  6967. }
  6968. });
  6969. /**
  6970. * Handler for when WebSocket is CLOSED
  6971. * @param {CloseEvent} e The event associated with a close
  6972. * @param {Number} e.code The status code sent by the server
  6973. * Possible codes are documented here:
  6974. * https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
  6975. * @return {undefined}
  6976. */
  6977. socket.onclose = function (e) {
  6978. debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:close')("".concat(e.code));
  6979. if (e.code === CLOSE_GOING_AWAY) {
  6980. _this.onServerClose && _this.onServerClose();
  6981. } // Terminate the streams.
  6982. incoming.push(null);
  6983. outgoing.end();
  6984. };
  6985. /**
  6986. * initialize the component.
  6987. */
  6988. _this = _super.call(this, incoming, outgoing);
  6989. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  6990. return _this;
  6991. }
  6992. /**
  6993. * Expose websocket opener as a class method that returns a promise which
  6994. * resolves with a new WebSocketComponent.
  6995. */
  6996. _createClass(WSSource, null, [{
  6997. key: "open",
  6998. value: function open(config) {
  6999. return (0,_openwebsocket__WEBPACK_IMPORTED_MODULE_4__.openWebSocket)(config).then(function (socket) {
  7000. return new WSSource(socket);
  7001. });
  7002. }
  7003. }]);
  7004. return WSSource;
  7005. }(_component__WEBPACK_IMPORTED_MODULE_1__.Source);
  7006. /***/ }),
  7007. /***/ "./lib/components/ws-source/openwebsocket.ts":
  7008. /*!***************************************************!*\
  7009. !*** ./lib/components/ws-source/openwebsocket.ts ***!
  7010. \***************************************************/
  7011. /*! namespace exports */
  7012. /*! export openWebSocket [provided] [no usage info] [missing usage info prevents renaming] */
  7013. /*! other exports [not provided] [no usage info] */
  7014. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7015. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7016. "use strict";
  7017. __webpack_require__.r(__webpack_exports__);
  7018. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7019. /* harmony export */ "openWebSocket": () => /* binding */ openWebSocket
  7020. /* harmony export */ });
  7021. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js");
  7022. /* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__);
  7023. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  7024. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_1__);
  7025. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/core-js/modules/es.promise.js");
  7026. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_2__);
  7027. /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
  7028. ;
  7029. // Time in milliseconds we want to wait for a websocket to open
  7030. var WEBSOCKET_TIMEOUT = 10007;
  7031. // Default configuration
  7032. var defaultConfig = function defaultConfig() {
  7033. var host = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.host;
  7034. var scheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.protocol;
  7035. var wsScheme = scheme === 'https:' ? 'wss:' : 'ws:';
  7036. return {
  7037. uri: "".concat(wsScheme, "//").concat(host, "/rtsp-over-websocket"),
  7038. tokenUri: "".concat(scheme, "//").concat(host, "/cgi/rtspwssession.cgi"),
  7039. protocol: 'binary',
  7040. timeout: WEBSOCKET_TIMEOUT
  7041. };
  7042. };
  7043. /**
  7044. * Open a new WebSocket, fallback to token-auth on failure and retry.
  7045. * @param {Object} [config={}] WebSocket configuration.
  7046. * @param {String} [config.host] Specify different host
  7047. * @param {String} [config.sheme] Specify different scheme.
  7048. * @param {String} [config.uri] Full uri for websocket connection
  7049. * @param {String} [config.tokenUri] Full uri for token API
  7050. * @param {String} [config.protocol] Websocket protocol
  7051. * @param {Number} [config.timeout] Websocket connection timeout
  7052. * @return {Promise} Resolves with WebSocket, rejects with error.
  7053. */
  7054. var openWebSocket = function openWebSocket() {
  7055. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7056. var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_3__.merge)(defaultConfig(config.host, config.scheme), config),
  7057. uri = _merge.uri,
  7058. tokenUri = _merge.tokenUri,
  7059. protocol = _merge.protocol,
  7060. timeout = _merge.timeout;
  7061. if (uri === undefined) {
  7062. throw new Error('ws: internal error');
  7063. }
  7064. return new Promise(function (resolve, reject) {
  7065. try {
  7066. var ws = new WebSocket(uri, protocol);
  7067. var countdown = setTimeout(function () {
  7068. clearTimeout(countdown);
  7069. if (ws.readyState === WebSocket.CONNECTING) {
  7070. ws.onerror = null;
  7071. reject(new Error('websocket connection timed out'));
  7072. }
  7073. }, timeout);
  7074. ws.binaryType = 'arraybuffer';
  7075. ws.onerror = function (originalError) {
  7076. console.error(originalError);
  7077. /*
  7078. clearTimeout(countdown)
  7079. // try fetching an authentication token
  7080. function onLoadToken(this: XMLHttpRequest) {
  7081. if (this.status >= 400) {
  7082. console.warn('failed to load token', this.status, this.responseText)
  7083. reject(originalError)
  7084. return
  7085. }
  7086. const token = this.responseText.trim()
  7087. // We have a token! attempt to open a WebSocket again.
  7088. const newUri = `${uri}?rtspwssession=${token}`
  7089. const ws2 = new WebSocket(newUri, protocol)
  7090. ws2.binaryType = 'arraybuffer'
  7091. ws2.onerror = (err) => {
  7092. reject(err)
  7093. }
  7094. ws2.onopen = () => resolve(ws2)
  7095. }
  7096. const request = new XMLHttpRequest()
  7097. request.addEventListener('load', onLoadToken)
  7098. request.addEventListener('error', (err) => {
  7099. console.warn('failed to get token')
  7100. reject(err)
  7101. })
  7102. request.addEventListener('abort', () => reject(originalError))
  7103. request.open('GET', `${tokenUri}?${Date.now()}`)
  7104. try {
  7105. request.send()
  7106. } catch (error) {
  7107. reject(originalError)
  7108. }
  7109. */
  7110. };
  7111. ws.onopen = function () {
  7112. clearTimeout(countdown);
  7113. resolve(ws);
  7114. };
  7115. } catch (e) {
  7116. reject(e);
  7117. }
  7118. });
  7119. };
  7120. /***/ }),
  7121. /***/ "./lib/index.browser.ts":
  7122. /*!******************************!*\
  7123. !*** ./lib/index.browser.ts ***!
  7124. \******************************/
  7125. /*! namespace exports */
  7126. /*! export AACDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
  7127. /*! export BasicDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
  7128. /*! export CanvasSink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
  7129. /*! export H264Depay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
  7130. /*! export HTTPTunnelSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
  7131. /*! export Html5CanvasPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
  7132. /*! export Html5VideoMetadataPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
  7133. /*! export Html5VideoPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
  7134. /*! export Html5VideoPipeline_HTTP [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
  7135. /*! export HttpMsePipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
  7136. /*! export HttpSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
  7137. /*! export Inspector [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
  7138. /*! export JPEGDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
  7139. /*! export MessageType [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/message.ts .MessageType */
  7140. /*! export MetadataPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
  7141. /*! export Mp4Capture [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
  7142. /*! export Mp4Muxer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
  7143. /*! export MseSink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
  7144. /*! export ONVIFDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
  7145. /*! export Pipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
  7146. /*! export RTSP_METHOD [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
  7147. /*! export RtspMjpegPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
  7148. /*! export RtspMp4Pipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
  7149. /*! export RtspParser [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
  7150. /*! export RtspPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
  7151. /*! export RtspSession [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
  7152. /*! export Scheduler [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
  7153. /*! export Sink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Sink */
  7154. /*! export Source [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Source */
  7155. /*! export Tube [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Tube */
  7156. /*! export WSSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
  7157. /*! export WsSdpPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
  7158. /*! export base64ArrayBuffer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
  7159. /*! export bodyOffset [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
  7160. /*! export cSrc [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
  7161. /*! export cSrcCount [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
  7162. /*! export components [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/index.browser.ts */
  7163. /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
  7164. /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
  7165. /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
  7166. /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
  7167. /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
  7168. /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
  7169. /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
  7170. /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
  7171. /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/message.ts .MessageType */
  7172. /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
  7173. /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
  7174. /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
  7175. /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
  7176. /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
  7177. /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
  7178. /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
  7179. /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Sink */
  7180. /*! export Source [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Source */
  7181. /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Tube */
  7182. /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
  7183. /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
  7184. /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
  7185. /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
  7186. /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
  7187. /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
  7188. /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
  7189. /*! other exports [not provided] [no usage info] */
  7190. /*! export connectionEnded [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
  7191. /*! export contentBase [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
  7192. /*! export createTransform [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
  7193. /*! export dataCatcherDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
  7194. /*! export extHeader [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
  7195. /*! export extHeaderLength [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
  7196. /*! export extension [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
  7197. /*! export extractHeaderValue [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
  7198. /*! export extractURIs [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
  7199. /*! export g711toPCM [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
  7200. /*! export getTime [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
  7201. /*! export init_connection [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
  7202. /*! export marker [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
  7203. /*! export messageFromBuffer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
  7204. /*! export padding [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
  7205. /*! export parse [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
  7206. /*! export payload [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
  7207. /*! export payloadType [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
  7208. /*! export pipelines [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/index.browser.ts */
  7209. /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
  7210. /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
  7211. /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
  7212. /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
  7213. /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
  7214. /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
  7215. /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
  7216. /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
  7217. /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
  7218. /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
  7219. /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
  7220. /*! other exports [not provided] [no usage info] */
  7221. /*! export range [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
  7222. /*! export sSrc [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
  7223. /*! export send_command [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
  7224. /*! export sequence [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
  7225. /*! export sequenceNumber [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
  7226. /*! export sessionId [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
  7227. /*! export sessionTimeout [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
  7228. /*! export statusCode [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
  7229. /*! export timestamp [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
  7230. /*! export utils [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/index.browser.ts */
  7231. /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
  7232. /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
  7233. /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
  7234. /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
  7235. /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
  7236. /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
  7237. /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
  7238. /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
  7239. /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
  7240. /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
  7241. /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
  7242. /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
  7243. /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
  7244. /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
  7245. /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
  7246. /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
  7247. /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
  7248. /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
  7249. /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
  7250. /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
  7251. /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
  7252. /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
  7253. /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
  7254. /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
  7255. /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
  7256. /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
  7257. /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
  7258. /*! other exports [not provided] [no usage info] */
  7259. /*! export version [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
  7260. /*! other exports [not provided] [maybe used in main (runtime-defined)] */
  7261. /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
  7262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7263. "use strict";
  7264. __webpack_require__.r(__webpack_exports__);
  7265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7266. /* harmony export */ "components": () => /* reexport module object */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__,
  7267. /* harmony export */ "pipelines": () => /* reexport module object */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__,
  7268. /* harmony export */ "utils": () => /* reexport module object */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__,
  7269. /* harmony export */ "AACDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.AACDepay,
  7270. /* harmony export */ "BasicDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.BasicDepay,
  7271. /* harmony export */ "CanvasSink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.CanvasSink,
  7272. /* harmony export */ "H264Depay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.H264Depay,
  7273. /* harmony export */ "HTTPTunnelSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.HTTPTunnelSource,
  7274. /* harmony export */ "HttpSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.HttpSource,
  7275. /* harmony export */ "Inspector": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Inspector,
  7276. /* harmony export */ "JPEGDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.JPEGDepay,
  7277. /* harmony export */ "MessageType": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.MessageType,
  7278. /* harmony export */ "Mp4Capture": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Mp4Capture,
  7279. /* harmony export */ "Mp4Muxer": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Mp4Muxer,
  7280. /* harmony export */ "MseSink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.MseSink,
  7281. /* harmony export */ "ONVIFDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.ONVIFDepay,
  7282. /* harmony export */ "RTSP_METHOD": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RTSP_METHOD,
  7283. /* harmony export */ "RtspParser": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RtspParser,
  7284. /* harmony export */ "RtspSession": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RtspSession,
  7285. /* harmony export */ "Sink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Sink,
  7286. /* harmony export */ "Source": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Source,
  7287. /* harmony export */ "Tube": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Tube,
  7288. /* harmony export */ "WSSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.WSSource,
  7289. /* harmony export */ "base64ArrayBuffer": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.base64ArrayBuffer,
  7290. /* harmony export */ "createTransform": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.createTransform,
  7291. /* harmony export */ "dataCatcherDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.dataCatcherDepay,
  7292. /* harmony export */ "g711toPCM": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.g711toPCM,
  7293. /* harmony export */ "init_connection": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.init_connection,
  7294. /* harmony export */ "send_command": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.send_command,
  7295. /* harmony export */ "Html5CanvasPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5CanvasPipeline,
  7296. /* harmony export */ "Html5VideoMetadataPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoMetadataPipeline,
  7297. /* harmony export */ "Html5VideoPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline,
  7298. /* harmony export */ "Html5VideoPipeline_HTTP": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline_HTTP,
  7299. /* harmony export */ "HttpMsePipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.HttpMsePipeline,
  7300. /* harmony export */ "MetadataPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.MetadataPipeline,
  7301. /* harmony export */ "Pipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Pipeline,
  7302. /* harmony export */ "RtspMjpegPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspMjpegPipeline,
  7303. /* harmony export */ "RtspMp4Pipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspMp4Pipeline,
  7304. /* harmony export */ "RtspPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline,
  7305. /* harmony export */ "WsSdpPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.WsSdpPipeline,
  7306. /* harmony export */ "Scheduler": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.Scheduler,
  7307. /* harmony export */ "bodyOffset": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.bodyOffset,
  7308. /* harmony export */ "cSrc": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.cSrc,
  7309. /* harmony export */ "cSrcCount": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.cSrcCount,
  7310. /* harmony export */ "connectionEnded": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.connectionEnded,
  7311. /* harmony export */ "contentBase": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.contentBase,
  7312. /* harmony export */ "extHeader": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extHeader,
  7313. /* harmony export */ "extHeaderLength": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extHeaderLength,
  7314. /* harmony export */ "extension": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extension,
  7315. /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extractHeaderValue,
  7316. /* harmony export */ "extractURIs": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extractURIs,
  7317. /* harmony export */ "getTime": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.getTime,
  7318. /* harmony export */ "marker": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.marker,
  7319. /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.messageFromBuffer,
  7320. /* harmony export */ "padding": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.padding,
  7321. /* harmony export */ "parse": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.parse,
  7322. /* harmony export */ "payload": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.payload,
  7323. /* harmony export */ "payloadType": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.payloadType,
  7324. /* harmony export */ "range": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.range,
  7325. /* harmony export */ "sSrc": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sSrc,
  7326. /* harmony export */ "sequence": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sequence,
  7327. /* harmony export */ "sequenceNumber": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sequenceNumber,
  7328. /* harmony export */ "sessionId": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sessionId,
  7329. /* harmony export */ "sessionTimeout": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sessionTimeout,
  7330. /* harmony export */ "statusCode": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.statusCode,
  7331. /* harmony export */ "timestamp": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.timestamp,
  7332. /* harmony export */ "version": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.version
  7333. /* harmony export */ });
  7334. /* harmony import */ var _components_index_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/index.browser */ "./lib/components/index.browser.ts");
  7335. /* harmony import */ var _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pipelines/index.browser */ "./lib/pipelines/index.browser.ts");
  7336. /* harmony import */ var _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/index.browser */ "./lib/utils/index.browser.ts");
  7337. ;
  7338. /***/ }),
  7339. /***/ "./lib/pipelines/html5-canvas-pipeline.ts":
  7340. /*!************************************************!*\
  7341. !*** ./lib/pipelines/html5-canvas-pipeline.ts ***!
  7342. \************************************************/
  7343. /*! namespace exports */
  7344. /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7345. /*! other exports [not provided] [no usage info] */
  7346. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7347. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7348. "use strict";
  7349. __webpack_require__.r(__webpack_exports__);
  7350. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7351. /* harmony export */ "Html5CanvasPipeline": () => /* binding */ Html5CanvasPipeline
  7352. /* harmony export */ });
  7353. /* harmony import */ var _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mjpeg-pipeline */ "./lib/pipelines/rtsp-mjpeg-pipeline.ts");
  7354. /* harmony import */ var _components_canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/canvas */ "./lib/components/canvas/index.ts");
  7355. /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
  7356. /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
  7357. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7358. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7359. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7360. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7361. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7362. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7363. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7364. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7365. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7366. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7367. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7368. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7369. /**
  7370. * Pipeline that can receive Motion JPEG over RTP over WebSocket
  7371. * and display it on a canvas.
  7372. *
  7373. * Handlers that can be set on the pipeline:
  7374. * - onCanplay: called when the first frame is ready, at this point
  7375. * you can call the play method to start playback.
  7376. * Note: the default is to autoplay, so call .pause() inside
  7377. * your onCanplay function if you want to prevent this.
  7378. * - onSync: called when UNIX time (milliseconds) is available
  7379. * for the start of the presentation.
  7380. *
  7381. * @class Html5CanvasPipeline
  7382. * @extends {RtspMjpegPipeline}
  7383. */
  7384. var Html5CanvasPipeline = /*#__PURE__*/function (_RtspMjpegPipeline) {
  7385. _inherits(Html5CanvasPipeline, _RtspMjpegPipeline);
  7386. var _super = _createSuper(Html5CanvasPipeline);
  7387. /**
  7388. * Creates an instance of Html5CanvasPipeline.
  7389. * @param {any} [config={}] Component options
  7390. * @memberof Html5CanvasPipeline
  7391. */
  7392. function Html5CanvasPipeline(config) {
  7393. var _this;
  7394. _classCallCheck(this, Html5CanvasPipeline);
  7395. var wsConfig = config.ws,
  7396. rtspConfig = config.rtsp,
  7397. mediaElement = config.mediaElement,
  7398. authConfig = config.auth;
  7399. _this = _super.call(this, rtspConfig);
  7400. _defineProperty(_assertThisInitialized(_this), "onCanplay", void 0);
  7401. _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
  7402. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  7403. _defineProperty(_assertThisInitialized(_this), "ready", void 0);
  7404. _defineProperty(_assertThisInitialized(_this), "_src", void 0);
  7405. _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
  7406. if (authConfig) {
  7407. var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
  7408. _this.insertBefore(_this.rtsp, auth);
  7409. }
  7410. var canvasSink = new _components_canvas__WEBPACK_IMPORTED_MODULE_1__.CanvasSink(mediaElement);
  7411. canvasSink.onCanplay = function () {
  7412. canvasSink.play();
  7413. _this.onCanplay && _this.onCanplay();
  7414. };
  7415. canvasSink.onSync = function (ntpPresentationTime) {
  7416. _this.onSync && _this.onSync(ntpPresentationTime);
  7417. };
  7418. _this.append(canvasSink);
  7419. _this._sink = canvasSink;
  7420. var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_2__.WSSource.open(wsConfig);
  7421. _this.ready = waitForWs.then(function (wsSource) {
  7422. wsSource.onServerClose = function () {
  7423. _this.onServerClose && _this.onServerClose();
  7424. };
  7425. _this.prepend(wsSource);
  7426. _this._src = wsSource;
  7427. });
  7428. return _this;
  7429. }
  7430. _createClass(Html5CanvasPipeline, [{
  7431. key: "close",
  7432. value: function close() {
  7433. this._src && this._src.outgoing.end();
  7434. }
  7435. }, {
  7436. key: "currentTime",
  7437. get: function get() {
  7438. return this._sink.currentTime;
  7439. }
  7440. }, {
  7441. key: "play",
  7442. value: function play() {
  7443. return this._sink.play();
  7444. }
  7445. }, {
  7446. key: "pause",
  7447. value: function pause() {
  7448. return this._sink.pause();
  7449. }
  7450. }, {
  7451. key: "bitrate",
  7452. get: function get() {
  7453. return this._sink.bitrate;
  7454. }
  7455. }, {
  7456. key: "framerate",
  7457. get: function get() {
  7458. return this._sink.framerate;
  7459. }
  7460. }]);
  7461. return Html5CanvasPipeline;
  7462. }(_rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMjpegPipeline);
  7463. /***/ }),
  7464. /***/ "./lib/pipelines/html5-video-metadata-pipeline.ts":
  7465. /*!********************************************************!*\
  7466. !*** ./lib/pipelines/html5-video-metadata-pipeline.ts ***!
  7467. \********************************************************/
  7468. /*! namespace exports */
  7469. /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7470. /*! other exports [not provided] [no usage info] */
  7471. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7472. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7473. "use strict";
  7474. __webpack_require__.r(__webpack_exports__);
  7475. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7476. /* harmony export */ "Html5VideoMetadataPipeline": () => /* binding */ Html5VideoMetadataPipeline
  7477. /* harmony export */ });
  7478. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  7479. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__);
  7480. /* harmony import */ var _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./html5-video-pipeline */ "./lib/pipelines/html5-video-pipeline.ts");
  7481. /* harmony import */ var _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/onvifdepay */ "./lib/components/onvifdepay/index.ts");
  7482. /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/message */ "./lib/components/message.ts");
  7483. /* harmony import */ var _components_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/component */ "./lib/components/component.ts");
  7484. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7485. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7486. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7487. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7488. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7489. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7490. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7491. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7492. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7493. /**
  7494. * Pipeline that can receive H264/AAC video over RTP
  7495. * over WebSocket and pass it to a video element.
  7496. * Additionally, this pipeline passes XML metadata sent
  7497. * in the same stream to a handler.
  7498. */
  7499. var Html5VideoMetadataPipeline = /*#__PURE__*/function (_Html5VideoPipeline) {
  7500. _inherits(Html5VideoMetadataPipeline, _Html5VideoPipeline);
  7501. var _super = _createSuper(Html5VideoMetadataPipeline);
  7502. function Html5VideoMetadataPipeline(config) {
  7503. var _this;
  7504. _classCallCheck(this, Html5VideoMetadataPipeline);
  7505. var metadataHandler = config.metadataHandler;
  7506. _this = _super.call(this, config);
  7507. var onvifDepay = new _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__.ONVIFDepay();
  7508. _this.insertAfter(_this.rtsp, onvifDepay);
  7509. var onvifHandlerPipe = _components_component__WEBPACK_IMPORTED_MODULE_4__.Tube.fromHandlers(function (msg) {
  7510. if (msg.type === _components_message__WEBPACK_IMPORTED_MODULE_3__.MessageType.XML) {
  7511. metadataHandler(msg);
  7512. }
  7513. }, undefined);
  7514. _this.insertAfter(onvifDepay, onvifHandlerPipe);
  7515. return _this;
  7516. }
  7517. return Html5VideoMetadataPipeline;
  7518. }(_html5_video_pipeline__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline);
  7519. /***/ }),
  7520. /***/ "./lib/pipelines/html5-video-pipeline-http.ts":
  7521. /*!****************************************************!*\
  7522. !*** ./lib/pipelines/html5-video-pipeline-http.ts ***!
  7523. \****************************************************/
  7524. /*! namespace exports */
  7525. /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] */
  7526. /*! other exports [not provided] [no usage info] */
  7527. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7529. "use strict";
  7530. __webpack_require__.r(__webpack_exports__);
  7531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7532. /* harmony export */ "Html5VideoPipeline_HTTP": () => /* binding */ Html5VideoPipeline_HTTP
  7533. /* harmony export */ });
  7534. /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
  7535. /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
  7536. /* harmony import */ var _components_http_tunnel_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/http-tunnel-source */ "./lib/components/http-tunnel-source/index.ts");
  7537. /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
  7538. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7539. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7540. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7541. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7542. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7543. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7544. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7545. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7546. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7547. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7548. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7549. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7550. /**
  7551. * Pipeline that can receive H264/AAC video over RTP
  7552. * over WebSocket and pass it to a video element.
  7553. *
  7554. * @class Html5VideoPipeline
  7555. * @extends {RtspMp4Pipeline}
  7556. */
  7557. var Html5VideoPipeline_HTTP = /*#__PURE__*/function (_RtspMp4Pipeline) {
  7558. _inherits(Html5VideoPipeline_HTTP, _RtspMp4Pipeline);
  7559. var _super = _createSuper(Html5VideoPipeline_HTTP);
  7560. /**
  7561. * Creates an instance of Html5VideoPipeline.
  7562. * @param {any} [config={}] Component options
  7563. * @memberof Html5VideoPipeline
  7564. */
  7565. function Html5VideoPipeline_HTTP(config) {
  7566. var _this;
  7567. _classCallCheck(this, Html5VideoPipeline_HTTP);
  7568. var http_Tunnel_Config = config.ws,
  7569. rtspConfig = config.rtsp,
  7570. mediaElement = config.mediaElement,
  7571. authConfig = config.auth;
  7572. _this = _super.call(this, rtspConfig);
  7573. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  7574. _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
  7575. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  7576. _defineProperty(_assertThisInitialized(_this), "ready", void 0);
  7577. _defineProperty(_assertThisInitialized(_this), "tracks", void 0);
  7578. _defineProperty(_assertThisInitialized(_this), "_src", void 0);
  7579. _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
  7580. if (authConfig) {
  7581. var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
  7582. _this.insertBefore(_this.rtsp, auth);
  7583. }
  7584. var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_1__.MseSink(mediaElement);
  7585. mseSink.onSourceOpen = function (mse, tracks) {
  7586. _this.tracks = tracks;
  7587. _this.onSourceOpen && _this.onSourceOpen(mse, tracks);
  7588. };
  7589. mseSink.onDataCallback = function (sourceBuffer, msg) {
  7590. _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
  7591. };
  7592. _this.append(mseSink);
  7593. _this._sink = mseSink;
  7594. var waitForWs = _components_http_tunnel_source__WEBPACK_IMPORTED_MODULE_2__.HTTPTunnelSource.open(http_Tunnel_Config);
  7595. _this.ready = waitForWs.then(function (httpTunnnelSource) {
  7596. httpTunnnelSource.onServerClose = function () {
  7597. _this.onServerClose && _this.onServerClose();
  7598. };
  7599. _this.prepend(httpTunnnelSource);
  7600. _this._src = httpTunnnelSource;
  7601. });
  7602. return _this;
  7603. }
  7604. _createClass(Html5VideoPipeline_HTTP, [{
  7605. key: "close",
  7606. value: function close() {
  7607. this._src && this._src.outgoing.end();
  7608. }
  7609. }, {
  7610. key: "currentTime",
  7611. get: function get() {
  7612. return this._sink.currentTime;
  7613. }
  7614. }, {
  7615. key: "play",
  7616. value: function play() {
  7617. return this._sink.play();
  7618. }
  7619. }, {
  7620. key: "pause",
  7621. value: function pause() {
  7622. return this._sink.pause();
  7623. }
  7624. }]);
  7625. return Html5VideoPipeline_HTTP;
  7626. }(_rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMp4Pipeline);
  7627. /***/ }),
  7628. /***/ "./lib/pipelines/html5-video-pipeline.ts":
  7629. /*!***********************************************!*\
  7630. !*** ./lib/pipelines/html5-video-pipeline.ts ***!
  7631. \***********************************************/
  7632. /*! namespace exports */
  7633. /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7634. /*! other exports [not provided] [no usage info] */
  7635. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7637. "use strict";
  7638. __webpack_require__.r(__webpack_exports__);
  7639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7640. /* harmony export */ "Html5VideoPipeline": () => /* binding */ Html5VideoPipeline
  7641. /* harmony export */ });
  7642. /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
  7643. /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
  7644. /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
  7645. /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
  7646. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7647. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7648. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7649. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7650. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7651. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7652. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7653. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7654. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7655. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7656. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7657. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7658. /**
  7659. * Pipeline that can receive H264/AAC video over RTP
  7660. * over WebSocket and pass it to a video element.
  7661. *
  7662. * @class Html5VideoPipeline
  7663. * @extends {RtspMp4Pipeline}
  7664. */
  7665. var Html5VideoPipeline = /*#__PURE__*/function (_RtspMp4Pipeline) {
  7666. _inherits(Html5VideoPipeline, _RtspMp4Pipeline);
  7667. var _super = _createSuper(Html5VideoPipeline);
  7668. /**
  7669. * Creates an instance of Html5VideoPipeline.
  7670. * @param {any} [config={}] Component options
  7671. * @memberof Html5VideoPipeline
  7672. */
  7673. function Html5VideoPipeline(config) {
  7674. var _this;
  7675. _classCallCheck(this, Html5VideoPipeline);
  7676. var wsConfig = config.ws,
  7677. rtspConfig = config.rtsp,
  7678. mediaElement = config.mediaElement,
  7679. authConfig = config.auth;
  7680. _this = _super.call(this, rtspConfig);
  7681. _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
  7682. _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
  7683. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  7684. _defineProperty(_assertThisInitialized(_this), "ready", void 0);
  7685. _defineProperty(_assertThisInitialized(_this), "tracks", void 0);
  7686. _defineProperty(_assertThisInitialized(_this), "_src", void 0);
  7687. _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
  7688. if (authConfig) {
  7689. var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
  7690. _this.insertBefore(_this.rtsp, auth);
  7691. }
  7692. var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_1__.MseSink(mediaElement);
  7693. mseSink.onSourceOpen = function (mse, tracks) {
  7694. _this.tracks = tracks;
  7695. _this.onSourceOpen && _this.onSourceOpen(mse, tracks);
  7696. };
  7697. mseSink.onDataCallback = function (sourceBuffer, msg) {
  7698. _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
  7699. };
  7700. _this.append(mseSink);
  7701. _this._sink = mseSink;
  7702. var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_2__.WSSource.open(wsConfig);
  7703. _this.ready = waitForWs.then(function (wsSource) {
  7704. wsSource.onServerClose = function () {
  7705. _this.onServerClose && _this.onServerClose();
  7706. };
  7707. _this.prepend(wsSource);
  7708. _this._src = wsSource;
  7709. });
  7710. return _this;
  7711. }
  7712. _createClass(Html5VideoPipeline, [{
  7713. key: "close",
  7714. value: function close() {
  7715. this._src && this._src.outgoing.end();
  7716. }
  7717. }, {
  7718. key: "currentTime",
  7719. get: function get() {
  7720. return this._sink.currentTime;
  7721. }
  7722. }, {
  7723. key: "play",
  7724. value: function play() {
  7725. return this._sink.play();
  7726. }
  7727. }, {
  7728. key: "pause",
  7729. value: function pause() {
  7730. return this._sink.pause();
  7731. }
  7732. }]);
  7733. return Html5VideoPipeline;
  7734. }(_rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMp4Pipeline);
  7735. /***/ }),
  7736. /***/ "./lib/pipelines/http-mse-pipeline.ts":
  7737. /*!********************************************!*\
  7738. !*** ./lib/pipelines/http-mse-pipeline.ts ***!
  7739. \********************************************/
  7740. /*! namespace exports */
  7741. /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7742. /*! other exports [not provided] [no usage info] */
  7743. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7744. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7745. "use strict";
  7746. __webpack_require__.r(__webpack_exports__);
  7747. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7748. /* harmony export */ "HttpMsePipeline": () => /* binding */ HttpMsePipeline
  7749. /* harmony export */ });
  7750. /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
  7751. /* harmony import */ var _components_http_source__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/http-source */ "./lib/components/http-source/index.ts");
  7752. /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
  7753. /* harmony import */ var _components_mp4_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/mp4-parser */ "./lib/components/mp4-parser/index.ts");
  7754. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7755. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7756. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7757. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7758. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7759. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7760. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7761. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7762. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7763. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7764. var HttpMsePipeline = /*#__PURE__*/function (_Pipeline) {
  7765. _inherits(HttpMsePipeline, _Pipeline);
  7766. var _super = _createSuper(HttpMsePipeline);
  7767. function HttpMsePipeline(config) {
  7768. var _this;
  7769. _classCallCheck(this, HttpMsePipeline);
  7770. var httpConfig = config.http,
  7771. mediaElement = config.mediaElement;
  7772. var httpSource = new _components_http_source__WEBPACK_IMPORTED_MODULE_1__.HttpSource(httpConfig);
  7773. var mp4Parser = new _components_mp4_parser__WEBPACK_IMPORTED_MODULE_3__.Mp4Parser();
  7774. var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_2__.MseSink(mediaElement);
  7775. _this = _super.call(this, httpSource, mp4Parser, mseSink); // Expose session for external use
  7776. _defineProperty(_assertThisInitialized(_this), "http", void 0);
  7777. _this.http = httpSource;
  7778. return _this;
  7779. }
  7780. return HttpMsePipeline;
  7781. }(_pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline);
  7782. /***/ }),
  7783. /***/ "./lib/pipelines/index.browser.ts":
  7784. /*!****************************************!*\
  7785. !*** ./lib/pipelines/index.browser.ts ***!
  7786. \****************************************/
  7787. /*! namespace exports */
  7788. /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
  7789. /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
  7790. /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
  7791. /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
  7792. /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
  7793. /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
  7794. /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
  7795. /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
  7796. /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
  7797. /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
  7798. /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
  7799. /*! other exports [not provided] [no usage info] */
  7800. /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
  7801. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7802. "use strict";
  7803. __webpack_require__.r(__webpack_exports__);
  7804. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7805. /* harmony export */ "Pipeline": () => /* reexport safe */ _pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline,
  7806. /* harmony export */ "RtspPipeline": () => /* reexport safe */ _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline,
  7807. /* harmony export */ "RtspMp4Pipeline": () => /* reexport safe */ _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_2__.RtspMp4Pipeline,
  7808. /* harmony export */ "RtspMjpegPipeline": () => /* reexport safe */ _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_3__.RtspMjpegPipeline,
  7809. /* harmony export */ "Html5CanvasPipeline": () => /* reexport safe */ _html5_canvas_pipeline__WEBPACK_IMPORTED_MODULE_4__.Html5CanvasPipeline,
  7810. /* harmony export */ "Html5VideoPipeline": () => /* reexport safe */ _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_5__.Html5VideoPipeline,
  7811. /* harmony export */ "Html5VideoPipeline_HTTP": () => /* reexport safe */ _html5_video_pipeline_http__WEBPACK_IMPORTED_MODULE_6__.Html5VideoPipeline_HTTP,
  7812. /* harmony export */ "Html5VideoMetadataPipeline": () => /* reexport safe */ _html5_video_metadata_pipeline__WEBPACK_IMPORTED_MODULE_7__.Html5VideoMetadataPipeline,
  7813. /* harmony export */ "MetadataPipeline": () => /* reexport safe */ _metadata_pipeline__WEBPACK_IMPORTED_MODULE_8__.MetadataPipeline,
  7814. /* harmony export */ "WsSdpPipeline": () => /* reexport safe */ _ws_sdp_pipeline__WEBPACK_IMPORTED_MODULE_9__.WsSdpPipeline,
  7815. /* harmony export */ "HttpMsePipeline": () => /* reexport safe */ _http_mse_pipeline__WEBPACK_IMPORTED_MODULE_10__.HttpMsePipeline
  7816. /* harmony export */ });
  7817. /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
  7818. /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
  7819. /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
  7820. /* harmony import */ var _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rtsp-mjpeg-pipeline */ "./lib/pipelines/rtsp-mjpeg-pipeline.ts");
  7821. /* harmony import */ var _html5_canvas_pipeline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./html5-canvas-pipeline */ "./lib/pipelines/html5-canvas-pipeline.ts");
  7822. /* harmony import */ var _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./html5-video-pipeline */ "./lib/pipelines/html5-video-pipeline.ts");
  7823. /* harmony import */ var _html5_video_pipeline_http__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./html5-video-pipeline-http */ "./lib/pipelines/html5-video-pipeline-http.ts");
  7824. /* harmony import */ var _html5_video_metadata_pipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./html5-video-metadata-pipeline */ "./lib/pipelines/html5-video-metadata-pipeline.ts");
  7825. /* harmony import */ var _metadata_pipeline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./metadata-pipeline */ "./lib/pipelines/metadata-pipeline.ts");
  7826. /* harmony import */ var _ws_sdp_pipeline__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ws-sdp-pipeline */ "./lib/pipelines/ws-sdp-pipeline.ts");
  7827. /* harmony import */ var _http_mse_pipeline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./http-mse-pipeline */ "./lib/pipelines/http-mse-pipeline.ts");
  7828. /***/ }),
  7829. /***/ "./lib/pipelines/metadata-pipeline.ts":
  7830. /*!********************************************!*\
  7831. !*** ./lib/pipelines/metadata-pipeline.ts ***!
  7832. \********************************************/
  7833. /*! namespace exports */
  7834. /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7835. /*! other exports [not provided] [no usage info] */
  7836. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7838. "use strict";
  7839. __webpack_require__.r(__webpack_exports__);
  7840. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7841. /* harmony export */ "MetadataPipeline": () => /* binding */ MetadataPipeline
  7842. /* harmony export */ });
  7843. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  7844. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__);
  7845. /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
  7846. /* harmony import */ var _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/onvifdepay */ "./lib/components/onvifdepay/index.ts");
  7847. /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
  7848. /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/message */ "./lib/components/message.ts");
  7849. /* harmony import */ var _components_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/component */ "./lib/components/component.ts");
  7850. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7851. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7852. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7853. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7854. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7855. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7856. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7857. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7858. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7859. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  7860. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7861. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7862. // Default configuration for XML event stream
  7863. var DEFAULT_RTSP_PARAMETERS = {
  7864. parameters: ['audio=0', 'video=0', 'event=on', 'ptz=all']
  7865. };
  7866. /**
  7867. * Pipeline that can receive XML metadata over RTP
  7868. * over WebSocket and pass it to a handler.
  7869. */
  7870. var MetadataPipeline = /*#__PURE__*/function (_RtspPipeline) {
  7871. _inherits(MetadataPipeline, _RtspPipeline);
  7872. var _super = _createSuper(MetadataPipeline);
  7873. function MetadataPipeline(config) {
  7874. var _this;
  7875. _classCallCheck(this, MetadataPipeline);
  7876. var wsConfig = config.ws,
  7877. rtspConfig = config.rtsp,
  7878. metadataHandler = config.metadataHandler;
  7879. _this = _super.call(this, Object.assign({}, DEFAULT_RTSP_PARAMETERS, rtspConfig));
  7880. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  7881. _defineProperty(_assertThisInitialized(_this), "ready", void 0);
  7882. _defineProperty(_assertThisInitialized(_this), "_src", void 0);
  7883. var onvifDepay = new _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__.ONVIFDepay();
  7884. _this.append(onvifDepay);
  7885. var handlerSink = _components_component__WEBPACK_IMPORTED_MODULE_5__.Sink.fromHandler(function (msg) {
  7886. if (msg.type === _components_message__WEBPACK_IMPORTED_MODULE_4__.MessageType.XML) {
  7887. metadataHandler(msg);
  7888. }
  7889. });
  7890. _this.append(handlerSink);
  7891. var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_3__.WSSource.open(wsConfig);
  7892. _this.ready = waitForWs.then(function (wsSource) {
  7893. wsSource.onServerClose = function () {
  7894. _this.onServerClose && _this.onServerClose();
  7895. };
  7896. _this.prepend(wsSource);
  7897. _this._src = wsSource;
  7898. });
  7899. return _this;
  7900. }
  7901. _createClass(MetadataPipeline, [{
  7902. key: "close",
  7903. value: function close() {
  7904. this._src && this._src.outgoing.end();
  7905. }
  7906. }]);
  7907. return MetadataPipeline;
  7908. }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline);
  7909. /***/ }),
  7910. /***/ "./lib/pipelines/pipeline.ts":
  7911. /*!***********************************!*\
  7912. !*** ./lib/pipelines/pipeline.ts ***!
  7913. \***********************************/
  7914. /*! namespace exports */
  7915. /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] */
  7916. /*! other exports [not provided] [no usage info] */
  7917. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  7918. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7919. "use strict";
  7920. __webpack_require__.r(__webpack_exports__);
  7921. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7922. /* harmony export */ "Pipeline": () => /* binding */ Pipeline
  7923. /* harmony export */ });
  7924. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  7925. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);
  7926. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  7927. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  7928. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  7929. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_2__);
  7930. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.set */ "./node_modules/core-js/modules/es.set.js");
  7931. /* harmony import */ var core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_set__WEBPACK_IMPORTED_MODULE_3__);
  7932. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  7933. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4__);
  7934. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  7935. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_5__);
  7936. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  7937. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_6__);
  7938. ;
  7939. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7940. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7941. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7942. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  7943. var Pipeline = /*#__PURE__*/function () {
  7944. /**
  7945. * Create a pipeline which is a linked list of components.
  7946. * Works naturally with only a single component.
  7947. * A set keeps track of which components the pipeline contains,
  7948. * while any order is completely determined by the component's
  7949. * connectedness.
  7950. * @param {Array} components The components of the pipeline in order.
  7951. */
  7952. function Pipeline() {
  7953. _classCallCheck(this, Pipeline);
  7954. _defineProperty(this, "firstComponent", void 0);
  7955. _defineProperty(this, "lastComponent", void 0);
  7956. _defineProperty(this, "_set", void 0);
  7957. for (var _len = arguments.length, components = new Array(_len), _key = 0; _key < _len; _key++) {
  7958. components[_key] = arguments[_key];
  7959. }
  7960. var car = components[0],
  7961. cdr = components.slice(1);
  7962. this._set = new Set(components);
  7963. this.firstComponent = car;
  7964. this.lastComponent = cdr.reduce(function (last, component) {
  7965. return last.connect(component);
  7966. }, car);
  7967. }
  7968. _createClass(Pipeline, [{
  7969. key: "init",
  7970. value: function init() {
  7971. for (var _len2 = arguments.length, components = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  7972. components[_key2] = arguments[_key2];
  7973. }
  7974. var car = components[0],
  7975. cdr = components.slice(1);
  7976. this._set = new Set(components);
  7977. this.firstComponent = car;
  7978. this.lastComponent = cdr.reduce(function (last, component) {
  7979. return last.connect(component);
  7980. }, car);
  7981. }
  7982. }, {
  7983. key: "insertAfter",
  7984. value: function insertAfter(component, newComponent) {
  7985. if (!this._set.has(component)) {
  7986. throw new Error('insertion point not part of pipeline');
  7987. }
  7988. if (this._set.has(newComponent)) {
  7989. throw new Error('new component already in the pipeline');
  7990. }
  7991. var cdr = component.next;
  7992. if (cdr === null) {
  7993. component.connect(newComponent);
  7994. this.lastComponent = newComponent;
  7995. } else {
  7996. component.disconnect();
  7997. component.connect(newComponent).connect(cdr);
  7998. }
  7999. this._set.add(newComponent);
  8000. return this;
  8001. }
  8002. }, {
  8003. key: "insertBefore",
  8004. value: function insertBefore(component, newComponent) {
  8005. if (!this._set.has(component)) {
  8006. throw new Error('insertion point not part of pipeline');
  8007. }
  8008. if (this._set.has(newComponent)) {
  8009. throw new Error('new component already in the pipeline');
  8010. }
  8011. var car = component.prev;
  8012. if (car === null) {
  8013. newComponent.connect(component);
  8014. this.firstComponent = newComponent;
  8015. } else {
  8016. car.disconnect();
  8017. car.connect(newComponent).connect(component);
  8018. }
  8019. this._set.add(newComponent);
  8020. return this;
  8021. }
  8022. }, {
  8023. key: "remove",
  8024. value: function remove(component) {
  8025. if (!this._set.has(component)) {
  8026. throw new Error('component not part of pipeline');
  8027. }
  8028. var car = component.prev;
  8029. var cdr = component.next;
  8030. if (car === null && cdr === null) {
  8031. throw new Error('cannot remove last component');
  8032. } else if (car === null && cdr !== null) {
  8033. component.disconnect();
  8034. this.firstComponent = cdr;
  8035. } else if (car !== null && cdr === null) {
  8036. car.disconnect();
  8037. this.lastComponent = car;
  8038. } else if (car !== null && cdr !== null) {
  8039. car.disconnect();
  8040. component.disconnect();
  8041. car.connect(cdr);
  8042. }
  8043. this._set.delete(component);
  8044. return this;
  8045. }
  8046. }, {
  8047. key: "append",
  8048. value: function append() {
  8049. var _this = this;
  8050. for (var _len3 = arguments.length, components = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  8051. components[_key3] = arguments[_key3];
  8052. }
  8053. components.forEach(function (component) {
  8054. _this.insertAfter(_this.lastComponent, component);
  8055. });
  8056. return this;
  8057. }
  8058. }, {
  8059. key: "prepend",
  8060. value: function prepend() {
  8061. var _this2 = this;
  8062. for (var _len4 = arguments.length, components = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  8063. components[_key4] = arguments[_key4];
  8064. }
  8065. components.forEach(function (component) {
  8066. _this2.insertBefore(_this2.firstComponent, component);
  8067. });
  8068. return this;
  8069. }
  8070. }]);
  8071. return Pipeline;
  8072. }();
  8073. /***/ }),
  8074. /***/ "./lib/pipelines/rtsp-mjpeg-pipeline.ts":
  8075. /*!**********************************************!*\
  8076. !*** ./lib/pipelines/rtsp-mjpeg-pipeline.ts ***!
  8077. \**********************************************/
  8078. /*! namespace exports */
  8079. /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  8080. /*! other exports [not provided] [no usage info] */
  8081. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8082. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8083. "use strict";
  8084. __webpack_require__.r(__webpack_exports__);
  8085. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8086. /* harmony export */ "RtspMjpegPipeline": () => /* binding */ RtspMjpegPipeline
  8087. /* harmony export */ });
  8088. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
  8089. /* harmony import */ var core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of__WEBPACK_IMPORTED_MODULE_0__);
  8090. /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
  8091. /* harmony import */ var _components_jpegdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/jpegdepay */ "./lib/components/jpegdepay/index.ts");
  8092. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8093. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8094. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8095. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8096. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  8097. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8098. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8099. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  8100. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8101. /**
  8102. * A pipeline that deals with JPEG encoded video
  8103. * sent over RTP, and converts it to motion JPEG
  8104. * format.
  8105. */
  8106. var RtspMjpegPipeline = /*#__PURE__*/function (_RtspPipeline) {
  8107. _inherits(RtspMjpegPipeline, _RtspPipeline);
  8108. var _super = _createSuper(RtspMjpegPipeline);
  8109. function RtspMjpegPipeline(rtspConfig) {
  8110. var _this;
  8111. _classCallCheck(this, RtspMjpegPipeline);
  8112. _this = _super.call(this, rtspConfig);
  8113. var jpegDepay = new _components_jpegdepay__WEBPACK_IMPORTED_MODULE_2__.JPEGDepay();
  8114. _this.append(jpegDepay);
  8115. return _this;
  8116. }
  8117. return RtspMjpegPipeline;
  8118. }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline);
  8119. /***/ }),
  8120. /***/ "./lib/pipelines/rtsp-mp4-pipeline.ts":
  8121. /*!********************************************!*\
  8122. !*** ./lib/pipelines/rtsp-mp4-pipeline.ts ***!
  8123. \********************************************/
  8124. /*! namespace exports */
  8125. /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] */
  8126. /*! other exports [not provided] [no usage info] */
  8127. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8128. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8129. "use strict";
  8130. __webpack_require__.r(__webpack_exports__);
  8131. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8132. /* harmony export */ "RtspMp4Pipeline": () => /* binding */ RtspMp4Pipeline
  8133. /* harmony export */ });
  8134. /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
  8135. /* harmony import */ var _components_h264depay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/h264depay */ "./lib/components/h264depay/index.ts");
  8136. /* harmony import */ var _components_aacdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/aacdepay */ "./lib/components/aacdepay/index.ts");
  8137. /* harmony import */ var _components_mp4muxer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/mp4muxer */ "./lib/components/mp4muxer/index.ts");
  8138. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8139. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8140. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8141. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8142. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8143. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8144. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  8145. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8146. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8147. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  8148. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8149. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  8150. /**
  8151. * A pipeline that deals with H264/AAC encoded video
  8152. * sent over RTP, and converts it to streaming MP4
  8153. * format.
  8154. *
  8155. * The following handlers can be defined:
  8156. * - onSync: called when the NTP time of the first frame
  8157. * is known, with the timestamp as argument
  8158. * (the timestamp is UNIX milliseconds)
  8159. */
  8160. var RtspMp4Pipeline = /*#__PURE__*/function (_RtspPipeline) {
  8161. _inherits(RtspMp4Pipeline, _RtspPipeline);
  8162. var _super = _createSuper(RtspMp4Pipeline);
  8163. function RtspMp4Pipeline(rtspConfig) {
  8164. var _this;
  8165. _classCallCheck(this, RtspMp4Pipeline);
  8166. _this = _super.call(this, rtspConfig);
  8167. _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
  8168. _defineProperty(_assertThisInitialized(_this), "_mp4Muxer", void 0);
  8169. var h264Depay = new _components_h264depay__WEBPACK_IMPORTED_MODULE_1__.H264Depay();
  8170. var aacDepay = new _components_aacdepay__WEBPACK_IMPORTED_MODULE_2__.AACDepay();
  8171. var mp4Muxer = new _components_mp4muxer__WEBPACK_IMPORTED_MODULE_3__.Mp4Muxer();
  8172. mp4Muxer.onSync = function (ntpPresentationTime) {
  8173. _this.onSync && _this.onSync(ntpPresentationTime);
  8174. };
  8175. _this.append(h264Depay, aacDepay, mp4Muxer);
  8176. _this._mp4Muxer = mp4Muxer;
  8177. return _this;
  8178. }
  8179. _createClass(RtspMp4Pipeline, [{
  8180. key: "bitrate",
  8181. get: function get() {
  8182. return this._mp4Muxer.bitrate;
  8183. }
  8184. }, {
  8185. key: "framerate",
  8186. get: function get() {
  8187. return this._mp4Muxer.framerate;
  8188. }
  8189. }]);
  8190. return RtspMp4Pipeline;
  8191. }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspPipeline);
  8192. /***/ }),
  8193. /***/ "./lib/pipelines/rtsp-pipeline.ts":
  8194. /*!****************************************!*\
  8195. !*** ./lib/pipelines/rtsp-pipeline.ts ***!
  8196. \****************************************/
  8197. /*! namespace exports */
  8198. /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  8199. /*! other exports [not provided] [no usage info] */
  8200. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8201. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8202. "use strict";
  8203. __webpack_require__.r(__webpack_exports__);
  8204. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8205. /* harmony export */ "RtspPipeline": () => /* binding */ RtspPipeline
  8206. /* harmony export */ });
  8207. /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
  8208. /* harmony import */ var _components_rtsp_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/rtsp-parser */ "./lib/components/rtsp-parser/index.ts");
  8209. /* harmony import */ var _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/rtsp-session */ "./lib/components/rtsp-session/index.ts");
  8210. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8211. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8212. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8213. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8214. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  8215. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8216. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8217. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  8218. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8219. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  8220. /**
  8221. * A pipeline that converts interleaved RTSP/RTP
  8222. * into a series of RTP, RTCP, and RTSP packets.
  8223. * The pipeline exposes the RTSP session component
  8224. * as `this.session`, and wraps its play, pause
  8225. * and stop methods.
  8226. *
  8227. * The following handlers can be defined:
  8228. * - onSdp: called when the session descript protocol
  8229. * is available, with the SDP object as argument
  8230. * - onPlay: called when a response from the PLAY command
  8231. * arrives, with the play range as argument
  8232. */
  8233. var RtspPipeline = /*#__PURE__*/function (_Pipeline) {
  8234. _inherits(RtspPipeline, _Pipeline);
  8235. var _super = _createSuper(RtspPipeline);
  8236. function RtspPipeline(rtspConfig) {
  8237. var _this;
  8238. _classCallCheck(this, RtspPipeline);
  8239. var rtspParser = new _components_rtsp_parser__WEBPACK_IMPORTED_MODULE_1__.RtspParser();
  8240. var rtspSession = new _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RtspSession(rtspConfig);
  8241. rtspSession.onSdp = function (sdp) {
  8242. _this.onSdp && _this.onSdp(sdp);
  8243. };
  8244. rtspSession.onPlay = function (range) {
  8245. _this.onPlay && _this.onPlay(range);
  8246. };
  8247. _this = _super.call(this, rtspParser, rtspSession); // Expose session for external use
  8248. _defineProperty(_assertThisInitialized(_this), "onSdp", void 0);
  8249. _defineProperty(_assertThisInitialized(_this), "onPlay", void 0);
  8250. _defineProperty(_assertThisInitialized(_this), "rtsp", void 0);
  8251. _this.rtsp = rtspSession;
  8252. return _this;
  8253. }
  8254. return RtspPipeline;
  8255. }(_pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline);
  8256. /***/ }),
  8257. /***/ "./lib/pipelines/ws-sdp-pipeline.ts":
  8258. /*!******************************************!*\
  8259. !*** ./lib/pipelines/ws-sdp-pipeline.ts ***!
  8260. \******************************************/
  8261. /*! namespace exports */
  8262. /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] */
  8263. /*! other exports [not provided] [no usage info] */
  8264. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8265. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8266. "use strict";
  8267. __webpack_require__.r(__webpack_exports__);
  8268. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8269. /* harmony export */ "WsSdpPipeline": () => /* binding */ WsSdpPipeline
  8270. /* harmony export */ });
  8271. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  8272. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__);
  8273. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise */ "./node_modules/core-js/modules/es.promise.js");
  8274. /* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__);
  8275. /* harmony import */ var _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/rtsp-session */ "./lib/components/rtsp-session/index.ts");
  8276. /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
  8277. /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
  8278. /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
  8279. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8280. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8281. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8282. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8283. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8284. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8285. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  8286. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8287. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8288. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  8289. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8290. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  8291. /**
  8292. * Pipeline that can receive the SDP object for an RTS stream.
  8293. *
  8294. * @class WsSdpPipeline
  8295. * @extends {RtspPipeline}
  8296. */
  8297. var WsSdpPipeline = /*#__PURE__*/function (_RtspPipeline) {
  8298. _inherits(WsSdpPipeline, _RtspPipeline);
  8299. var _super = _createSuper(WsSdpPipeline);
  8300. /**
  8301. * Creates an instance of Html5VideoPipeline.
  8302. * @param {any} [config={}] Component options
  8303. * @memberof Html5VideoPipeline
  8304. */
  8305. function WsSdpPipeline(config) {
  8306. var _this;
  8307. _classCallCheck(this, WsSdpPipeline);
  8308. var wsConfig = config.ws,
  8309. rtspConfig = config.rtsp,
  8310. authConfig = config.auth;
  8311. _this = _super.call(this, rtspConfig);
  8312. _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
  8313. _defineProperty(_assertThisInitialized(_this), "ready", void 0);
  8314. _defineProperty(_assertThisInitialized(_this), "_src", void 0);
  8315. if (authConfig) {
  8316. var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_4__.Auth(authConfig);
  8317. _this.insertBefore(_this.rtsp, auth);
  8318. }
  8319. var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_3__.WSSource.open(wsConfig);
  8320. _this.ready = waitForWs.then(function (wsSource) {
  8321. wsSource.onServerClose = function () {
  8322. _this.onServerClose && _this.onServerClose();
  8323. };
  8324. _this.prepend(wsSource);
  8325. _this._src = wsSource;
  8326. });
  8327. return _this;
  8328. }
  8329. _createClass(WsSdpPipeline, [{
  8330. key: "close",
  8331. value: function close() {
  8332. this._src && this._src.outgoing.end();
  8333. }
  8334. }, {
  8335. key: "sdp",
  8336. get: function get() {
  8337. var _this2 = this;
  8338. return this.ready.then(function () {
  8339. var sdpPromise = new Promise(function (resolve) {
  8340. _this2.rtsp.onSdp = resolve;
  8341. });
  8342. _this2.rtsp.send({
  8343. method: _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RTSP_METHOD.DESCRIBE
  8344. });
  8345. _this2.rtsp.send({
  8346. method: _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RTSP_METHOD.TEARDOWN
  8347. });
  8348. return sdpPromise;
  8349. });
  8350. }
  8351. }]);
  8352. return WsSdpPipeline;
  8353. }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_5__.RtspPipeline);
  8354. /***/ }),
  8355. /***/ "./lib/utils/bits.ts":
  8356. /*!***************************!*\
  8357. !*** ./lib/utils/bits.ts ***!
  8358. \***************************/
  8359. /*! namespace exports */
  8360. /*! export POS [provided] [no usage info] [missing usage info prevents renaming] */
  8361. /*! other exports [not provided] [no usage info] */
  8362. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8363. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8364. "use strict";
  8365. __webpack_require__.r(__webpack_exports__);
  8366. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8367. /* harmony export */ "POS": () => /* binding */ POS
  8368. /* harmony export */ });
  8369. var POS = [0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01];
  8370. /***/ }),
  8371. /***/ "./lib/utils/clamp.ts":
  8372. /*!****************************!*\
  8373. !*** ./lib/utils/clamp.ts ***!
  8374. \****************************/
  8375. /*! namespace exports */
  8376. /*! export clamp [provided] [no usage info] [missing usage info prevents renaming] */
  8377. /*! other exports [not provided] [no usage info] */
  8378. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8379. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8380. "use strict";
  8381. __webpack_require__.r(__webpack_exports__);
  8382. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8383. /* harmony export */ "clamp": () => /* binding */ clamp
  8384. /* harmony export */ });
  8385. function clamp(val, min, max) {
  8386. return val > max ? max : val < min ? min : val;
  8387. }
  8388. /***/ }),
  8389. /***/ "./lib/utils/clock.ts":
  8390. /*!****************************!*\
  8391. !*** ./lib/utils/clock.ts ***!
  8392. \****************************/
  8393. /*! namespace exports */
  8394. /*! export Clock [provided] [no usage info] [missing usage info prevents renaming] */
  8395. /*! other exports [not provided] [no usage info] */
  8396. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8397. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8398. "use strict";
  8399. __webpack_require__.r(__webpack_exports__);
  8400. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8401. /* harmony export */ "Clock": () => /* binding */ Clock
  8402. /* harmony export */ });
  8403. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8404. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8405. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8406. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  8407. /**
  8408. * Clock
  8409. *
  8410. * A simple timer to keep track of elapsed time,
  8411. * which can be retrieved with the `now` method.
  8412. * The clock is initially in a stopped state, during
  8413. * which the elapsed time does not increase. When
  8414. * started, the clock will return the total elapsed
  8415. * time since the first start / last reset.
  8416. *
  8417. * As a convenience, start/stop are aliased as
  8418. * play/pause, to mimic a media element (for use
  8419. * as a playback clock). The `currentTime` getter
  8420. * returns the elapsed time in seconds (floating
  8421. * point), also as a convenienve to closely match
  8422. * the behaviour of a video element.
  8423. */
  8424. var Clock = /*#__PURE__*/function () {
  8425. function Clock() {
  8426. _classCallCheck(this, Clock);
  8427. _defineProperty(this, "started", void 0);
  8428. _defineProperty(this, "stopped", void 0);
  8429. _defineProperty(this, "elapsed", void 0);
  8430. this.elapsed = 0;
  8431. this.started = 0;
  8432. this.stopped = true;
  8433. }
  8434. _createClass(Clock, [{
  8435. key: "start",
  8436. value: function start() {
  8437. if (this.stopped) {
  8438. this.started = window.performance.now();
  8439. this.stopped = false;
  8440. }
  8441. }
  8442. }, {
  8443. key: "stop",
  8444. value: function stop() {
  8445. if (!this.stopped) {
  8446. this.elapsed = this.now();
  8447. this.stopped = true;
  8448. }
  8449. }
  8450. }, {
  8451. key: "reset",
  8452. value: function reset() {
  8453. this.elapsed = 0;
  8454. this.started = 0;
  8455. this.stopped = true;
  8456. } // Gives the elapsed time in milliseconds since the
  8457. // clock was first started (after last reset).
  8458. }, {
  8459. key: "now",
  8460. value: function now() {
  8461. if (this.stopped) {
  8462. return this.elapsed;
  8463. } else {
  8464. return this.elapsed + (window.performance.now() - this.started);
  8465. }
  8466. }
  8467. }, {
  8468. key: "play",
  8469. value: function play() {
  8470. this.start();
  8471. }
  8472. }, {
  8473. key: "pause",
  8474. value: function pause() {
  8475. this.stop();
  8476. } // Gives the elapsed time in seconds since last reset.
  8477. }, {
  8478. key: "currentTime",
  8479. get: function get() {
  8480. return this.now() / 1000;
  8481. }
  8482. }]);
  8483. return Clock;
  8484. }();
  8485. /***/ }),
  8486. /***/ "./lib/utils/config.ts":
  8487. /*!*****************************!*\
  8488. !*** ./lib/utils/config.ts ***!
  8489. \*****************************/
  8490. /*! namespace exports */
  8491. /*! export merge [provided] [no usage info] [missing usage info prevents renaming] */
  8492. /*! other exports [not provided] [no usage info] */
  8493. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8494. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8495. "use strict";
  8496. __webpack_require__.r(__webpack_exports__);
  8497. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8498. /* harmony export */ "merge": () => /* binding */ merge
  8499. /* harmony export */ });
  8500. /* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol */ "./node_modules/core-js/modules/es.symbol.js");
  8501. /* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0__);
  8502. /* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description */ "./node_modules/core-js/modules/es.symbol.description.js");
  8503. /* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1__);
  8504. /* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator */ "./node_modules/core-js/modules/es.symbol.iterator.js");
  8505. /* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__);
  8506. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  8507. /* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_3__);
  8508. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  8509. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_4__);
  8510. /* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.keys */ "./node_modules/core-js/modules/es.object.keys.js");
  8511. /* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_5__);
  8512. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  8513. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_6__);
  8514. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  8515. /* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_7__);
  8516. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
  8517. /* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_8__);
  8518. ;
  8519. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8520. /**
  8521. * Flat merge of objects, ignoring undefined override values.
  8522. * @param {Object} template The object with default values
  8523. * @param {Object} override The object with override values.
  8524. * @return {Object} The template object with override merged in.
  8525. */
  8526. var merge = function merge(template, override) {
  8527. var cleanOverride;
  8528. if (override !== undefined) {
  8529. if (_typeof(override) !== 'object') {
  8530. throw new Error('merge expects override to be an object!');
  8531. } else {
  8532. cleanOverride = Object.keys(override).reduce(function (acc, key) {
  8533. if (override[key] !== undefined) {
  8534. acc[key] = override[key];
  8535. }
  8536. return acc;
  8537. }, {});
  8538. }
  8539. }
  8540. return Object.assign({}, template, cleanOverride);
  8541. };
  8542. /***/ }),
  8543. /***/ "./lib/utils/index.browser.ts":
  8544. /*!************************************!*\
  8545. !*** ./lib/utils/index.browser.ts ***!
  8546. \************************************/
  8547. /*! namespace exports */
  8548. /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
  8549. /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
  8550. /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
  8551. /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
  8552. /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
  8553. /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
  8554. /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
  8555. /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
  8556. /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
  8557. /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
  8558. /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
  8559. /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
  8560. /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
  8561. /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
  8562. /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
  8563. /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
  8564. /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
  8565. /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
  8566. /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
  8567. /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
  8568. /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
  8569. /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
  8570. /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
  8571. /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
  8572. /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
  8573. /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
  8574. /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
  8575. /*! other exports [not provided] [no usage info] */
  8576. /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
  8577. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8578. "use strict";
  8579. __webpack_require__.r(__webpack_exports__);
  8580. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8581. /* harmony export */ "Scheduler": () => /* reexport safe */ _scheduler__WEBPACK_IMPORTED_MODULE_0__.Scheduler,
  8582. /* harmony export */ "bodyOffset": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.bodyOffset,
  8583. /* harmony export */ "cSrc": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.cSrc,
  8584. /* harmony export */ "cSrcCount": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.cSrcCount,
  8585. /* harmony export */ "connectionEnded": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.connectionEnded,
  8586. /* harmony export */ "contentBase": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.contentBase,
  8587. /* harmony export */ "extHeader": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extHeader,
  8588. /* harmony export */ "extHeaderLength": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extHeaderLength,
  8589. /* harmony export */ "extension": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extension,
  8590. /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extractHeaderValue,
  8591. /* harmony export */ "extractURIs": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extractURIs,
  8592. /* harmony export */ "getTime": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.getTime,
  8593. /* harmony export */ "marker": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.marker,
  8594. /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.messageFromBuffer,
  8595. /* harmony export */ "padding": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.padding,
  8596. /* harmony export */ "parse": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.parse,
  8597. /* harmony export */ "payload": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.payload,
  8598. /* harmony export */ "payloadType": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.payloadType,
  8599. /* harmony export */ "range": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.range,
  8600. /* harmony export */ "sSrc": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sSrc,
  8601. /* harmony export */ "sequence": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sequence,
  8602. /* harmony export */ "sequenceNumber": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sequenceNumber,
  8603. /* harmony export */ "sessionId": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sessionId,
  8604. /* harmony export */ "sessionTimeout": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sessionTimeout,
  8605. /* harmony export */ "statusCode": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.statusCode,
  8606. /* harmony export */ "timestamp": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.timestamp,
  8607. /* harmony export */ "version": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.version
  8608. /* harmony export */ });
  8609. /* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduler */ "./lib/utils/scheduler.ts");
  8610. /* harmony import */ var _protocols__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./protocols */ "./lib/utils/protocols/index.ts");
  8611. /***/ }),
  8612. /***/ "./lib/utils/protocols/index.ts":
  8613. /*!**************************************!*\
  8614. !*** ./lib/utils/protocols/index.ts ***!
  8615. \**************************************/
  8616. /*! namespace exports */
  8617. /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
  8618. /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
  8619. /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
  8620. /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
  8621. /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
  8622. /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
  8623. /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
  8624. /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
  8625. /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
  8626. /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
  8627. /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
  8628. /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
  8629. /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
  8630. /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
  8631. /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
  8632. /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
  8633. /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
  8634. /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
  8635. /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
  8636. /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
  8637. /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
  8638. /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
  8639. /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
  8640. /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
  8641. /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
  8642. /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
  8643. /*! other exports [not provided] [no usage info] */
  8644. /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
  8645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8646. "use strict";
  8647. __webpack_require__.r(__webpack_exports__);
  8648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8649. /* harmony export */ "extractURIs": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.extractURIs,
  8650. /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.messageFromBuffer,
  8651. /* harmony export */ "parse": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.parse,
  8652. /* harmony export */ "cSrc": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.cSrc,
  8653. /* harmony export */ "cSrcCount": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.cSrcCount,
  8654. /* harmony export */ "extHeader": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extHeader,
  8655. /* harmony export */ "extHeaderLength": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extHeaderLength,
  8656. /* harmony export */ "extension": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extension,
  8657. /* harmony export */ "marker": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.marker,
  8658. /* harmony export */ "padding": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.padding,
  8659. /* harmony export */ "payload": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.payload,
  8660. /* harmony export */ "payloadType": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.payloadType,
  8661. /* harmony export */ "sSrc": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.sSrc,
  8662. /* harmony export */ "sequenceNumber": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.sequenceNumber,
  8663. /* harmony export */ "timestamp": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.timestamp,
  8664. /* harmony export */ "version": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.version,
  8665. /* harmony export */ "bodyOffset": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.bodyOffset,
  8666. /* harmony export */ "connectionEnded": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.connectionEnded,
  8667. /* harmony export */ "contentBase": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.contentBase,
  8668. /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.extractHeaderValue,
  8669. /* harmony export */ "range": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.range,
  8670. /* harmony export */ "sequence": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sequence,
  8671. /* harmony export */ "sessionId": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sessionId,
  8672. /* harmony export */ "sessionTimeout": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sessionTimeout,
  8673. /* harmony export */ "statusCode": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.statusCode,
  8674. /* harmony export */ "getTime": () => /* reexport safe */ _ntp__WEBPACK_IMPORTED_MODULE_3__.getTime
  8675. /* harmony export */ });
  8676. /* harmony import */ var _sdp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sdp */ "./lib/utils/protocols/sdp.ts");
  8677. /* harmony import */ var _rtp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtp */ "./lib/utils/protocols/rtp.ts");
  8678. /* harmony import */ var _rtsp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rtsp */ "./lib/utils/protocols/rtsp.ts");
  8679. /* harmony import */ var _ntp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ntp */ "./lib/utils/protocols/ntp.ts");
  8680. /***/ }),
  8681. /***/ "./lib/utils/protocols/isom.ts":
  8682. /*!*************************************!*\
  8683. !*** ./lib/utils/protocols/isom.ts ***!
  8684. \*************************************/
  8685. /*! namespace exports */
  8686. /*! export BOX_HEADER_BYTES [provided] [no usage info] [missing usage info prevents renaming] */
  8687. /*! export boxType [provided] [no usage info] [missing usage info prevents renaming] */
  8688. /*! other exports [not provided] [no usage info] */
  8689. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8691. "use strict";
  8692. __webpack_require__.r(__webpack_exports__);
  8693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8694. /* harmony export */ "BOX_HEADER_BYTES": () => /* binding */ BOX_HEADER_BYTES,
  8695. /* harmony export */ "boxType": () => /* binding */ boxType
  8696. /* harmony export */ });
  8697. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  8698. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_0__);
  8699. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  8700. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_1__);
  8701. ;
  8702. /*
  8703. * Track data which can be attached to an ISOM message.
  8704. * It indicates the start of a new movie.
  8705. */
  8706. var BOX_HEADER_BYTES = 8;
  8707. var boxType = function boxType(buffer) {
  8708. return buffer.toString('ascii', 4, 8).toLowerCase();
  8709. };
  8710. /***/ }),
  8711. /***/ "./lib/utils/protocols/ntp.ts":
  8712. /*!************************************!*\
  8713. !*** ./lib/utils/protocols/ntp.ts ***!
  8714. \************************************/
  8715. /*! namespace exports */
  8716. /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] */
  8717. /*! other exports [not provided] [no usage info] */
  8718. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8720. "use strict";
  8721. __webpack_require__.r(__webpack_exports__);
  8722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8723. /* harmony export */ "getTime": () => /* binding */ getTime
  8724. /* harmony export */ });
  8725. // NTP is offset from 01.01.1900
  8726. var NTP_UNIX_EPOCH_OFFSET = Date.UTC(1900, 0, 1); // Convenience types
  8727. /**
  8728. * Convert NTP time to milliseconds since January 1, 1970, 00:00:00 UTC (Unix Epoch)
  8729. * @param {Number} ntpMost Seconds since 01.01.1900
  8730. * @param {Number} ntpLeast Fractions since 01.01.1900
  8731. */
  8732. function getTime(ntpMost, ntpLeast) {
  8733. var ntpMilliSeconds = (ntpMost + ntpLeast / 0x100000000) * 1000;
  8734. return NTP_UNIX_EPOCH_OFFSET + ntpMilliSeconds;
  8735. }
  8736. /***/ }),
  8737. /***/ "./lib/utils/protocols/rtcp.ts":
  8738. /*!*************************************!*\
  8739. !*** ./lib/utils/protocols/rtcp.ts ***!
  8740. \*************************************/
  8741. /*! namespace exports */
  8742. /*! export APP [provided] [no usage info] [missing usage info prevents renaming] */
  8743. /*! export BYE [provided] [no usage info] [missing usage info prevents renaming] */
  8744. /*! export RR [provided] [no usage info] [missing usage info prevents renaming] */
  8745. /*! export SDES [provided] [no usage info] [missing usage info prevents renaming] */
  8746. /*! export SR [provided] [no usage info] [missing usage info prevents renaming] */
  8747. /*! export count [provided] [no usage info] [missing usage info prevents renaming] */
  8748. /*! export length [provided] [no usage info] [missing usage info prevents renaming] */
  8749. /*! export packetType [provided] [no usage info] [missing usage info prevents renaming] */
  8750. /*! export padding [provided] [no usage info] [missing usage info prevents renaming] */
  8751. /*! export version [provided] [no usage info] [missing usage info prevents renaming] */
  8752. /*! other exports [not provided] [no usage info] */
  8753. /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8755. "use strict";
  8756. __webpack_require__.r(__webpack_exports__);
  8757. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8758. /* harmony export */ "version": () => /* binding */ version,
  8759. /* harmony export */ "padding": () => /* binding */ padding,
  8760. /* harmony export */ "count": () => /* binding */ count,
  8761. /* harmony export */ "packetType": () => /* binding */ packetType,
  8762. /* harmony export */ "length": () => /* binding */ length,
  8763. /* harmony export */ "SR": () => /* binding */ SR,
  8764. /* harmony export */ "RR": () => /* binding */ RR,
  8765. /* harmony export */ "SDES": () => /* binding */ SDES,
  8766. /* harmony export */ "BYE": () => /* binding */ BYE,
  8767. /* harmony export */ "APP": () => /* binding */ APP
  8768. /* harmony export */ });
  8769. /* harmony import */ var _bits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bits */ "./lib/utils/bits.ts");
  8770. ; // Real Time Control Protocol (RTCP)
  8771. // https://tools.ietf.org/html/rfc3550#section-6
  8772. /*
  8773. Common RTCP packed header:
  8774. 0 1 2 3
  8775. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8776. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8777. header |V=2|P| RC | PT=SR=200 | length |
  8778. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8779. */
  8780. var version = function version(buffer) {
  8781. return buffer[0] >>> 6;
  8782. };
  8783. var padding = function padding(buffer) {
  8784. return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_0__.POS[2]);
  8785. };
  8786. var count = function count(buffer) {
  8787. return buffer[0] & 0x1f;
  8788. };
  8789. var packetType = function packetType(buffer) {
  8790. return buffer[1];
  8791. };
  8792. var length = function length(buffer) {
  8793. return buffer.readUInt16BE(2);
  8794. };
  8795. /*
  8796. SR: Sender Report RTCP Packet
  8797. 0 1 2 3
  8798. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8799. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8800. header |V=2|P| RC | PT=SR=200 | length |
  8801. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8802. | SSRC of sender |
  8803. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8804. sender | NTP timestamp, most significant word |
  8805. info +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8806. | NTP timestamp, least significant word |
  8807. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8808. | RTP timestamp |
  8809. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8810. | sender's packet count |
  8811. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8812. | sender's octet count |
  8813. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8814. report | SSRC_1 (SSRC of first source) |
  8815. block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8816. 1 | fraction lost | cumulative number of packets lost |
  8817. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8818. | extended highest sequence number received |
  8819. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8820. | interarrival jitter |
  8821. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8822. | last SR (LSR) |
  8823. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8824. | delay since last SR (DLSR) |
  8825. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8826. report | SSRC_2 (SSRC of second source) |
  8827. block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8828. 2 : ... :
  8829. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8830. | profile-specific extensions |
  8831. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8832. */
  8833. var SR = {
  8834. packetType: 200,
  8835. syncSource: function syncSource(buffer) {
  8836. return buffer.readUInt32BE(4);
  8837. },
  8838. ntpMost: function ntpMost(buffer) {
  8839. return buffer.readUInt32BE(8);
  8840. },
  8841. ntpLeast: function ntpLeast(buffer) {
  8842. return buffer.readUInt32BE(12);
  8843. },
  8844. rtpTimestamp: function rtpTimestamp(buffer) {
  8845. return buffer.readUInt32BE(16);
  8846. },
  8847. sendersPacketCount: function sendersPacketCount(buffer) {
  8848. return buffer.readUInt32BE(20);
  8849. },
  8850. sendersOctetCount: function sendersOctetCount(buffer) {
  8851. return buffer.readUInt32BE(24);
  8852. }
  8853. };
  8854. /*
  8855. RR: Receiver Report RTCP Packet
  8856. 0 1 2 3
  8857. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8858. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8859. header |V=2|P| RC | PT=RR=201 | length |
  8860. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8861. | SSRC of packet sender |
  8862. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8863. report | SSRC_1 (SSRC of first source) |
  8864. block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8865. 1 | fraction lost | cumulative number of packets lost |
  8866. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8867. | extended highest sequence number received |
  8868. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8869. | interarrival jitter |
  8870. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8871. | last SR (LSR) |
  8872. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8873. | delay since last SR (DLSR) |
  8874. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8875. report | SSRC_2 (SSRC of second source) |
  8876. block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8877. 2 : ... :
  8878. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8879. | profile-specific extensions |
  8880. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8881. */
  8882. var RR = {
  8883. packetType: 201
  8884. };
  8885. /*
  8886. SDES: Source Description RTCP Packet
  8887. 0 1 2 3
  8888. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8889. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8890. header |V=2|P| SC | PT=SDES=202 | length |
  8891. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8892. chunk | SSRC/CSRC_1 |
  8893. 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8894. | SDES items |
  8895. | ... |
  8896. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8897. chunk | SSRC/CSRC_2 |
  8898. 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8899. | SDES items |
  8900. | ... |
  8901. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8902. */
  8903. var SDES = {
  8904. packetType: 202
  8905. };
  8906. /*
  8907. BYE: Goodbye RTCP Packet
  8908. 0 1 2 3
  8909. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8910. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8911. |V=2|P| SC | PT=BYE=203 | length |
  8912. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8913. | SSRC/CSRC |
  8914. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8915. : ... :
  8916. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8917. (opt) | length | reason for leaving ...
  8918. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8919. */
  8920. var BYE = {
  8921. packetType: 203
  8922. };
  8923. /*
  8924. APP: Application-Defined RTCP Packet
  8925. 0 1 2 3
  8926. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8927. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8928. |V=2|P| subtype | PT=APP=204 | length |
  8929. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8930. | SSRC/CSRC |
  8931. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8932. | name (ASCII) |
  8933. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8934. | application-dependent data ...
  8935. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8936. */
  8937. var APP = {
  8938. packetType: 204
  8939. };
  8940. /***/ }),
  8941. /***/ "./lib/utils/protocols/rtp.ts":
  8942. /*!************************************!*\
  8943. !*** ./lib/utils/protocols/rtp.ts ***!
  8944. \************************************/
  8945. /*! namespace exports */
  8946. /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] */
  8947. /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] */
  8948. /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] */
  8949. /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] */
  8950. /*! export extension [provided] [no usage info] [missing usage info prevents renaming] */
  8951. /*! export marker [provided] [no usage info] [missing usage info prevents renaming] */
  8952. /*! export padding [provided] [no usage info] [missing usage info prevents renaming] */
  8953. /*! export payload [provided] [no usage info] [missing usage info prevents renaming] */
  8954. /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] */
  8955. /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] */
  8956. /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] */
  8957. /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] */
  8958. /*! export version [provided] [no usage info] [missing usage info prevents renaming] */
  8959. /*! other exports [not provided] [no usage info] */
  8960. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  8961. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  8962. "use strict";
  8963. __webpack_require__.r(__webpack_exports__);
  8964. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8965. /* harmony export */ "version": () => /* binding */ version,
  8966. /* harmony export */ "padding": () => /* binding */ padding,
  8967. /* harmony export */ "extension": () => /* binding */ extension,
  8968. /* harmony export */ "cSrcCount": () => /* binding */ cSrcCount,
  8969. /* harmony export */ "marker": () => /* binding */ marker,
  8970. /* harmony export */ "payloadType": () => /* binding */ payloadType,
  8971. /* harmony export */ "sequenceNumber": () => /* binding */ sequenceNumber,
  8972. /* harmony export */ "timestamp": () => /* binding */ timestamp,
  8973. /* harmony export */ "sSrc": () => /* binding */ sSrc,
  8974. /* harmony export */ "cSrc": () => /* binding */ cSrc,
  8975. /* harmony export */ "extHeaderLength": () => /* binding */ extHeaderLength,
  8976. /* harmony export */ "extHeader": () => /* binding */ extHeader,
  8977. /* harmony export */ "payload": () => /* binding */ payload
  8978. /* harmony export */ });
  8979. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  8980. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_0__);
  8981. /* harmony import */ var _bits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bits */ "./lib/utils/bits.ts");
  8982. /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
  8983. ;
  8984. // Real Time Protocol (RTP)
  8985. // https://tools.ietf.org/html/rfc3550#section-5.1
  8986. /*
  8987. RTP Fixed Header Fields
  8988. 0 1 2 3
  8989. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
  8990. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8991. |V=2|P|X| CC |M| PT | sequence number |
  8992. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8993. | timestamp |
  8994. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8995. | synchronization source (SSRC) identifier |
  8996. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8997. | contributing source (CSRC) identifiers |
  8998. | .... |
  8999. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9000. | profile-specific ext. id | profile-specific ext. length |
  9001. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9002. | profile-specific extension |
  9003. | .... |
  9004. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9005. */
  9006. var version = function version(buffer) {
  9007. return buffer[0] >>> 6;
  9008. };
  9009. var padding = function padding(buffer) {
  9010. return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[2]);
  9011. };
  9012. var extension = function extension(buffer) {
  9013. return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[3]);
  9014. };
  9015. var cSrcCount = function cSrcCount(buffer) {
  9016. return buffer[0] & 0x0f;
  9017. };
  9018. var marker = function marker(buffer) {
  9019. return !!(buffer[1] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[0]);
  9020. };
  9021. var payloadType = function payloadType(buffer) {
  9022. return buffer[1] & 0x7f;
  9023. };
  9024. var sequenceNumber = function sequenceNumber(buffer) {
  9025. return buffer.readUInt16BE(2);
  9026. };
  9027. var timestamp = function timestamp(buffer) {
  9028. return buffer.readUInt32BE(4);
  9029. };
  9030. var sSrc = function sSrc(buffer) {
  9031. return buffer.readUInt32BE(8);
  9032. };
  9033. var cSrc = function cSrc(buffer) {
  9034. var rank = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9035. return cSrcCount(buffer) > rank ? buffer.readUInt32BE(12 + rank * 4) : 0;
  9036. };
  9037. var extHeaderLength = function extHeaderLength(buffer) {
  9038. return extension(buffer) === false ? 0 : buffer.readUInt16BE(12 + cSrcCount(buffer) * 4 + 2);
  9039. };
  9040. var extHeader = function extHeader(buffer) {
  9041. return extHeaderLength(buffer) === 0 ? Buffer.from([]) : buffer.slice(12 + cSrcCount(buffer) * 4, 12 + cSrcCount(buffer) * 4 + 4 + extHeaderLength(buffer) * 4);
  9042. };
  9043. var payload = function payload(buffer) {
  9044. return extension(buffer) === false ? buffer.slice(12 + cSrcCount(buffer) * 4) : buffer.slice(12 + cSrcCount(buffer) * 4 + 4 + extHeaderLength(buffer) * 4);
  9045. };
  9046. /***/ }),
  9047. /***/ "./lib/utils/protocols/rtsp.ts":
  9048. /*!*************************************!*\
  9049. !*** ./lib/utils/protocols/rtsp.ts ***!
  9050. \*************************************/
  9051. /*! namespace exports */
  9052. /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] */
  9053. /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] */
  9054. /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] */
  9055. /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] */
  9056. /*! export range [provided] [no usage info] [missing usage info prevents renaming] */
  9057. /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] */
  9058. /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] */
  9059. /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] */
  9060. /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] */
  9061. /*! other exports [not provided] [no usage info] */
  9062. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  9063. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  9064. "use strict";
  9065. __webpack_require__.r(__webpack_exports__);
  9066. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9067. /* harmony export */ "extractHeaderValue": () => /* binding */ extractHeaderValue,
  9068. /* harmony export */ "sequence": () => /* binding */ sequence,
  9069. /* harmony export */ "sessionId": () => /* binding */ sessionId,
  9070. /* harmony export */ "sessionTimeout": () => /* binding */ sessionTimeout,
  9071. /* harmony export */ "statusCode": () => /* binding */ statusCode,
  9072. /* harmony export */ "contentBase": () => /* binding */ contentBase,
  9073. /* harmony export */ "connectionEnded": () => /* binding */ connectionEnded,
  9074. /* harmony export */ "range": () => /* binding */ range,
  9075. /* harmony export */ "bodyOffset": () => /* binding */ bodyOffset
  9076. /* harmony export */ });
  9077. /* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/core-js/modules/es.array.filter.js");
  9078. /* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__);
  9079. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  9080. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_1__);
  9081. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  9082. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__);
  9083. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  9084. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__);
  9085. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  9086. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4__);
  9087. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  9088. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_5__);
  9089. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  9090. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_6__);
  9091. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.trim */ "./node_modules/core-js/modules/es.string.trim.js");
  9092. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_7__);
  9093. ;
  9094. /*
  9095. * The RTSP response format is defined in RFC 7826,
  9096. * using ABNF notation specified in RFC 5234.
  9097. * Strings in ABNF rules ("...") are always case insensitive!
  9098. *
  9099. * Basic rules to help with the headers below:
  9100. * ====
  9101. * CR = %x0D ; US-ASCII CR, carriage return (13)
  9102. * LF = %x0A ; US-ASCII LF, linefeed (10)
  9103. * SP = %x20 ; US-ASCII SP, space (32)
  9104. * HT = %x09 ; US-ASCII HT, horizontal-tab (9)
  9105. * CRLF = CR LF
  9106. * LWS = [CRLF] 1*( SP / HT ) ; Line-breaking whitespace
  9107. * SWS = [LWS] ; Separating whitespace
  9108. * HCOLON = *( SP / HT ) ":" SWS
  9109. *
  9110. * RTSP response rules (a `*` means zero or more):
  9111. * ====
  9112. * Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF
  9113. * Response = Status-Line
  9114. * *((general-header
  9115. * / response-header
  9116. * / message-body-header) CRLF)
  9117. * CRLF
  9118. * [ message-body-data ]
  9119. *
  9120. * Example response:
  9121. * ====
  9122. * RTSP/1.0 200 OK
  9123. * CSeq: 3
  9124. * Content-Type: application/sdp
  9125. * Content-Base: rtsp://192.168.0.3/media/media.amp/
  9126. * Server: GStreamer RTSP server
  9127. * Date: Wed, 03 Jun 2015 14:23:42 GMT
  9128. * Content-Length: 623
  9129. *
  9130. * v=0
  9131. * ....
  9132. */
  9133. /**
  9134. * Extract the value of a header.
  9135. *
  9136. * @param buffer The response bytes
  9137. * @param header The header to search for
  9138. */
  9139. var extractHeaderValue = function extractHeaderValue(buffer, header) {
  9140. var anchor = "\n".concat(header.toLowerCase(), ": ");
  9141. var start = buffer.toString().toLowerCase().indexOf(anchor);
  9142. if (start >= 0) {
  9143. var end = buffer.indexOf('\n', start + anchor.length);
  9144. var headerValue = buffer.toString('ascii', start + anchor.length, end).trim();
  9145. return headerValue;
  9146. }
  9147. return null;
  9148. };
  9149. var sequence = function sequence(buffer) {
  9150. /**
  9151. * CSeq = "CSeq" HCOLON cseq-nr
  9152. * cseq-nr = 1*9DIGIT
  9153. */
  9154. var val = extractHeaderValue(buffer, 'CSeq');
  9155. if (val !== null) {
  9156. return Number(val);
  9157. }
  9158. return null;
  9159. };
  9160. var sessionId = function sessionId(buffer) {
  9161. /**
  9162. * Session = "Session" HCOLON session-id
  9163. * [ SEMI "timeout" EQUAL delta-seconds ]
  9164. * session-id = 1*256( ALPHA / DIGIT / safe )
  9165. * delta-seconds = 1*19DIGIT
  9166. */
  9167. var val = extractHeaderValue(buffer, 'Session');
  9168. return val ? val.split(';')[0] : null;
  9169. };
  9170. var sessionTimeout = function sessionTimeout(buffer) {
  9171. /**
  9172. * Session = "Session" HCOLON session-id
  9173. * [ SEMI "timeout" EQUAL delta-seconds ]
  9174. * session-id = 1*256( ALPHA / DIGIT / safe )
  9175. * delta-seconds = 1*19DIGIT
  9176. */
  9177. var val = extractHeaderValue(buffer, 'Session');
  9178. if (val === null) {
  9179. return null;
  9180. }
  9181. var timeoutToken = 'timeout=';
  9182. var timeoutPosition = val.toLowerCase().indexOf(timeoutToken);
  9183. if (timeoutPosition !== -1) {
  9184. var timeoutVal = val.substring(timeoutPosition + timeoutToken.length);
  9185. timeoutVal = timeoutVal.split(';')[0];
  9186. var parsedTimeout = parseInt(timeoutVal);
  9187. return isNaN(parsedTimeout) ? null : parsedTimeout;
  9188. }
  9189. return null;
  9190. };
  9191. var statusCode = function statusCode(buffer) {
  9192. return Number(buffer.toString('ascii', 9, 12));
  9193. };
  9194. var contentBase = function contentBase(buffer) {
  9195. /**
  9196. * Content-Base = "Content-Base" HCOLON RTSP-URI
  9197. */
  9198. return extractHeaderValue(buffer, 'Content-Base');
  9199. };
  9200. var connectionEnded = function connectionEnded(buffer) {
  9201. /**
  9202. * Connection = "Connection" HCOLON connection-token
  9203. * *(COMMA connection-token)
  9204. * connection-token = "close" / token
  9205. */
  9206. var connectionToken = extractHeaderValue(buffer, 'Connection');
  9207. return connectionToken !== null && connectionToken.toLowerCase() === 'close';
  9208. };
  9209. var range = function range(buffer) {
  9210. /**
  9211. * Range = "Range" HCOLON ranges-spec
  9212. * ranges-spec = npt-range / utc-range / smpte-range
  9213. * / range-ext
  9214. * npt-range = "npt" [EQUAL npt-range-spec]
  9215. * npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time )
  9216. * npt-time = "now" / npt-sec / npt-hhmmss / npt-hhmmss-comp
  9217. * npt-sec = 1*19DIGIT [ "." 1*9DIGIT ]
  9218. * npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ]
  9219. * npt-hh = 2*19DIGIT ; any positive number
  9220. * npt-mm = 2*2DIGIT ; 0-59
  9221. * npt-ss = 2*2DIGIT ; 0-59
  9222. * npt-hhmmss-comp = npt-hh-comp ":" npt-mm-comp ":" npt-ss-comp
  9223. * [ "." 1*9DIGIT ] ; Compatibility format
  9224. * npt-hh-comp = 1*19DIGIT ; any positive number
  9225. * npt-mm-comp = 1*2DIGIT ; 0-59
  9226. * npt-ss-comp = 1*2DIGIT ; 0-59
  9227. */
  9228. // Example range headers:
  9229. // Range: npt=now-
  9230. // Range: npt=1154.598701-3610.259146
  9231. var npt = extractHeaderValue(buffer, 'Range');
  9232. if (npt !== null) {
  9233. return npt.split('=')[1].split('-');
  9234. }
  9235. return undefined;
  9236. };
  9237. /**
  9238. * Determine the offset of the RTSP body, where the header ends.
  9239. * If there is no header ending, -1 is returned
  9240. * @param {Buffer} chunk A piece of data
  9241. * @return {Number} The body offset, or -1 if no header end found
  9242. */
  9243. var bodyOffset = function bodyOffset(chunk) {
  9244. /**
  9245. * Strictly speaking, it seems RTSP MUST have CRLF and doesn't allow CR or LF on its own.
  9246. * That means that the end of the header part should be a pair of CRLF, but we're being
  9247. * flexible here and also allow LF LF or CR CR instead of CRLF CRLF.
  9248. */
  9249. var bodyOffsets = ['\n\n', '\r\r', '\r\n\r\n'].map(function (s) {
  9250. var offset = chunk.indexOf(s);
  9251. if (offset !== -1) {
  9252. return offset + s.length;
  9253. }
  9254. return offset;
  9255. }).filter(function (offset) {
  9256. return offset !== -1;
  9257. });
  9258. if (bodyOffsets.length > 0) {
  9259. return bodyOffsets.reduce(function (acc, offset) {
  9260. return Math.min(acc, offset);
  9261. });
  9262. } else {
  9263. return -1;
  9264. }
  9265. };
  9266. /***/ }),
  9267. /***/ "./lib/utils/protocols/sdp.ts":
  9268. /*!************************************!*\
  9269. !*** ./lib/utils/protocols/sdp.ts ***!
  9270. \************************************/
  9271. /*! namespace exports */
  9272. /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] */
  9273. /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] */
  9274. /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */
  9275. /*! other exports [not provided] [no usage info] */
  9276. /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  9277. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  9278. "use strict";
  9279. __webpack_require__.r(__webpack_exports__);
  9280. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9281. /* harmony export */ "extractURIs": () => /* binding */ extractURIs,
  9282. /* harmony export */ "parse": () => /* binding */ parse,
  9283. /* harmony export */ "messageFromBuffer": () => /* binding */ messageFromBuffer
  9284. /* harmony export */ });
  9285. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.map */ "./node_modules/core-js/modules/es.array.map.js");
  9286. /* harmony import */ var core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_0__);
  9287. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ "./node_modules/core-js/modules/es.array.slice.js");
  9288. /* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);
  9289. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js");
  9290. /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_2__);
  9291. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.assign */ "./node_modules/core-js/modules/es.object.assign.js");
  9292. /* harmony import */ var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_3__);
  9293. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js");
  9294. /* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_4__);
  9295. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  9296. /* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_5__);
  9297. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  9298. /* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_6__);
  9299. /* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.match */ "./node_modules/core-js/modules/es.string.match.js");
  9300. /* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_7__);
  9301. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.split */ "./node_modules/core-js/modules/es.string.split.js");
  9302. /* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_8__);
  9303. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.trim */ "./node_modules/core-js/modules/es.string.trim.js");
  9304. /* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_9__);
  9305. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
  9306. /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_10__);
  9307. /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../components/message */ "./lib/components/message.ts");
  9308. ;
  9309. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  9310. function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
  9311. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  9312. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  9313. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  9314. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  9315. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  9316. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  9317. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  9318. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  9319. var extractLineVals = function extractLineVals(buffer, lineStart) {
  9320. var start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  9321. var anchor = "\n".concat(lineStart);
  9322. start = buffer.indexOf(anchor, start);
  9323. var end = 0;
  9324. var ret = [];
  9325. while (start >= 0) {
  9326. end = buffer.indexOf('\n', start + anchor.length);
  9327. ret.push(buffer.toString('ascii', start + anchor.length, end).trim());
  9328. start = buffer.indexOf(anchor, end);
  9329. }
  9330. return ret;
  9331. }; // SDP parsing
  9332. /**
  9333. * Identify the start of a session-level or media-level section.
  9334. * @param {String} line The line to parse
  9335. * @return {Object} Object with a type + name
  9336. */
  9337. var newMediaLevel = function newMediaLevel(line) {
  9338. return line.match(/^m=/);
  9339. };
  9340. var splitOnFirst = function splitOnFirst(c, text) {
  9341. var p = text.indexOf(c);
  9342. if (p < 0) {
  9343. return [text.slice(0)];
  9344. } else {
  9345. return [text.slice(0, p), text.slice(p + 1)];
  9346. }
  9347. };
  9348. var attributeParsers = {
  9349. fmtp: function fmtp(value) {
  9350. var _splitOnFirst = splitOnFirst(' ', value),
  9351. _splitOnFirst2 = _slicedToArray(_splitOnFirst, 2),
  9352. format = _splitOnFirst2[0],
  9353. stringParameters = _splitOnFirst2[1];
  9354. switch (format) {
  9355. default:
  9356. var pairs = stringParameters.trim().split(';');
  9357. var parameters = {};
  9358. pairs.forEach(function (pair) {
  9359. var _splitOnFirst3 = splitOnFirst('=', pair),
  9360. _splitOnFirst4 = _slicedToArray(_splitOnFirst3, 2),
  9361. key = _splitOnFirst4[0],
  9362. val = _splitOnFirst4[1];
  9363. var normalizedKey = key.trim().toLowerCase();
  9364. if (normalizedKey !== '') {
  9365. parameters[normalizedKey] = val.trim();
  9366. }
  9367. });
  9368. return {
  9369. format: format,
  9370. parameters: parameters
  9371. };
  9372. }
  9373. },
  9374. framerate: Number,
  9375. rtpmap: function rtpmap(value) {
  9376. var _splitOnFirst5 = splitOnFirst(' ', value),
  9377. _splitOnFirst6 = _slicedToArray(_splitOnFirst5, 2),
  9378. payloadType = _splitOnFirst6[0],
  9379. encoding = _splitOnFirst6[1];
  9380. var _encoding$toUpperCase = encoding.toUpperCase().split('/'),
  9381. _encoding$toUpperCase2 = _slicedToArray(_encoding$toUpperCase, 3),
  9382. encodingName = _encoding$toUpperCase2[0],
  9383. clockrate = _encoding$toUpperCase2[1],
  9384. encodingParameters = _encoding$toUpperCase2[2];
  9385. if (encodingParameters === undefined) {
  9386. return {
  9387. payloadType: Number(payloadType),
  9388. encodingName: encodingName,
  9389. clockrate: Number(clockrate)
  9390. };
  9391. } else {
  9392. return {
  9393. payloadType: Number(payloadType),
  9394. encodingName: encodingName,
  9395. clockrate: Number(clockrate),
  9396. encodingParameters: encodingParameters
  9397. };
  9398. }
  9399. },
  9400. transform: function transform(value) {
  9401. return value.split(';').map(function (row) {
  9402. return row.split(',').map(Number);
  9403. });
  9404. },
  9405. framesize: function framesize(value) {
  9406. return value.split(' ')[1].split('-').map(Number);
  9407. }
  9408. };
  9409. var parseAttribute = function parseAttribute(body) {
  9410. var _splitOnFirst7 = splitOnFirst(':', body),
  9411. _splitOnFirst8 = _slicedToArray(_splitOnFirst7, 2),
  9412. attribute = _splitOnFirst8[0],
  9413. value = _splitOnFirst8[1];
  9414. if (value === undefined) {
  9415. return _defineProperty({}, attribute, true);
  9416. } else {
  9417. if (attributeParsers[attribute] !== undefined) {
  9418. return _defineProperty({}, attribute, attributeParsers[attribute](value));
  9419. } else {
  9420. return _defineProperty({}, attribute, value);
  9421. }
  9422. }
  9423. };
  9424. var extractField = function extractField(line) {
  9425. var prefix = line.slice(0, 1);
  9426. var body = line.slice(2);
  9427. switch (prefix) {
  9428. case 'v':
  9429. return {
  9430. version: body
  9431. };
  9432. case 'o':
  9433. var _body$split = body.split(' '),
  9434. _body$split2 = _slicedToArray(_body$split, 6),
  9435. username = _body$split2[0],
  9436. sessionId = _body$split2[1],
  9437. sessionVersion = _body$split2[2],
  9438. netType = _body$split2[3],
  9439. addrType = _body$split2[4],
  9440. unicastAddress = _body$split2[5];
  9441. return {
  9442. origin: {
  9443. addrType: addrType,
  9444. netType: netType,
  9445. sessionId: sessionId,
  9446. sessionVersion: sessionVersion,
  9447. unicastAddress: unicastAddress,
  9448. username: username
  9449. }
  9450. };
  9451. case 's':
  9452. return {
  9453. sessionName: body
  9454. };
  9455. case 'i':
  9456. return {
  9457. sessionInformation: body
  9458. };
  9459. case 'u':
  9460. return {
  9461. uri: body
  9462. };
  9463. case 'e':
  9464. return {
  9465. email: body
  9466. };
  9467. case 'p':
  9468. return {
  9469. phone: body
  9470. };
  9471. // c=<nettype> <addrtype> <connection-address>
  9472. case 'c':
  9473. var _body$split3 = body.split(' '),
  9474. _body$split4 = _slicedToArray(_body$split3, 3),
  9475. connectionNetType = _body$split4[0],
  9476. connectionAddrType = _body$split4[1],
  9477. connectionAddress = _body$split4[2];
  9478. return {
  9479. connectionData: {
  9480. addrType: connectionAddrType,
  9481. connectionAddress: connectionAddress,
  9482. netType: connectionNetType
  9483. }
  9484. };
  9485. // b=<bwtype>:<bandwidth>
  9486. case 'b':
  9487. var _body$split5 = body.split(':'),
  9488. _body$split6 = _slicedToArray(_body$split5, 2),
  9489. bwtype = _body$split6[0],
  9490. bandwidth = _body$split6[1];
  9491. return {
  9492. bwtype: bwtype,
  9493. bandwidth: bandwidth
  9494. };
  9495. // t=<start-time> <stop-time>
  9496. case 't':
  9497. var _body$split$map = body.split(' ').map(Number),
  9498. _body$split$map2 = _slicedToArray(_body$split$map, 2),
  9499. startTime = _body$split$map2[0],
  9500. stopTime = _body$split$map2[1];
  9501. return {
  9502. time: {
  9503. startTime: startTime,
  9504. stopTime: stopTime
  9505. }
  9506. };
  9507. // r=<repeat interval> <active duration> <offsets from start-time>
  9508. case 'r':
  9509. var _body$split$map3 = body.split(' ').map(Number),
  9510. _body$split$map4 = _toArray(_body$split$map3),
  9511. repeatInterval = _body$split$map4[0],
  9512. activeDuration = _body$split$map4[1],
  9513. offsets = _body$split$map4.slice(2);
  9514. return {
  9515. repeatTimes: {
  9516. repeatInterval: repeatInterval,
  9517. activeDuration: activeDuration,
  9518. offsets: offsets
  9519. }
  9520. };
  9521. // z=<adjustment time> <offset> <adjustment time> <offset> ....
  9522. case 'z':
  9523. return;
  9524. // k=<method>
  9525. // k=<method>:<encryption key>
  9526. case 'k':
  9527. return;
  9528. // a=<attribute>
  9529. // a=<attribute>:<value>
  9530. case 'a':
  9531. return parseAttribute(body);
  9532. case 'm':
  9533. // Only the first fmt field is parsed!
  9534. var _body$split7 = body.split(' '),
  9535. _body$split8 = _slicedToArray(_body$split7, 4),
  9536. type = _body$split8[0],
  9537. port = _body$split8[1],
  9538. protocol = _body$split8[2],
  9539. fmt = _body$split8[3];
  9540. return {
  9541. type: type,
  9542. port: Number(port),
  9543. protocol: protocol,
  9544. fmt: Number(fmt)
  9545. };
  9546. default: // console.log('unknown SDP prefix ', prefix);
  9547. }
  9548. };
  9549. var extractURIs = function extractURIs(buffer) {
  9550. // There is a control URI above the m= line, which should not be used
  9551. var seekFrom = buffer.indexOf('\nm=');
  9552. return extractLineVals(buffer, 'a=control:', seekFrom);
  9553. };
  9554. /**
  9555. * Create an array of sprop-parameter-sets elements
  9556. * @param {Buffer} buffer The buffer containing the sdp data
  9557. * @return {Array} The differen parameter strings
  9558. */
  9559. var parse = function parse(buffer) {
  9560. var sdp = buffer.toString('ascii').split('\n').map(function (s) {
  9561. return s.trim();
  9562. });
  9563. var struct = {
  9564. session: {},
  9565. media: []
  9566. };
  9567. var mediaCounter = 0;
  9568. var current = struct.session;
  9569. var _iterator = _createForOfIteratorHelper(sdp),
  9570. _step;
  9571. try {
  9572. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  9573. var line = _step.value;
  9574. if (newMediaLevel(line)) {
  9575. struct.media[mediaCounter] = {};
  9576. current = struct.media[mediaCounter];
  9577. ++mediaCounter;
  9578. }
  9579. current = Object.assign(current, extractField(line));
  9580. }
  9581. } catch (err) {
  9582. _iterator.e(err);
  9583. } finally {
  9584. _iterator.f();
  9585. }
  9586. return struct;
  9587. };
  9588. var messageFromBuffer = function messageFromBuffer(buffer) {
  9589. return {
  9590. type: _components_message__WEBPACK_IMPORTED_MODULE_11__.MessageType.SDP,
  9591. data: buffer,
  9592. sdp: parse(buffer)
  9593. };
  9594. };
  9595. /***/ }),
  9596. /***/ "./lib/utils/scheduler.ts":
  9597. /*!********************************!*\
  9598. !*** ./lib/utils/scheduler.ts ***!
  9599. \********************************/
  9600. /*! namespace exports */
  9601. /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] */
  9602. /*! other exports [not provided] [no usage info] */
  9603. /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
  9604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  9605. "use strict";
  9606. __webpack_require__.r(__webpack_exports__);
  9607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9608. /* harmony export */ "Scheduler": () => /* binding */ Scheduler
  9609. /* harmony export */ });
  9610. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9611. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9612. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9613. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  9614. // The default tolerance for matching the handler
  9615. // invocation to clock presentation time.
  9616. var DEFAULT_TOLERANCE = 10;
  9617. /**
  9618. * A scheduler that can decide when to execute a certain
  9619. * timestamped callback so that it happens in sync with a video
  9620. * element.
  9621. *
  9622. * To use it:
  9623. *
  9624. * (1) Initialize a new Scheduler with a clock (to synchronize
  9625. * against) and a callback (to be called when a message is in
  9626. * sync with the video). The clock can be a HTMLVideoElement,
  9627. * or anything that has a `currentTime` property which gives
  9628. * the current presentation time in seconds, and a `pause` and
  9629. * `play` method to control playback.
  9630. *
  9631. * (2) Call the `run` method every time a new message arrives
  9632. * that you want to schedule (it needs to have an ntpTimestamp).
  9633. * As soon at the presentation time is known, call the `init`
  9634. * method and pass in that time, so that the scheduler can
  9635. * start to schedule the callbacks. From then on, whenever
  9636. * a message in the queue has a timestamp that matches the
  9637. * current presentation time of the video, your callback will
  9638. * fire.
  9639. *
  9640. * @class Scheduler
  9641. */
  9642. var Scheduler = /*#__PURE__*/function () {
  9643. /**
  9644. * Creates an instance of Scheduler.
  9645. * @param {any} clock The clock to use (so we can control playback)
  9646. * @param {any} handler The callback to invoke when a message is in sync
  9647. * @param {number} [tolerance=DEFAULT_TOLERANCE] The milliseconds defining "in sync"
  9648. * @memberof Scheduler
  9649. */
  9650. function Scheduler(clock, handler) {
  9651. var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_TOLERANCE;
  9652. _classCallCheck(this, Scheduler);
  9653. _defineProperty(this, "_clock", void 0);
  9654. _defineProperty(this, "_handler", void 0);
  9655. _defineProperty(this, "_tolerance", void 0);
  9656. _defineProperty(this, "_nextRun", void 0);
  9657. _defineProperty(this, "_nextPlay", void 0);
  9658. _defineProperty(this, "_fifo", void 0);
  9659. _defineProperty(this, "_ntpPresentationTime", void 0);
  9660. _defineProperty(this, "_suspended", void 0);
  9661. this._clock = clock;
  9662. this._handler = handler;
  9663. this._tolerance = tolerance;
  9664. this._nextRun = 0;
  9665. this._nextPlay = 0;
  9666. this._fifo = [];
  9667. this._ntpPresentationTime = 0;
  9668. this._suspended = false;
  9669. }
  9670. /**
  9671. * Bring the scheduler back to it's initial state.
  9672. * @memberof Scheduler
  9673. */
  9674. _createClass(Scheduler, [{
  9675. key: "reset",
  9676. value: function reset() {
  9677. clearTimeout(this._nextRun);
  9678. clearTimeout(this._nextPlay);
  9679. this._fifo = [];
  9680. this._ntpPresentationTime = 0;
  9681. this._suspended = false;
  9682. }
  9683. /**
  9684. * Initialize the scheduler.
  9685. *
  9686. * @param {any} ntpPresentationTime The offset representing the start of the presentation
  9687. * @memberof Scheduler
  9688. */
  9689. }, {
  9690. key: "init",
  9691. value: function init(ntpPresentationTime) {
  9692. this._ntpPresentationTime = ntpPresentationTime;
  9693. }
  9694. /**
  9695. * Suspend the scheduler.
  9696. *
  9697. * This releases control of the clock and stops any scheduling activity.
  9698. * Note that this doesn't mean the clock will be in a particular state
  9699. * (could be started or stopped), just that the scheduler will no longer
  9700. * control it.
  9701. *
  9702. * @memberof Scheduler
  9703. */
  9704. }, {
  9705. key: "suspend",
  9706. value: function suspend() {
  9707. clearTimeout(this._nextPlay);
  9708. this._suspended = true;
  9709. }
  9710. /**
  9711. * Resume the scheduler.
  9712. *
  9713. * This gives back control of the clock and the ability
  9714. * to schedule messages. The scheduler will immediately
  9715. * try to do that on resume.
  9716. *
  9717. * @memberof Scheduler
  9718. */
  9719. }, {
  9720. key: "resume",
  9721. value: function resume() {
  9722. this._suspended = false;
  9723. this.run(undefined);
  9724. }
  9725. /**
  9726. * Run the scheduler.
  9727. *
  9728. * @param {any} [msg] New message to schedule.
  9729. * @memberof Scheduler
  9730. */
  9731. }, {
  9732. key: "run",
  9733. value: function run(newMessage) {
  9734. var _this = this;
  9735. clearTimeout(this._nextRun); // If there is no way to schedule anything, just return.
  9736. // The first schedule will happen for the first .run that
  9737. // is called after the presentation time has been initialized.
  9738. if (typeof this._ntpPresentationTime === 'undefined') {
  9739. return;
  9740. } // If there is a new message, add it to the FIFO queue
  9741. if (typeof newMessage !== 'undefined') {
  9742. this._fifo.push(newMessage);
  9743. } // If the scheduler is suspended, we can only keep the
  9744. // messages and not do anything with them.
  9745. if (this._suspended) {
  9746. return;
  9747. } // If there are no messages, we don't need to bother or
  9748. // even re-schedule, because the new call to .run() will
  9749. // have to come from outside with a new message.
  9750. if (this._fifo.length === 0) {
  9751. return;
  9752. } // There is at least one message in the FIFO queue, either
  9753. // display it, or re-schedule the method for later execution
  9754. var timeToPresent = 0;
  9755. var currentMessage;
  9756. do {
  9757. var _msg = this._fifo.shift();
  9758. if (_msg === undefined) {
  9759. throw new Error('internal error: message should never be undefined');
  9760. }
  9761. currentMessage = _msg;
  9762. var ntpTimestamp = currentMessage.ntpTimestamp;
  9763. if (ntpTimestamp === undefined) {
  9764. continue;
  9765. }
  9766. var presentationTime = ntpTimestamp - this._ntpPresentationTime;
  9767. timeToPresent = presentationTime - this._clock.currentTime * 1000; // If the message is within a tolerance of the presentation time
  9768. // then call the handler.
  9769. if (Math.abs(timeToPresent) < this._tolerance) {
  9770. this._handler && this._handler(currentMessage);
  9771. }
  9772. } while (timeToPresent < this._tolerance && this._fifo.length > 0);
  9773. if (timeToPresent < -this._tolerance) {
  9774. // We ran out of messages, delay the video with the same amount
  9775. // of delay as the last message had on the FIFO queue.
  9776. // Since we don't have any messages in the queue right now,
  9777. // the only way for anything to happen is if scheduler.run
  9778. // is called.
  9779. clearTimeout(this._nextPlay);
  9780. this._clock.pause();
  9781. this._nextPlay = window.setTimeout(function () {
  9782. return _this._clock.play();
  9783. }, -timeToPresent);
  9784. } else if (timeToPresent > this._tolerance) {
  9785. // message is later than video, add it back to the queue and
  9786. // re-run the scheduling at a later point in time
  9787. this._fifo.unshift(currentMessage);
  9788. this._nextRun = window.setTimeout(function () {
  9789. return _this.run(undefined);
  9790. }, timeToPresent);
  9791. }
  9792. }
  9793. }]);
  9794. return Scheduler;
  9795. }();
  9796. /***/ }),
  9797. /***/ "./node_modules/base64-js/index.js":
  9798. /*!*****************************************!*\
  9799. !*** ./node_modules/base64-js/index.js ***!
  9800. \*****************************************/
  9801. /*! default exports */
  9802. /*! export byteLength [provided] [no usage info] [missing usage info prevents renaming] */
  9803. /*! export fromByteArray [provided] [no usage info] [missing usage info prevents renaming] */
  9804. /*! export toByteArray [provided] [no usage info] [missing usage info prevents renaming] */
  9805. /*! other exports [not provided] [no usage info] */
  9806. /*! runtime requirements: __webpack_exports__ */
  9807. /***/ ((__unused_webpack_module, exports) => {
  9808. "use strict";
  9809. exports.byteLength = byteLength
  9810. exports.toByteArray = toByteArray
  9811. exports.fromByteArray = fromByteArray
  9812. var lookup = []
  9813. var revLookup = []
  9814. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  9815. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  9816. for (var i = 0, len = code.length; i < len; ++i) {
  9817. lookup[i] = code[i]
  9818. revLookup[code.charCodeAt(i)] = i
  9819. }
  9820. // Support decoding URL-safe base64 strings, as Node.js does.
  9821. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  9822. revLookup['-'.charCodeAt(0)] = 62
  9823. revLookup['_'.charCodeAt(0)] = 63
  9824. function getLens (b64) {
  9825. var len = b64.length
  9826. if (len % 4 > 0) {
  9827. throw new Error('Invalid string. Length must be a multiple of 4')
  9828. }
  9829. // Trim off extra bytes after placeholder bytes are found
  9830. // See: https://github.com/beatgammit/base64-js/issues/42
  9831. var validLen = b64.indexOf('=')
  9832. if (validLen === -1) validLen = len
  9833. var placeHoldersLen = validLen === len
  9834. ? 0
  9835. : 4 - (validLen % 4)
  9836. return [validLen, placeHoldersLen]
  9837. }
  9838. // base64 is 4/3 + up to two characters of the original data
  9839. function byteLength (b64) {
  9840. var lens = getLens(b64)
  9841. var validLen = lens[0]
  9842. var placeHoldersLen = lens[1]
  9843. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  9844. }
  9845. function _byteLength (b64, validLen, placeHoldersLen) {
  9846. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  9847. }
  9848. function toByteArray (b64) {
  9849. var tmp
  9850. var lens = getLens(b64)
  9851. var validLen = lens[0]
  9852. var placeHoldersLen = lens[1]
  9853. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  9854. var curByte = 0
  9855. // if there are placeholders, only get up to the last complete 4 chars
  9856. var len = placeHoldersLen > 0
  9857. ? validLen - 4
  9858. : validLen
  9859. var i
  9860. for (i = 0; i < len; i += 4) {
  9861. tmp =
  9862. (revLookup[b64.charCodeAt(i)] << 18) |
  9863. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  9864. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  9865. revLookup[b64.charCodeAt(i + 3)]
  9866. arr[curByte++] = (tmp >> 16) & 0xFF
  9867. arr[curByte++] = (tmp >> 8) & 0xFF
  9868. arr[curByte++] = tmp & 0xFF
  9869. }
  9870. if (placeHoldersLen === 2) {
  9871. tmp =
  9872. (revLookup[b64.charCodeAt(i)] << 2) |
  9873. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  9874. arr[curByte++] = tmp & 0xFF
  9875. }
  9876. if (placeHoldersLen === 1) {
  9877. tmp =
  9878. (revLookup[b64.charCodeAt(i)] << 10) |
  9879. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  9880. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  9881. arr[curByte++] = (tmp >> 8) & 0xFF
  9882. arr[curByte++] = tmp & 0xFF
  9883. }
  9884. return arr
  9885. }
  9886. function tripletToBase64 (num) {
  9887. return lookup[num >> 18 & 0x3F] +
  9888. lookup[num >> 12 & 0x3F] +
  9889. lookup[num >> 6 & 0x3F] +
  9890. lookup[num & 0x3F]
  9891. }
  9892. function encodeChunk (uint8, start, end) {
  9893. var tmp
  9894. var output = []
  9895. for (var i = start; i < end; i += 3) {
  9896. tmp =
  9897. ((uint8[i] << 16) & 0xFF0000) +
  9898. ((uint8[i + 1] << 8) & 0xFF00) +
  9899. (uint8[i + 2] & 0xFF)
  9900. output.push(tripletToBase64(tmp))
  9901. }
  9902. return output.join('')
  9903. }
  9904. function fromByteArray (uint8) {
  9905. var tmp
  9906. var len = uint8.length
  9907. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  9908. var parts = []
  9909. var maxChunkLength = 16383 // must be multiple of 3
  9910. // go through the array every three bytes, we'll deal with trailing stuff later
  9911. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  9912. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  9913. }
  9914. // pad the end with zeros, but make sure to not forget the extra bytes
  9915. if (extraBytes === 1) {
  9916. tmp = uint8[len - 1]
  9917. parts.push(
  9918. lookup[tmp >> 2] +
  9919. lookup[(tmp << 4) & 0x3F] +
  9920. '=='
  9921. )
  9922. } else if (extraBytes === 2) {
  9923. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  9924. parts.push(
  9925. lookup[tmp >> 10] +
  9926. lookup[(tmp >> 4) & 0x3F] +
  9927. lookup[(tmp << 2) & 0x3F] +
  9928. '='
  9929. )
  9930. }
  9931. return parts.join('')
  9932. }
  9933. /***/ }),
  9934. /***/ "./node_modules/buffer/index.js":
  9935. /*!**************************************!*\
  9936. !*** ./node_modules/buffer/index.js ***!
  9937. \**************************************/
  9938. /*! default exports */
  9939. /*! export Buffer [provided] [no usage info] [missing usage info prevents renaming] */
  9940. /*! export INSPECT_MAX_BYTES [provided] [no usage info] [missing usage info prevents renaming] */
  9941. /*! export SlowBuffer [provided] [no usage info] [missing usage info prevents renaming] */
  9942. /*! export kMaxLength [provided] [no usage info] [missing usage info prevents renaming] */
  9943. /*! other exports [not provided] [no usage info] */
  9944. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  9945. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  9946. "use strict";
  9947. /*!
  9948. * The buffer module from node.js, for the browser.
  9949. *
  9950. * @author Feross Aboukhadijeh <https://feross.org>
  9951. * @license MIT
  9952. */
  9953. /* eslint-disable no-proto */
  9954. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  9955. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  9956. var customInspectSymbol =
  9957. (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
  9958. ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
  9959. : null
  9960. exports.Buffer = Buffer
  9961. exports.SlowBuffer = SlowBuffer
  9962. exports.INSPECT_MAX_BYTES = 50
  9963. var K_MAX_LENGTH = 0x7fffffff
  9964. exports.kMaxLength = K_MAX_LENGTH
  9965. /**
  9966. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  9967. * === true Use Uint8Array implementation (fastest)
  9968. * === false Print warning and recommend using `buffer` v4.x which has an Object
  9969. * implementation (most compatible, even IE6)
  9970. *
  9971. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  9972. * Opera 11.6+, iOS 4.2+.
  9973. *
  9974. * We report that the browser does not support typed arrays if the are not subclassable
  9975. * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
  9976. * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
  9977. * for __proto__ and has a buggy typed array implementation.
  9978. */
  9979. Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
  9980. if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
  9981. typeof console.error === 'function') {
  9982. console.error(
  9983. 'This browser lacks typed array (Uint8Array) support which is required by ' +
  9984. '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
  9985. )
  9986. }
  9987. function typedArraySupport () {
  9988. // Can typed array instances can be augmented?
  9989. try {
  9990. var arr = new Uint8Array(1)
  9991. var proto = { foo: function () { return 42 } }
  9992. Object.setPrototypeOf(proto, Uint8Array.prototype)
  9993. Object.setPrototypeOf(arr, proto)
  9994. return arr.foo() === 42
  9995. } catch (e) {
  9996. return false
  9997. }
  9998. }
  9999. Object.defineProperty(Buffer.prototype, 'parent', {
  10000. enumerable: true,
  10001. get: function () {
  10002. if (!Buffer.isBuffer(this)) return undefined
  10003. return this.buffer
  10004. }
  10005. })
  10006. Object.defineProperty(Buffer.prototype, 'offset', {
  10007. enumerable: true,
  10008. get: function () {
  10009. if (!Buffer.isBuffer(this)) return undefined
  10010. return this.byteOffset
  10011. }
  10012. })
  10013. function createBuffer (length) {
  10014. if (length > K_MAX_LENGTH) {
  10015. throw new RangeError('The value "' + length + '" is invalid for option "size"')
  10016. }
  10017. // Return an augmented `Uint8Array` instance
  10018. var buf = new Uint8Array(length)
  10019. Object.setPrototypeOf(buf, Buffer.prototype)
  10020. return buf
  10021. }
  10022. /**
  10023. * The Buffer constructor returns instances of `Uint8Array` that have their
  10024. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  10025. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  10026. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  10027. * returns a single octet.
  10028. *
  10029. * The `Uint8Array` prototype remains unmodified.
  10030. */
  10031. function Buffer (arg, encodingOrOffset, length) {
  10032. // Common case.
  10033. if (typeof arg === 'number') {
  10034. if (typeof encodingOrOffset === 'string') {
  10035. throw new TypeError(
  10036. 'The "string" argument must be of type string. Received type number'
  10037. )
  10038. }
  10039. return allocUnsafe(arg)
  10040. }
  10041. return from(arg, encodingOrOffset, length)
  10042. }
  10043. Buffer.poolSize = 8192 // not used by this implementation
  10044. function from (value, encodingOrOffset, length) {
  10045. if (typeof value === 'string') {
  10046. return fromString(value, encodingOrOffset)
  10047. }
  10048. if (ArrayBuffer.isView(value)) {
  10049. return fromArrayView(value)
  10050. }
  10051. if (value == null) {
  10052. throw new TypeError(
  10053. 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
  10054. 'or Array-like Object. Received type ' + (typeof value)
  10055. )
  10056. }
  10057. if (isInstance(value, ArrayBuffer) ||
  10058. (value && isInstance(value.buffer, ArrayBuffer))) {
  10059. return fromArrayBuffer(value, encodingOrOffset, length)
  10060. }
  10061. if (typeof SharedArrayBuffer !== 'undefined' &&
  10062. (isInstance(value, SharedArrayBuffer) ||
  10063. (value && isInstance(value.buffer, SharedArrayBuffer)))) {
  10064. return fromArrayBuffer(value, encodingOrOffset, length)
  10065. }
  10066. if (typeof value === 'number') {
  10067. throw new TypeError(
  10068. 'The "value" argument must not be of type number. Received type number'
  10069. )
  10070. }
  10071. var valueOf = value.valueOf && value.valueOf()
  10072. if (valueOf != null && valueOf !== value) {
  10073. return Buffer.from(valueOf, encodingOrOffset, length)
  10074. }
  10075. var b = fromObject(value)
  10076. if (b) return b
  10077. if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
  10078. typeof value[Symbol.toPrimitive] === 'function') {
  10079. return Buffer.from(
  10080. value[Symbol.toPrimitive]('string'), encodingOrOffset, length
  10081. )
  10082. }
  10083. throw new TypeError(
  10084. 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
  10085. 'or Array-like Object. Received type ' + (typeof value)
  10086. )
  10087. }
  10088. /**
  10089. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  10090. * if value is a number.
  10091. * Buffer.from(str[, encoding])
  10092. * Buffer.from(array)
  10093. * Buffer.from(buffer)
  10094. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  10095. **/
  10096. Buffer.from = function (value, encodingOrOffset, length) {
  10097. return from(value, encodingOrOffset, length)
  10098. }
  10099. // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
  10100. // https://github.com/feross/buffer/pull/148
  10101. Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
  10102. Object.setPrototypeOf(Buffer, Uint8Array)
  10103. function assertSize (size) {
  10104. if (typeof size !== 'number') {
  10105. throw new TypeError('"size" argument must be of type number')
  10106. } else if (size < 0) {
  10107. throw new RangeError('The value "' + size + '" is invalid for option "size"')
  10108. }
  10109. }
  10110. function alloc (size, fill, encoding) {
  10111. assertSize(size)
  10112. if (size <= 0) {
  10113. return createBuffer(size)
  10114. }
  10115. if (fill !== undefined) {
  10116. // Only pay attention to encoding if it's a string. This
  10117. // prevents accidentally sending in a number that would
  10118. // be interpreted as a start offset.
  10119. return typeof encoding === 'string'
  10120. ? createBuffer(size).fill(fill, encoding)
  10121. : createBuffer(size).fill(fill)
  10122. }
  10123. return createBuffer(size)
  10124. }
  10125. /**
  10126. * Creates a new filled Buffer instance.
  10127. * alloc(size[, fill[, encoding]])
  10128. **/
  10129. Buffer.alloc = function (size, fill, encoding) {
  10130. return alloc(size, fill, encoding)
  10131. }
  10132. function allocUnsafe (size) {
  10133. assertSize(size)
  10134. return createBuffer(size < 0 ? 0 : checked(size) | 0)
  10135. }
  10136. /**
  10137. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10138. * */
  10139. Buffer.allocUnsafe = function (size) {
  10140. return allocUnsafe(size)
  10141. }
  10142. /**
  10143. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10144. */
  10145. Buffer.allocUnsafeSlow = function (size) {
  10146. return allocUnsafe(size)
  10147. }
  10148. function fromString (string, encoding) {
  10149. if (typeof encoding !== 'string' || encoding === '') {
  10150. encoding = 'utf8'
  10151. }
  10152. if (!Buffer.isEncoding(encoding)) {
  10153. throw new TypeError('Unknown encoding: ' + encoding)
  10154. }
  10155. var length = byteLength(string, encoding) | 0
  10156. var buf = createBuffer(length)
  10157. var actual = buf.write(string, encoding)
  10158. if (actual !== length) {
  10159. // Writing a hex string, for example, that contains invalid characters will
  10160. // cause everything after the first invalid character to be ignored. (e.g.
  10161. // 'abxxcd' will be treated as 'ab')
  10162. buf = buf.slice(0, actual)
  10163. }
  10164. return buf
  10165. }
  10166. function fromArrayLike (array) {
  10167. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10168. var buf = createBuffer(length)
  10169. for (var i = 0; i < length; i += 1) {
  10170. buf[i] = array[i] & 255
  10171. }
  10172. return buf
  10173. }
  10174. function fromArrayView (arrayView) {
  10175. if (isInstance(arrayView, Uint8Array)) {
  10176. var copy = new Uint8Array(arrayView)
  10177. return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
  10178. }
  10179. return fromArrayLike(arrayView)
  10180. }
  10181. function fromArrayBuffer (array, byteOffset, length) {
  10182. if (byteOffset < 0 || array.byteLength < byteOffset) {
  10183. throw new RangeError('"offset" is outside of buffer bounds')
  10184. }
  10185. if (array.byteLength < byteOffset + (length || 0)) {
  10186. throw new RangeError('"length" is outside of buffer bounds')
  10187. }
  10188. var buf
  10189. if (byteOffset === undefined && length === undefined) {
  10190. buf = new Uint8Array(array)
  10191. } else if (length === undefined) {
  10192. buf = new Uint8Array(array, byteOffset)
  10193. } else {
  10194. buf = new Uint8Array(array, byteOffset, length)
  10195. }
  10196. // Return an augmented `Uint8Array` instance
  10197. Object.setPrototypeOf(buf, Buffer.prototype)
  10198. return buf
  10199. }
  10200. function fromObject (obj) {
  10201. if (Buffer.isBuffer(obj)) {
  10202. var len = checked(obj.length) | 0
  10203. var buf = createBuffer(len)
  10204. if (buf.length === 0) {
  10205. return buf
  10206. }
  10207. obj.copy(buf, 0, 0, len)
  10208. return buf
  10209. }
  10210. if (obj.length !== undefined) {
  10211. if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
  10212. return createBuffer(0)
  10213. }
  10214. return fromArrayLike(obj)
  10215. }
  10216. if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
  10217. return fromArrayLike(obj.data)
  10218. }
  10219. }
  10220. function checked (length) {
  10221. // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
  10222. // length is NaN (which is otherwise coerced to zero.)
  10223. if (length >= K_MAX_LENGTH) {
  10224. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  10225. 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
  10226. }
  10227. return length | 0
  10228. }
  10229. function SlowBuffer (length) {
  10230. if (+length != length) { // eslint-disable-line eqeqeq
  10231. length = 0
  10232. }
  10233. return Buffer.alloc(+length)
  10234. }
  10235. Buffer.isBuffer = function isBuffer (b) {
  10236. return b != null && b._isBuffer === true &&
  10237. b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
  10238. }
  10239. Buffer.compare = function compare (a, b) {
  10240. if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
  10241. if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
  10242. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  10243. throw new TypeError(
  10244. 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
  10245. )
  10246. }
  10247. if (a === b) return 0
  10248. var x = a.length
  10249. var y = b.length
  10250. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  10251. if (a[i] !== b[i]) {
  10252. x = a[i]
  10253. y = b[i]
  10254. break
  10255. }
  10256. }
  10257. if (x < y) return -1
  10258. if (y < x) return 1
  10259. return 0
  10260. }
  10261. Buffer.isEncoding = function isEncoding (encoding) {
  10262. switch (String(encoding).toLowerCase()) {
  10263. case 'hex':
  10264. case 'utf8':
  10265. case 'utf-8':
  10266. case 'ascii':
  10267. case 'latin1':
  10268. case 'binary':
  10269. case 'base64':
  10270. case 'ucs2':
  10271. case 'ucs-2':
  10272. case 'utf16le':
  10273. case 'utf-16le':
  10274. return true
  10275. default:
  10276. return false
  10277. }
  10278. }
  10279. Buffer.concat = function concat (list, length) {
  10280. if (!Array.isArray(list)) {
  10281. throw new TypeError('"list" argument must be an Array of Buffers')
  10282. }
  10283. if (list.length === 0) {
  10284. return Buffer.alloc(0)
  10285. }
  10286. var i
  10287. if (length === undefined) {
  10288. length = 0
  10289. for (i = 0; i < list.length; ++i) {
  10290. length += list[i].length
  10291. }
  10292. }
  10293. var buffer = Buffer.allocUnsafe(length)
  10294. var pos = 0
  10295. for (i = 0; i < list.length; ++i) {
  10296. var buf = list[i]
  10297. if (isInstance(buf, Uint8Array)) {
  10298. if (pos + buf.length > buffer.length) {
  10299. Buffer.from(buf).copy(buffer, pos)
  10300. } else {
  10301. Uint8Array.prototype.set.call(
  10302. buffer,
  10303. buf,
  10304. pos
  10305. )
  10306. }
  10307. } else if (!Buffer.isBuffer(buf)) {
  10308. throw new TypeError('"list" argument must be an Array of Buffers')
  10309. } else {
  10310. buf.copy(buffer, pos)
  10311. }
  10312. pos += buf.length
  10313. }
  10314. return buffer
  10315. }
  10316. function byteLength (string, encoding) {
  10317. if (Buffer.isBuffer(string)) {
  10318. return string.length
  10319. }
  10320. if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
  10321. return string.byteLength
  10322. }
  10323. if (typeof string !== 'string') {
  10324. throw new TypeError(
  10325. 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
  10326. 'Received type ' + typeof string
  10327. )
  10328. }
  10329. var len = string.length
  10330. var mustMatch = (arguments.length > 2 && arguments[2] === true)
  10331. if (!mustMatch && len === 0) return 0
  10332. // Use a for loop to avoid recursion
  10333. var loweredCase = false
  10334. for (;;) {
  10335. switch (encoding) {
  10336. case 'ascii':
  10337. case 'latin1':
  10338. case 'binary':
  10339. return len
  10340. case 'utf8':
  10341. case 'utf-8':
  10342. return utf8ToBytes(string).length
  10343. case 'ucs2':
  10344. case 'ucs-2':
  10345. case 'utf16le':
  10346. case 'utf-16le':
  10347. return len * 2
  10348. case 'hex':
  10349. return len >>> 1
  10350. case 'base64':
  10351. return base64ToBytes(string).length
  10352. default:
  10353. if (loweredCase) {
  10354. return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
  10355. }
  10356. encoding = ('' + encoding).toLowerCase()
  10357. loweredCase = true
  10358. }
  10359. }
  10360. }
  10361. Buffer.byteLength = byteLength
  10362. function slowToString (encoding, start, end) {
  10363. var loweredCase = false
  10364. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  10365. // property of a typed array.
  10366. // This behaves neither like String nor Uint8Array in that we set start/end
  10367. // to their upper/lower bounds if the value passed is out of range.
  10368. // undefined is handled specially as per ECMA-262 6th Edition,
  10369. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  10370. if (start === undefined || start < 0) {
  10371. start = 0
  10372. }
  10373. // Return early if start > this.length. Done here to prevent potential uint32
  10374. // coercion fail below.
  10375. if (start > this.length) {
  10376. return ''
  10377. }
  10378. if (end === undefined || end > this.length) {
  10379. end = this.length
  10380. }
  10381. if (end <= 0) {
  10382. return ''
  10383. }
  10384. // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
  10385. end >>>= 0
  10386. start >>>= 0
  10387. if (end <= start) {
  10388. return ''
  10389. }
  10390. if (!encoding) encoding = 'utf8'
  10391. while (true) {
  10392. switch (encoding) {
  10393. case 'hex':
  10394. return hexSlice(this, start, end)
  10395. case 'utf8':
  10396. case 'utf-8':
  10397. return utf8Slice(this, start, end)
  10398. case 'ascii':
  10399. return asciiSlice(this, start, end)
  10400. case 'latin1':
  10401. case 'binary':
  10402. return latin1Slice(this, start, end)
  10403. case 'base64':
  10404. return base64Slice(this, start, end)
  10405. case 'ucs2':
  10406. case 'ucs-2':
  10407. case 'utf16le':
  10408. case 'utf-16le':
  10409. return utf16leSlice(this, start, end)
  10410. default:
  10411. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  10412. encoding = (encoding + '').toLowerCase()
  10413. loweredCase = true
  10414. }
  10415. }
  10416. }
  10417. // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
  10418. // to detect a Buffer instance. It's not possible to use `instanceof Buffer`
  10419. // reliably in a browserify context because there could be multiple different
  10420. // copies of the 'buffer' package in use. This method works even for Buffer
  10421. // instances that were created from another copy of the `buffer` package.
  10422. // See: https://github.com/feross/buffer/issues/154
  10423. Buffer.prototype._isBuffer = true
  10424. function swap (b, n, m) {
  10425. var i = b[n]
  10426. b[n] = b[m]
  10427. b[m] = i
  10428. }
  10429. Buffer.prototype.swap16 = function swap16 () {
  10430. var len = this.length
  10431. if (len % 2 !== 0) {
  10432. throw new RangeError('Buffer size must be a multiple of 16-bits')
  10433. }
  10434. for (var i = 0; i < len; i += 2) {
  10435. swap(this, i, i + 1)
  10436. }
  10437. return this
  10438. }
  10439. Buffer.prototype.swap32 = function swap32 () {
  10440. var len = this.length
  10441. if (len % 4 !== 0) {
  10442. throw new RangeError('Buffer size must be a multiple of 32-bits')
  10443. }
  10444. for (var i = 0; i < len; i += 4) {
  10445. swap(this, i, i + 3)
  10446. swap(this, i + 1, i + 2)
  10447. }
  10448. return this
  10449. }
  10450. Buffer.prototype.swap64 = function swap64 () {
  10451. var len = this.length
  10452. if (len % 8 !== 0) {
  10453. throw new RangeError('Buffer size must be a multiple of 64-bits')
  10454. }
  10455. for (var i = 0; i < len; i += 8) {
  10456. swap(this, i, i + 7)
  10457. swap(this, i + 1, i + 6)
  10458. swap(this, i + 2, i + 5)
  10459. swap(this, i + 3, i + 4)
  10460. }
  10461. return this
  10462. }
  10463. Buffer.prototype.toString = function toString () {
  10464. var length = this.length
  10465. if (length === 0) return ''
  10466. if (arguments.length === 0) return utf8Slice(this, 0, length)
  10467. return slowToString.apply(this, arguments)
  10468. }
  10469. Buffer.prototype.toLocaleString = Buffer.prototype.toString
  10470. Buffer.prototype.equals = function equals (b) {
  10471. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  10472. if (this === b) return true
  10473. return Buffer.compare(this, b) === 0
  10474. }
  10475. Buffer.prototype.inspect = function inspect () {
  10476. var str = ''
  10477. var max = exports.INSPECT_MAX_BYTES
  10478. str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
  10479. if (this.length > max) str += ' ... '
  10480. return '<Buffer ' + str + '>'
  10481. }
  10482. if (customInspectSymbol) {
  10483. Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
  10484. }
  10485. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  10486. if (isInstance(target, Uint8Array)) {
  10487. target = Buffer.from(target, target.offset, target.byteLength)
  10488. }
  10489. if (!Buffer.isBuffer(target)) {
  10490. throw new TypeError(
  10491. 'The "target" argument must be one of type Buffer or Uint8Array. ' +
  10492. 'Received type ' + (typeof target)
  10493. )
  10494. }
  10495. if (start === undefined) {
  10496. start = 0
  10497. }
  10498. if (end === undefined) {
  10499. end = target ? target.length : 0
  10500. }
  10501. if (thisStart === undefined) {
  10502. thisStart = 0
  10503. }
  10504. if (thisEnd === undefined) {
  10505. thisEnd = this.length
  10506. }
  10507. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  10508. throw new RangeError('out of range index')
  10509. }
  10510. if (thisStart >= thisEnd && start >= end) {
  10511. return 0
  10512. }
  10513. if (thisStart >= thisEnd) {
  10514. return -1
  10515. }
  10516. if (start >= end) {
  10517. return 1
  10518. }
  10519. start >>>= 0
  10520. end >>>= 0
  10521. thisStart >>>= 0
  10522. thisEnd >>>= 0
  10523. if (this === target) return 0
  10524. var x = thisEnd - thisStart
  10525. var y = end - start
  10526. var len = Math.min(x, y)
  10527. var thisCopy = this.slice(thisStart, thisEnd)
  10528. var targetCopy = target.slice(start, end)
  10529. for (var i = 0; i < len; ++i) {
  10530. if (thisCopy[i] !== targetCopy[i]) {
  10531. x = thisCopy[i]
  10532. y = targetCopy[i]
  10533. break
  10534. }
  10535. }
  10536. if (x < y) return -1
  10537. if (y < x) return 1
  10538. return 0
  10539. }
  10540. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  10541. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  10542. //
  10543. // Arguments:
  10544. // - buffer - a Buffer to search
  10545. // - val - a string, Buffer, or number
  10546. // - byteOffset - an index into `buffer`; will be clamped to an int32
  10547. // - encoding - an optional encoding, relevant is val is a string
  10548. // - dir - true for indexOf, false for lastIndexOf
  10549. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  10550. // Empty buffer means no match
  10551. if (buffer.length === 0) return -1
  10552. // Normalize byteOffset
  10553. if (typeof byteOffset === 'string') {
  10554. encoding = byteOffset
  10555. byteOffset = 0
  10556. } else if (byteOffset > 0x7fffffff) {
  10557. byteOffset = 0x7fffffff
  10558. } else if (byteOffset < -0x80000000) {
  10559. byteOffset = -0x80000000
  10560. }
  10561. byteOffset = +byteOffset // Coerce to Number.
  10562. if (numberIsNaN(byteOffset)) {
  10563. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  10564. byteOffset = dir ? 0 : (buffer.length - 1)
  10565. }
  10566. // Normalize byteOffset: negative offsets start from the end of the buffer
  10567. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  10568. if (byteOffset >= buffer.length) {
  10569. if (dir) return -1
  10570. else byteOffset = buffer.length - 1
  10571. } else if (byteOffset < 0) {
  10572. if (dir) byteOffset = 0
  10573. else return -1
  10574. }
  10575. // Normalize val
  10576. if (typeof val === 'string') {
  10577. val = Buffer.from(val, encoding)
  10578. }
  10579. // Finally, search either indexOf (if dir is true) or lastIndexOf
  10580. if (Buffer.isBuffer(val)) {
  10581. // Special case: looking for empty string/buffer always fails
  10582. if (val.length === 0) {
  10583. return -1
  10584. }
  10585. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  10586. } else if (typeof val === 'number') {
  10587. val = val & 0xFF // Search for a byte value [0-255]
  10588. if (typeof Uint8Array.prototype.indexOf === 'function') {
  10589. if (dir) {
  10590. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  10591. } else {
  10592. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  10593. }
  10594. }
  10595. return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
  10596. }
  10597. throw new TypeError('val must be string, number or Buffer')
  10598. }
  10599. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  10600. var indexSize = 1
  10601. var arrLength = arr.length
  10602. var valLength = val.length
  10603. if (encoding !== undefined) {
  10604. encoding = String(encoding).toLowerCase()
  10605. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  10606. encoding === 'utf16le' || encoding === 'utf-16le') {
  10607. if (arr.length < 2 || val.length < 2) {
  10608. return -1
  10609. }
  10610. indexSize = 2
  10611. arrLength /= 2
  10612. valLength /= 2
  10613. byteOffset /= 2
  10614. }
  10615. }
  10616. function read (buf, i) {
  10617. if (indexSize === 1) {
  10618. return buf[i]
  10619. } else {
  10620. return buf.readUInt16BE(i * indexSize)
  10621. }
  10622. }
  10623. var i
  10624. if (dir) {
  10625. var foundIndex = -1
  10626. for (i = byteOffset; i < arrLength; i++) {
  10627. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  10628. if (foundIndex === -1) foundIndex = i
  10629. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  10630. } else {
  10631. if (foundIndex !== -1) i -= i - foundIndex
  10632. foundIndex = -1
  10633. }
  10634. }
  10635. } else {
  10636. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  10637. for (i = byteOffset; i >= 0; i--) {
  10638. var found = true
  10639. for (var j = 0; j < valLength; j++) {
  10640. if (read(arr, i + j) !== read(val, j)) {
  10641. found = false
  10642. break
  10643. }
  10644. }
  10645. if (found) return i
  10646. }
  10647. }
  10648. return -1
  10649. }
  10650. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  10651. return this.indexOf(val, byteOffset, encoding) !== -1
  10652. }
  10653. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  10654. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  10655. }
  10656. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  10657. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  10658. }
  10659. function hexWrite (buf, string, offset, length) {
  10660. offset = Number(offset) || 0
  10661. var remaining = buf.length - offset
  10662. if (!length) {
  10663. length = remaining
  10664. } else {
  10665. length = Number(length)
  10666. if (length > remaining) {
  10667. length = remaining
  10668. }
  10669. }
  10670. var strLen = string.length
  10671. if (length > strLen / 2) {
  10672. length = strLen / 2
  10673. }
  10674. for (var i = 0; i < length; ++i) {
  10675. var parsed = parseInt(string.substr(i * 2, 2), 16)
  10676. if (numberIsNaN(parsed)) return i
  10677. buf[offset + i] = parsed
  10678. }
  10679. return i
  10680. }
  10681. function utf8Write (buf, string, offset, length) {
  10682. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  10683. }
  10684. function asciiWrite (buf, string, offset, length) {
  10685. return blitBuffer(asciiToBytes(string), buf, offset, length)
  10686. }
  10687. function base64Write (buf, string, offset, length) {
  10688. return blitBuffer(base64ToBytes(string), buf, offset, length)
  10689. }
  10690. function ucs2Write (buf, string, offset, length) {
  10691. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  10692. }
  10693. Buffer.prototype.write = function write (string, offset, length, encoding) {
  10694. // Buffer#write(string)
  10695. if (offset === undefined) {
  10696. encoding = 'utf8'
  10697. length = this.length
  10698. offset = 0
  10699. // Buffer#write(string, encoding)
  10700. } else if (length === undefined && typeof offset === 'string') {
  10701. encoding = offset
  10702. length = this.length
  10703. offset = 0
  10704. // Buffer#write(string, offset[, length][, encoding])
  10705. } else if (isFinite(offset)) {
  10706. offset = offset >>> 0
  10707. if (isFinite(length)) {
  10708. length = length >>> 0
  10709. if (encoding === undefined) encoding = 'utf8'
  10710. } else {
  10711. encoding = length
  10712. length = undefined
  10713. }
  10714. } else {
  10715. throw new Error(
  10716. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  10717. )
  10718. }
  10719. var remaining = this.length - offset
  10720. if (length === undefined || length > remaining) length = remaining
  10721. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  10722. throw new RangeError('Attempt to write outside buffer bounds')
  10723. }
  10724. if (!encoding) encoding = 'utf8'
  10725. var loweredCase = false
  10726. for (;;) {
  10727. switch (encoding) {
  10728. case 'hex':
  10729. return hexWrite(this, string, offset, length)
  10730. case 'utf8':
  10731. case 'utf-8':
  10732. return utf8Write(this, string, offset, length)
  10733. case 'ascii':
  10734. case 'latin1':
  10735. case 'binary':
  10736. return asciiWrite(this, string, offset, length)
  10737. case 'base64':
  10738. // Warning: maxLength not taken into account in base64Write
  10739. return base64Write(this, string, offset, length)
  10740. case 'ucs2':
  10741. case 'ucs-2':
  10742. case 'utf16le':
  10743. case 'utf-16le':
  10744. return ucs2Write(this, string, offset, length)
  10745. default:
  10746. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  10747. encoding = ('' + encoding).toLowerCase()
  10748. loweredCase = true
  10749. }
  10750. }
  10751. }
  10752. Buffer.prototype.toJSON = function toJSON () {
  10753. return {
  10754. type: 'Buffer',
  10755. data: Array.prototype.slice.call(this._arr || this, 0)
  10756. }
  10757. }
  10758. function base64Slice (buf, start, end) {
  10759. if (start === 0 && end === buf.length) {
  10760. return base64.fromByteArray(buf)
  10761. } else {
  10762. return base64.fromByteArray(buf.slice(start, end))
  10763. }
  10764. }
  10765. function utf8Slice (buf, start, end) {
  10766. end = Math.min(buf.length, end)
  10767. var res = []
  10768. var i = start
  10769. while (i < end) {
  10770. var firstByte = buf[i]
  10771. var codePoint = null
  10772. var bytesPerSequence = (firstByte > 0xEF)
  10773. ? 4
  10774. : (firstByte > 0xDF)
  10775. ? 3
  10776. : (firstByte > 0xBF)
  10777. ? 2
  10778. : 1
  10779. if (i + bytesPerSequence <= end) {
  10780. var secondByte, thirdByte, fourthByte, tempCodePoint
  10781. switch (bytesPerSequence) {
  10782. case 1:
  10783. if (firstByte < 0x80) {
  10784. codePoint = firstByte
  10785. }
  10786. break
  10787. case 2:
  10788. secondByte = buf[i + 1]
  10789. if ((secondByte & 0xC0) === 0x80) {
  10790. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  10791. if (tempCodePoint > 0x7F) {
  10792. codePoint = tempCodePoint
  10793. }
  10794. }
  10795. break
  10796. case 3:
  10797. secondByte = buf[i + 1]
  10798. thirdByte = buf[i + 2]
  10799. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  10800. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  10801. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  10802. codePoint = tempCodePoint
  10803. }
  10804. }
  10805. break
  10806. case 4:
  10807. secondByte = buf[i + 1]
  10808. thirdByte = buf[i + 2]
  10809. fourthByte = buf[i + 3]
  10810. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  10811. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  10812. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  10813. codePoint = tempCodePoint
  10814. }
  10815. }
  10816. }
  10817. }
  10818. if (codePoint === null) {
  10819. // we did not generate a valid codePoint so insert a
  10820. // replacement char (U+FFFD) and advance only 1 byte
  10821. codePoint = 0xFFFD
  10822. bytesPerSequence = 1
  10823. } else if (codePoint > 0xFFFF) {
  10824. // encode to utf16 (surrogate pair dance)
  10825. codePoint -= 0x10000
  10826. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  10827. codePoint = 0xDC00 | codePoint & 0x3FF
  10828. }
  10829. res.push(codePoint)
  10830. i += bytesPerSequence
  10831. }
  10832. return decodeCodePointsArray(res)
  10833. }
  10834. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  10835. // the lowest limit is Chrome, with 0x10000 args.
  10836. // We go 1 magnitude less, for safety
  10837. var MAX_ARGUMENTS_LENGTH = 0x1000
  10838. function decodeCodePointsArray (codePoints) {
  10839. var len = codePoints.length
  10840. if (len <= MAX_ARGUMENTS_LENGTH) {
  10841. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  10842. }
  10843. // Decode in chunks to avoid "call stack size exceeded".
  10844. var res = ''
  10845. var i = 0
  10846. while (i < len) {
  10847. res += String.fromCharCode.apply(
  10848. String,
  10849. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  10850. )
  10851. }
  10852. return res
  10853. }
  10854. function asciiSlice (buf, start, end) {
  10855. var ret = ''
  10856. end = Math.min(buf.length, end)
  10857. for (var i = start; i < end; ++i) {
  10858. ret += String.fromCharCode(buf[i] & 0x7F)
  10859. }
  10860. return ret
  10861. }
  10862. function latin1Slice (buf, start, end) {
  10863. var ret = ''
  10864. end = Math.min(buf.length, end)
  10865. for (var i = start; i < end; ++i) {
  10866. ret += String.fromCharCode(buf[i])
  10867. }
  10868. return ret
  10869. }
  10870. function hexSlice (buf, start, end) {
  10871. var len = buf.length
  10872. if (!start || start < 0) start = 0
  10873. if (!end || end < 0 || end > len) end = len
  10874. var out = ''
  10875. for (var i = start; i < end; ++i) {
  10876. out += hexSliceLookupTable[buf[i]]
  10877. }
  10878. return out
  10879. }
  10880. function utf16leSlice (buf, start, end) {
  10881. var bytes = buf.slice(start, end)
  10882. var res = ''
  10883. // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
  10884. for (var i = 0; i < bytes.length - 1; i += 2) {
  10885. res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
  10886. }
  10887. return res
  10888. }
  10889. Buffer.prototype.slice = function slice (start, end) {
  10890. var len = this.length
  10891. start = ~~start
  10892. end = end === undefined ? len : ~~end
  10893. if (start < 0) {
  10894. start += len
  10895. if (start < 0) start = 0
  10896. } else if (start > len) {
  10897. start = len
  10898. }
  10899. if (end < 0) {
  10900. end += len
  10901. if (end < 0) end = 0
  10902. } else if (end > len) {
  10903. end = len
  10904. }
  10905. if (end < start) end = start
  10906. var newBuf = this.subarray(start, end)
  10907. // Return an augmented `Uint8Array` instance
  10908. Object.setPrototypeOf(newBuf, Buffer.prototype)
  10909. return newBuf
  10910. }
  10911. /*
  10912. * Need to make sure that buffer isn't trying to write out of bounds.
  10913. */
  10914. function checkOffset (offset, ext, length) {
  10915. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  10916. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  10917. }
  10918. Buffer.prototype.readUintLE =
  10919. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  10920. offset = offset >>> 0
  10921. byteLength = byteLength >>> 0
  10922. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10923. var val = this[offset]
  10924. var mul = 1
  10925. var i = 0
  10926. while (++i < byteLength && (mul *= 0x100)) {
  10927. val += this[offset + i] * mul
  10928. }
  10929. return val
  10930. }
  10931. Buffer.prototype.readUintBE =
  10932. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  10933. offset = offset >>> 0
  10934. byteLength = byteLength >>> 0
  10935. if (!noAssert) {
  10936. checkOffset(offset, byteLength, this.length)
  10937. }
  10938. var val = this[offset + --byteLength]
  10939. var mul = 1
  10940. while (byteLength > 0 && (mul *= 0x100)) {
  10941. val += this[offset + --byteLength] * mul
  10942. }
  10943. return val
  10944. }
  10945. Buffer.prototype.readUint8 =
  10946. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  10947. offset = offset >>> 0
  10948. if (!noAssert) checkOffset(offset, 1, this.length)
  10949. return this[offset]
  10950. }
  10951. Buffer.prototype.readUint16LE =
  10952. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  10953. offset = offset >>> 0
  10954. if (!noAssert) checkOffset(offset, 2, this.length)
  10955. return this[offset] | (this[offset + 1] << 8)
  10956. }
  10957. Buffer.prototype.readUint16BE =
  10958. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  10959. offset = offset >>> 0
  10960. if (!noAssert) checkOffset(offset, 2, this.length)
  10961. return (this[offset] << 8) | this[offset + 1]
  10962. }
  10963. Buffer.prototype.readUint32LE =
  10964. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  10965. offset = offset >>> 0
  10966. if (!noAssert) checkOffset(offset, 4, this.length)
  10967. return ((this[offset]) |
  10968. (this[offset + 1] << 8) |
  10969. (this[offset + 2] << 16)) +
  10970. (this[offset + 3] * 0x1000000)
  10971. }
  10972. Buffer.prototype.readUint32BE =
  10973. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  10974. offset = offset >>> 0
  10975. if (!noAssert) checkOffset(offset, 4, this.length)
  10976. return (this[offset] * 0x1000000) +
  10977. ((this[offset + 1] << 16) |
  10978. (this[offset + 2] << 8) |
  10979. this[offset + 3])
  10980. }
  10981. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  10982. offset = offset >>> 0
  10983. byteLength = byteLength >>> 0
  10984. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10985. var val = this[offset]
  10986. var mul = 1
  10987. var i = 0
  10988. while (++i < byteLength && (mul *= 0x100)) {
  10989. val += this[offset + i] * mul
  10990. }
  10991. mul *= 0x80
  10992. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  10993. return val
  10994. }
  10995. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  10996. offset = offset >>> 0
  10997. byteLength = byteLength >>> 0
  10998. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10999. var i = byteLength
  11000. var mul = 1
  11001. var val = this[offset + --i]
  11002. while (i > 0 && (mul *= 0x100)) {
  11003. val += this[offset + --i] * mul
  11004. }
  11005. mul *= 0x80
  11006. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11007. return val
  11008. }
  11009. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  11010. offset = offset >>> 0
  11011. if (!noAssert) checkOffset(offset, 1, this.length)
  11012. if (!(this[offset] & 0x80)) return (this[offset])
  11013. return ((0xff - this[offset] + 1) * -1)
  11014. }
  11015. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  11016. offset = offset >>> 0
  11017. if (!noAssert) checkOffset(offset, 2, this.length)
  11018. var val = this[offset] | (this[offset + 1] << 8)
  11019. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11020. }
  11021. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  11022. offset = offset >>> 0
  11023. if (!noAssert) checkOffset(offset, 2, this.length)
  11024. var val = this[offset + 1] | (this[offset] << 8)
  11025. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11026. }
  11027. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  11028. offset = offset >>> 0
  11029. if (!noAssert) checkOffset(offset, 4, this.length)
  11030. return (this[offset]) |
  11031. (this[offset + 1] << 8) |
  11032. (this[offset + 2] << 16) |
  11033. (this[offset + 3] << 24)
  11034. }
  11035. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  11036. offset = offset >>> 0
  11037. if (!noAssert) checkOffset(offset, 4, this.length)
  11038. return (this[offset] << 24) |
  11039. (this[offset + 1] << 16) |
  11040. (this[offset + 2] << 8) |
  11041. (this[offset + 3])
  11042. }
  11043. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  11044. offset = offset >>> 0
  11045. if (!noAssert) checkOffset(offset, 4, this.length)
  11046. return ieee754.read(this, offset, true, 23, 4)
  11047. }
  11048. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  11049. offset = offset >>> 0
  11050. if (!noAssert) checkOffset(offset, 4, this.length)
  11051. return ieee754.read(this, offset, false, 23, 4)
  11052. }
  11053. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  11054. offset = offset >>> 0
  11055. if (!noAssert) checkOffset(offset, 8, this.length)
  11056. return ieee754.read(this, offset, true, 52, 8)
  11057. }
  11058. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  11059. offset = offset >>> 0
  11060. if (!noAssert) checkOffset(offset, 8, this.length)
  11061. return ieee754.read(this, offset, false, 52, 8)
  11062. }
  11063. function checkInt (buf, value, offset, ext, max, min) {
  11064. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  11065. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  11066. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11067. }
  11068. Buffer.prototype.writeUintLE =
  11069. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  11070. value = +value
  11071. offset = offset >>> 0
  11072. byteLength = byteLength >>> 0
  11073. if (!noAssert) {
  11074. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11075. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11076. }
  11077. var mul = 1
  11078. var i = 0
  11079. this[offset] = value & 0xFF
  11080. while (++i < byteLength && (mul *= 0x100)) {
  11081. this[offset + i] = (value / mul) & 0xFF
  11082. }
  11083. return offset + byteLength
  11084. }
  11085. Buffer.prototype.writeUintBE =
  11086. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  11087. value = +value
  11088. offset = offset >>> 0
  11089. byteLength = byteLength >>> 0
  11090. if (!noAssert) {
  11091. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11092. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11093. }
  11094. var i = byteLength - 1
  11095. var mul = 1
  11096. this[offset + i] = value & 0xFF
  11097. while (--i >= 0 && (mul *= 0x100)) {
  11098. this[offset + i] = (value / mul) & 0xFF
  11099. }
  11100. return offset + byteLength
  11101. }
  11102. Buffer.prototype.writeUint8 =
  11103. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  11104. value = +value
  11105. offset = offset >>> 0
  11106. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  11107. this[offset] = (value & 0xff)
  11108. return offset + 1
  11109. }
  11110. Buffer.prototype.writeUint16LE =
  11111. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  11112. value = +value
  11113. offset = offset >>> 0
  11114. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11115. this[offset] = (value & 0xff)
  11116. this[offset + 1] = (value >>> 8)
  11117. return offset + 2
  11118. }
  11119. Buffer.prototype.writeUint16BE =
  11120. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  11121. value = +value
  11122. offset = offset >>> 0
  11123. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11124. this[offset] = (value >>> 8)
  11125. this[offset + 1] = (value & 0xff)
  11126. return offset + 2
  11127. }
  11128. Buffer.prototype.writeUint32LE =
  11129. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11130. value = +value
  11131. offset = offset >>> 0
  11132. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11133. this[offset + 3] = (value >>> 24)
  11134. this[offset + 2] = (value >>> 16)
  11135. this[offset + 1] = (value >>> 8)
  11136. this[offset] = (value & 0xff)
  11137. return offset + 4
  11138. }
  11139. Buffer.prototype.writeUint32BE =
  11140. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11141. value = +value
  11142. offset = offset >>> 0
  11143. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11144. this[offset] = (value >>> 24)
  11145. this[offset + 1] = (value >>> 16)
  11146. this[offset + 2] = (value >>> 8)
  11147. this[offset + 3] = (value & 0xff)
  11148. return offset + 4
  11149. }
  11150. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11151. value = +value
  11152. offset = offset >>> 0
  11153. if (!noAssert) {
  11154. var limit = Math.pow(2, (8 * byteLength) - 1)
  11155. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11156. }
  11157. var i = 0
  11158. var mul = 1
  11159. var sub = 0
  11160. this[offset] = value & 0xFF
  11161. while (++i < byteLength && (mul *= 0x100)) {
  11162. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11163. sub = 1
  11164. }
  11165. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11166. }
  11167. return offset + byteLength
  11168. }
  11169. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11170. value = +value
  11171. offset = offset >>> 0
  11172. if (!noAssert) {
  11173. var limit = Math.pow(2, (8 * byteLength) - 1)
  11174. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11175. }
  11176. var i = byteLength - 1
  11177. var mul = 1
  11178. var sub = 0
  11179. this[offset + i] = value & 0xFF
  11180. while (--i >= 0 && (mul *= 0x100)) {
  11181. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11182. sub = 1
  11183. }
  11184. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11185. }
  11186. return offset + byteLength
  11187. }
  11188. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11189. value = +value
  11190. offset = offset >>> 0
  11191. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  11192. if (value < 0) value = 0xff + value + 1
  11193. this[offset] = (value & 0xff)
  11194. return offset + 1
  11195. }
  11196. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  11197. value = +value
  11198. offset = offset >>> 0
  11199. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11200. this[offset] = (value & 0xff)
  11201. this[offset + 1] = (value >>> 8)
  11202. return offset + 2
  11203. }
  11204. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  11205. value = +value
  11206. offset = offset >>> 0
  11207. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11208. this[offset] = (value >>> 8)
  11209. this[offset + 1] = (value & 0xff)
  11210. return offset + 2
  11211. }
  11212. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  11213. value = +value
  11214. offset = offset >>> 0
  11215. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11216. this[offset] = (value & 0xff)
  11217. this[offset + 1] = (value >>> 8)
  11218. this[offset + 2] = (value >>> 16)
  11219. this[offset + 3] = (value >>> 24)
  11220. return offset + 4
  11221. }
  11222. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  11223. value = +value
  11224. offset = offset >>> 0
  11225. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11226. if (value < 0) value = 0xffffffff + value + 1
  11227. this[offset] = (value >>> 24)
  11228. this[offset + 1] = (value >>> 16)
  11229. this[offset + 2] = (value >>> 8)
  11230. this[offset + 3] = (value & 0xff)
  11231. return offset + 4
  11232. }
  11233. function checkIEEE754 (buf, value, offset, ext, max, min) {
  11234. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11235. if (offset < 0) throw new RangeError('Index out of range')
  11236. }
  11237. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  11238. value = +value
  11239. offset = offset >>> 0
  11240. if (!noAssert) {
  11241. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  11242. }
  11243. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  11244. return offset + 4
  11245. }
  11246. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  11247. return writeFloat(this, value, offset, true, noAssert)
  11248. }
  11249. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  11250. return writeFloat(this, value, offset, false, noAssert)
  11251. }
  11252. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  11253. value = +value
  11254. offset = offset >>> 0
  11255. if (!noAssert) {
  11256. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  11257. }
  11258. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  11259. return offset + 8
  11260. }
  11261. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  11262. return writeDouble(this, value, offset, true, noAssert)
  11263. }
  11264. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  11265. return writeDouble(this, value, offset, false, noAssert)
  11266. }
  11267. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  11268. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  11269. if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
  11270. if (!start) start = 0
  11271. if (!end && end !== 0) end = this.length
  11272. if (targetStart >= target.length) targetStart = target.length
  11273. if (!targetStart) targetStart = 0
  11274. if (end > 0 && end < start) end = start
  11275. // Copy 0 bytes; we're done
  11276. if (end === start) return 0
  11277. if (target.length === 0 || this.length === 0) return 0
  11278. // Fatal error conditions
  11279. if (targetStart < 0) {
  11280. throw new RangeError('targetStart out of bounds')
  11281. }
  11282. if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
  11283. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  11284. // Are we oob?
  11285. if (end > this.length) end = this.length
  11286. if (target.length - targetStart < end - start) {
  11287. end = target.length - targetStart + start
  11288. }
  11289. var len = end - start
  11290. if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
  11291. // Use built-in when available, missing from IE11
  11292. this.copyWithin(targetStart, start, end)
  11293. } else {
  11294. Uint8Array.prototype.set.call(
  11295. target,
  11296. this.subarray(start, end),
  11297. targetStart
  11298. )
  11299. }
  11300. return len
  11301. }
  11302. // Usage:
  11303. // buffer.fill(number[, offset[, end]])
  11304. // buffer.fill(buffer[, offset[, end]])
  11305. // buffer.fill(string[, offset[, end]][, encoding])
  11306. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  11307. // Handle string cases:
  11308. if (typeof val === 'string') {
  11309. if (typeof start === 'string') {
  11310. encoding = start
  11311. start = 0
  11312. end = this.length
  11313. } else if (typeof end === 'string') {
  11314. encoding = end
  11315. end = this.length
  11316. }
  11317. if (encoding !== undefined && typeof encoding !== 'string') {
  11318. throw new TypeError('encoding must be a string')
  11319. }
  11320. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  11321. throw new TypeError('Unknown encoding: ' + encoding)
  11322. }
  11323. if (val.length === 1) {
  11324. var code = val.charCodeAt(0)
  11325. if ((encoding === 'utf8' && code < 128) ||
  11326. encoding === 'latin1') {
  11327. // Fast path: If `val` fits into a single byte, use that numeric value.
  11328. val = code
  11329. }
  11330. }
  11331. } else if (typeof val === 'number') {
  11332. val = val & 255
  11333. } else if (typeof val === 'boolean') {
  11334. val = Number(val)
  11335. }
  11336. // Invalid ranges are not set to a default, so can range check early.
  11337. if (start < 0 || this.length < start || this.length < end) {
  11338. throw new RangeError('Out of range index')
  11339. }
  11340. if (end <= start) {
  11341. return this
  11342. }
  11343. start = start >>> 0
  11344. end = end === undefined ? this.length : end >>> 0
  11345. if (!val) val = 0
  11346. var i
  11347. if (typeof val === 'number') {
  11348. for (i = start; i < end; ++i) {
  11349. this[i] = val
  11350. }
  11351. } else {
  11352. var bytes = Buffer.isBuffer(val)
  11353. ? val
  11354. : Buffer.from(val, encoding)
  11355. var len = bytes.length
  11356. if (len === 0) {
  11357. throw new TypeError('The value "' + val +
  11358. '" is invalid for argument "value"')
  11359. }
  11360. for (i = 0; i < end - start; ++i) {
  11361. this[i + start] = bytes[i % len]
  11362. }
  11363. }
  11364. return this
  11365. }
  11366. // HELPER FUNCTIONS
  11367. // ================
  11368. var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
  11369. function base64clean (str) {
  11370. // Node takes equal signs as end of the Base64 encoding
  11371. str = str.split('=')[0]
  11372. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  11373. str = str.trim().replace(INVALID_BASE64_RE, '')
  11374. // Node converts strings with length < 2 to ''
  11375. if (str.length < 2) return ''
  11376. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  11377. while (str.length % 4 !== 0) {
  11378. str = str + '='
  11379. }
  11380. return str
  11381. }
  11382. function utf8ToBytes (string, units) {
  11383. units = units || Infinity
  11384. var codePoint
  11385. var length = string.length
  11386. var leadSurrogate = null
  11387. var bytes = []
  11388. for (var i = 0; i < length; ++i) {
  11389. codePoint = string.charCodeAt(i)
  11390. // is surrogate component
  11391. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  11392. // last char was a lead
  11393. if (!leadSurrogate) {
  11394. // no lead yet
  11395. if (codePoint > 0xDBFF) {
  11396. // unexpected trail
  11397. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11398. continue
  11399. } else if (i + 1 === length) {
  11400. // unpaired lead
  11401. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11402. continue
  11403. }
  11404. // valid lead
  11405. leadSurrogate = codePoint
  11406. continue
  11407. }
  11408. // 2 leads in a row
  11409. if (codePoint < 0xDC00) {
  11410. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11411. leadSurrogate = codePoint
  11412. continue
  11413. }
  11414. // valid surrogate pair
  11415. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  11416. } else if (leadSurrogate) {
  11417. // valid bmp char, but last char was a lead
  11418. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11419. }
  11420. leadSurrogate = null
  11421. // encode utf8
  11422. if (codePoint < 0x80) {
  11423. if ((units -= 1) < 0) break
  11424. bytes.push(codePoint)
  11425. } else if (codePoint < 0x800) {
  11426. if ((units -= 2) < 0) break
  11427. bytes.push(
  11428. codePoint >> 0x6 | 0xC0,
  11429. codePoint & 0x3F | 0x80
  11430. )
  11431. } else if (codePoint < 0x10000) {
  11432. if ((units -= 3) < 0) break
  11433. bytes.push(
  11434. codePoint >> 0xC | 0xE0,
  11435. codePoint >> 0x6 & 0x3F | 0x80,
  11436. codePoint & 0x3F | 0x80
  11437. )
  11438. } else if (codePoint < 0x110000) {
  11439. if ((units -= 4) < 0) break
  11440. bytes.push(
  11441. codePoint >> 0x12 | 0xF0,
  11442. codePoint >> 0xC & 0x3F | 0x80,
  11443. codePoint >> 0x6 & 0x3F | 0x80,
  11444. codePoint & 0x3F | 0x80
  11445. )
  11446. } else {
  11447. throw new Error('Invalid code point')
  11448. }
  11449. }
  11450. return bytes
  11451. }
  11452. function asciiToBytes (str) {
  11453. var byteArray = []
  11454. for (var i = 0; i < str.length; ++i) {
  11455. // Node's code seems to be doing this and not & 0x7F..
  11456. byteArray.push(str.charCodeAt(i) & 0xFF)
  11457. }
  11458. return byteArray
  11459. }
  11460. function utf16leToBytes (str, units) {
  11461. var c, hi, lo
  11462. var byteArray = []
  11463. for (var i = 0; i < str.length; ++i) {
  11464. if ((units -= 2) < 0) break
  11465. c = str.charCodeAt(i)
  11466. hi = c >> 8
  11467. lo = c % 256
  11468. byteArray.push(lo)
  11469. byteArray.push(hi)
  11470. }
  11471. return byteArray
  11472. }
  11473. function base64ToBytes (str) {
  11474. return base64.toByteArray(base64clean(str))
  11475. }
  11476. function blitBuffer (src, dst, offset, length) {
  11477. for (var i = 0; i < length; ++i) {
  11478. if ((i + offset >= dst.length) || (i >= src.length)) break
  11479. dst[i + offset] = src[i]
  11480. }
  11481. return i
  11482. }
  11483. // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
  11484. // the `instanceof` check but they should be treated as of that type.
  11485. // See: https://github.com/feross/buffer/issues/166
  11486. function isInstance (obj, type) {
  11487. return obj instanceof type ||
  11488. (obj != null && obj.constructor != null && obj.constructor.name != null &&
  11489. obj.constructor.name === type.name)
  11490. }
  11491. function numberIsNaN (obj) {
  11492. // For IE11 support
  11493. return obj !== obj // eslint-disable-line no-self-compare
  11494. }
  11495. // Create lookup table for `toString('hex')`
  11496. // See: https://github.com/feross/buffer/issues/219
  11497. var hexSliceLookupTable = (function () {
  11498. var alphabet = '0123456789abcdef'
  11499. var table = new Array(256)
  11500. for (var i = 0; i < 16; ++i) {
  11501. var i16 = i * 16
  11502. for (var j = 0; j < 16; ++j) {
  11503. table[i16 + j] = alphabet[i] + alphabet[j]
  11504. }
  11505. }
  11506. return table
  11507. })()
  11508. /***/ }),
  11509. /***/ "./node_modules/core-js/internals/a-function.js":
  11510. /*!******************************************************!*\
  11511. !*** ./node_modules/core-js/internals/a-function.js ***!
  11512. \******************************************************/
  11513. /*! unknown exports (runtime-defined) */
  11514. /*! runtime requirements: module */
  11515. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  11516. /***/ ((module) => {
  11517. module.exports = function (it) {
  11518. if (typeof it != 'function') {
  11519. throw TypeError(String(it) + ' is not a function');
  11520. } return it;
  11521. };
  11522. /***/ }),
  11523. /***/ "./node_modules/core-js/internals/a-possible-prototype.js":
  11524. /*!****************************************************************!*\
  11525. !*** ./node_modules/core-js/internals/a-possible-prototype.js ***!
  11526. \****************************************************************/
  11527. /*! unknown exports (runtime-defined) */
  11528. /*! runtime requirements: module, __webpack_require__ */
  11529. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  11530. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11531. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  11532. module.exports = function (it) {
  11533. if (!isObject(it) && it !== null) {
  11534. throw TypeError("Can't set " + String(it) + ' as a prototype');
  11535. } return it;
  11536. };
  11537. /***/ }),
  11538. /***/ "./node_modules/core-js/internals/add-to-unscopables.js":
  11539. /*!**************************************************************!*\
  11540. !*** ./node_modules/core-js/internals/add-to-unscopables.js ***!
  11541. \**************************************************************/
  11542. /*! unknown exports (runtime-defined) */
  11543. /*! runtime requirements: module, __webpack_require__ */
  11544. /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
  11545. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11546. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  11547. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  11548. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  11549. var UNSCOPABLES = wellKnownSymbol('unscopables');
  11550. var ArrayPrototype = Array.prototype;
  11551. // Array.prototype[@@unscopables]
  11552. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  11553. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  11554. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  11555. configurable: true,
  11556. value: create(null)
  11557. });
  11558. }
  11559. // add a key to Array.prototype[@@unscopables]
  11560. module.exports = function (key) {
  11561. ArrayPrototype[UNSCOPABLES][key] = true;
  11562. };
  11563. /***/ }),
  11564. /***/ "./node_modules/core-js/internals/advance-string-index.js":
  11565. /*!****************************************************************!*\
  11566. !*** ./node_modules/core-js/internals/advance-string-index.js ***!
  11567. \****************************************************************/
  11568. /*! unknown exports (runtime-defined) */
  11569. /*! runtime requirements: __webpack_require__, module */
  11570. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  11571. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11572. "use strict";
  11573. var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").charAt;
  11574. // `AdvanceStringIndex` abstract operation
  11575. // https://tc39.github.io/ecma262/#sec-advancestringindex
  11576. module.exports = function (S, index, unicode) {
  11577. return index + (unicode ? charAt(S, index).length : 1);
  11578. };
  11579. /***/ }),
  11580. /***/ "./node_modules/core-js/internals/an-instance.js":
  11581. /*!*******************************************************!*\
  11582. !*** ./node_modules/core-js/internals/an-instance.js ***!
  11583. \*******************************************************/
  11584. /*! unknown exports (runtime-defined) */
  11585. /*! runtime requirements: module */
  11586. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  11587. /***/ ((module) => {
  11588. module.exports = function (it, Constructor, name) {
  11589. if (!(it instanceof Constructor)) {
  11590. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  11591. } return it;
  11592. };
  11593. /***/ }),
  11594. /***/ "./node_modules/core-js/internals/an-object.js":
  11595. /*!*****************************************************!*\
  11596. !*** ./node_modules/core-js/internals/an-object.js ***!
  11597. \*****************************************************/
  11598. /*! unknown exports (runtime-defined) */
  11599. /*! runtime requirements: module, __webpack_require__ */
  11600. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  11601. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11602. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  11603. module.exports = function (it) {
  11604. if (!isObject(it)) {
  11605. throw TypeError(String(it) + ' is not an object');
  11606. } return it;
  11607. };
  11608. /***/ }),
  11609. /***/ "./node_modules/core-js/internals/array-buffer-native.js":
  11610. /*!***************************************************************!*\
  11611. !*** ./node_modules/core-js/internals/array-buffer-native.js ***!
  11612. \***************************************************************/
  11613. /*! unknown exports (runtime-defined) */
  11614. /*! runtime requirements: module */
  11615. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  11616. /***/ ((module) => {
  11617. module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
  11618. /***/ }),
  11619. /***/ "./node_modules/core-js/internals/array-buffer-view-core.js":
  11620. /*!******************************************************************!*\
  11621. !*** ./node_modules/core-js/internals/array-buffer-view-core.js ***!
  11622. \******************************************************************/
  11623. /*! unknown exports (runtime-defined) */
  11624. /*! runtime requirements: __webpack_require__, module */
  11625. /*! CommonJS bailout: module.exports is used directly at 145:0-14 */
  11626. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11627. "use strict";
  11628. var NATIVE_ARRAY_BUFFER = __webpack_require__(/*! ../internals/array-buffer-native */ "./node_modules/core-js/internals/array-buffer-native.js");
  11629. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  11630. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  11631. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  11632. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  11633. var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
  11634. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  11635. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  11636. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  11637. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
  11638. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
  11639. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  11640. var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
  11641. var Int8Array = global.Int8Array;
  11642. var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
  11643. var Uint8ClampedArray = global.Uint8ClampedArray;
  11644. var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
  11645. var TypedArray = Int8Array && getPrototypeOf(Int8Array);
  11646. var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
  11647. var ObjectPrototype = Object.prototype;
  11648. var isPrototypeOf = ObjectPrototype.isPrototypeOf;
  11649. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  11650. var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
  11651. // Fixing native typed arrays in Opera Presto crashes the browser, see #595
  11652. var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
  11653. var TYPED_ARRAY_TAG_REQIRED = false;
  11654. var NAME;
  11655. var TypedArrayConstructorsList = {
  11656. Int8Array: 1,
  11657. Uint8Array: 1,
  11658. Uint8ClampedArray: 1,
  11659. Int16Array: 2,
  11660. Uint16Array: 2,
  11661. Int32Array: 4,
  11662. Uint32Array: 4,
  11663. Float32Array: 4,
  11664. Float64Array: 8
  11665. };
  11666. var isView = function isView(it) {
  11667. var klass = classof(it);
  11668. return klass === 'DataView' || has(TypedArrayConstructorsList, klass);
  11669. };
  11670. var isTypedArray = function (it) {
  11671. return isObject(it) && has(TypedArrayConstructorsList, classof(it));
  11672. };
  11673. var aTypedArray = function (it) {
  11674. if (isTypedArray(it)) return it;
  11675. throw TypeError('Target is not a typed array');
  11676. };
  11677. var aTypedArrayConstructor = function (C) {
  11678. if (setPrototypeOf) {
  11679. if (isPrototypeOf.call(TypedArray, C)) return C;
  11680. } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) {
  11681. var TypedArrayConstructor = global[ARRAY];
  11682. if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) {
  11683. return C;
  11684. }
  11685. } throw TypeError('Target is not a typed array constructor');
  11686. };
  11687. var exportTypedArrayMethod = function (KEY, property, forced) {
  11688. if (!DESCRIPTORS) return;
  11689. if (forced) for (var ARRAY in TypedArrayConstructorsList) {
  11690. var TypedArrayConstructor = global[ARRAY];
  11691. if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) {
  11692. delete TypedArrayConstructor.prototype[KEY];
  11693. }
  11694. }
  11695. if (!TypedArrayPrototype[KEY] || forced) {
  11696. redefine(TypedArrayPrototype, KEY, forced ? property
  11697. : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
  11698. }
  11699. };
  11700. var exportTypedArrayStaticMethod = function (KEY, property, forced) {
  11701. var ARRAY, TypedArrayConstructor;
  11702. if (!DESCRIPTORS) return;
  11703. if (setPrototypeOf) {
  11704. if (forced) for (ARRAY in TypedArrayConstructorsList) {
  11705. TypedArrayConstructor = global[ARRAY];
  11706. if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {
  11707. delete TypedArrayConstructor[KEY];
  11708. }
  11709. }
  11710. if (!TypedArray[KEY] || forced) {
  11711. // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
  11712. try {
  11713. return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property);
  11714. } catch (error) { /* empty */ }
  11715. } else return;
  11716. }
  11717. for (ARRAY in TypedArrayConstructorsList) {
  11718. TypedArrayConstructor = global[ARRAY];
  11719. if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
  11720. redefine(TypedArrayConstructor, KEY, property);
  11721. }
  11722. }
  11723. };
  11724. for (NAME in TypedArrayConstructorsList) {
  11725. if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;
  11726. }
  11727. // WebKit bug - typed arrays constructors prototype is Object.prototype
  11728. if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {
  11729. // eslint-disable-next-line no-shadow
  11730. TypedArray = function TypedArray() {
  11731. throw TypeError('Incorrect invocation');
  11732. };
  11733. if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
  11734. if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
  11735. }
  11736. }
  11737. if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
  11738. TypedArrayPrototype = TypedArray.prototype;
  11739. if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
  11740. if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
  11741. }
  11742. }
  11743. // WebKit bug - one more object in Uint8ClampedArray prototype chain
  11744. if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
  11745. setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
  11746. }
  11747. if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
  11748. TYPED_ARRAY_TAG_REQIRED = true;
  11749. defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
  11750. return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
  11751. } });
  11752. for (NAME in TypedArrayConstructorsList) if (global[NAME]) {
  11753. createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
  11754. }
  11755. }
  11756. module.exports = {
  11757. NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
  11758. TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
  11759. aTypedArray: aTypedArray,
  11760. aTypedArrayConstructor: aTypedArrayConstructor,
  11761. exportTypedArrayMethod: exportTypedArrayMethod,
  11762. exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
  11763. isView: isView,
  11764. isTypedArray: isTypedArray,
  11765. TypedArray: TypedArray,
  11766. TypedArrayPrototype: TypedArrayPrototype
  11767. };
  11768. /***/ }),
  11769. /***/ "./node_modules/core-js/internals/array-buffer.js":
  11770. /*!********************************************************!*\
  11771. !*** ./node_modules/core-js/internals/array-buffer.js ***!
  11772. \********************************************************/
  11773. /*! unknown exports (runtime-defined) */
  11774. /*! runtime requirements: __webpack_require__, module */
  11775. /*! CommonJS bailout: module.exports is used directly at 223:0-14 */
  11776. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11777. "use strict";
  11778. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  11779. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  11780. var NATIVE_ARRAY_BUFFER = __webpack_require__(/*! ../internals/array-buffer-native */ "./node_modules/core-js/internals/array-buffer-native.js");
  11781. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  11782. var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
  11783. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  11784. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  11785. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  11786. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  11787. var toIndex = __webpack_require__(/*! ../internals/to-index */ "./node_modules/core-js/internals/to-index.js");
  11788. var IEEE754 = __webpack_require__(/*! ../internals/ieee754 */ "./node_modules/core-js/internals/ieee754.js");
  11789. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
  11790. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
  11791. var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
  11792. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  11793. var arrayFill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
  11794. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  11795. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  11796. var getInternalState = InternalStateModule.get;
  11797. var setInternalState = InternalStateModule.set;
  11798. var ARRAY_BUFFER = 'ArrayBuffer';
  11799. var DATA_VIEW = 'DataView';
  11800. var PROTOTYPE = 'prototype';
  11801. var WRONG_LENGTH = 'Wrong length';
  11802. var WRONG_INDEX = 'Wrong index';
  11803. var NativeArrayBuffer = global[ARRAY_BUFFER];
  11804. var $ArrayBuffer = NativeArrayBuffer;
  11805. var $DataView = global[DATA_VIEW];
  11806. var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
  11807. var ObjectPrototype = Object.prototype;
  11808. var RangeError = global.RangeError;
  11809. var packIEEE754 = IEEE754.pack;
  11810. var unpackIEEE754 = IEEE754.unpack;
  11811. var packInt8 = function (number) {
  11812. return [number & 0xFF];
  11813. };
  11814. var packInt16 = function (number) {
  11815. return [number & 0xFF, number >> 8 & 0xFF];
  11816. };
  11817. var packInt32 = function (number) {
  11818. return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
  11819. };
  11820. var unpackInt32 = function (buffer) {
  11821. return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
  11822. };
  11823. var packFloat32 = function (number) {
  11824. return packIEEE754(number, 23, 4);
  11825. };
  11826. var packFloat64 = function (number) {
  11827. return packIEEE754(number, 52, 8);
  11828. };
  11829. var addGetter = function (Constructor, key) {
  11830. defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });
  11831. };
  11832. var get = function (view, count, index, isLittleEndian) {
  11833. var intIndex = toIndex(index);
  11834. var store = getInternalState(view);
  11835. if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
  11836. var bytes = getInternalState(store.buffer).bytes;
  11837. var start = intIndex + store.byteOffset;
  11838. var pack = bytes.slice(start, start + count);
  11839. return isLittleEndian ? pack : pack.reverse();
  11840. };
  11841. var set = function (view, count, index, conversion, value, isLittleEndian) {
  11842. var intIndex = toIndex(index);
  11843. var store = getInternalState(view);
  11844. if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
  11845. var bytes = getInternalState(store.buffer).bytes;
  11846. var start = intIndex + store.byteOffset;
  11847. var pack = conversion(+value);
  11848. for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
  11849. };
  11850. if (!NATIVE_ARRAY_BUFFER) {
  11851. $ArrayBuffer = function ArrayBuffer(length) {
  11852. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  11853. var byteLength = toIndex(length);
  11854. setInternalState(this, {
  11855. bytes: arrayFill.call(new Array(byteLength), 0),
  11856. byteLength: byteLength
  11857. });
  11858. if (!DESCRIPTORS) this.byteLength = byteLength;
  11859. };
  11860. $DataView = function DataView(buffer, byteOffset, byteLength) {
  11861. anInstance(this, $DataView, DATA_VIEW);
  11862. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  11863. var bufferLength = getInternalState(buffer).byteLength;
  11864. var offset = toInteger(byteOffset);
  11865. if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');
  11866. byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
  11867. if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
  11868. setInternalState(this, {
  11869. buffer: buffer,
  11870. byteLength: byteLength,
  11871. byteOffset: offset
  11872. });
  11873. if (!DESCRIPTORS) {
  11874. this.buffer = buffer;
  11875. this.byteLength = byteLength;
  11876. this.byteOffset = offset;
  11877. }
  11878. };
  11879. if (DESCRIPTORS) {
  11880. addGetter($ArrayBuffer, 'byteLength');
  11881. addGetter($DataView, 'buffer');
  11882. addGetter($DataView, 'byteLength');
  11883. addGetter($DataView, 'byteOffset');
  11884. }
  11885. redefineAll($DataView[PROTOTYPE], {
  11886. getInt8: function getInt8(byteOffset) {
  11887. return get(this, 1, byteOffset)[0] << 24 >> 24;
  11888. },
  11889. getUint8: function getUint8(byteOffset) {
  11890. return get(this, 1, byteOffset)[0];
  11891. },
  11892. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  11893. var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
  11894. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  11895. },
  11896. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  11897. var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
  11898. return bytes[1] << 8 | bytes[0];
  11899. },
  11900. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  11901. return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));
  11902. },
  11903. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  11904. return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;
  11905. },
  11906. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  11907. return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);
  11908. },
  11909. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  11910. return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);
  11911. },
  11912. setInt8: function setInt8(byteOffset, value) {
  11913. set(this, 1, byteOffset, packInt8, value);
  11914. },
  11915. setUint8: function setUint8(byteOffset, value) {
  11916. set(this, 1, byteOffset, packInt8, value);
  11917. },
  11918. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  11919. set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
  11920. },
  11921. setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
  11922. set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
  11923. },
  11924. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  11925. set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
  11926. },
  11927. setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
  11928. set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
  11929. },
  11930. setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
  11931. set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);
  11932. },
  11933. setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
  11934. set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);
  11935. }
  11936. });
  11937. } else {
  11938. if (!fails(function () {
  11939. NativeArrayBuffer(1);
  11940. }) || !fails(function () {
  11941. new NativeArrayBuffer(-1); // eslint-disable-line no-new
  11942. }) || fails(function () {
  11943. new NativeArrayBuffer(); // eslint-disable-line no-new
  11944. new NativeArrayBuffer(1.5); // eslint-disable-line no-new
  11945. new NativeArrayBuffer(NaN); // eslint-disable-line no-new
  11946. return NativeArrayBuffer.name != ARRAY_BUFFER;
  11947. })) {
  11948. $ArrayBuffer = function ArrayBuffer(length) {
  11949. anInstance(this, $ArrayBuffer);
  11950. return new NativeArrayBuffer(toIndex(length));
  11951. };
  11952. var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];
  11953. for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
  11954. if (!((key = keys[j++]) in $ArrayBuffer)) {
  11955. createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
  11956. }
  11957. }
  11958. ArrayBufferPrototype.constructor = $ArrayBuffer;
  11959. }
  11960. // WebKit bug - the same parent prototype for typed arrays and data view
  11961. if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {
  11962. setPrototypeOf($DataViewPrototype, ObjectPrototype);
  11963. }
  11964. // iOS Safari 7.x bug
  11965. var testView = new $DataView(new $ArrayBuffer(2));
  11966. var nativeSetInt8 = $DataViewPrototype.setInt8;
  11967. testView.setInt8(0, 2147483648);
  11968. testView.setInt8(1, 2147483649);
  11969. if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
  11970. setInt8: function setInt8(byteOffset, value) {
  11971. nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
  11972. },
  11973. setUint8: function setUint8(byteOffset, value) {
  11974. nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
  11975. }
  11976. }, { unsafe: true });
  11977. }
  11978. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  11979. setToStringTag($DataView, DATA_VIEW);
  11980. module.exports = {
  11981. ArrayBuffer: $ArrayBuffer,
  11982. DataView: $DataView
  11983. };
  11984. /***/ }),
  11985. /***/ "./node_modules/core-js/internals/array-copy-within.js":
  11986. /*!*************************************************************!*\
  11987. !*** ./node_modules/core-js/internals/array-copy-within.js ***!
  11988. \*************************************************************/
  11989. /*! unknown exports (runtime-defined) */
  11990. /*! runtime requirements: module, __webpack_require__ */
  11991. /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
  11992. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  11993. "use strict";
  11994. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  11995. var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
  11996. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  11997. var min = Math.min;
  11998. // `Array.prototype.copyWithin` method implementation
  11999. // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin
  12000. module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  12001. var O = toObject(this);
  12002. var len = toLength(O.length);
  12003. var to = toAbsoluteIndex(target, len);
  12004. var from = toAbsoluteIndex(start, len);
  12005. var end = arguments.length > 2 ? arguments[2] : undefined;
  12006. var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  12007. var inc = 1;
  12008. if (from < to && to < from + count) {
  12009. inc = -1;
  12010. from += count - 1;
  12011. to += count - 1;
  12012. }
  12013. while (count-- > 0) {
  12014. if (from in O) O[to] = O[from];
  12015. else delete O[to];
  12016. to += inc;
  12017. from += inc;
  12018. } return O;
  12019. };
  12020. /***/ }),
  12021. /***/ "./node_modules/core-js/internals/array-fill.js":
  12022. /*!******************************************************!*\
  12023. !*** ./node_modules/core-js/internals/array-fill.js ***!
  12024. \******************************************************/
  12025. /*! unknown exports (runtime-defined) */
  12026. /*! runtime requirements: module, __webpack_require__ */
  12027. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  12028. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12029. "use strict";
  12030. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  12031. var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
  12032. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12033. // `Array.prototype.fill` method implementation
  12034. // https://tc39.github.io/ecma262/#sec-array.prototype.fill
  12035. module.exports = function fill(value /* , start = 0, end = @length */) {
  12036. var O = toObject(this);
  12037. var length = toLength(O.length);
  12038. var argumentsLength = arguments.length;
  12039. var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
  12040. var end = argumentsLength > 2 ? arguments[2] : undefined;
  12041. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  12042. while (endPos > index) O[index++] = value;
  12043. return O;
  12044. };
  12045. /***/ }),
  12046. /***/ "./node_modules/core-js/internals/array-for-each.js":
  12047. /*!**********************************************************!*\
  12048. !*** ./node_modules/core-js/internals/array-for-each.js ***!
  12049. \**********************************************************/
  12050. /*! unknown exports (runtime-defined) */
  12051. /*! runtime requirements: __webpack_require__, module */
  12052. /*! CommonJS bailout: module.exports is used directly at 11:0-14 */
  12053. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12054. "use strict";
  12055. var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
  12056. var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
  12057. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  12058. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  12059. var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
  12060. // `Array.prototype.forEach` method implementation
  12061. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  12062. module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
  12063. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  12064. } : [].forEach;
  12065. /***/ }),
  12066. /***/ "./node_modules/core-js/internals/array-from.js":
  12067. /*!******************************************************!*\
  12068. !*** ./node_modules/core-js/internals/array-from.js ***!
  12069. \******************************************************/
  12070. /*! unknown exports (runtime-defined) */
  12071. /*! runtime requirements: module, __webpack_require__ */
  12072. /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
  12073. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12074. "use strict";
  12075. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  12076. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  12077. var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js");
  12078. var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
  12079. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12080. var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
  12081. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
  12082. // `Array.from` method implementation
  12083. // https://tc39.github.io/ecma262/#sec-array.from
  12084. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  12085. var O = toObject(arrayLike);
  12086. var C = typeof this == 'function' ? this : Array;
  12087. var argumentsLength = arguments.length;
  12088. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  12089. var mapping = mapfn !== undefined;
  12090. var iteratorMethod = getIteratorMethod(O);
  12091. var index = 0;
  12092. var length, result, step, iterator, next, value;
  12093. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  12094. // if the target is not iterable or it's an array with the default iterator - use a simple case
  12095. if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
  12096. iterator = iteratorMethod.call(O);
  12097. next = iterator.next;
  12098. result = new C();
  12099. for (;!(step = next.call(iterator)).done; index++) {
  12100. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  12101. createProperty(result, index, value);
  12102. }
  12103. } else {
  12104. length = toLength(O.length);
  12105. result = new C(length);
  12106. for (;length > index; index++) {
  12107. value = mapping ? mapfn(O[index], index) : O[index];
  12108. createProperty(result, index, value);
  12109. }
  12110. }
  12111. result.length = index;
  12112. return result;
  12113. };
  12114. /***/ }),
  12115. /***/ "./node_modules/core-js/internals/array-includes.js":
  12116. /*!**********************************************************!*\
  12117. !*** ./node_modules/core-js/internals/array-includes.js ***!
  12118. \**********************************************************/
  12119. /*! unknown exports (runtime-defined) */
  12120. /*! runtime requirements: module, __webpack_require__ */
  12121. /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
  12122. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12123. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  12124. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12125. var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
  12126. // `Array.prototype.{ indexOf, includes }` methods implementation
  12127. var createMethod = function (IS_INCLUDES) {
  12128. return function ($this, el, fromIndex) {
  12129. var O = toIndexedObject($this);
  12130. var length = toLength(O.length);
  12131. var index = toAbsoluteIndex(fromIndex, length);
  12132. var value;
  12133. // Array#includes uses SameValueZero equality algorithm
  12134. // eslint-disable-next-line no-self-compare
  12135. if (IS_INCLUDES && el != el) while (length > index) {
  12136. value = O[index++];
  12137. // eslint-disable-next-line no-self-compare
  12138. if (value != value) return true;
  12139. // Array#indexOf ignores holes, Array#includes - not
  12140. } else for (;length > index; index++) {
  12141. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  12142. } return !IS_INCLUDES && -1;
  12143. };
  12144. };
  12145. module.exports = {
  12146. // `Array.prototype.includes` method
  12147. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  12148. includes: createMethod(true),
  12149. // `Array.prototype.indexOf` method
  12150. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  12151. indexOf: createMethod(false)
  12152. };
  12153. /***/ }),
  12154. /***/ "./node_modules/core-js/internals/array-iteration.js":
  12155. /*!***********************************************************!*\
  12156. !*** ./node_modules/core-js/internals/array-iteration.js ***!
  12157. \***********************************************************/
  12158. /*! unknown exports (runtime-defined) */
  12159. /*! runtime requirements: module, __webpack_require__ */
  12160. /*! CommonJS bailout: module.exports is used directly at 43:0-14 */
  12161. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12162. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  12163. var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
  12164. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  12165. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12166. var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/core-js/internals/array-species-create.js");
  12167. var push = [].push;
  12168. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  12169. var createMethod = function (TYPE) {
  12170. var IS_MAP = TYPE == 1;
  12171. var IS_FILTER = TYPE == 2;
  12172. var IS_SOME = TYPE == 3;
  12173. var IS_EVERY = TYPE == 4;
  12174. var IS_FIND_INDEX = TYPE == 6;
  12175. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  12176. return function ($this, callbackfn, that, specificCreate) {
  12177. var O = toObject($this);
  12178. var self = IndexedObject(O);
  12179. var boundFunction = bind(callbackfn, that, 3);
  12180. var length = toLength(self.length);
  12181. var index = 0;
  12182. var create = specificCreate || arraySpeciesCreate;
  12183. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  12184. var value, result;
  12185. for (;length > index; index++) if (NO_HOLES || index in self) {
  12186. value = self[index];
  12187. result = boundFunction(value, index, O);
  12188. if (TYPE) {
  12189. if (IS_MAP) target[index] = result; // map
  12190. else if (result) switch (TYPE) {
  12191. case 3: return true; // some
  12192. case 5: return value; // find
  12193. case 6: return index; // findIndex
  12194. case 2: push.call(target, value); // filter
  12195. } else if (IS_EVERY) return false; // every
  12196. }
  12197. }
  12198. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  12199. };
  12200. };
  12201. module.exports = {
  12202. // `Array.prototype.forEach` method
  12203. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  12204. forEach: createMethod(0),
  12205. // `Array.prototype.map` method
  12206. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  12207. map: createMethod(1),
  12208. // `Array.prototype.filter` method
  12209. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  12210. filter: createMethod(2),
  12211. // `Array.prototype.some` method
  12212. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  12213. some: createMethod(3),
  12214. // `Array.prototype.every` method
  12215. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  12216. every: createMethod(4),
  12217. // `Array.prototype.find` method
  12218. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  12219. find: createMethod(5),
  12220. // `Array.prototype.findIndex` method
  12221. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  12222. findIndex: createMethod(6)
  12223. };
  12224. /***/ }),
  12225. /***/ "./node_modules/core-js/internals/array-last-index-of.js":
  12226. /*!***************************************************************!*\
  12227. !*** ./node_modules/core-js/internals/array-last-index-of.js ***!
  12228. \***************************************************************/
  12229. /*! unknown exports (runtime-defined) */
  12230. /*! runtime requirements: module, __webpack_require__ */
  12231. /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
  12232. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12233. "use strict";
  12234. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  12235. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  12236. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12237. var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
  12238. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  12239. var min = Math.min;
  12240. var nativeLastIndexOf = [].lastIndexOf;
  12241. var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
  12242. var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
  12243. // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
  12244. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  12245. var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
  12246. // `Array.prototype.lastIndexOf` method implementation
  12247. // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
  12248. module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  12249. // convert -0 to +0
  12250. if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
  12251. var O = toIndexedObject(this);
  12252. var length = toLength(O.length);
  12253. var index = length - 1;
  12254. if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
  12255. if (index < 0) index = length + index;
  12256. for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
  12257. return -1;
  12258. } : nativeLastIndexOf;
  12259. /***/ }),
  12260. /***/ "./node_modules/core-js/internals/array-method-has-species-support.js":
  12261. /*!****************************************************************************!*\
  12262. !*** ./node_modules/core-js/internals/array-method-has-species-support.js ***!
  12263. \****************************************************************************/
  12264. /*! unknown exports (runtime-defined) */
  12265. /*! runtime requirements: module, __webpack_require__ */
  12266. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  12267. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12268. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  12269. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  12270. var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
  12271. var SPECIES = wellKnownSymbol('species');
  12272. module.exports = function (METHOD_NAME) {
  12273. // We can't use this feature detection in V8 since it causes
  12274. // deoptimization and serious performance degradation
  12275. // https://github.com/zloirock/core-js/issues/677
  12276. return V8_VERSION >= 51 || !fails(function () {
  12277. var array = [];
  12278. var constructor = array.constructor = {};
  12279. constructor[SPECIES] = function () {
  12280. return { foo: 1 };
  12281. };
  12282. return array[METHOD_NAME](Boolean).foo !== 1;
  12283. });
  12284. };
  12285. /***/ }),
  12286. /***/ "./node_modules/core-js/internals/array-method-is-strict.js":
  12287. /*!******************************************************************!*\
  12288. !*** ./node_modules/core-js/internals/array-method-is-strict.js ***!
  12289. \******************************************************************/
  12290. /*! unknown exports (runtime-defined) */
  12291. /*! runtime requirements: module, __webpack_require__ */
  12292. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  12293. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12294. "use strict";
  12295. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  12296. module.exports = function (METHOD_NAME, argument) {
  12297. var method = [][METHOD_NAME];
  12298. return !!method && fails(function () {
  12299. // eslint-disable-next-line no-useless-call,no-throw-literal
  12300. method.call(null, argument || function () { throw 1; }, 1);
  12301. });
  12302. };
  12303. /***/ }),
  12304. /***/ "./node_modules/core-js/internals/array-method-uses-to-length.js":
  12305. /*!***********************************************************************!*\
  12306. !*** ./node_modules/core-js/internals/array-method-uses-to-length.js ***!
  12307. \***********************************************************************/
  12308. /*! unknown exports (runtime-defined) */
  12309. /*! runtime requirements: module, __webpack_require__ */
  12310. /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
  12311. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12312. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  12313. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  12314. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  12315. var defineProperty = Object.defineProperty;
  12316. var cache = {};
  12317. var thrower = function (it) { throw it; };
  12318. module.exports = function (METHOD_NAME, options) {
  12319. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  12320. if (!options) options = {};
  12321. var method = [][METHOD_NAME];
  12322. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  12323. var argument0 = has(options, 0) ? options[0] : thrower;
  12324. var argument1 = has(options, 1) ? options[1] : undefined;
  12325. return cache[METHOD_NAME] = !!method && !fails(function () {
  12326. if (ACCESSORS && !DESCRIPTORS) return true;
  12327. var O = { length: -1 };
  12328. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  12329. else O[1] = 1;
  12330. method.call(O, argument0, argument1);
  12331. });
  12332. };
  12333. /***/ }),
  12334. /***/ "./node_modules/core-js/internals/array-reduce.js":
  12335. /*!********************************************************!*\
  12336. !*** ./node_modules/core-js/internals/array-reduce.js ***!
  12337. \********************************************************/
  12338. /*! unknown exports (runtime-defined) */
  12339. /*! runtime requirements: module, __webpack_require__ */
  12340. /*! CommonJS bailout: module.exports is used directly at 33:0-14 */
  12341. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12342. var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
  12343. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  12344. var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
  12345. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  12346. // `Array.prototype.{ reduce, reduceRight }` methods implementation
  12347. var createMethod = function (IS_RIGHT) {
  12348. return function (that, callbackfn, argumentsLength, memo) {
  12349. aFunction(callbackfn);
  12350. var O = toObject(that);
  12351. var self = IndexedObject(O);
  12352. var length = toLength(O.length);
  12353. var index = IS_RIGHT ? length - 1 : 0;
  12354. var i = IS_RIGHT ? -1 : 1;
  12355. if (argumentsLength < 2) while (true) {
  12356. if (index in self) {
  12357. memo = self[index];
  12358. index += i;
  12359. break;
  12360. }
  12361. index += i;
  12362. if (IS_RIGHT ? index < 0 : length <= index) {
  12363. throw TypeError('Reduce of empty array with no initial value');
  12364. }
  12365. }
  12366. for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
  12367. memo = callbackfn(memo, self[index], index, O);
  12368. }
  12369. return memo;
  12370. };
  12371. };
  12372. module.exports = {
  12373. // `Array.prototype.reduce` method
  12374. // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
  12375. left: createMethod(false),
  12376. // `Array.prototype.reduceRight` method
  12377. // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
  12378. right: createMethod(true)
  12379. };
  12380. /***/ }),
  12381. /***/ "./node_modules/core-js/internals/array-species-create.js":
  12382. /*!****************************************************************!*\
  12383. !*** ./node_modules/core-js/internals/array-species-create.js ***!
  12384. \****************************************************************/
  12385. /*! unknown exports (runtime-defined) */
  12386. /*! runtime requirements: module, __webpack_require__ */
  12387. /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
  12388. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12389. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  12390. var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
  12391. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  12392. var SPECIES = wellKnownSymbol('species');
  12393. // `ArraySpeciesCreate` abstract operation
  12394. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  12395. module.exports = function (originalArray, length) {
  12396. var C;
  12397. if (isArray(originalArray)) {
  12398. C = originalArray.constructor;
  12399. // cross-realm fallback
  12400. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  12401. else if (isObject(C)) {
  12402. C = C[SPECIES];
  12403. if (C === null) C = undefined;
  12404. }
  12405. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  12406. };
  12407. /***/ }),
  12408. /***/ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js":
  12409. /*!****************************************************************************!*\
  12410. !*** ./node_modules/core-js/internals/call-with-safe-iteration-closing.js ***!
  12411. \****************************************************************************/
  12412. /*! unknown exports (runtime-defined) */
  12413. /*! runtime requirements: module, __webpack_require__ */
  12414. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  12415. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12416. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  12417. // call something on iterator step with safe closing on error
  12418. module.exports = function (iterator, fn, value, ENTRIES) {
  12419. try {
  12420. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  12421. // 7.4.6 IteratorClose(iterator, completion)
  12422. } catch (error) {
  12423. var returnMethod = iterator['return'];
  12424. if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
  12425. throw error;
  12426. }
  12427. };
  12428. /***/ }),
  12429. /***/ "./node_modules/core-js/internals/check-correctness-of-iteration.js":
  12430. /*!**************************************************************************!*\
  12431. !*** ./node_modules/core-js/internals/check-correctness-of-iteration.js ***!
  12432. \**************************************************************************/
  12433. /*! unknown exports (runtime-defined) */
  12434. /*! runtime requirements: module, __webpack_require__ */
  12435. /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
  12436. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12437. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  12438. var ITERATOR = wellKnownSymbol('iterator');
  12439. var SAFE_CLOSING = false;
  12440. try {
  12441. var called = 0;
  12442. var iteratorWithReturn = {
  12443. next: function () {
  12444. return { done: !!called++ };
  12445. },
  12446. 'return': function () {
  12447. SAFE_CLOSING = true;
  12448. }
  12449. };
  12450. iteratorWithReturn[ITERATOR] = function () {
  12451. return this;
  12452. };
  12453. // eslint-disable-next-line no-throw-literal
  12454. Array.from(iteratorWithReturn, function () { throw 2; });
  12455. } catch (error) { /* empty */ }
  12456. module.exports = function (exec, SKIP_CLOSING) {
  12457. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  12458. var ITERATION_SUPPORT = false;
  12459. try {
  12460. var object = {};
  12461. object[ITERATOR] = function () {
  12462. return {
  12463. next: function () {
  12464. return { done: ITERATION_SUPPORT = true };
  12465. }
  12466. };
  12467. };
  12468. exec(object);
  12469. } catch (error) { /* empty */ }
  12470. return ITERATION_SUPPORT;
  12471. };
  12472. /***/ }),
  12473. /***/ "./node_modules/core-js/internals/classof-raw.js":
  12474. /*!*******************************************************!*\
  12475. !*** ./node_modules/core-js/internals/classof-raw.js ***!
  12476. \*******************************************************/
  12477. /*! unknown exports (runtime-defined) */
  12478. /*! runtime requirements: module */
  12479. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  12480. /***/ ((module) => {
  12481. var toString = {}.toString;
  12482. module.exports = function (it) {
  12483. return toString.call(it).slice(8, -1);
  12484. };
  12485. /***/ }),
  12486. /***/ "./node_modules/core-js/internals/classof.js":
  12487. /*!***************************************************!*\
  12488. !*** ./node_modules/core-js/internals/classof.js ***!
  12489. \***************************************************/
  12490. /*! unknown exports (runtime-defined) */
  12491. /*! runtime requirements: module, __webpack_require__ */
  12492. /*! CommonJS bailout: module.exports is used directly at 17:0-14 */
  12493. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12494. var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
  12495. var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  12496. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  12497. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  12498. // ES3 wrong here
  12499. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  12500. // fallback for IE11 Script Access Denied error
  12501. var tryGet = function (it, key) {
  12502. try {
  12503. return it[key];
  12504. } catch (error) { /* empty */ }
  12505. };
  12506. // getting tag from ES6+ `Object.prototype.toString`
  12507. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  12508. var O, tag, result;
  12509. return it === undefined ? 'Undefined' : it === null ? 'Null'
  12510. // @@toStringTag case
  12511. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  12512. // builtinTag case
  12513. : CORRECT_ARGUMENTS ? classofRaw(O)
  12514. // ES3 arguments fallback
  12515. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  12516. };
  12517. /***/ }),
  12518. /***/ "./node_modules/core-js/internals/collection-strong.js":
  12519. /*!*************************************************************!*\
  12520. !*** ./node_modules/core-js/internals/collection-strong.js ***!
  12521. \*************************************************************/
  12522. /*! unknown exports (runtime-defined) */
  12523. /*! runtime requirements: __webpack_require__, module */
  12524. /*! CommonJS bailout: module.exports is used directly at 17:0-14 */
  12525. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12526. "use strict";
  12527. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  12528. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  12529. var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
  12530. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  12531. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  12532. var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
  12533. var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
  12534. var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
  12535. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  12536. var fastKey = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/core-js/internals/internal-metadata.js").fastKey;
  12537. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  12538. var setInternalState = InternalStateModule.set;
  12539. var internalStateGetterFor = InternalStateModule.getterFor;
  12540. module.exports = {
  12541. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  12542. var C = wrapper(function (that, iterable) {
  12543. anInstance(that, C, CONSTRUCTOR_NAME);
  12544. setInternalState(that, {
  12545. type: CONSTRUCTOR_NAME,
  12546. index: create(null),
  12547. first: undefined,
  12548. last: undefined,
  12549. size: 0
  12550. });
  12551. if (!DESCRIPTORS) that.size = 0;
  12552. if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
  12553. });
  12554. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  12555. var define = function (that, key, value) {
  12556. var state = getInternalState(that);
  12557. var entry = getEntry(that, key);
  12558. var previous, index;
  12559. // change existing entry
  12560. if (entry) {
  12561. entry.value = value;
  12562. // create new entry
  12563. } else {
  12564. state.last = entry = {
  12565. index: index = fastKey(key, true),
  12566. key: key,
  12567. value: value,
  12568. previous: previous = state.last,
  12569. next: undefined,
  12570. removed: false
  12571. };
  12572. if (!state.first) state.first = entry;
  12573. if (previous) previous.next = entry;
  12574. if (DESCRIPTORS) state.size++;
  12575. else that.size++;
  12576. // add to index
  12577. if (index !== 'F') state.index[index] = entry;
  12578. } return that;
  12579. };
  12580. var getEntry = function (that, key) {
  12581. var state = getInternalState(that);
  12582. // fast case
  12583. var index = fastKey(key);
  12584. var entry;
  12585. if (index !== 'F') return state.index[index];
  12586. // frozen object case
  12587. for (entry = state.first; entry; entry = entry.next) {
  12588. if (entry.key == key) return entry;
  12589. }
  12590. };
  12591. redefineAll(C.prototype, {
  12592. // 23.1.3.1 Map.prototype.clear()
  12593. // 23.2.3.2 Set.prototype.clear()
  12594. clear: function clear() {
  12595. var that = this;
  12596. var state = getInternalState(that);
  12597. var data = state.index;
  12598. var entry = state.first;
  12599. while (entry) {
  12600. entry.removed = true;
  12601. if (entry.previous) entry.previous = entry.previous.next = undefined;
  12602. delete data[entry.index];
  12603. entry = entry.next;
  12604. }
  12605. state.first = state.last = undefined;
  12606. if (DESCRIPTORS) state.size = 0;
  12607. else that.size = 0;
  12608. },
  12609. // 23.1.3.3 Map.prototype.delete(key)
  12610. // 23.2.3.4 Set.prototype.delete(value)
  12611. 'delete': function (key) {
  12612. var that = this;
  12613. var state = getInternalState(that);
  12614. var entry = getEntry(that, key);
  12615. if (entry) {
  12616. var next = entry.next;
  12617. var prev = entry.previous;
  12618. delete state.index[entry.index];
  12619. entry.removed = true;
  12620. if (prev) prev.next = next;
  12621. if (next) next.previous = prev;
  12622. if (state.first == entry) state.first = next;
  12623. if (state.last == entry) state.last = prev;
  12624. if (DESCRIPTORS) state.size--;
  12625. else that.size--;
  12626. } return !!entry;
  12627. },
  12628. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  12629. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  12630. forEach: function forEach(callbackfn /* , that = undefined */) {
  12631. var state = getInternalState(this);
  12632. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  12633. var entry;
  12634. while (entry = entry ? entry.next : state.first) {
  12635. boundFunction(entry.value, entry.key, this);
  12636. // revert to the last existing entry
  12637. while (entry && entry.removed) entry = entry.previous;
  12638. }
  12639. },
  12640. // 23.1.3.7 Map.prototype.has(key)
  12641. // 23.2.3.7 Set.prototype.has(value)
  12642. has: function has(key) {
  12643. return !!getEntry(this, key);
  12644. }
  12645. });
  12646. redefineAll(C.prototype, IS_MAP ? {
  12647. // 23.1.3.6 Map.prototype.get(key)
  12648. get: function get(key) {
  12649. var entry = getEntry(this, key);
  12650. return entry && entry.value;
  12651. },
  12652. // 23.1.3.9 Map.prototype.set(key, value)
  12653. set: function set(key, value) {
  12654. return define(this, key === 0 ? 0 : key, value);
  12655. }
  12656. } : {
  12657. // 23.2.3.1 Set.prototype.add(value)
  12658. add: function add(value) {
  12659. return define(this, value = value === 0 ? 0 : value, value);
  12660. }
  12661. });
  12662. if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
  12663. get: function () {
  12664. return getInternalState(this).size;
  12665. }
  12666. });
  12667. return C;
  12668. },
  12669. setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
  12670. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  12671. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  12672. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  12673. // add .keys, .values, .entries, [@@iterator]
  12674. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  12675. defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
  12676. setInternalState(this, {
  12677. type: ITERATOR_NAME,
  12678. target: iterated,
  12679. state: getInternalCollectionState(iterated),
  12680. kind: kind,
  12681. last: undefined
  12682. });
  12683. }, function () {
  12684. var state = getInternalIteratorState(this);
  12685. var kind = state.kind;
  12686. var entry = state.last;
  12687. // revert to the last existing entry
  12688. while (entry && entry.removed) entry = entry.previous;
  12689. // get next entry
  12690. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  12691. // or finish the iteration
  12692. state.target = undefined;
  12693. return { value: undefined, done: true };
  12694. }
  12695. // return step by kind
  12696. if (kind == 'keys') return { value: entry.key, done: false };
  12697. if (kind == 'values') return { value: entry.value, done: false };
  12698. return { value: [entry.key, entry.value], done: false };
  12699. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  12700. // add [@@species], 23.1.2.2, 23.2.2.2
  12701. setSpecies(CONSTRUCTOR_NAME);
  12702. }
  12703. };
  12704. /***/ }),
  12705. /***/ "./node_modules/core-js/internals/collection.js":
  12706. /*!******************************************************!*\
  12707. !*** ./node_modules/core-js/internals/collection.js ***!
  12708. \******************************************************/
  12709. /*! unknown exports (runtime-defined) */
  12710. /*! runtime requirements: module, __webpack_require__ */
  12711. /*! CommonJS bailout: module.exports is used directly at 15:0-14 */
  12712. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12713. "use strict";
  12714. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  12715. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  12716. var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
  12717. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  12718. var InternalMetadataModule = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/core-js/internals/internal-metadata.js");
  12719. var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
  12720. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  12721. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  12722. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  12723. var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
  12724. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  12725. var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
  12726. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  12727. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  12728. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  12729. var ADDER = IS_MAP ? 'set' : 'add';
  12730. var NativeConstructor = global[CONSTRUCTOR_NAME];
  12731. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  12732. var Constructor = NativeConstructor;
  12733. var exported = {};
  12734. var fixMethod = function (KEY) {
  12735. var nativeMethod = NativePrototype[KEY];
  12736. redefine(NativePrototype, KEY,
  12737. KEY == 'add' ? function add(value) {
  12738. nativeMethod.call(this, value === 0 ? 0 : value);
  12739. return this;
  12740. } : KEY == 'delete' ? function (key) {
  12741. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  12742. } : KEY == 'get' ? function get(key) {
  12743. return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
  12744. } : KEY == 'has' ? function has(key) {
  12745. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  12746. } : function set(key, value) {
  12747. nativeMethod.call(this, key === 0 ? 0 : key, value);
  12748. return this;
  12749. }
  12750. );
  12751. };
  12752. // eslint-disable-next-line max-len
  12753. if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
  12754. new NativeConstructor().entries().next();
  12755. })))) {
  12756. // create collection constructor
  12757. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  12758. InternalMetadataModule.REQUIRED = true;
  12759. } else if (isForced(CONSTRUCTOR_NAME, true)) {
  12760. var instance = new Constructor();
  12761. // early implementations not supports chaining
  12762. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  12763. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  12764. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  12765. // most early implementations doesn't supports iterables, most modern - not close it correctly
  12766. // eslint-disable-next-line no-new
  12767. var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
  12768. // for early implementations -0 and +0 not the same
  12769. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  12770. // V8 ~ Chromium 42- fails only with 5+ elements
  12771. var $instance = new NativeConstructor();
  12772. var index = 5;
  12773. while (index--) $instance[ADDER](index, index);
  12774. return !$instance.has(-0);
  12775. });
  12776. if (!ACCEPT_ITERABLES) {
  12777. Constructor = wrapper(function (dummy, iterable) {
  12778. anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
  12779. var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
  12780. if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
  12781. return that;
  12782. });
  12783. Constructor.prototype = NativePrototype;
  12784. NativePrototype.constructor = Constructor;
  12785. }
  12786. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  12787. fixMethod('delete');
  12788. fixMethod('has');
  12789. IS_MAP && fixMethod('get');
  12790. }
  12791. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  12792. // weak collections should not contains .clear method
  12793. if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
  12794. }
  12795. exported[CONSTRUCTOR_NAME] = Constructor;
  12796. $({ global: true, forced: Constructor != NativeConstructor }, exported);
  12797. setToStringTag(Constructor, CONSTRUCTOR_NAME);
  12798. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  12799. return Constructor;
  12800. };
  12801. /***/ }),
  12802. /***/ "./node_modules/core-js/internals/copy-constructor-properties.js":
  12803. /*!***********************************************************************!*\
  12804. !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***!
  12805. \***********************************************************************/
  12806. /*! unknown exports (runtime-defined) */
  12807. /*! runtime requirements: module, __webpack_require__ */
  12808. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  12809. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12810. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  12811. var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/core-js/internals/own-keys.js");
  12812. var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
  12813. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  12814. module.exports = function (target, source) {
  12815. var keys = ownKeys(source);
  12816. var defineProperty = definePropertyModule.f;
  12817. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  12818. for (var i = 0; i < keys.length; i++) {
  12819. var key = keys[i];
  12820. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  12821. }
  12822. };
  12823. /***/ }),
  12824. /***/ "./node_modules/core-js/internals/correct-prototype-getter.js":
  12825. /*!********************************************************************!*\
  12826. !*** ./node_modules/core-js/internals/correct-prototype-getter.js ***!
  12827. \********************************************************************/
  12828. /*! unknown exports (runtime-defined) */
  12829. /*! runtime requirements: module, __webpack_require__ */
  12830. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  12831. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12832. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  12833. module.exports = !fails(function () {
  12834. function F() { /* empty */ }
  12835. F.prototype.constructor = null;
  12836. return Object.getPrototypeOf(new F()) !== F.prototype;
  12837. });
  12838. /***/ }),
  12839. /***/ "./node_modules/core-js/internals/create-iterator-constructor.js":
  12840. /*!***********************************************************************!*\
  12841. !*** ./node_modules/core-js/internals/create-iterator-constructor.js ***!
  12842. \***********************************************************************/
  12843. /*! unknown exports (runtime-defined) */
  12844. /*! runtime requirements: __webpack_require__, module */
  12845. /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
  12846. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12847. "use strict";
  12848. var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
  12849. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  12850. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  12851. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  12852. var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
  12853. var returnThis = function () { return this; };
  12854. module.exports = function (IteratorConstructor, NAME, next) {
  12855. var TO_STRING_TAG = NAME + ' Iterator';
  12856. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  12857. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  12858. Iterators[TO_STRING_TAG] = returnThis;
  12859. return IteratorConstructor;
  12860. };
  12861. /***/ }),
  12862. /***/ "./node_modules/core-js/internals/create-non-enumerable-property.js":
  12863. /*!**************************************************************************!*\
  12864. !*** ./node_modules/core-js/internals/create-non-enumerable-property.js ***!
  12865. \**************************************************************************/
  12866. /*! unknown exports (runtime-defined) */
  12867. /*! runtime requirements: module, __webpack_require__ */
  12868. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  12869. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12870. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  12871. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  12872. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  12873. module.exports = DESCRIPTORS ? function (object, key, value) {
  12874. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  12875. } : function (object, key, value) {
  12876. object[key] = value;
  12877. return object;
  12878. };
  12879. /***/ }),
  12880. /***/ "./node_modules/core-js/internals/create-property-descriptor.js":
  12881. /*!**********************************************************************!*\
  12882. !*** ./node_modules/core-js/internals/create-property-descriptor.js ***!
  12883. \**********************************************************************/
  12884. /*! unknown exports (runtime-defined) */
  12885. /*! runtime requirements: module */
  12886. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  12887. /***/ ((module) => {
  12888. module.exports = function (bitmap, value) {
  12889. return {
  12890. enumerable: !(bitmap & 1),
  12891. configurable: !(bitmap & 2),
  12892. writable: !(bitmap & 4),
  12893. value: value
  12894. };
  12895. };
  12896. /***/ }),
  12897. /***/ "./node_modules/core-js/internals/create-property.js":
  12898. /*!***********************************************************!*\
  12899. !*** ./node_modules/core-js/internals/create-property.js ***!
  12900. \***********************************************************/
  12901. /*! unknown exports (runtime-defined) */
  12902. /*! runtime requirements: module, __webpack_require__ */
  12903. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  12904. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12905. "use strict";
  12906. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  12907. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  12908. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  12909. module.exports = function (object, key, value) {
  12910. var propertyKey = toPrimitive(key);
  12911. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  12912. else object[propertyKey] = value;
  12913. };
  12914. /***/ }),
  12915. /***/ "./node_modules/core-js/internals/define-iterator.js":
  12916. /*!***********************************************************!*\
  12917. !*** ./node_modules/core-js/internals/define-iterator.js ***!
  12918. \***********************************************************/
  12919. /*! unknown exports (runtime-defined) */
  12920. /*! runtime requirements: module, __webpack_require__ */
  12921. /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
  12922. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  12923. "use strict";
  12924. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  12925. var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "./node_modules/core-js/internals/create-iterator-constructor.js");
  12926. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
  12927. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
  12928. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  12929. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  12930. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  12931. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  12932. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  12933. var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
  12934. var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js");
  12935. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  12936. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  12937. var ITERATOR = wellKnownSymbol('iterator');
  12938. var KEYS = 'keys';
  12939. var VALUES = 'values';
  12940. var ENTRIES = 'entries';
  12941. var returnThis = function () { return this; };
  12942. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  12943. createIteratorConstructor(IteratorConstructor, NAME, next);
  12944. var getIterationMethod = function (KIND) {
  12945. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  12946. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  12947. switch (KIND) {
  12948. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  12949. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  12950. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  12951. } return function () { return new IteratorConstructor(this); };
  12952. };
  12953. var TO_STRING_TAG = NAME + ' Iterator';
  12954. var INCORRECT_VALUES_NAME = false;
  12955. var IterablePrototype = Iterable.prototype;
  12956. var nativeIterator = IterablePrototype[ITERATOR]
  12957. || IterablePrototype['@@iterator']
  12958. || DEFAULT && IterablePrototype[DEFAULT];
  12959. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  12960. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  12961. var CurrentIteratorPrototype, methods, KEY;
  12962. // fix native
  12963. if (anyNativeIterator) {
  12964. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  12965. if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  12966. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  12967. if (setPrototypeOf) {
  12968. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  12969. } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
  12970. createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
  12971. }
  12972. }
  12973. // Set @@toStringTag to native iterators
  12974. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  12975. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  12976. }
  12977. }
  12978. // fix Array#{values, @@iterator}.name in V8 / FF
  12979. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  12980. INCORRECT_VALUES_NAME = true;
  12981. defaultIterator = function values() { return nativeIterator.call(this); };
  12982. }
  12983. // define iterator
  12984. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  12985. createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
  12986. }
  12987. Iterators[NAME] = defaultIterator;
  12988. // export additional methods
  12989. if (DEFAULT) {
  12990. methods = {
  12991. values: getIterationMethod(VALUES),
  12992. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  12993. entries: getIterationMethod(ENTRIES)
  12994. };
  12995. if (FORCED) for (KEY in methods) {
  12996. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  12997. redefine(IterablePrototype, KEY, methods[KEY]);
  12998. }
  12999. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  13000. }
  13001. return methods;
  13002. };
  13003. /***/ }),
  13004. /***/ "./node_modules/core-js/internals/define-well-known-symbol.js":
  13005. /*!********************************************************************!*\
  13006. !*** ./node_modules/core-js/internals/define-well-known-symbol.js ***!
  13007. \********************************************************************/
  13008. /*! unknown exports (runtime-defined) */
  13009. /*! runtime requirements: __webpack_require__, module */
  13010. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  13011. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13012. var path = __webpack_require__(/*! ../internals/path */ "./node_modules/core-js/internals/path.js");
  13013. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  13014. var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/core-js/internals/well-known-symbol-wrapped.js");
  13015. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  13016. module.exports = function (NAME) {
  13017. var Symbol = path.Symbol || (path.Symbol = {});
  13018. if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
  13019. value: wrappedWellKnownSymbolModule.f(NAME)
  13020. });
  13021. };
  13022. /***/ }),
  13023. /***/ "./node_modules/core-js/internals/descriptors.js":
  13024. /*!*******************************************************!*\
  13025. !*** ./node_modules/core-js/internals/descriptors.js ***!
  13026. \*******************************************************/
  13027. /*! unknown exports (runtime-defined) */
  13028. /*! runtime requirements: module, __webpack_require__ */
  13029. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  13030. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13031. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13032. // Thank's IE8 for his funny defineProperty
  13033. module.exports = !fails(function () {
  13034. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  13035. });
  13036. /***/ }),
  13037. /***/ "./node_modules/core-js/internals/document-create-element.js":
  13038. /*!*******************************************************************!*\
  13039. !*** ./node_modules/core-js/internals/document-create-element.js ***!
  13040. \*******************************************************************/
  13041. /*! unknown exports (runtime-defined) */
  13042. /*! runtime requirements: module, __webpack_require__ */
  13043. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  13044. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13045. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13046. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  13047. var document = global.document;
  13048. // typeof document.createElement is 'object' in old IE
  13049. var EXISTS = isObject(document) && isObject(document.createElement);
  13050. module.exports = function (it) {
  13051. return EXISTS ? document.createElement(it) : {};
  13052. };
  13053. /***/ }),
  13054. /***/ "./node_modules/core-js/internals/dom-iterables.js":
  13055. /*!*********************************************************!*\
  13056. !*** ./node_modules/core-js/internals/dom-iterables.js ***!
  13057. \*********************************************************/
  13058. /*! unknown exports (runtime-defined) */
  13059. /*! runtime requirements: module */
  13060. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13061. /***/ ((module) => {
  13062. // iterable DOM collections
  13063. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  13064. module.exports = {
  13065. CSSRuleList: 0,
  13066. CSSStyleDeclaration: 0,
  13067. CSSValueList: 0,
  13068. ClientRectList: 0,
  13069. DOMRectList: 0,
  13070. DOMStringList: 0,
  13071. DOMTokenList: 1,
  13072. DataTransferItemList: 0,
  13073. FileList: 0,
  13074. HTMLAllCollection: 0,
  13075. HTMLCollection: 0,
  13076. HTMLFormElement: 0,
  13077. HTMLSelectElement: 0,
  13078. MediaList: 0,
  13079. MimeTypeArray: 0,
  13080. NamedNodeMap: 0,
  13081. NodeList: 1,
  13082. PaintRequestList: 0,
  13083. Plugin: 0,
  13084. PluginArray: 0,
  13085. SVGLengthList: 0,
  13086. SVGNumberList: 0,
  13087. SVGPathSegList: 0,
  13088. SVGPointList: 0,
  13089. SVGStringList: 0,
  13090. SVGTransformList: 0,
  13091. SourceBufferList: 0,
  13092. StyleSheetList: 0,
  13093. TextTrackCueList: 0,
  13094. TextTrackList: 0,
  13095. TouchList: 0
  13096. };
  13097. /***/ }),
  13098. /***/ "./node_modules/core-js/internals/engine-is-ios.js":
  13099. /*!*********************************************************!*\
  13100. !*** ./node_modules/core-js/internals/engine-is-ios.js ***!
  13101. \*********************************************************/
  13102. /*! unknown exports (runtime-defined) */
  13103. /*! runtime requirements: module, __webpack_require__ */
  13104. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13105. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13106. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
  13107. module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
  13108. /***/ }),
  13109. /***/ "./node_modules/core-js/internals/engine-user-agent.js":
  13110. /*!*************************************************************!*\
  13111. !*** ./node_modules/core-js/internals/engine-user-agent.js ***!
  13112. \*************************************************************/
  13113. /*! unknown exports (runtime-defined) */
  13114. /*! runtime requirements: module, __webpack_require__ */
  13115. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13116. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13117. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  13118. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  13119. /***/ }),
  13120. /***/ "./node_modules/core-js/internals/engine-v8-version.js":
  13121. /*!*************************************************************!*\
  13122. !*** ./node_modules/core-js/internals/engine-v8-version.js ***!
  13123. \*************************************************************/
  13124. /*! unknown exports (runtime-defined) */
  13125. /*! runtime requirements: module, __webpack_require__ */
  13126. /*! CommonJS bailout: module.exports is used directly at 20:0-14 */
  13127. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13128. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13129. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
  13130. var process = global.process;
  13131. var versions = process && process.versions;
  13132. var v8 = versions && versions.v8;
  13133. var match, version;
  13134. if (v8) {
  13135. match = v8.split('.');
  13136. version = match[0] + match[1];
  13137. } else if (userAgent) {
  13138. match = userAgent.match(/Edge\/(\d+)/);
  13139. if (!match || match[1] >= 74) {
  13140. match = userAgent.match(/Chrome\/(\d+)/);
  13141. if (match) version = match[1];
  13142. }
  13143. }
  13144. module.exports = version && +version;
  13145. /***/ }),
  13146. /***/ "./node_modules/core-js/internals/enum-bug-keys.js":
  13147. /*!*********************************************************!*\
  13148. !*** ./node_modules/core-js/internals/enum-bug-keys.js ***!
  13149. \*********************************************************/
  13150. /*! unknown exports (runtime-defined) */
  13151. /*! runtime requirements: module */
  13152. /*! CommonJS bailout: module.exports is used directly at 2:0-14 */
  13153. /***/ ((module) => {
  13154. // IE8- don't enum bug keys
  13155. module.exports = [
  13156. 'constructor',
  13157. 'hasOwnProperty',
  13158. 'isPrototypeOf',
  13159. 'propertyIsEnumerable',
  13160. 'toLocaleString',
  13161. 'toString',
  13162. 'valueOf'
  13163. ];
  13164. /***/ }),
  13165. /***/ "./node_modules/core-js/internals/export.js":
  13166. /*!**************************************************!*\
  13167. !*** ./node_modules/core-js/internals/export.js ***!
  13168. \**************************************************/
  13169. /*! unknown exports (runtime-defined) */
  13170. /*! runtime requirements: __webpack_require__, module */
  13171. /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
  13172. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13173. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13174. var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
  13175. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  13176. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  13177. var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
  13178. var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
  13179. var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
  13180. /*
  13181. options.target - name of the target object
  13182. options.global - target is the global object
  13183. options.stat - export as static methods of target
  13184. options.proto - export as prototype methods of target
  13185. options.real - real prototype method for the `pure` version
  13186. options.forced - export even if the native feature is available
  13187. options.bind - bind methods to the target, required for the `pure` version
  13188. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  13189. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  13190. options.sham - add a flag to not completely full polyfills
  13191. options.enumerable - export as enumerable property
  13192. options.noTargetGet - prevent calling a getter on target
  13193. */
  13194. module.exports = function (options, source) {
  13195. var TARGET = options.target;
  13196. var GLOBAL = options.global;
  13197. var STATIC = options.stat;
  13198. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  13199. if (GLOBAL) {
  13200. target = global;
  13201. } else if (STATIC) {
  13202. target = global[TARGET] || setGlobal(TARGET, {});
  13203. } else {
  13204. target = (global[TARGET] || {}).prototype;
  13205. }
  13206. if (target) for (key in source) {
  13207. sourceProperty = source[key];
  13208. if (options.noTargetGet) {
  13209. descriptor = getOwnPropertyDescriptor(target, key);
  13210. targetProperty = descriptor && descriptor.value;
  13211. } else targetProperty = target[key];
  13212. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  13213. // contained in target
  13214. if (!FORCED && targetProperty !== undefined) {
  13215. if (typeof sourceProperty === typeof targetProperty) continue;
  13216. copyConstructorProperties(sourceProperty, targetProperty);
  13217. }
  13218. // add a flag to not completely full polyfills
  13219. if (options.sham || (targetProperty && targetProperty.sham)) {
  13220. createNonEnumerableProperty(sourceProperty, 'sham', true);
  13221. }
  13222. // extend global
  13223. redefine(target, key, sourceProperty, options);
  13224. }
  13225. };
  13226. /***/ }),
  13227. /***/ "./node_modules/core-js/internals/fails.js":
  13228. /*!*************************************************!*\
  13229. !*** ./node_modules/core-js/internals/fails.js ***!
  13230. \*************************************************/
  13231. /*! unknown exports (runtime-defined) */
  13232. /*! runtime requirements: module */
  13233. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  13234. /***/ ((module) => {
  13235. module.exports = function (exec) {
  13236. try {
  13237. return !!exec();
  13238. } catch (error) {
  13239. return true;
  13240. }
  13241. };
  13242. /***/ }),
  13243. /***/ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
  13244. /*!******************************************************************************!*\
  13245. !*** ./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
  13246. \******************************************************************************/
  13247. /*! unknown exports (runtime-defined) */
  13248. /*! runtime requirements: module, __webpack_require__ */
  13249. /*! CommonJS bailout: module.exports is used directly at 50:0-14 */
  13250. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13251. "use strict";
  13252. // TODO: Remove from `core-js@4` since it's moved to entry points
  13253. __webpack_require__(/*! ../modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
  13254. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  13255. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13256. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  13257. var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
  13258. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  13259. var SPECIES = wellKnownSymbol('species');
  13260. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  13261. // #replace needs built-in support for named groups.
  13262. // #match works fine because it just return the exec results, even if it has
  13263. // a "grops" property.
  13264. var re = /./;
  13265. re.exec = function () {
  13266. var result = [];
  13267. result.groups = { a: '7' };
  13268. return result;
  13269. };
  13270. return ''.replace(re, '$<a>') !== '7';
  13271. });
  13272. // IE <= 11 replaces $0 with the whole match, as if it was $&
  13273. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  13274. var REPLACE_KEEPS_$0 = (function () {
  13275. return 'a'.replace(/./, '$0') === '$0';
  13276. })();
  13277. var REPLACE = wellKnownSymbol('replace');
  13278. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  13279. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  13280. if (/./[REPLACE]) {
  13281. return /./[REPLACE]('a', '$0') === '';
  13282. }
  13283. return false;
  13284. })();
  13285. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  13286. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  13287. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  13288. var re = /(?:)/;
  13289. var originalExec = re.exec;
  13290. re.exec = function () { return originalExec.apply(this, arguments); };
  13291. var result = 'ab'.split(re);
  13292. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  13293. });
  13294. module.exports = function (KEY, length, exec, sham) {
  13295. var SYMBOL = wellKnownSymbol(KEY);
  13296. var DELEGATES_TO_SYMBOL = !fails(function () {
  13297. // String methods call symbol-named RegEp methods
  13298. var O = {};
  13299. O[SYMBOL] = function () { return 7; };
  13300. return ''[KEY](O) != 7;
  13301. });
  13302. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  13303. // Symbol-named RegExp methods call .exec
  13304. var execCalled = false;
  13305. var re = /a/;
  13306. if (KEY === 'split') {
  13307. // We can't use real regex here since it causes deoptimization
  13308. // and serious performance degradation in V8
  13309. // https://github.com/zloirock/core-js/issues/306
  13310. re = {};
  13311. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  13312. // a new one. We need to return the patched regex when creating the new one.
  13313. re.constructor = {};
  13314. re.constructor[SPECIES] = function () { return re; };
  13315. re.flags = '';
  13316. re[SYMBOL] = /./[SYMBOL];
  13317. }
  13318. re.exec = function () { execCalled = true; return null; };
  13319. re[SYMBOL]('');
  13320. return !execCalled;
  13321. });
  13322. if (
  13323. !DELEGATES_TO_SYMBOL ||
  13324. !DELEGATES_TO_EXEC ||
  13325. (KEY === 'replace' && !(
  13326. REPLACE_SUPPORTS_NAMED_GROUPS &&
  13327. REPLACE_KEEPS_$0 &&
  13328. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  13329. )) ||
  13330. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  13331. ) {
  13332. var nativeRegExpMethod = /./[SYMBOL];
  13333. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  13334. if (regexp.exec === regexpExec) {
  13335. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  13336. // The native String method already delegates to @@method (this
  13337. // polyfilled function), leasing to infinite recursion.
  13338. // We avoid it by directly calling the native @@method method.
  13339. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  13340. }
  13341. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  13342. }
  13343. return { done: false };
  13344. }, {
  13345. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  13346. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  13347. });
  13348. var stringMethod = methods[0];
  13349. var regexMethod = methods[1];
  13350. redefine(String.prototype, KEY, stringMethod);
  13351. redefine(RegExp.prototype, SYMBOL, length == 2
  13352. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  13353. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  13354. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  13355. // 21.2.5.6 RegExp.prototype[@@match](string)
  13356. // 21.2.5.9 RegExp.prototype[@@search](string)
  13357. : function (string) { return regexMethod.call(string, this); }
  13358. );
  13359. }
  13360. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  13361. };
  13362. /***/ }),
  13363. /***/ "./node_modules/core-js/internals/freezing.js":
  13364. /*!****************************************************!*\
  13365. !*** ./node_modules/core-js/internals/freezing.js ***!
  13366. \****************************************************/
  13367. /*! unknown exports (runtime-defined) */
  13368. /*! runtime requirements: module, __webpack_require__ */
  13369. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13370. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13371. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13372. module.exports = !fails(function () {
  13373. return Object.isExtensible(Object.preventExtensions({}));
  13374. });
  13375. /***/ }),
  13376. /***/ "./node_modules/core-js/internals/function-bind-context.js":
  13377. /*!*****************************************************************!*\
  13378. !*** ./node_modules/core-js/internals/function-bind-context.js ***!
  13379. \*****************************************************************/
  13380. /*! unknown exports (runtime-defined) */
  13381. /*! runtime requirements: module, __webpack_require__ */
  13382. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  13383. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13384. var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
  13385. // optional / simple context binding
  13386. module.exports = function (fn, that, length) {
  13387. aFunction(fn);
  13388. if (that === undefined) return fn;
  13389. switch (length) {
  13390. case 0: return function () {
  13391. return fn.call(that);
  13392. };
  13393. case 1: return function (a) {
  13394. return fn.call(that, a);
  13395. };
  13396. case 2: return function (a, b) {
  13397. return fn.call(that, a, b);
  13398. };
  13399. case 3: return function (a, b, c) {
  13400. return fn.call(that, a, b, c);
  13401. };
  13402. }
  13403. return function (/* ...args */) {
  13404. return fn.apply(that, arguments);
  13405. };
  13406. };
  13407. /***/ }),
  13408. /***/ "./node_modules/core-js/internals/get-built-in.js":
  13409. /*!********************************************************!*\
  13410. !*** ./node_modules/core-js/internals/get-built-in.js ***!
  13411. \********************************************************/
  13412. /*! unknown exports (runtime-defined) */
  13413. /*! runtime requirements: module, __webpack_require__ */
  13414. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  13415. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13416. var path = __webpack_require__(/*! ../internals/path */ "./node_modules/core-js/internals/path.js");
  13417. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13418. var aFunction = function (variable) {
  13419. return typeof variable == 'function' ? variable : undefined;
  13420. };
  13421. module.exports = function (namespace, method) {
  13422. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  13423. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  13424. };
  13425. /***/ }),
  13426. /***/ "./node_modules/core-js/internals/get-iterator-method.js":
  13427. /*!***************************************************************!*\
  13428. !*** ./node_modules/core-js/internals/get-iterator-method.js ***!
  13429. \***************************************************************/
  13430. /*! unknown exports (runtime-defined) */
  13431. /*! runtime requirements: module, __webpack_require__ */
  13432. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  13433. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13434. var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
  13435. var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
  13436. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  13437. var ITERATOR = wellKnownSymbol('iterator');
  13438. module.exports = function (it) {
  13439. if (it != undefined) return it[ITERATOR]
  13440. || it['@@iterator']
  13441. || Iterators[classof(it)];
  13442. };
  13443. /***/ }),
  13444. /***/ "./node_modules/core-js/internals/get-iterator.js":
  13445. /*!********************************************************!*\
  13446. !*** ./node_modules/core-js/internals/get-iterator.js ***!
  13447. \********************************************************/
  13448. /*! unknown exports (runtime-defined) */
  13449. /*! runtime requirements: module, __webpack_require__ */
  13450. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  13451. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13452. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  13453. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
  13454. module.exports = function (it) {
  13455. var iteratorMethod = getIteratorMethod(it);
  13456. if (typeof iteratorMethod != 'function') {
  13457. throw TypeError(String(it) + ' is not iterable');
  13458. } return anObject(iteratorMethod.call(it));
  13459. };
  13460. /***/ }),
  13461. /***/ "./node_modules/core-js/internals/global.js":
  13462. /*!**************************************************!*\
  13463. !*** ./node_modules/core-js/internals/global.js ***!
  13464. \**************************************************/
  13465. /*! unknown exports (runtime-defined) */
  13466. /*! runtime requirements: module, __webpack_require__.g, __webpack_require__.* */
  13467. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  13468. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13469. var check = function (it) {
  13470. return it && it.Math == Math && it;
  13471. };
  13472. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  13473. module.exports =
  13474. // eslint-disable-next-line no-undef
  13475. check(typeof globalThis == 'object' && globalThis) ||
  13476. check(typeof window == 'object' && window) ||
  13477. check(typeof self == 'object' && self) ||
  13478. check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||
  13479. // eslint-disable-next-line no-new-func
  13480. Function('return this')();
  13481. /***/ }),
  13482. /***/ "./node_modules/core-js/internals/has.js":
  13483. /*!***********************************************!*\
  13484. !*** ./node_modules/core-js/internals/has.js ***!
  13485. \***********************************************/
  13486. /*! unknown exports (runtime-defined) */
  13487. /*! runtime requirements: module */
  13488. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13489. /***/ ((module) => {
  13490. var hasOwnProperty = {}.hasOwnProperty;
  13491. module.exports = function (it, key) {
  13492. return hasOwnProperty.call(it, key);
  13493. };
  13494. /***/ }),
  13495. /***/ "./node_modules/core-js/internals/hidden-keys.js":
  13496. /*!*******************************************************!*\
  13497. !*** ./node_modules/core-js/internals/hidden-keys.js ***!
  13498. \*******************************************************/
  13499. /*! unknown exports (runtime-defined) */
  13500. /*! runtime requirements: module */
  13501. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  13502. /***/ ((module) => {
  13503. module.exports = {};
  13504. /***/ }),
  13505. /***/ "./node_modules/core-js/internals/host-report-errors.js":
  13506. /*!**************************************************************!*\
  13507. !*** ./node_modules/core-js/internals/host-report-errors.js ***!
  13508. \**************************************************************/
  13509. /*! unknown exports (runtime-defined) */
  13510. /*! runtime requirements: module, __webpack_require__ */
  13511. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13512. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13513. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13514. module.exports = function (a, b) {
  13515. var console = global.console;
  13516. if (console && console.error) {
  13517. arguments.length === 1 ? console.error(a) : console.error(a, b);
  13518. }
  13519. };
  13520. /***/ }),
  13521. /***/ "./node_modules/core-js/internals/html.js":
  13522. /*!************************************************!*\
  13523. !*** ./node_modules/core-js/internals/html.js ***!
  13524. \************************************************/
  13525. /*! unknown exports (runtime-defined) */
  13526. /*! runtime requirements: module, __webpack_require__ */
  13527. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  13528. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13529. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  13530. module.exports = getBuiltIn('document', 'documentElement');
  13531. /***/ }),
  13532. /***/ "./node_modules/core-js/internals/ie8-dom-define.js":
  13533. /*!**********************************************************!*\
  13534. !*** ./node_modules/core-js/internals/ie8-dom-define.js ***!
  13535. \**********************************************************/
  13536. /*! unknown exports (runtime-defined) */
  13537. /*! runtime requirements: module, __webpack_require__ */
  13538. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  13539. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13540. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  13541. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13542. var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
  13543. // Thank's IE8 for his funny defineProperty
  13544. module.exports = !DESCRIPTORS && !fails(function () {
  13545. return Object.defineProperty(createElement('div'), 'a', {
  13546. get: function () { return 7; }
  13547. }).a != 7;
  13548. });
  13549. /***/ }),
  13550. /***/ "./node_modules/core-js/internals/ieee754.js":
  13551. /*!***************************************************!*\
  13552. !*** ./node_modules/core-js/internals/ieee754.js ***!
  13553. \***************************************************/
  13554. /*! unknown exports (runtime-defined) */
  13555. /*! runtime requirements: module */
  13556. /*! CommonJS bailout: module.exports is used directly at 85:0-14 */
  13557. /***/ ((module) => {
  13558. // IEEE754 conversions based on https://github.com/feross/ieee754
  13559. // eslint-disable-next-line no-shadow-restricted-names
  13560. var Infinity = 1 / 0;
  13561. var abs = Math.abs;
  13562. var pow = Math.pow;
  13563. var floor = Math.floor;
  13564. var log = Math.log;
  13565. var LN2 = Math.LN2;
  13566. var pack = function (number, mantissaLength, bytes) {
  13567. var buffer = new Array(bytes);
  13568. var exponentLength = bytes * 8 - mantissaLength - 1;
  13569. var eMax = (1 << exponentLength) - 1;
  13570. var eBias = eMax >> 1;
  13571. var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
  13572. var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
  13573. var index = 0;
  13574. var exponent, mantissa, c;
  13575. number = abs(number);
  13576. // eslint-disable-next-line no-self-compare
  13577. if (number != number || number === Infinity) {
  13578. // eslint-disable-next-line no-self-compare
  13579. mantissa = number != number ? 1 : 0;
  13580. exponent = eMax;
  13581. } else {
  13582. exponent = floor(log(number) / LN2);
  13583. if (number * (c = pow(2, -exponent)) < 1) {
  13584. exponent--;
  13585. c *= 2;
  13586. }
  13587. if (exponent + eBias >= 1) {
  13588. number += rt / c;
  13589. } else {
  13590. number += rt * pow(2, 1 - eBias);
  13591. }
  13592. if (number * c >= 2) {
  13593. exponent++;
  13594. c /= 2;
  13595. }
  13596. if (exponent + eBias >= eMax) {
  13597. mantissa = 0;
  13598. exponent = eMax;
  13599. } else if (exponent + eBias >= 1) {
  13600. mantissa = (number * c - 1) * pow(2, mantissaLength);
  13601. exponent = exponent + eBias;
  13602. } else {
  13603. mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
  13604. exponent = 0;
  13605. }
  13606. }
  13607. for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);
  13608. exponent = exponent << mantissaLength | mantissa;
  13609. exponentLength += mantissaLength;
  13610. for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);
  13611. buffer[--index] |= sign * 128;
  13612. return buffer;
  13613. };
  13614. var unpack = function (buffer, mantissaLength) {
  13615. var bytes = buffer.length;
  13616. var exponentLength = bytes * 8 - mantissaLength - 1;
  13617. var eMax = (1 << exponentLength) - 1;
  13618. var eBias = eMax >> 1;
  13619. var nBits = exponentLength - 7;
  13620. var index = bytes - 1;
  13621. var sign = buffer[index--];
  13622. var exponent = sign & 127;
  13623. var mantissa;
  13624. sign >>= 7;
  13625. for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);
  13626. mantissa = exponent & (1 << -nBits) - 1;
  13627. exponent >>= -nBits;
  13628. nBits += mantissaLength;
  13629. for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);
  13630. if (exponent === 0) {
  13631. exponent = 1 - eBias;
  13632. } else if (exponent === eMax) {
  13633. return mantissa ? NaN : sign ? -Infinity : Infinity;
  13634. } else {
  13635. mantissa = mantissa + pow(2, mantissaLength);
  13636. exponent = exponent - eBias;
  13637. } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
  13638. };
  13639. module.exports = {
  13640. pack: pack,
  13641. unpack: unpack
  13642. };
  13643. /***/ }),
  13644. /***/ "./node_modules/core-js/internals/indexed-object.js":
  13645. /*!**********************************************************!*\
  13646. !*** ./node_modules/core-js/internals/indexed-object.js ***!
  13647. \**********************************************************/
  13648. /*! unknown exports (runtime-defined) */
  13649. /*! runtime requirements: module, __webpack_require__ */
  13650. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  13651. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13652. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13653. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  13654. var split = ''.split;
  13655. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  13656. module.exports = fails(function () {
  13657. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  13658. // eslint-disable-next-line no-prototype-builtins
  13659. return !Object('z').propertyIsEnumerable(0);
  13660. }) ? function (it) {
  13661. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  13662. } : Object;
  13663. /***/ }),
  13664. /***/ "./node_modules/core-js/internals/inherit-if-required.js":
  13665. /*!***************************************************************!*\
  13666. !*** ./node_modules/core-js/internals/inherit-if-required.js ***!
  13667. \***************************************************************/
  13668. /*! unknown exports (runtime-defined) */
  13669. /*! runtime requirements: module, __webpack_require__ */
  13670. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  13671. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13672. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  13673. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
  13674. // makes subclassing work correct for wrapped built-ins
  13675. module.exports = function ($this, dummy, Wrapper) {
  13676. var NewTarget, NewTargetPrototype;
  13677. if (
  13678. // it can work only with native `setPrototypeOf`
  13679. setPrototypeOf &&
  13680. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  13681. typeof (NewTarget = dummy.constructor) == 'function' &&
  13682. NewTarget !== Wrapper &&
  13683. isObject(NewTargetPrototype = NewTarget.prototype) &&
  13684. NewTargetPrototype !== Wrapper.prototype
  13685. ) setPrototypeOf($this, NewTargetPrototype);
  13686. return $this;
  13687. };
  13688. /***/ }),
  13689. /***/ "./node_modules/core-js/internals/inspect-source.js":
  13690. /*!**********************************************************!*\
  13691. !*** ./node_modules/core-js/internals/inspect-source.js ***!
  13692. \**********************************************************/
  13693. /*! unknown exports (runtime-defined) */
  13694. /*! runtime requirements: module, __webpack_require__ */
  13695. /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
  13696. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13697. var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
  13698. var functionToString = Function.toString;
  13699. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  13700. if (typeof store.inspectSource != 'function') {
  13701. store.inspectSource = function (it) {
  13702. return functionToString.call(it);
  13703. };
  13704. }
  13705. module.exports = store.inspectSource;
  13706. /***/ }),
  13707. /***/ "./node_modules/core-js/internals/internal-metadata.js":
  13708. /*!*************************************************************!*\
  13709. !*** ./node_modules/core-js/internals/internal-metadata.js ***!
  13710. \*************************************************************/
  13711. /*! unknown exports (runtime-defined) */
  13712. /*! runtime requirements: __webpack_require__, module */
  13713. /*! CommonJS bailout: module.exports is used directly at 54:11-25 */
  13714. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13715. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
  13716. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  13717. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  13718. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  13719. var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
  13720. var FREEZING = __webpack_require__(/*! ../internals/freezing */ "./node_modules/core-js/internals/freezing.js");
  13721. var METADATA = uid('meta');
  13722. var id = 0;
  13723. var isExtensible = Object.isExtensible || function () {
  13724. return true;
  13725. };
  13726. var setMetadata = function (it) {
  13727. defineProperty(it, METADATA, { value: {
  13728. objectID: 'O' + ++id, // object ID
  13729. weakData: {} // weak collections IDs
  13730. } });
  13731. };
  13732. var fastKey = function (it, create) {
  13733. // return a primitive with prefix
  13734. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  13735. if (!has(it, METADATA)) {
  13736. // can't set metadata to uncaught frozen object
  13737. if (!isExtensible(it)) return 'F';
  13738. // not necessary to add metadata
  13739. if (!create) return 'E';
  13740. // add missing metadata
  13741. setMetadata(it);
  13742. // return object ID
  13743. } return it[METADATA].objectID;
  13744. };
  13745. var getWeakData = function (it, create) {
  13746. if (!has(it, METADATA)) {
  13747. // can't set metadata to uncaught frozen object
  13748. if (!isExtensible(it)) return true;
  13749. // not necessary to add metadata
  13750. if (!create) return false;
  13751. // add missing metadata
  13752. setMetadata(it);
  13753. // return the store of weak collections IDs
  13754. } return it[METADATA].weakData;
  13755. };
  13756. // add metadata on freeze-family methods calling
  13757. var onFreeze = function (it) {
  13758. if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
  13759. return it;
  13760. };
  13761. var meta = module.exports = {
  13762. REQUIRED: false,
  13763. fastKey: fastKey,
  13764. getWeakData: getWeakData,
  13765. onFreeze: onFreeze
  13766. };
  13767. hiddenKeys[METADATA] = true;
  13768. /***/ }),
  13769. /***/ "./node_modules/core-js/internals/internal-state.js":
  13770. /*!**********************************************************!*\
  13771. !*** ./node_modules/core-js/internals/internal-state.js ***!
  13772. \**********************************************************/
  13773. /*! unknown exports (runtime-defined) */
  13774. /*! runtime requirements: module, __webpack_require__ */
  13775. /*! CommonJS bailout: module.exports is used directly at 55:0-14 */
  13776. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13777. var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "./node_modules/core-js/internals/native-weak-map.js");
  13778. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  13779. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  13780. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  13781. var objectHas = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  13782. var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
  13783. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
  13784. var WeakMap = global.WeakMap;
  13785. var set, get, has;
  13786. var enforce = function (it) {
  13787. return has(it) ? get(it) : set(it, {});
  13788. };
  13789. var getterFor = function (TYPE) {
  13790. return function (it) {
  13791. var state;
  13792. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  13793. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  13794. } return state;
  13795. };
  13796. };
  13797. if (NATIVE_WEAK_MAP) {
  13798. var store = new WeakMap();
  13799. var wmget = store.get;
  13800. var wmhas = store.has;
  13801. var wmset = store.set;
  13802. set = function (it, metadata) {
  13803. wmset.call(store, it, metadata);
  13804. return metadata;
  13805. };
  13806. get = function (it) {
  13807. return wmget.call(store, it) || {};
  13808. };
  13809. has = function (it) {
  13810. return wmhas.call(store, it);
  13811. };
  13812. } else {
  13813. var STATE = sharedKey('state');
  13814. hiddenKeys[STATE] = true;
  13815. set = function (it, metadata) {
  13816. createNonEnumerableProperty(it, STATE, metadata);
  13817. return metadata;
  13818. };
  13819. get = function (it) {
  13820. return objectHas(it, STATE) ? it[STATE] : {};
  13821. };
  13822. has = function (it) {
  13823. return objectHas(it, STATE);
  13824. };
  13825. }
  13826. module.exports = {
  13827. set: set,
  13828. get: get,
  13829. has: has,
  13830. enforce: enforce,
  13831. getterFor: getterFor
  13832. };
  13833. /***/ }),
  13834. /***/ "./node_modules/core-js/internals/is-array-iterator-method.js":
  13835. /*!********************************************************************!*\
  13836. !*** ./node_modules/core-js/internals/is-array-iterator-method.js ***!
  13837. \********************************************************************/
  13838. /*! unknown exports (runtime-defined) */
  13839. /*! runtime requirements: module, __webpack_require__ */
  13840. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  13841. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13842. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  13843. var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
  13844. var ITERATOR = wellKnownSymbol('iterator');
  13845. var ArrayPrototype = Array.prototype;
  13846. // check on default Array iterator
  13847. module.exports = function (it) {
  13848. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  13849. };
  13850. /***/ }),
  13851. /***/ "./node_modules/core-js/internals/is-array.js":
  13852. /*!****************************************************!*\
  13853. !*** ./node_modules/core-js/internals/is-array.js ***!
  13854. \****************************************************/
  13855. /*! unknown exports (runtime-defined) */
  13856. /*! runtime requirements: module, __webpack_require__ */
  13857. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  13858. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13859. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  13860. // `IsArray` abstract operation
  13861. // https://tc39.github.io/ecma262/#sec-isarray
  13862. module.exports = Array.isArray || function isArray(arg) {
  13863. return classof(arg) == 'Array';
  13864. };
  13865. /***/ }),
  13866. /***/ "./node_modules/core-js/internals/is-forced.js":
  13867. /*!*****************************************************!*\
  13868. !*** ./node_modules/core-js/internals/is-forced.js ***!
  13869. \*****************************************************/
  13870. /*! unknown exports (runtime-defined) */
  13871. /*! runtime requirements: module, __webpack_require__ */
  13872. /*! CommonJS bailout: module.exports is used directly at 21:0-14 */
  13873. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13874. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  13875. var replacement = /#|\.prototype\./;
  13876. var isForced = function (feature, detection) {
  13877. var value = data[normalize(feature)];
  13878. return value == POLYFILL ? true
  13879. : value == NATIVE ? false
  13880. : typeof detection == 'function' ? fails(detection)
  13881. : !!detection;
  13882. };
  13883. var normalize = isForced.normalize = function (string) {
  13884. return String(string).replace(replacement, '.').toLowerCase();
  13885. };
  13886. var data = isForced.data = {};
  13887. var NATIVE = isForced.NATIVE = 'N';
  13888. var POLYFILL = isForced.POLYFILL = 'P';
  13889. module.exports = isForced;
  13890. /***/ }),
  13891. /***/ "./node_modules/core-js/internals/is-object.js":
  13892. /*!*****************************************************!*\
  13893. !*** ./node_modules/core-js/internals/is-object.js ***!
  13894. \*****************************************************/
  13895. /*! unknown exports (runtime-defined) */
  13896. /*! runtime requirements: module */
  13897. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  13898. /***/ ((module) => {
  13899. module.exports = function (it) {
  13900. return typeof it === 'object' ? it !== null : typeof it === 'function';
  13901. };
  13902. /***/ }),
  13903. /***/ "./node_modules/core-js/internals/is-pure.js":
  13904. /*!***************************************************!*\
  13905. !*** ./node_modules/core-js/internals/is-pure.js ***!
  13906. \***************************************************/
  13907. /*! unknown exports (runtime-defined) */
  13908. /*! runtime requirements: module */
  13909. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  13910. /***/ ((module) => {
  13911. module.exports = false;
  13912. /***/ }),
  13913. /***/ "./node_modules/core-js/internals/is-regexp.js":
  13914. /*!*****************************************************!*\
  13915. !*** ./node_modules/core-js/internals/is-regexp.js ***!
  13916. \*****************************************************/
  13917. /*! unknown exports (runtime-defined) */
  13918. /*! runtime requirements: module, __webpack_require__ */
  13919. /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
  13920. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13921. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  13922. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  13923. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  13924. var MATCH = wellKnownSymbol('match');
  13925. // `IsRegExp` abstract operation
  13926. // https://tc39.github.io/ecma262/#sec-isregexp
  13927. module.exports = function (it) {
  13928. var isRegExp;
  13929. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
  13930. };
  13931. /***/ }),
  13932. /***/ "./node_modules/core-js/internals/iterate.js":
  13933. /*!***************************************************!*\
  13934. !*** ./node_modules/core-js/internals/iterate.js ***!
  13935. \***************************************************/
  13936. /*! unknown exports (runtime-defined) */
  13937. /*! runtime requirements: module, __webpack_require__ */
  13938. /*! CommonJS bailout: module.exports is used directly at 13:14-28 */
  13939. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13940. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  13941. var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
  13942. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  13943. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  13944. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
  13945. var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js");
  13946. var Result = function (stopped, result) {
  13947. this.stopped = stopped;
  13948. this.result = result;
  13949. };
  13950. var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
  13951. var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
  13952. var iterator, iterFn, index, length, result, next, step;
  13953. if (IS_ITERATOR) {
  13954. iterator = iterable;
  13955. } else {
  13956. iterFn = getIteratorMethod(iterable);
  13957. if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
  13958. // optimisation for array iterators
  13959. if (isArrayIteratorMethod(iterFn)) {
  13960. for (index = 0, length = toLength(iterable.length); length > index; index++) {
  13961. result = AS_ENTRIES
  13962. ? boundFunction(anObject(step = iterable[index])[0], step[1])
  13963. : boundFunction(iterable[index]);
  13964. if (result && result instanceof Result) return result;
  13965. } return new Result(false);
  13966. }
  13967. iterator = iterFn.call(iterable);
  13968. }
  13969. next = iterator.next;
  13970. while (!(step = next.call(iterator)).done) {
  13971. result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
  13972. if (typeof result == 'object' && result && result instanceof Result) return result;
  13973. } return new Result(false);
  13974. };
  13975. iterate.stop = function (result) {
  13976. return new Result(true, result);
  13977. };
  13978. /***/ }),
  13979. /***/ "./node_modules/core-js/internals/iterators-core.js":
  13980. /*!**********************************************************!*\
  13981. !*** ./node_modules/core-js/internals/iterators-core.js ***!
  13982. \**********************************************************/
  13983. /*! unknown exports (runtime-defined) */
  13984. /*! runtime requirements: module, __webpack_require__ */
  13985. /*! CommonJS bailout: module.exports is used directly at 34:0-14 */
  13986. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  13987. "use strict";
  13988. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
  13989. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  13990. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  13991. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  13992. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  13993. var ITERATOR = wellKnownSymbol('iterator');
  13994. var BUGGY_SAFARI_ITERATORS = false;
  13995. var returnThis = function () { return this; };
  13996. // `%IteratorPrototype%` object
  13997. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  13998. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  13999. if ([].keys) {
  14000. arrayIterator = [].keys();
  14001. // Safari 8 has buggy iterators w/o `next`
  14002. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  14003. else {
  14004. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  14005. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  14006. }
  14007. }
  14008. if (IteratorPrototype == undefined) IteratorPrototype = {};
  14009. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  14010. if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
  14011. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  14012. }
  14013. module.exports = {
  14014. IteratorPrototype: IteratorPrototype,
  14015. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  14016. };
  14017. /***/ }),
  14018. /***/ "./node_modules/core-js/internals/iterators.js":
  14019. /*!*****************************************************!*\
  14020. !*** ./node_modules/core-js/internals/iterators.js ***!
  14021. \*****************************************************/
  14022. /*! unknown exports (runtime-defined) */
  14023. /*! runtime requirements: module */
  14024. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  14025. /***/ ((module) => {
  14026. module.exports = {};
  14027. /***/ }),
  14028. /***/ "./node_modules/core-js/internals/microtask.js":
  14029. /*!*****************************************************!*\
  14030. !*** ./node_modules/core-js/internals/microtask.js ***!
  14031. \*****************************************************/
  14032. /*! unknown exports (runtime-defined) */
  14033. /*! runtime requirements: __webpack_require__, module */
  14034. /*! CommonJS bailout: module.exports is used directly at 71:0-14 */
  14035. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14036. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14037. var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
  14038. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  14039. var macrotask = __webpack_require__(/*! ../internals/task */ "./node_modules/core-js/internals/task.js").set;
  14040. var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/core-js/internals/engine-is-ios.js");
  14041. var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
  14042. var process = global.process;
  14043. var Promise = global.Promise;
  14044. var IS_NODE = classof(process) == 'process';
  14045. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  14046. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
  14047. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  14048. var flush, head, last, notify, toggle, node, promise, then;
  14049. // modern engines have queueMicrotask method
  14050. if (!queueMicrotask) {
  14051. flush = function () {
  14052. var parent, fn;
  14053. if (IS_NODE && (parent = process.domain)) parent.exit();
  14054. while (head) {
  14055. fn = head.fn;
  14056. head = head.next;
  14057. try {
  14058. fn();
  14059. } catch (error) {
  14060. if (head) notify();
  14061. else last = undefined;
  14062. throw error;
  14063. }
  14064. } last = undefined;
  14065. if (parent) parent.enter();
  14066. };
  14067. // Node.js
  14068. if (IS_NODE) {
  14069. notify = function () {
  14070. process.nextTick(flush);
  14071. };
  14072. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  14073. } else if (MutationObserver && !IS_IOS) {
  14074. toggle = true;
  14075. node = document.createTextNode('');
  14076. new MutationObserver(flush).observe(node, { characterData: true });
  14077. notify = function () {
  14078. node.data = toggle = !toggle;
  14079. };
  14080. // environments with maybe non-completely correct, but existent Promise
  14081. } else if (Promise && Promise.resolve) {
  14082. // Promise.resolve without an argument throws an error in LG WebOS 2
  14083. promise = Promise.resolve(undefined);
  14084. then = promise.then;
  14085. notify = function () {
  14086. then.call(promise, flush);
  14087. };
  14088. // for other environments - macrotask based on:
  14089. // - setImmediate
  14090. // - MessageChannel
  14091. // - window.postMessag
  14092. // - onreadystatechange
  14093. // - setTimeout
  14094. } else {
  14095. notify = function () {
  14096. // strange IE + webpack dev server bug - use .call(global)
  14097. macrotask.call(global, flush);
  14098. };
  14099. }
  14100. }
  14101. module.exports = queueMicrotask || function (fn) {
  14102. var task = { fn: fn, next: undefined };
  14103. if (last) last.next = task;
  14104. if (!head) {
  14105. head = task;
  14106. notify();
  14107. } last = task;
  14108. };
  14109. /***/ }),
  14110. /***/ "./node_modules/core-js/internals/native-promise-constructor.js":
  14111. /*!**********************************************************************!*\
  14112. !*** ./node_modules/core-js/internals/native-promise-constructor.js ***!
  14113. \**********************************************************************/
  14114. /*! unknown exports (runtime-defined) */
  14115. /*! runtime requirements: module, __webpack_require__ */
  14116. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  14117. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14118. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14119. module.exports = global.Promise;
  14120. /***/ }),
  14121. /***/ "./node_modules/core-js/internals/native-symbol.js":
  14122. /*!*********************************************************!*\
  14123. !*** ./node_modules/core-js/internals/native-symbol.js ***!
  14124. \*********************************************************/
  14125. /*! unknown exports (runtime-defined) */
  14126. /*! runtime requirements: module, __webpack_require__ */
  14127. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  14128. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14129. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  14130. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  14131. // Chrome 38 Symbol has incorrect toString conversion
  14132. // eslint-disable-next-line no-undef
  14133. return !String(Symbol());
  14134. });
  14135. /***/ }),
  14136. /***/ "./node_modules/core-js/internals/native-url.js":
  14137. /*!******************************************************!*\
  14138. !*** ./node_modules/core-js/internals/native-url.js ***!
  14139. \******************************************************/
  14140. /*! unknown exports (runtime-defined) */
  14141. /*! runtime requirements: module, __webpack_require__ */
  14142. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  14143. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14144. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  14145. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  14146. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  14147. var ITERATOR = wellKnownSymbol('iterator');
  14148. module.exports = !fails(function () {
  14149. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  14150. var searchParams = url.searchParams;
  14151. var result = '';
  14152. url.pathname = 'c%20d';
  14153. searchParams.forEach(function (value, key) {
  14154. searchParams['delete']('b');
  14155. result += key + value;
  14156. });
  14157. return (IS_PURE && !url.toJSON)
  14158. || !searchParams.sort
  14159. || url.href !== 'http://a/c%20d?a=1&c=3'
  14160. || searchParams.get('c') !== '3'
  14161. || String(new URLSearchParams('?a=1')) !== 'a=1'
  14162. || !searchParams[ITERATOR]
  14163. // throws in Edge
  14164. || new URL('https://a@b').username !== 'a'
  14165. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  14166. // not punycoded in Edge
  14167. || new URL('http://тест').host !== 'xn--e1aybc'
  14168. // not escaped in Chrome 62-
  14169. || new URL('http://a#б').hash !== '#%D0%B1'
  14170. // fails in Chrome 66-
  14171. || result !== 'a1c3'
  14172. // throws in Safari
  14173. || new URL('http://x', undefined).host !== 'x';
  14174. });
  14175. /***/ }),
  14176. /***/ "./node_modules/core-js/internals/native-weak-map.js":
  14177. /*!***********************************************************!*\
  14178. !*** ./node_modules/core-js/internals/native-weak-map.js ***!
  14179. \***********************************************************/
  14180. /*! unknown exports (runtime-defined) */
  14181. /*! runtime requirements: module, __webpack_require__ */
  14182. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  14183. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14184. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14185. var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
  14186. var WeakMap = global.WeakMap;
  14187. module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  14188. /***/ }),
  14189. /***/ "./node_modules/core-js/internals/new-promise-capability.js":
  14190. /*!******************************************************************!*\
  14191. !*** ./node_modules/core-js/internals/new-promise-capability.js ***!
  14192. \******************************************************************/
  14193. /*! default exports */
  14194. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14195. /*! other exports [not provided] [no usage info] */
  14196. /*! runtime requirements: module, __webpack_require__ */
  14197. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14198. "use strict";
  14199. var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
  14200. var PromiseCapability = function (C) {
  14201. var resolve, reject;
  14202. this.promise = new C(function ($$resolve, $$reject) {
  14203. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  14204. resolve = $$resolve;
  14205. reject = $$reject;
  14206. });
  14207. this.resolve = aFunction(resolve);
  14208. this.reject = aFunction(reject);
  14209. };
  14210. // 25.4.1.5 NewPromiseCapability(C)
  14211. module.exports.f = function (C) {
  14212. return new PromiseCapability(C);
  14213. };
  14214. /***/ }),
  14215. /***/ "./node_modules/core-js/internals/object-assign.js":
  14216. /*!*********************************************************!*\
  14217. !*** ./node_modules/core-js/internals/object-assign.js ***!
  14218. \*********************************************************/
  14219. /*! unknown exports (runtime-defined) */
  14220. /*! runtime requirements: module, __webpack_require__ */
  14221. /*! CommonJS bailout: module.exports is used directly at 15:0-14 */
  14222. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14223. "use strict";
  14224. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14225. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  14226. var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
  14227. var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
  14228. var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
  14229. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  14230. var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
  14231. var nativeAssign = Object.assign;
  14232. var defineProperty = Object.defineProperty;
  14233. // `Object.assign` method
  14234. // https://tc39.github.io/ecma262/#sec-object.assign
  14235. module.exports = !nativeAssign || fails(function () {
  14236. // should have correct order of operations (Edge bug)
  14237. if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  14238. enumerable: true,
  14239. get: function () {
  14240. defineProperty(this, 'b', {
  14241. value: 3,
  14242. enumerable: false
  14243. });
  14244. }
  14245. }), { b: 2 })).b !== 1) return true;
  14246. // should work with symbols and should have deterministic property order (V8 bug)
  14247. var A = {};
  14248. var B = {};
  14249. // eslint-disable-next-line no-undef
  14250. var symbol = Symbol();
  14251. var alphabet = 'abcdefghijklmnopqrst';
  14252. A[symbol] = 7;
  14253. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  14254. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  14255. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  14256. var T = toObject(target);
  14257. var argumentsLength = arguments.length;
  14258. var index = 1;
  14259. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  14260. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  14261. while (argumentsLength > index) {
  14262. var S = IndexedObject(arguments[index++]);
  14263. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  14264. var length = keys.length;
  14265. var j = 0;
  14266. var key;
  14267. while (length > j) {
  14268. key = keys[j++];
  14269. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  14270. }
  14271. } return T;
  14272. } : nativeAssign;
  14273. /***/ }),
  14274. /***/ "./node_modules/core-js/internals/object-create.js":
  14275. /*!*********************************************************!*\
  14276. !*** ./node_modules/core-js/internals/object-create.js ***!
  14277. \*********************************************************/
  14278. /*! unknown exports (runtime-defined) */
  14279. /*! runtime requirements: module, __webpack_require__ */
  14280. /*! CommonJS bailout: module.exports is used directly at 68:0-14 */
  14281. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14282. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14283. var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js");
  14284. var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
  14285. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
  14286. var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js");
  14287. var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
  14288. var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
  14289. var GT = '>';
  14290. var LT = '<';
  14291. var PROTOTYPE = 'prototype';
  14292. var SCRIPT = 'script';
  14293. var IE_PROTO = sharedKey('IE_PROTO');
  14294. var EmptyConstructor = function () { /* empty */ };
  14295. var scriptTag = function (content) {
  14296. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  14297. };
  14298. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  14299. var NullProtoObjectViaActiveX = function (activeXDocument) {
  14300. activeXDocument.write(scriptTag(''));
  14301. activeXDocument.close();
  14302. var temp = activeXDocument.parentWindow.Object;
  14303. activeXDocument = null; // avoid memory leak
  14304. return temp;
  14305. };
  14306. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  14307. var NullProtoObjectViaIFrame = function () {
  14308. // Thrash, waste and sodomy: IE GC bug
  14309. var iframe = documentCreateElement('iframe');
  14310. var JS = 'java' + SCRIPT + ':';
  14311. var iframeDocument;
  14312. iframe.style.display = 'none';
  14313. html.appendChild(iframe);
  14314. // https://github.com/zloirock/core-js/issues/475
  14315. iframe.src = String(JS);
  14316. iframeDocument = iframe.contentWindow.document;
  14317. iframeDocument.open();
  14318. iframeDocument.write(scriptTag('document.F=Object'));
  14319. iframeDocument.close();
  14320. return iframeDocument.F;
  14321. };
  14322. // Check for document.domain and active x support
  14323. // No need to use active x approach when document.domain is not set
  14324. // see https://github.com/es-shims/es5-shim/issues/150
  14325. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  14326. // avoid IE GC bug
  14327. var activeXDocument;
  14328. var NullProtoObject = function () {
  14329. try {
  14330. /* global ActiveXObject */
  14331. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  14332. } catch (error) { /* ignore */ }
  14333. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  14334. var length = enumBugKeys.length;
  14335. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  14336. return NullProtoObject();
  14337. };
  14338. hiddenKeys[IE_PROTO] = true;
  14339. // `Object.create` method
  14340. // https://tc39.github.io/ecma262/#sec-object.create
  14341. module.exports = Object.create || function create(O, Properties) {
  14342. var result;
  14343. if (O !== null) {
  14344. EmptyConstructor[PROTOTYPE] = anObject(O);
  14345. result = new EmptyConstructor();
  14346. EmptyConstructor[PROTOTYPE] = null;
  14347. // add "__proto__" for Object.getPrototypeOf polyfill
  14348. result[IE_PROTO] = O;
  14349. } else result = NullProtoObject();
  14350. return Properties === undefined ? result : defineProperties(result, Properties);
  14351. };
  14352. /***/ }),
  14353. /***/ "./node_modules/core-js/internals/object-define-properties.js":
  14354. /*!********************************************************************!*\
  14355. !*** ./node_modules/core-js/internals/object-define-properties.js ***!
  14356. \********************************************************************/
  14357. /*! unknown exports (runtime-defined) */
  14358. /*! runtime requirements: module, __webpack_require__ */
  14359. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  14360. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14361. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14362. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  14363. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14364. var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
  14365. // `Object.defineProperties` method
  14366. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  14367. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  14368. anObject(O);
  14369. var keys = objectKeys(Properties);
  14370. var length = keys.length;
  14371. var index = 0;
  14372. var key;
  14373. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  14374. return O;
  14375. };
  14376. /***/ }),
  14377. /***/ "./node_modules/core-js/internals/object-define-property.js":
  14378. /*!******************************************************************!*\
  14379. !*** ./node_modules/core-js/internals/object-define-property.js ***!
  14380. \******************************************************************/
  14381. /*! default exports */
  14382. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14383. /*! other exports [not provided] [no usage info] */
  14384. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  14385. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  14386. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14387. var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
  14388. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14389. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  14390. var nativeDefineProperty = Object.defineProperty;
  14391. // `Object.defineProperty` method
  14392. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  14393. exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  14394. anObject(O);
  14395. P = toPrimitive(P, true);
  14396. anObject(Attributes);
  14397. if (IE8_DOM_DEFINE) try {
  14398. return nativeDefineProperty(O, P, Attributes);
  14399. } catch (error) { /* empty */ }
  14400. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  14401. if ('value' in Attributes) O[P] = Attributes.value;
  14402. return O;
  14403. };
  14404. /***/ }),
  14405. /***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js":
  14406. /*!******************************************************************************!*\
  14407. !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***!
  14408. \******************************************************************************/
  14409. /*! default exports */
  14410. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14411. /*! other exports [not provided] [no usage info] */
  14412. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  14413. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  14414. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14415. var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
  14416. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  14417. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  14418. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  14419. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  14420. var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
  14421. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  14422. // `Object.getOwnPropertyDescriptor` method
  14423. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  14424. exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  14425. O = toIndexedObject(O);
  14426. P = toPrimitive(P, true);
  14427. if (IE8_DOM_DEFINE) try {
  14428. return nativeGetOwnPropertyDescriptor(O, P);
  14429. } catch (error) { /* empty */ }
  14430. if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
  14431. };
  14432. /***/ }),
  14433. /***/ "./node_modules/core-js/internals/object-get-own-property-names-external.js":
  14434. /*!**********************************************************************************!*\
  14435. !*** ./node_modules/core-js/internals/object-get-own-property-names-external.js ***!
  14436. \**********************************************************************************/
  14437. /*! default exports */
  14438. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14439. /*! other exports [not provided] [no usage info] */
  14440. /*! runtime requirements: __webpack_require__, module */
  14441. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14442. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  14443. var nativeGetOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
  14444. var toString = {}.toString;
  14445. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  14446. ? Object.getOwnPropertyNames(window) : [];
  14447. var getWindowNames = function (it) {
  14448. try {
  14449. return nativeGetOwnPropertyNames(it);
  14450. } catch (error) {
  14451. return windowNames.slice();
  14452. }
  14453. };
  14454. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  14455. module.exports.f = function getOwnPropertyNames(it) {
  14456. return windowNames && toString.call(it) == '[object Window]'
  14457. ? getWindowNames(it)
  14458. : nativeGetOwnPropertyNames(toIndexedObject(it));
  14459. };
  14460. /***/ }),
  14461. /***/ "./node_modules/core-js/internals/object-get-own-property-names.js":
  14462. /*!*************************************************************************!*\
  14463. !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***!
  14464. \*************************************************************************/
  14465. /*! default exports */
  14466. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14467. /*! other exports [not provided] [no usage info] */
  14468. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  14469. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  14470. var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
  14471. var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
  14472. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  14473. // `Object.getOwnPropertyNames` method
  14474. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  14475. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  14476. return internalObjectKeys(O, hiddenKeys);
  14477. };
  14478. /***/ }),
  14479. /***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js":
  14480. /*!***************************************************************************!*\
  14481. !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***!
  14482. \***************************************************************************/
  14483. /*! default exports */
  14484. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14485. /*! other exports [not provided] [no usage info] */
  14486. /*! runtime requirements: __webpack_exports__ */
  14487. /***/ ((__unused_webpack_module, exports) => {
  14488. exports.f = Object.getOwnPropertySymbols;
  14489. /***/ }),
  14490. /***/ "./node_modules/core-js/internals/object-get-prototype-of.js":
  14491. /*!*******************************************************************!*\
  14492. !*** ./node_modules/core-js/internals/object-get-prototype-of.js ***!
  14493. \*******************************************************************/
  14494. /*! unknown exports (runtime-defined) */
  14495. /*! runtime requirements: module, __webpack_require__ */
  14496. /*! CommonJS bailout: module.exports is used directly at 11:0-14 */
  14497. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14498. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  14499. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  14500. var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
  14501. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/core-js/internals/correct-prototype-getter.js");
  14502. var IE_PROTO = sharedKey('IE_PROTO');
  14503. var ObjectPrototype = Object.prototype;
  14504. // `Object.getPrototypeOf` method
  14505. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  14506. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  14507. O = toObject(O);
  14508. if (has(O, IE_PROTO)) return O[IE_PROTO];
  14509. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  14510. return O.constructor.prototype;
  14511. } return O instanceof Object ? ObjectPrototype : null;
  14512. };
  14513. /***/ }),
  14514. /***/ "./node_modules/core-js/internals/object-keys-internal.js":
  14515. /*!****************************************************************!*\
  14516. !*** ./node_modules/core-js/internals/object-keys-internal.js ***!
  14517. \****************************************************************/
  14518. /*! unknown exports (runtime-defined) */
  14519. /*! runtime requirements: __webpack_require__, module */
  14520. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  14521. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14522. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  14523. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  14524. var indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
  14525. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
  14526. module.exports = function (object, names) {
  14527. var O = toIndexedObject(object);
  14528. var i = 0;
  14529. var result = [];
  14530. var key;
  14531. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  14532. // Don't enum bug & hidden keys
  14533. while (names.length > i) if (has(O, key = names[i++])) {
  14534. ~indexOf(result, key) || result.push(key);
  14535. }
  14536. return result;
  14537. };
  14538. /***/ }),
  14539. /***/ "./node_modules/core-js/internals/object-keys.js":
  14540. /*!*******************************************************!*\
  14541. !*** ./node_modules/core-js/internals/object-keys.js ***!
  14542. \*******************************************************/
  14543. /*! unknown exports (runtime-defined) */
  14544. /*! runtime requirements: module, __webpack_require__ */
  14545. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  14546. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14547. var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
  14548. var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
  14549. // `Object.keys` method
  14550. // https://tc39.github.io/ecma262/#sec-object.keys
  14551. module.exports = Object.keys || function keys(O) {
  14552. return internalObjectKeys(O, enumBugKeys);
  14553. };
  14554. /***/ }),
  14555. /***/ "./node_modules/core-js/internals/object-property-is-enumerable.js":
  14556. /*!*************************************************************************!*\
  14557. !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***!
  14558. \*************************************************************************/
  14559. /*! default exports */
  14560. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  14561. /*! other exports [not provided] [no usage info] */
  14562. /*! runtime requirements: __webpack_exports__ */
  14563. /***/ ((__unused_webpack_module, exports) => {
  14564. "use strict";
  14565. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  14566. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  14567. // Nashorn ~ JDK8 bug
  14568. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  14569. // `Object.prototype.propertyIsEnumerable` method implementation
  14570. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  14571. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  14572. var descriptor = getOwnPropertyDescriptor(this, V);
  14573. return !!descriptor && descriptor.enumerable;
  14574. } : nativePropertyIsEnumerable;
  14575. /***/ }),
  14576. /***/ "./node_modules/core-js/internals/object-set-prototype-of.js":
  14577. /*!*******************************************************************!*\
  14578. !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***!
  14579. \*******************************************************************/
  14580. /*! unknown exports (runtime-defined) */
  14581. /*! runtime requirements: module, __webpack_require__ */
  14582. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  14583. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14584. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14585. var aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ "./node_modules/core-js/internals/a-possible-prototype.js");
  14586. // `Object.setPrototypeOf` method
  14587. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  14588. // Works with __proto__ only. Old v8 can't work with null proto objects.
  14589. /* eslint-disable no-proto */
  14590. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  14591. var CORRECT_SETTER = false;
  14592. var test = {};
  14593. var setter;
  14594. try {
  14595. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  14596. setter.call(test, []);
  14597. CORRECT_SETTER = test instanceof Array;
  14598. } catch (error) { /* empty */ }
  14599. return function setPrototypeOf(O, proto) {
  14600. anObject(O);
  14601. aPossiblePrototype(proto);
  14602. if (CORRECT_SETTER) setter.call(O, proto);
  14603. else O.__proto__ = proto;
  14604. return O;
  14605. };
  14606. }() : undefined);
  14607. /***/ }),
  14608. /***/ "./node_modules/core-js/internals/object-to-array.js":
  14609. /*!***********************************************************!*\
  14610. !*** ./node_modules/core-js/internals/object-to-array.js ***!
  14611. \***********************************************************/
  14612. /*! unknown exports (runtime-defined) */
  14613. /*! runtime requirements: __webpack_require__, module */
  14614. /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
  14615. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14616. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14617. var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
  14618. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  14619. var propertyIsEnumerable = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js").f;
  14620. // `Object.{ entries, values }` methods implementation
  14621. var createMethod = function (TO_ENTRIES) {
  14622. return function (it) {
  14623. var O = toIndexedObject(it);
  14624. var keys = objectKeys(O);
  14625. var length = keys.length;
  14626. var i = 0;
  14627. var result = [];
  14628. var key;
  14629. while (length > i) {
  14630. key = keys[i++];
  14631. if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
  14632. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  14633. }
  14634. }
  14635. return result;
  14636. };
  14637. };
  14638. module.exports = {
  14639. // `Object.entries` method
  14640. // https://tc39.github.io/ecma262/#sec-object.entries
  14641. entries: createMethod(true),
  14642. // `Object.values` method
  14643. // https://tc39.github.io/ecma262/#sec-object.values
  14644. values: createMethod(false)
  14645. };
  14646. /***/ }),
  14647. /***/ "./node_modules/core-js/internals/object-to-string.js":
  14648. /*!************************************************************!*\
  14649. !*** ./node_modules/core-js/internals/object-to-string.js ***!
  14650. \************************************************************/
  14651. /*! unknown exports (runtime-defined) */
  14652. /*! runtime requirements: module, __webpack_require__ */
  14653. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  14654. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14655. "use strict";
  14656. var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
  14657. var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
  14658. // `Object.prototype.toString` method implementation
  14659. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  14660. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  14661. return '[object ' + classof(this) + ']';
  14662. };
  14663. /***/ }),
  14664. /***/ "./node_modules/core-js/internals/own-keys.js":
  14665. /*!****************************************************!*\
  14666. !*** ./node_modules/core-js/internals/own-keys.js ***!
  14667. \****************************************************/
  14668. /*! unknown exports (runtime-defined) */
  14669. /*! runtime requirements: module, __webpack_require__ */
  14670. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  14671. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14672. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  14673. var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
  14674. var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
  14675. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14676. // all object keys, includes non-enumerable and symbols
  14677. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  14678. var keys = getOwnPropertyNamesModule.f(anObject(it));
  14679. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  14680. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  14681. };
  14682. /***/ }),
  14683. /***/ "./node_modules/core-js/internals/path.js":
  14684. /*!************************************************!*\
  14685. !*** ./node_modules/core-js/internals/path.js ***!
  14686. \************************************************/
  14687. /*! unknown exports (runtime-defined) */
  14688. /*! runtime requirements: module, __webpack_require__ */
  14689. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  14690. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14691. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14692. module.exports = global;
  14693. /***/ }),
  14694. /***/ "./node_modules/core-js/internals/perform.js":
  14695. /*!***************************************************!*\
  14696. !*** ./node_modules/core-js/internals/perform.js ***!
  14697. \***************************************************/
  14698. /*! unknown exports (runtime-defined) */
  14699. /*! runtime requirements: module */
  14700. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  14701. /***/ ((module) => {
  14702. module.exports = function (exec) {
  14703. try {
  14704. return { error: false, value: exec() };
  14705. } catch (error) {
  14706. return { error: true, value: error };
  14707. }
  14708. };
  14709. /***/ }),
  14710. /***/ "./node_modules/core-js/internals/promise-resolve.js":
  14711. /*!***********************************************************!*\
  14712. !*** ./node_modules/core-js/internals/promise-resolve.js ***!
  14713. \***********************************************************/
  14714. /*! unknown exports (runtime-defined) */
  14715. /*! runtime requirements: module, __webpack_require__ */
  14716. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  14717. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14718. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14719. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  14720. var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/core-js/internals/new-promise-capability.js");
  14721. module.exports = function (C, x) {
  14722. anObject(C);
  14723. if (isObject(x) && x.constructor === C) return x;
  14724. var promiseCapability = newPromiseCapability.f(C);
  14725. var resolve = promiseCapability.resolve;
  14726. resolve(x);
  14727. return promiseCapability.promise;
  14728. };
  14729. /***/ }),
  14730. /***/ "./node_modules/core-js/internals/redefine-all.js":
  14731. /*!********************************************************!*\
  14732. !*** ./node_modules/core-js/internals/redefine-all.js ***!
  14733. \********************************************************/
  14734. /*! unknown exports (runtime-defined) */
  14735. /*! runtime requirements: module, __webpack_require__ */
  14736. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  14737. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14738. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  14739. module.exports = function (target, src, options) {
  14740. for (var key in src) redefine(target, key, src[key], options);
  14741. return target;
  14742. };
  14743. /***/ }),
  14744. /***/ "./node_modules/core-js/internals/redefine.js":
  14745. /*!****************************************************!*\
  14746. !*** ./node_modules/core-js/internals/redefine.js ***!
  14747. \****************************************************/
  14748. /*! unknown exports (runtime-defined) */
  14749. /*! runtime requirements: module, __webpack_require__ */
  14750. /*! CommonJS bailout: module.exports is used directly at 12:1-15 */
  14751. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14752. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14753. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  14754. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  14755. var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
  14756. var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
  14757. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  14758. var getInternalState = InternalStateModule.get;
  14759. var enforceInternalState = InternalStateModule.enforce;
  14760. var TEMPLATE = String(String).split('String');
  14761. (module.exports = function (O, key, value, options) {
  14762. var unsafe = options ? !!options.unsafe : false;
  14763. var simple = options ? !!options.enumerable : false;
  14764. var noTargetGet = options ? !!options.noTargetGet : false;
  14765. if (typeof value == 'function') {
  14766. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  14767. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  14768. }
  14769. if (O === global) {
  14770. if (simple) O[key] = value;
  14771. else setGlobal(key, value);
  14772. return;
  14773. } else if (!unsafe) {
  14774. delete O[key];
  14775. } else if (!noTargetGet && O[key]) {
  14776. simple = true;
  14777. }
  14778. if (simple) O[key] = value;
  14779. else createNonEnumerableProperty(O, key, value);
  14780. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  14781. })(Function.prototype, 'toString', function toString() {
  14782. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  14783. });
  14784. /***/ }),
  14785. /***/ "./node_modules/core-js/internals/regexp-exec-abstract.js":
  14786. /*!****************************************************************!*\
  14787. !*** ./node_modules/core-js/internals/regexp-exec-abstract.js ***!
  14788. \****************************************************************/
  14789. /*! unknown exports (runtime-defined) */
  14790. /*! runtime requirements: module, __webpack_require__ */
  14791. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  14792. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14793. var classof = __webpack_require__(/*! ./classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  14794. var regexpExec = __webpack_require__(/*! ./regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
  14795. // `RegExpExec` abstract operation
  14796. // https://tc39.github.io/ecma262/#sec-regexpexec
  14797. module.exports = function (R, S) {
  14798. var exec = R.exec;
  14799. if (typeof exec === 'function') {
  14800. var result = exec.call(R, S);
  14801. if (typeof result !== 'object') {
  14802. throw TypeError('RegExp exec method returned something other than an Object or null');
  14803. }
  14804. return result;
  14805. }
  14806. if (classof(R) !== 'RegExp') {
  14807. throw TypeError('RegExp#exec called on incompatible receiver');
  14808. }
  14809. return regexpExec.call(R, S);
  14810. };
  14811. /***/ }),
  14812. /***/ "./node_modules/core-js/internals/regexp-exec.js":
  14813. /*!*******************************************************!*\
  14814. !*** ./node_modules/core-js/internals/regexp-exec.js ***!
  14815. \*******************************************************/
  14816. /*! unknown exports (runtime-defined) */
  14817. /*! runtime requirements: module, __webpack_require__ */
  14818. /*! CommonJS bailout: module.exports is used directly at 87:0-14 */
  14819. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14820. "use strict";
  14821. var regexpFlags = __webpack_require__(/*! ./regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");
  14822. var stickyHelpers = __webpack_require__(/*! ./regexp-sticky-helpers */ "./node_modules/core-js/internals/regexp-sticky-helpers.js");
  14823. var nativeExec = RegExp.prototype.exec;
  14824. // This always refers to the native implementation, because the
  14825. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  14826. // which loads this file before patching the method.
  14827. var nativeReplace = String.prototype.replace;
  14828. var patchedExec = nativeExec;
  14829. var UPDATES_LAST_INDEX_WRONG = (function () {
  14830. var re1 = /a/;
  14831. var re2 = /b*/g;
  14832. nativeExec.call(re1, 'a');
  14833. nativeExec.call(re2, 'a');
  14834. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  14835. })();
  14836. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
  14837. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  14838. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  14839. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  14840. if (PATCH) {
  14841. patchedExec = function exec(str) {
  14842. var re = this;
  14843. var lastIndex, reCopy, match, i;
  14844. var sticky = UNSUPPORTED_Y && re.sticky;
  14845. var flags = regexpFlags.call(re);
  14846. var source = re.source;
  14847. var charsAdded = 0;
  14848. var strCopy = str;
  14849. if (sticky) {
  14850. flags = flags.replace('y', '');
  14851. if (flags.indexOf('g') === -1) {
  14852. flags += 'g';
  14853. }
  14854. strCopy = String(str).slice(re.lastIndex);
  14855. // Support anchored sticky behavior.
  14856. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  14857. source = '(?: ' + source + ')';
  14858. strCopy = ' ' + strCopy;
  14859. charsAdded++;
  14860. }
  14861. // ^(? + rx + ) is needed, in combination with some str slicing, to
  14862. // simulate the 'y' flag.
  14863. reCopy = new RegExp('^(?:' + source + ')', flags);
  14864. }
  14865. if (NPCG_INCLUDED) {
  14866. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  14867. }
  14868. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  14869. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  14870. if (sticky) {
  14871. if (match) {
  14872. match.input = match.input.slice(charsAdded);
  14873. match[0] = match[0].slice(charsAdded);
  14874. match.index = re.lastIndex;
  14875. re.lastIndex += match[0].length;
  14876. } else re.lastIndex = 0;
  14877. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  14878. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  14879. }
  14880. if (NPCG_INCLUDED && match && match.length > 1) {
  14881. // Fix browsers whose `exec` methods don't consistently return `undefined`
  14882. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  14883. nativeReplace.call(match[0], reCopy, function () {
  14884. for (i = 1; i < arguments.length - 2; i++) {
  14885. if (arguments[i] === undefined) match[i] = undefined;
  14886. }
  14887. });
  14888. }
  14889. return match;
  14890. };
  14891. }
  14892. module.exports = patchedExec;
  14893. /***/ }),
  14894. /***/ "./node_modules/core-js/internals/regexp-flags.js":
  14895. /*!********************************************************!*\
  14896. !*** ./node_modules/core-js/internals/regexp-flags.js ***!
  14897. \********************************************************/
  14898. /*! unknown exports (runtime-defined) */
  14899. /*! runtime requirements: module, __webpack_require__ */
  14900. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  14901. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14902. "use strict";
  14903. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  14904. // `RegExp.prototype.flags` getter implementation
  14905. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  14906. module.exports = function () {
  14907. var that = anObject(this);
  14908. var result = '';
  14909. if (that.global) result += 'g';
  14910. if (that.ignoreCase) result += 'i';
  14911. if (that.multiline) result += 'm';
  14912. if (that.dotAll) result += 's';
  14913. if (that.unicode) result += 'u';
  14914. if (that.sticky) result += 'y';
  14915. return result;
  14916. };
  14917. /***/ }),
  14918. /***/ "./node_modules/core-js/internals/regexp-sticky-helpers.js":
  14919. /*!*****************************************************************!*\
  14920. !*** ./node_modules/core-js/internals/regexp-sticky-helpers.js ***!
  14921. \*****************************************************************/
  14922. /*! default exports */
  14923. /*! export BROKEN_CARET [provided] [no usage info] [missing usage info prevents renaming] */
  14924. /*! export UNSUPPORTED_Y [provided] [no usage info] [missing usage info prevents renaming] */
  14925. /*! other exports [not provided] [no usage info] */
  14926. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  14927. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  14928. "use strict";
  14929. var fails = __webpack_require__(/*! ./fails */ "./node_modules/core-js/internals/fails.js");
  14930. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  14931. // so we use an intermediate function.
  14932. function RE(s, f) {
  14933. return RegExp(s, f);
  14934. }
  14935. exports.UNSUPPORTED_Y = fails(function () {
  14936. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  14937. var re = RE('a', 'y');
  14938. re.lastIndex = 2;
  14939. return re.exec('abcd') != null;
  14940. });
  14941. exports.BROKEN_CARET = fails(function () {
  14942. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  14943. var re = RE('^r', 'gy');
  14944. re.lastIndex = 2;
  14945. return re.exec('str') != null;
  14946. });
  14947. /***/ }),
  14948. /***/ "./node_modules/core-js/internals/require-object-coercible.js":
  14949. /*!********************************************************************!*\
  14950. !*** ./node_modules/core-js/internals/require-object-coercible.js ***!
  14951. \********************************************************************/
  14952. /*! unknown exports (runtime-defined) */
  14953. /*! runtime requirements: module */
  14954. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  14955. /***/ ((module) => {
  14956. // `RequireObjectCoercible` abstract operation
  14957. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  14958. module.exports = function (it) {
  14959. if (it == undefined) throw TypeError("Can't call method on " + it);
  14960. return it;
  14961. };
  14962. /***/ }),
  14963. /***/ "./node_modules/core-js/internals/set-global.js":
  14964. /*!******************************************************!*\
  14965. !*** ./node_modules/core-js/internals/set-global.js ***!
  14966. \******************************************************/
  14967. /*! unknown exports (runtime-defined) */
  14968. /*! runtime requirements: module, __webpack_require__ */
  14969. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  14970. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14971. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  14972. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  14973. module.exports = function (key, value) {
  14974. try {
  14975. createNonEnumerableProperty(global, key, value);
  14976. } catch (error) {
  14977. global[key] = value;
  14978. } return value;
  14979. };
  14980. /***/ }),
  14981. /***/ "./node_modules/core-js/internals/set-species.js":
  14982. /*!*******************************************************!*\
  14983. !*** ./node_modules/core-js/internals/set-species.js ***!
  14984. \*******************************************************/
  14985. /*! unknown exports (runtime-defined) */
  14986. /*! runtime requirements: module, __webpack_require__ */
  14987. /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
  14988. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14989. "use strict";
  14990. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  14991. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  14992. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  14993. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  14994. var SPECIES = wellKnownSymbol('species');
  14995. module.exports = function (CONSTRUCTOR_NAME) {
  14996. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  14997. var defineProperty = definePropertyModule.f;
  14998. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  14999. defineProperty(Constructor, SPECIES, {
  15000. configurable: true,
  15001. get: function () { return this; }
  15002. });
  15003. }
  15004. };
  15005. /***/ }),
  15006. /***/ "./node_modules/core-js/internals/set-to-string-tag.js":
  15007. /*!*************************************************************!*\
  15008. !*** ./node_modules/core-js/internals/set-to-string-tag.js ***!
  15009. \*************************************************************/
  15010. /*! unknown exports (runtime-defined) */
  15011. /*! runtime requirements: __webpack_require__, module */
  15012. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  15013. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15014. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  15015. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  15016. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  15017. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  15018. module.exports = function (it, TAG, STATIC) {
  15019. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  15020. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  15021. }
  15022. };
  15023. /***/ }),
  15024. /***/ "./node_modules/core-js/internals/shared-key.js":
  15025. /*!******************************************************!*\
  15026. !*** ./node_modules/core-js/internals/shared-key.js ***!
  15027. \******************************************************/
  15028. /*! unknown exports (runtime-defined) */
  15029. /*! runtime requirements: module, __webpack_require__ */
  15030. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  15031. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15032. var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
  15033. var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
  15034. var keys = shared('keys');
  15035. module.exports = function (key) {
  15036. return keys[key] || (keys[key] = uid(key));
  15037. };
  15038. /***/ }),
  15039. /***/ "./node_modules/core-js/internals/shared-store.js":
  15040. /*!********************************************************!*\
  15041. !*** ./node_modules/core-js/internals/shared-store.js ***!
  15042. \********************************************************/
  15043. /*! unknown exports (runtime-defined) */
  15044. /*! runtime requirements: module, __webpack_require__ */
  15045. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  15046. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15047. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  15048. var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
  15049. var SHARED = '__core-js_shared__';
  15050. var store = global[SHARED] || setGlobal(SHARED, {});
  15051. module.exports = store;
  15052. /***/ }),
  15053. /***/ "./node_modules/core-js/internals/shared.js":
  15054. /*!**************************************************!*\
  15055. !*** ./node_modules/core-js/internals/shared.js ***!
  15056. \**************************************************/
  15057. /*! unknown exports (runtime-defined) */
  15058. /*! runtime requirements: module, __webpack_require__ */
  15059. /*! CommonJS bailout: module.exports is used directly at 4:1-15 */
  15060. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15061. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  15062. var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
  15063. (module.exports = function (key, value) {
  15064. return store[key] || (store[key] = value !== undefined ? value : {});
  15065. })('versions', []).push({
  15066. version: '3.6.5',
  15067. mode: IS_PURE ? 'pure' : 'global',
  15068. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  15069. });
  15070. /***/ }),
  15071. /***/ "./node_modules/core-js/internals/species-constructor.js":
  15072. /*!***************************************************************!*\
  15073. !*** ./node_modules/core-js/internals/species-constructor.js ***!
  15074. \***************************************************************/
  15075. /*! unknown exports (runtime-defined) */
  15076. /*! runtime requirements: module, __webpack_require__ */
  15077. /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
  15078. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15079. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  15080. var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
  15081. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  15082. var SPECIES = wellKnownSymbol('species');
  15083. // `SpeciesConstructor` abstract operation
  15084. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  15085. module.exports = function (O, defaultConstructor) {
  15086. var C = anObject(O).constructor;
  15087. var S;
  15088. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
  15089. };
  15090. /***/ }),
  15091. /***/ "./node_modules/core-js/internals/string-multibyte.js":
  15092. /*!************************************************************!*\
  15093. !*** ./node_modules/core-js/internals/string-multibyte.js ***!
  15094. \************************************************************/
  15095. /*! unknown exports (runtime-defined) */
  15096. /*! runtime requirements: module, __webpack_require__ */
  15097. /*! CommonJS bailout: module.exports is used directly at 20:0-14 */
  15098. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15099. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15100. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15101. // `String.prototype.{ codePointAt, at }` methods implementation
  15102. var createMethod = function (CONVERT_TO_STRING) {
  15103. return function ($this, pos) {
  15104. var S = String(requireObjectCoercible($this));
  15105. var position = toInteger(pos);
  15106. var size = S.length;
  15107. var first, second;
  15108. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  15109. first = S.charCodeAt(position);
  15110. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  15111. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  15112. ? CONVERT_TO_STRING ? S.charAt(position) : first
  15113. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  15114. };
  15115. };
  15116. module.exports = {
  15117. // `String.prototype.codePointAt` method
  15118. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  15119. codeAt: createMethod(false),
  15120. // `String.prototype.at` method
  15121. // https://github.com/mathiasbynens/String.prototype.at
  15122. charAt: createMethod(true)
  15123. };
  15124. /***/ }),
  15125. /***/ "./node_modules/core-js/internals/string-pad-webkit-bug.js":
  15126. /*!*****************************************************************!*\
  15127. !*** ./node_modules/core-js/internals/string-pad-webkit-bug.js ***!
  15128. \*****************************************************************/
  15129. /*! unknown exports (runtime-defined) */
  15130. /*! runtime requirements: module, __webpack_require__ */
  15131. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  15132. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15133. // https://github.com/zloirock/core-js/issues/280
  15134. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
  15135. // eslint-disable-next-line unicorn/no-unsafe-regex
  15136. module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  15137. /***/ }),
  15138. /***/ "./node_modules/core-js/internals/string-pad.js":
  15139. /*!******************************************************!*\
  15140. !*** ./node_modules/core-js/internals/string-pad.js ***!
  15141. \******************************************************/
  15142. /*! unknown exports (runtime-defined) */
  15143. /*! runtime requirements: module, __webpack_require__ */
  15144. /*! CommonJS bailout: module.exports is used directly at 24:0-14 */
  15145. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15146. // https://github.com/tc39/proposal-string-pad-start-end
  15147. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  15148. var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
  15149. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15150. var ceil = Math.ceil;
  15151. // `String.prototype.{ padStart, padEnd }` methods implementation
  15152. var createMethod = function (IS_END) {
  15153. return function ($this, maxLength, fillString) {
  15154. var S = String(requireObjectCoercible($this));
  15155. var stringLength = S.length;
  15156. var fillStr = fillString === undefined ? ' ' : String(fillString);
  15157. var intMaxLength = toLength(maxLength);
  15158. var fillLen, stringFiller;
  15159. if (intMaxLength <= stringLength || fillStr == '') return S;
  15160. fillLen = intMaxLength - stringLength;
  15161. stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
  15162. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  15163. return IS_END ? S + stringFiller : stringFiller + S;
  15164. };
  15165. };
  15166. module.exports = {
  15167. // `String.prototype.padStart` method
  15168. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  15169. start: createMethod(false),
  15170. // `String.prototype.padEnd` method
  15171. // https://tc39.github.io/ecma262/#sec-string.prototype.padend
  15172. end: createMethod(true)
  15173. };
  15174. /***/ }),
  15175. /***/ "./node_modules/core-js/internals/string-punycode-to-ascii.js":
  15176. /*!********************************************************************!*\
  15177. !*** ./node_modules/core-js/internals/string-punycode-to-ascii.js ***!
  15178. \********************************************************************/
  15179. /*! unknown exports (runtime-defined) */
  15180. /*! runtime requirements: module */
  15181. /*! CommonJS bailout: module.exports is used directly at 159:0-14 */
  15182. /***/ ((module) => {
  15183. "use strict";
  15184. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  15185. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  15186. var base = 36;
  15187. var tMin = 1;
  15188. var tMax = 26;
  15189. var skew = 38;
  15190. var damp = 700;
  15191. var initialBias = 72;
  15192. var initialN = 128; // 0x80
  15193. var delimiter = '-'; // '\x2D'
  15194. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  15195. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  15196. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  15197. var baseMinusTMin = base - tMin;
  15198. var floor = Math.floor;
  15199. var stringFromCharCode = String.fromCharCode;
  15200. /**
  15201. * Creates an array containing the numeric code points of each Unicode
  15202. * character in the string. While JavaScript uses UCS-2 internally,
  15203. * this function will convert a pair of surrogate halves (each of which
  15204. * UCS-2 exposes as separate characters) into a single code point,
  15205. * matching UTF-16.
  15206. */
  15207. var ucs2decode = function (string) {
  15208. var output = [];
  15209. var counter = 0;
  15210. var length = string.length;
  15211. while (counter < length) {
  15212. var value = string.charCodeAt(counter++);
  15213. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  15214. // It's a high surrogate, and there is a next character.
  15215. var extra = string.charCodeAt(counter++);
  15216. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  15217. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  15218. } else {
  15219. // It's an unmatched surrogate; only append this code unit, in case the
  15220. // next code unit is the high surrogate of a surrogate pair.
  15221. output.push(value);
  15222. counter--;
  15223. }
  15224. } else {
  15225. output.push(value);
  15226. }
  15227. }
  15228. return output;
  15229. };
  15230. /**
  15231. * Converts a digit/integer into a basic code point.
  15232. */
  15233. var digitToBasic = function (digit) {
  15234. // 0..25 map to ASCII a..z or A..Z
  15235. // 26..35 map to ASCII 0..9
  15236. return digit + 22 + 75 * (digit < 26);
  15237. };
  15238. /**
  15239. * Bias adaptation function as per section 3.4 of RFC 3492.
  15240. * https://tools.ietf.org/html/rfc3492#section-3.4
  15241. */
  15242. var adapt = function (delta, numPoints, firstTime) {
  15243. var k = 0;
  15244. delta = firstTime ? floor(delta / damp) : delta >> 1;
  15245. delta += floor(delta / numPoints);
  15246. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  15247. delta = floor(delta / baseMinusTMin);
  15248. }
  15249. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  15250. };
  15251. /**
  15252. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  15253. * Punycode string of ASCII-only symbols.
  15254. */
  15255. // eslint-disable-next-line max-statements
  15256. var encode = function (input) {
  15257. var output = [];
  15258. // Convert the input in UCS-2 to an array of Unicode code points.
  15259. input = ucs2decode(input);
  15260. // Cache the length.
  15261. var inputLength = input.length;
  15262. // Initialize the state.
  15263. var n = initialN;
  15264. var delta = 0;
  15265. var bias = initialBias;
  15266. var i, currentValue;
  15267. // Handle the basic code points.
  15268. for (i = 0; i < input.length; i++) {
  15269. currentValue = input[i];
  15270. if (currentValue < 0x80) {
  15271. output.push(stringFromCharCode(currentValue));
  15272. }
  15273. }
  15274. var basicLength = output.length; // number of basic code points.
  15275. var handledCPCount = basicLength; // number of code points that have been handled;
  15276. // Finish the basic string with a delimiter unless it's empty.
  15277. if (basicLength) {
  15278. output.push(delimiter);
  15279. }
  15280. // Main encoding loop:
  15281. while (handledCPCount < inputLength) {
  15282. // All non-basic code points < n have been handled already. Find the next larger one:
  15283. var m = maxInt;
  15284. for (i = 0; i < input.length; i++) {
  15285. currentValue = input[i];
  15286. if (currentValue >= n && currentValue < m) {
  15287. m = currentValue;
  15288. }
  15289. }
  15290. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  15291. var handledCPCountPlusOne = handledCPCount + 1;
  15292. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  15293. throw RangeError(OVERFLOW_ERROR);
  15294. }
  15295. delta += (m - n) * handledCPCountPlusOne;
  15296. n = m;
  15297. for (i = 0; i < input.length; i++) {
  15298. currentValue = input[i];
  15299. if (currentValue < n && ++delta > maxInt) {
  15300. throw RangeError(OVERFLOW_ERROR);
  15301. }
  15302. if (currentValue == n) {
  15303. // Represent delta as a generalized variable-length integer.
  15304. var q = delta;
  15305. for (var k = base; /* no condition */; k += base) {
  15306. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  15307. if (q < t) break;
  15308. var qMinusT = q - t;
  15309. var baseMinusT = base - t;
  15310. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  15311. q = floor(qMinusT / baseMinusT);
  15312. }
  15313. output.push(stringFromCharCode(digitToBasic(q)));
  15314. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  15315. delta = 0;
  15316. ++handledCPCount;
  15317. }
  15318. }
  15319. ++delta;
  15320. ++n;
  15321. }
  15322. return output.join('');
  15323. };
  15324. module.exports = function (input) {
  15325. var encoded = [];
  15326. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  15327. var i, label;
  15328. for (i = 0; i < labels.length; i++) {
  15329. label = labels[i];
  15330. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  15331. }
  15332. return encoded.join('.');
  15333. };
  15334. /***/ }),
  15335. /***/ "./node_modules/core-js/internals/string-repeat.js":
  15336. /*!*********************************************************!*\
  15337. !*** ./node_modules/core-js/internals/string-repeat.js ***!
  15338. \*********************************************************/
  15339. /*! unknown exports (runtime-defined) */
  15340. /*! runtime requirements: module, __webpack_require__ */
  15341. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  15342. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15343. "use strict";
  15344. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15345. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15346. // `String.prototype.repeat` method implementation
  15347. // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
  15348. module.exports = ''.repeat || function repeat(count) {
  15349. var str = String(requireObjectCoercible(this));
  15350. var result = '';
  15351. var n = toInteger(count);
  15352. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  15353. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  15354. return result;
  15355. };
  15356. /***/ }),
  15357. /***/ "./node_modules/core-js/internals/string-trim-forced.js":
  15358. /*!**************************************************************!*\
  15359. !*** ./node_modules/core-js/internals/string-trim-forced.js ***!
  15360. \**************************************************************/
  15361. /*! unknown exports (runtime-defined) */
  15362. /*! runtime requirements: module, __webpack_require__ */
  15363. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  15364. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15365. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  15366. var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js");
  15367. var non = '\u200B\u0085\u180E';
  15368. // check that a method works with the correct list
  15369. // of whitespaces and has a correct name
  15370. module.exports = function (METHOD_NAME) {
  15371. return fails(function () {
  15372. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  15373. });
  15374. };
  15375. /***/ }),
  15376. /***/ "./node_modules/core-js/internals/string-trim.js":
  15377. /*!*******************************************************!*\
  15378. !*** ./node_modules/core-js/internals/string-trim.js ***!
  15379. \*******************************************************/
  15380. /*! unknown exports (runtime-defined) */
  15381. /*! runtime requirements: module, __webpack_require__ */
  15382. /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
  15383. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15384. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15385. var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js");
  15386. var whitespace = '[' + whitespaces + ']';
  15387. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  15388. var rtrim = RegExp(whitespace + whitespace + '*$');
  15389. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  15390. var createMethod = function (TYPE) {
  15391. return function ($this) {
  15392. var string = String(requireObjectCoercible($this));
  15393. if (TYPE & 1) string = string.replace(ltrim, '');
  15394. if (TYPE & 2) string = string.replace(rtrim, '');
  15395. return string;
  15396. };
  15397. };
  15398. module.exports = {
  15399. // `String.prototype.{ trimLeft, trimStart }` methods
  15400. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  15401. start: createMethod(1),
  15402. // `String.prototype.{ trimRight, trimEnd }` methods
  15403. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  15404. end: createMethod(2),
  15405. // `String.prototype.trim` method
  15406. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  15407. trim: createMethod(3)
  15408. };
  15409. /***/ }),
  15410. /***/ "./node_modules/core-js/internals/task.js":
  15411. /*!************************************************!*\
  15412. !*** ./node_modules/core-js/internals/task.js ***!
  15413. \************************************************/
  15414. /*! unknown exports (runtime-defined) */
  15415. /*! runtime requirements: module, __webpack_require__ */
  15416. /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
  15417. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15418. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  15419. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  15420. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  15421. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  15422. var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js");
  15423. var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
  15424. var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/core-js/internals/engine-is-ios.js");
  15425. var location = global.location;
  15426. var set = global.setImmediate;
  15427. var clear = global.clearImmediate;
  15428. var process = global.process;
  15429. var MessageChannel = global.MessageChannel;
  15430. var Dispatch = global.Dispatch;
  15431. var counter = 0;
  15432. var queue = {};
  15433. var ONREADYSTATECHANGE = 'onreadystatechange';
  15434. var defer, channel, port;
  15435. var run = function (id) {
  15436. // eslint-disable-next-line no-prototype-builtins
  15437. if (queue.hasOwnProperty(id)) {
  15438. var fn = queue[id];
  15439. delete queue[id];
  15440. fn();
  15441. }
  15442. };
  15443. var runner = function (id) {
  15444. return function () {
  15445. run(id);
  15446. };
  15447. };
  15448. var listener = function (event) {
  15449. run(event.data);
  15450. };
  15451. var post = function (id) {
  15452. // old engines have not location.origin
  15453. global.postMessage(id + '', location.protocol + '//' + location.host);
  15454. };
  15455. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  15456. if (!set || !clear) {
  15457. set = function setImmediate(fn) {
  15458. var args = [];
  15459. var i = 1;
  15460. while (arguments.length > i) args.push(arguments[i++]);
  15461. queue[++counter] = function () {
  15462. // eslint-disable-next-line no-new-func
  15463. (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
  15464. };
  15465. defer(counter);
  15466. return counter;
  15467. };
  15468. clear = function clearImmediate(id) {
  15469. delete queue[id];
  15470. };
  15471. // Node.js 0.8-
  15472. if (classof(process) == 'process') {
  15473. defer = function (id) {
  15474. process.nextTick(runner(id));
  15475. };
  15476. // Sphere (JS game engine) Dispatch API
  15477. } else if (Dispatch && Dispatch.now) {
  15478. defer = function (id) {
  15479. Dispatch.now(runner(id));
  15480. };
  15481. // Browsers with MessageChannel, includes WebWorkers
  15482. // except iOS - https://github.com/zloirock/core-js/issues/624
  15483. } else if (MessageChannel && !IS_IOS) {
  15484. channel = new MessageChannel();
  15485. port = channel.port2;
  15486. channel.port1.onmessage = listener;
  15487. defer = bind(port.postMessage, port, 1);
  15488. // Browsers with postMessage, skip WebWorkers
  15489. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  15490. } else if (
  15491. global.addEventListener &&
  15492. typeof postMessage == 'function' &&
  15493. !global.importScripts &&
  15494. !fails(post) &&
  15495. location.protocol !== 'file:'
  15496. ) {
  15497. defer = post;
  15498. global.addEventListener('message', listener, false);
  15499. // IE8-
  15500. } else if (ONREADYSTATECHANGE in createElement('script')) {
  15501. defer = function (id) {
  15502. html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
  15503. html.removeChild(this);
  15504. run(id);
  15505. };
  15506. };
  15507. // Rest old browsers
  15508. } else {
  15509. defer = function (id) {
  15510. setTimeout(runner(id), 0);
  15511. };
  15512. }
  15513. }
  15514. module.exports = {
  15515. set: set,
  15516. clear: clear
  15517. };
  15518. /***/ }),
  15519. /***/ "./node_modules/core-js/internals/this-number-value.js":
  15520. /*!*************************************************************!*\
  15521. !*** ./node_modules/core-js/internals/this-number-value.js ***!
  15522. \*************************************************************/
  15523. /*! unknown exports (runtime-defined) */
  15524. /*! runtime requirements: module, __webpack_require__ */
  15525. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  15526. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15527. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  15528. // `thisNumberValue` abstract operation
  15529. // https://tc39.github.io/ecma262/#sec-thisnumbervalue
  15530. module.exports = function (value) {
  15531. if (typeof value != 'number' && classof(value) != 'Number') {
  15532. throw TypeError('Incorrect invocation');
  15533. }
  15534. return +value;
  15535. };
  15536. /***/ }),
  15537. /***/ "./node_modules/core-js/internals/to-absolute-index.js":
  15538. /*!*************************************************************!*\
  15539. !*** ./node_modules/core-js/internals/to-absolute-index.js ***!
  15540. \*************************************************************/
  15541. /*! unknown exports (runtime-defined) */
  15542. /*! runtime requirements: module, __webpack_require__ */
  15543. /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
  15544. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15545. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15546. var max = Math.max;
  15547. var min = Math.min;
  15548. // Helper for a popular repeating case of the spec:
  15549. // Let integer be ? ToInteger(index).
  15550. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  15551. module.exports = function (index, length) {
  15552. var integer = toInteger(index);
  15553. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  15554. };
  15555. /***/ }),
  15556. /***/ "./node_modules/core-js/internals/to-index.js":
  15557. /*!****************************************************!*\
  15558. !*** ./node_modules/core-js/internals/to-index.js ***!
  15559. \****************************************************/
  15560. /*! unknown exports (runtime-defined) */
  15561. /*! runtime requirements: module, __webpack_require__ */
  15562. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  15563. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15564. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15565. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  15566. // `ToIndex` abstract operation
  15567. // https://tc39.github.io/ecma262/#sec-toindex
  15568. module.exports = function (it) {
  15569. if (it === undefined) return 0;
  15570. var number = toInteger(it);
  15571. var length = toLength(number);
  15572. if (number !== length) throw RangeError('Wrong length or index');
  15573. return length;
  15574. };
  15575. /***/ }),
  15576. /***/ "./node_modules/core-js/internals/to-indexed-object.js":
  15577. /*!*************************************************************!*\
  15578. !*** ./node_modules/core-js/internals/to-indexed-object.js ***!
  15579. \*************************************************************/
  15580. /*! unknown exports (runtime-defined) */
  15581. /*! runtime requirements: module, __webpack_require__ */
  15582. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  15583. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15584. // toObject with fallback for non-array-like ES3 strings
  15585. var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
  15586. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15587. module.exports = function (it) {
  15588. return IndexedObject(requireObjectCoercible(it));
  15589. };
  15590. /***/ }),
  15591. /***/ "./node_modules/core-js/internals/to-integer.js":
  15592. /*!******************************************************!*\
  15593. !*** ./node_modules/core-js/internals/to-integer.js ***!
  15594. \******************************************************/
  15595. /*! unknown exports (runtime-defined) */
  15596. /*! runtime requirements: module */
  15597. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  15598. /***/ ((module) => {
  15599. var ceil = Math.ceil;
  15600. var floor = Math.floor;
  15601. // `ToInteger` abstract operation
  15602. // https://tc39.github.io/ecma262/#sec-tointeger
  15603. module.exports = function (argument) {
  15604. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  15605. };
  15606. /***/ }),
  15607. /***/ "./node_modules/core-js/internals/to-length.js":
  15608. /*!*****************************************************!*\
  15609. !*** ./node_modules/core-js/internals/to-length.js ***!
  15610. \*****************************************************/
  15611. /*! unknown exports (runtime-defined) */
  15612. /*! runtime requirements: module, __webpack_require__ */
  15613. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  15614. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15615. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15616. var min = Math.min;
  15617. // `ToLength` abstract operation
  15618. // https://tc39.github.io/ecma262/#sec-tolength
  15619. module.exports = function (argument) {
  15620. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  15621. };
  15622. /***/ }),
  15623. /***/ "./node_modules/core-js/internals/to-object.js":
  15624. /*!*****************************************************!*\
  15625. !*** ./node_modules/core-js/internals/to-object.js ***!
  15626. \*****************************************************/
  15627. /*! unknown exports (runtime-defined) */
  15628. /*! runtime requirements: module, __webpack_require__ */
  15629. /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
  15630. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15631. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  15632. // `ToObject` abstract operation
  15633. // https://tc39.github.io/ecma262/#sec-toobject
  15634. module.exports = function (argument) {
  15635. return Object(requireObjectCoercible(argument));
  15636. };
  15637. /***/ }),
  15638. /***/ "./node_modules/core-js/internals/to-offset.js":
  15639. /*!*****************************************************!*\
  15640. !*** ./node_modules/core-js/internals/to-offset.js ***!
  15641. \*****************************************************/
  15642. /*! unknown exports (runtime-defined) */
  15643. /*! runtime requirements: module, __webpack_require__ */
  15644. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  15645. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15646. var toPositiveInteger = __webpack_require__(/*! ../internals/to-positive-integer */ "./node_modules/core-js/internals/to-positive-integer.js");
  15647. module.exports = function (it, BYTES) {
  15648. var offset = toPositiveInteger(it);
  15649. if (offset % BYTES) throw RangeError('Wrong offset');
  15650. return offset;
  15651. };
  15652. /***/ }),
  15653. /***/ "./node_modules/core-js/internals/to-positive-integer.js":
  15654. /*!***************************************************************!*\
  15655. !*** ./node_modules/core-js/internals/to-positive-integer.js ***!
  15656. \***************************************************************/
  15657. /*! unknown exports (runtime-defined) */
  15658. /*! runtime requirements: module, __webpack_require__ */
  15659. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  15660. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15661. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  15662. module.exports = function (it) {
  15663. var result = toInteger(it);
  15664. if (result < 0) throw RangeError("The argument can't be less than 0");
  15665. return result;
  15666. };
  15667. /***/ }),
  15668. /***/ "./node_modules/core-js/internals/to-primitive.js":
  15669. /*!********************************************************!*\
  15670. !*** ./node_modules/core-js/internals/to-primitive.js ***!
  15671. \********************************************************/
  15672. /*! unknown exports (runtime-defined) */
  15673. /*! runtime requirements: module, __webpack_require__ */
  15674. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  15675. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15676. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  15677. // `ToPrimitive` abstract operation
  15678. // https://tc39.github.io/ecma262/#sec-toprimitive
  15679. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  15680. // and the second argument - flag - preferred type is a string
  15681. module.exports = function (input, PREFERRED_STRING) {
  15682. if (!isObject(input)) return input;
  15683. var fn, val;
  15684. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  15685. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  15686. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  15687. throw TypeError("Can't convert object to primitive value");
  15688. };
  15689. /***/ }),
  15690. /***/ "./node_modules/core-js/internals/to-string-tag-support.js":
  15691. /*!*****************************************************************!*\
  15692. !*** ./node_modules/core-js/internals/to-string-tag-support.js ***!
  15693. \*****************************************************************/
  15694. /*! unknown exports (runtime-defined) */
  15695. /*! runtime requirements: module, __webpack_require__ */
  15696. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  15697. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15698. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  15699. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  15700. var test = {};
  15701. test[TO_STRING_TAG] = 'z';
  15702. module.exports = String(test) === '[object z]';
  15703. /***/ }),
  15704. /***/ "./node_modules/core-js/internals/typed-array-constructor.js":
  15705. /*!*******************************************************************!*\
  15706. !*** ./node_modules/core-js/internals/typed-array-constructor.js ***!
  15707. \*******************************************************************/
  15708. /*! unknown exports (runtime-defined) */
  15709. /*! runtime requirements: __webpack_require__, module */
  15710. /*! CommonJS bailout: module.exports is used directly at 109:2-16 */
  15711. /*! CommonJS bailout: module.exports is used directly at 230:7-21 */
  15712. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15713. "use strict";
  15714. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  15715. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  15716. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  15717. var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(/*! ../internals/typed-array-constructors-require-wrappers */ "./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js");
  15718. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  15719. var ArrayBufferModule = __webpack_require__(/*! ../internals/array-buffer */ "./node_modules/core-js/internals/array-buffer.js");
  15720. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  15721. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  15722. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  15723. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  15724. var toIndex = __webpack_require__(/*! ../internals/to-index */ "./node_modules/core-js/internals/to-index.js");
  15725. var toOffset = __webpack_require__(/*! ../internals/to-offset */ "./node_modules/core-js/internals/to-offset.js");
  15726. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  15727. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  15728. var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
  15729. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  15730. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  15731. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
  15732. var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
  15733. var typedArrayFrom = __webpack_require__(/*! ../internals/typed-array-from */ "./node_modules/core-js/internals/typed-array-from.js");
  15734. var forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
  15735. var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
  15736. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  15737. var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
  15738. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  15739. var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
  15740. var getInternalState = InternalStateModule.get;
  15741. var setInternalState = InternalStateModule.set;
  15742. var nativeDefineProperty = definePropertyModule.f;
  15743. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  15744. var round = Math.round;
  15745. var RangeError = global.RangeError;
  15746. var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
  15747. var DataView = ArrayBufferModule.DataView;
  15748. var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
  15749. var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
  15750. var TypedArray = ArrayBufferViewCore.TypedArray;
  15751. var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
  15752. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  15753. var isTypedArray = ArrayBufferViewCore.isTypedArray;
  15754. var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  15755. var WRONG_LENGTH = 'Wrong length';
  15756. var fromList = function (C, list) {
  15757. var index = 0;
  15758. var length = list.length;
  15759. var result = new (aTypedArrayConstructor(C))(length);
  15760. while (length > index) result[index] = list[index++];
  15761. return result;
  15762. };
  15763. var addGetter = function (it, key) {
  15764. nativeDefineProperty(it, key, { get: function () {
  15765. return getInternalState(this)[key];
  15766. } });
  15767. };
  15768. var isArrayBuffer = function (it) {
  15769. var klass;
  15770. return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
  15771. };
  15772. var isTypedArrayIndex = function (target, key) {
  15773. return isTypedArray(target)
  15774. && typeof key != 'symbol'
  15775. && key in target
  15776. && String(+key) == String(key);
  15777. };
  15778. var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
  15779. return isTypedArrayIndex(target, key = toPrimitive(key, true))
  15780. ? createPropertyDescriptor(2, target[key])
  15781. : nativeGetOwnPropertyDescriptor(target, key);
  15782. };
  15783. var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
  15784. if (isTypedArrayIndex(target, key = toPrimitive(key, true))
  15785. && isObject(descriptor)
  15786. && has(descriptor, 'value')
  15787. && !has(descriptor, 'get')
  15788. && !has(descriptor, 'set')
  15789. // TODO: add validation descriptor w/o calling accessors
  15790. && !descriptor.configurable
  15791. && (!has(descriptor, 'writable') || descriptor.writable)
  15792. && (!has(descriptor, 'enumerable') || descriptor.enumerable)
  15793. ) {
  15794. target[key] = descriptor.value;
  15795. return target;
  15796. } return nativeDefineProperty(target, key, descriptor);
  15797. };
  15798. if (DESCRIPTORS) {
  15799. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  15800. getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
  15801. definePropertyModule.f = wrappedDefineProperty;
  15802. addGetter(TypedArrayPrototype, 'buffer');
  15803. addGetter(TypedArrayPrototype, 'byteOffset');
  15804. addGetter(TypedArrayPrototype, 'byteLength');
  15805. addGetter(TypedArrayPrototype, 'length');
  15806. }
  15807. $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
  15808. getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
  15809. defineProperty: wrappedDefineProperty
  15810. });
  15811. module.exports = function (TYPE, wrapper, CLAMPED) {
  15812. var BYTES = TYPE.match(/\d+$/)[0] / 8;
  15813. var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
  15814. var GETTER = 'get' + TYPE;
  15815. var SETTER = 'set' + TYPE;
  15816. var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
  15817. var TypedArrayConstructor = NativeTypedArrayConstructor;
  15818. var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
  15819. var exported = {};
  15820. var getter = function (that, index) {
  15821. var data = getInternalState(that);
  15822. return data.view[GETTER](index * BYTES + data.byteOffset, true);
  15823. };
  15824. var setter = function (that, index, value) {
  15825. var data = getInternalState(that);
  15826. if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
  15827. data.view[SETTER](index * BYTES + data.byteOffset, value, true);
  15828. };
  15829. var addElement = function (that, index) {
  15830. nativeDefineProperty(that, index, {
  15831. get: function () {
  15832. return getter(this, index);
  15833. },
  15834. set: function (value) {
  15835. return setter(this, index, value);
  15836. },
  15837. enumerable: true
  15838. });
  15839. };
  15840. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  15841. TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
  15842. anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);
  15843. var index = 0;
  15844. var byteOffset = 0;
  15845. var buffer, byteLength, length;
  15846. if (!isObject(data)) {
  15847. length = toIndex(data);
  15848. byteLength = length * BYTES;
  15849. buffer = new ArrayBuffer(byteLength);
  15850. } else if (isArrayBuffer(data)) {
  15851. buffer = data;
  15852. byteOffset = toOffset(offset, BYTES);
  15853. var $len = data.byteLength;
  15854. if ($length === undefined) {
  15855. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  15856. byteLength = $len - byteOffset;
  15857. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  15858. } else {
  15859. byteLength = toLength($length) * BYTES;
  15860. if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
  15861. }
  15862. length = byteLength / BYTES;
  15863. } else if (isTypedArray(data)) {
  15864. return fromList(TypedArrayConstructor, data);
  15865. } else {
  15866. return typedArrayFrom.call(TypedArrayConstructor, data);
  15867. }
  15868. setInternalState(that, {
  15869. buffer: buffer,
  15870. byteOffset: byteOffset,
  15871. byteLength: byteLength,
  15872. length: length,
  15873. view: new DataView(buffer)
  15874. });
  15875. while (index < length) addElement(that, index++);
  15876. });
  15877. if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
  15878. TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
  15879. } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
  15880. TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
  15881. anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);
  15882. return inheritIfRequired(function () {
  15883. if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
  15884. if (isArrayBuffer(data)) return $length !== undefined
  15885. ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
  15886. : typedArrayOffset !== undefined
  15887. ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
  15888. : new NativeTypedArrayConstructor(data);
  15889. if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
  15890. return typedArrayFrom.call(TypedArrayConstructor, data);
  15891. }(), dummy, TypedArrayConstructor);
  15892. });
  15893. if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
  15894. forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
  15895. if (!(key in TypedArrayConstructor)) {
  15896. createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
  15897. }
  15898. });
  15899. TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
  15900. }
  15901. if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
  15902. createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
  15903. }
  15904. if (TYPED_ARRAY_TAG) {
  15905. createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
  15906. }
  15907. exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
  15908. $({
  15909. global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS
  15910. }, exported);
  15911. if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
  15912. createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
  15913. }
  15914. if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
  15915. createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
  15916. }
  15917. setSpecies(CONSTRUCTOR_NAME);
  15918. };
  15919. } else module.exports = function () { /* empty */ };
  15920. /***/ }),
  15921. /***/ "./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js":
  15922. /*!*************************************************************************************!*\
  15923. !*** ./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js ***!
  15924. \*************************************************************************************/
  15925. /*! unknown exports (runtime-defined) */
  15926. /*! runtime requirements: __webpack_require__, module */
  15927. /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
  15928. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15929. /* eslint-disable no-new */
  15930. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  15931. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  15932. var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
  15933. var NATIVE_ARRAY_BUFFER_VIEWS = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js").NATIVE_ARRAY_BUFFER_VIEWS;
  15934. var ArrayBuffer = global.ArrayBuffer;
  15935. var Int8Array = global.Int8Array;
  15936. module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
  15937. Int8Array(1);
  15938. }) || !fails(function () {
  15939. new Int8Array(-1);
  15940. }) || !checkCorrectnessOfIteration(function (iterable) {
  15941. new Int8Array();
  15942. new Int8Array(null);
  15943. new Int8Array(1.5);
  15944. new Int8Array(iterable);
  15945. }, true) || fails(function () {
  15946. // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
  15947. return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
  15948. });
  15949. /***/ }),
  15950. /***/ "./node_modules/core-js/internals/typed-array-from.js":
  15951. /*!************************************************************!*\
  15952. !*** ./node_modules/core-js/internals/typed-array-from.js ***!
  15953. \************************************************************/
  15954. /*! unknown exports (runtime-defined) */
  15955. /*! runtime requirements: __webpack_require__, module */
  15956. /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
  15957. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15958. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  15959. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  15960. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
  15961. var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
  15962. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  15963. var aTypedArrayConstructor = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js").aTypedArrayConstructor;
  15964. module.exports = function from(source /* , mapfn, thisArg */) {
  15965. var O = toObject(source);
  15966. var argumentsLength = arguments.length;
  15967. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  15968. var mapping = mapfn !== undefined;
  15969. var iteratorMethod = getIteratorMethod(O);
  15970. var i, length, result, step, iterator, next;
  15971. if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {
  15972. iterator = iteratorMethod.call(O);
  15973. next = iterator.next;
  15974. O = [];
  15975. while (!(step = next.call(iterator)).done) {
  15976. O.push(step.value);
  15977. }
  15978. }
  15979. if (mapping && argumentsLength > 2) {
  15980. mapfn = bind(mapfn, arguments[2], 2);
  15981. }
  15982. length = toLength(O.length);
  15983. result = new (aTypedArrayConstructor(this))(length);
  15984. for (i = 0; length > i; i++) {
  15985. result[i] = mapping ? mapfn(O[i], i) : O[i];
  15986. }
  15987. return result;
  15988. };
  15989. /***/ }),
  15990. /***/ "./node_modules/core-js/internals/uid.js":
  15991. /*!***********************************************!*\
  15992. !*** ./node_modules/core-js/internals/uid.js ***!
  15993. \***********************************************/
  15994. /*! unknown exports (runtime-defined) */
  15995. /*! runtime requirements: module */
  15996. /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
  15997. /***/ ((module) => {
  15998. var id = 0;
  15999. var postfix = Math.random();
  16000. module.exports = function (key) {
  16001. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  16002. };
  16003. /***/ }),
  16004. /***/ "./node_modules/core-js/internals/use-symbol-as-uid.js":
  16005. /*!*************************************************************!*\
  16006. !*** ./node_modules/core-js/internals/use-symbol-as-uid.js ***!
  16007. \*************************************************************/
  16008. /*! unknown exports (runtime-defined) */
  16009. /*! runtime requirements: module, __webpack_require__ */
  16010. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  16011. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  16012. var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
  16013. module.exports = NATIVE_SYMBOL
  16014. // eslint-disable-next-line no-undef
  16015. && !Symbol.sham
  16016. // eslint-disable-next-line no-undef
  16017. && typeof Symbol.iterator == 'symbol';
  16018. /***/ }),
  16019. /***/ "./node_modules/core-js/internals/well-known-symbol-wrapped.js":
  16020. /*!*********************************************************************!*\
  16021. !*** ./node_modules/core-js/internals/well-known-symbol-wrapped.js ***!
  16022. \*********************************************************************/
  16023. /*! default exports */
  16024. /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
  16025. /*! other exports [not provided] [no usage info] */
  16026. /*! runtime requirements: __webpack_exports__, __webpack_require__ */
  16027. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  16028. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  16029. exports.f = wellKnownSymbol;
  16030. /***/ }),
  16031. /***/ "./node_modules/core-js/internals/well-known-symbol.js":
  16032. /*!*************************************************************!*\
  16033. !*** ./node_modules/core-js/internals/well-known-symbol.js ***!
  16034. \*************************************************************/
  16035. /*! unknown exports (runtime-defined) */
  16036. /*! runtime requirements: module, __webpack_require__ */
  16037. /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
  16038. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  16039. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  16040. var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
  16041. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  16042. var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
  16043. var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
  16044. var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
  16045. var WellKnownSymbolsStore = shared('wks');
  16046. var Symbol = global.Symbol;
  16047. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  16048. module.exports = function (name) {
  16049. if (!has(WellKnownSymbolsStore, name)) {
  16050. if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
  16051. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  16052. } return WellKnownSymbolsStore[name];
  16053. };
  16054. /***/ }),
  16055. /***/ "./node_modules/core-js/internals/whitespaces.js":
  16056. /*!*******************************************************!*\
  16057. !*** ./node_modules/core-js/internals/whitespaces.js ***!
  16058. \*******************************************************/
  16059. /*! unknown exports (runtime-defined) */
  16060. /*! runtime requirements: module */
  16061. /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
  16062. /***/ ((module) => {
  16063. // a string of all valid unicode whitespaces
  16064. // eslint-disable-next-line max-len
  16065. module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  16066. /***/ }),
  16067. /***/ "./node_modules/core-js/modules/es.array.concat.js":
  16068. /*!*********************************************************!*\
  16069. !*** ./node_modules/core-js/modules/es.array.concat.js ***!
  16070. \*********************************************************/
  16071. /*! unknown exports (runtime-defined) */
  16072. /*! runtime requirements: __webpack_require__ */
  16073. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16074. "use strict";
  16075. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16076. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  16077. var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
  16078. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  16079. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  16080. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  16081. var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
  16082. var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/core-js/internals/array-species-create.js");
  16083. var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
  16084. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  16085. var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
  16086. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  16087. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  16088. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  16089. // We can't use this feature detection in V8 since it causes
  16090. // deoptimization and serious performance degradation
  16091. // https://github.com/zloirock/core-js/issues/679
  16092. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  16093. var array = [];
  16094. array[IS_CONCAT_SPREADABLE] = false;
  16095. return array.concat()[0] !== array;
  16096. });
  16097. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  16098. var isConcatSpreadable = function (O) {
  16099. if (!isObject(O)) return false;
  16100. var spreadable = O[IS_CONCAT_SPREADABLE];
  16101. return spreadable !== undefined ? !!spreadable : isArray(O);
  16102. };
  16103. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  16104. // `Array.prototype.concat` method
  16105. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  16106. // with adding support of @@isConcatSpreadable and @@species
  16107. $({ target: 'Array', proto: true, forced: FORCED }, {
  16108. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  16109. var O = toObject(this);
  16110. var A = arraySpeciesCreate(O, 0);
  16111. var n = 0;
  16112. var i, k, length, len, E;
  16113. for (i = -1, length = arguments.length; i < length; i++) {
  16114. E = i === -1 ? O : arguments[i];
  16115. if (isConcatSpreadable(E)) {
  16116. len = toLength(E.length);
  16117. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  16118. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  16119. } else {
  16120. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  16121. createProperty(A, n++, E);
  16122. }
  16123. }
  16124. A.length = n;
  16125. return A;
  16126. }
  16127. });
  16128. /***/ }),
  16129. /***/ "./node_modules/core-js/modules/es.array.fill.js":
  16130. /*!*******************************************************!*\
  16131. !*** ./node_modules/core-js/modules/es.array.fill.js ***!
  16132. \*******************************************************/
  16133. /*! unknown exports (runtime-defined) */
  16134. /*! runtime requirements: __webpack_require__ */
  16135. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16136. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16137. var fill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
  16138. var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
  16139. // `Array.prototype.fill` method
  16140. // https://tc39.github.io/ecma262/#sec-array.prototype.fill
  16141. $({ target: 'Array', proto: true }, {
  16142. fill: fill
  16143. });
  16144. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  16145. addToUnscopables('fill');
  16146. /***/ }),
  16147. /***/ "./node_modules/core-js/modules/es.array.filter.js":
  16148. /*!*********************************************************!*\
  16149. !*** ./node_modules/core-js/modules/es.array.filter.js ***!
  16150. \*********************************************************/
  16151. /*! unknown exports (runtime-defined) */
  16152. /*! runtime requirements: __webpack_require__ */
  16153. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16154. "use strict";
  16155. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16156. var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").filter;
  16157. var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
  16158. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  16159. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  16160. // Edge 14- issue
  16161. var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
  16162. // `Array.prototype.filter` method
  16163. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  16164. // with adding support of @@species
  16165. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  16166. filter: function filter(callbackfn /* , thisArg */) {
  16167. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  16168. }
  16169. });
  16170. /***/ }),
  16171. /***/ "./node_modules/core-js/modules/es.array.find.js":
  16172. /*!*******************************************************!*\
  16173. !*** ./node_modules/core-js/modules/es.array.find.js ***!
  16174. \*******************************************************/
  16175. /*! unknown exports (runtime-defined) */
  16176. /*! runtime requirements: __webpack_require__ */
  16177. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16178. "use strict";
  16179. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16180. var $find = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").find;
  16181. var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
  16182. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  16183. var FIND = 'find';
  16184. var SKIPS_HOLES = true;
  16185. var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
  16186. // Shouldn't skip holes
  16187. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  16188. // `Array.prototype.find` method
  16189. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  16190. $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
  16191. find: function find(callbackfn /* , that = undefined */) {
  16192. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  16193. }
  16194. });
  16195. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  16196. addToUnscopables(FIND);
  16197. /***/ }),
  16198. /***/ "./node_modules/core-js/modules/es.array.iterator.js":
  16199. /*!***********************************************************!*\
  16200. !*** ./node_modules/core-js/modules/es.array.iterator.js ***!
  16201. \***********************************************************/
  16202. /*! unknown exports (runtime-defined) */
  16203. /*! runtime requirements: module, __webpack_require__ */
  16204. /*! CommonJS bailout: module.exports is used directly at 22:0-14 */
  16205. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  16206. "use strict";
  16207. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  16208. var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
  16209. var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
  16210. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  16211. var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
  16212. var ARRAY_ITERATOR = 'Array Iterator';
  16213. var setInternalState = InternalStateModule.set;
  16214. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  16215. // `Array.prototype.entries` method
  16216. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  16217. // `Array.prototype.keys` method
  16218. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  16219. // `Array.prototype.values` method
  16220. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  16221. // `Array.prototype[@@iterator]` method
  16222. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  16223. // `CreateArrayIterator` internal method
  16224. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  16225. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  16226. setInternalState(this, {
  16227. type: ARRAY_ITERATOR,
  16228. target: toIndexedObject(iterated), // target
  16229. index: 0, // next index
  16230. kind: kind // kind
  16231. });
  16232. // `%ArrayIteratorPrototype%.next` method
  16233. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  16234. }, function () {
  16235. var state = getInternalState(this);
  16236. var target = state.target;
  16237. var kind = state.kind;
  16238. var index = state.index++;
  16239. if (!target || index >= target.length) {
  16240. state.target = undefined;
  16241. return { value: undefined, done: true };
  16242. }
  16243. if (kind == 'keys') return { value: index, done: false };
  16244. if (kind == 'values') return { value: target[index], done: false };
  16245. return { value: [index, target[index]], done: false };
  16246. }, 'values');
  16247. // argumentsList[@@iterator] is %ArrayProto_values%
  16248. // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
  16249. // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
  16250. Iterators.Arguments = Iterators.Array;
  16251. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  16252. addToUnscopables('keys');
  16253. addToUnscopables('values');
  16254. addToUnscopables('entries');
  16255. /***/ }),
  16256. /***/ "./node_modules/core-js/modules/es.array.join.js":
  16257. /*!*******************************************************!*\
  16258. !*** ./node_modules/core-js/modules/es.array.join.js ***!
  16259. \*******************************************************/
  16260. /*! unknown exports (runtime-defined) */
  16261. /*! runtime requirements: __webpack_require__ */
  16262. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16263. "use strict";
  16264. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16265. var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
  16266. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  16267. var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
  16268. var nativeJoin = [].join;
  16269. var ES3_STRINGS = IndexedObject != Object;
  16270. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  16271. // `Array.prototype.join` method
  16272. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  16273. $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  16274. join: function join(separator) {
  16275. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  16276. }
  16277. });
  16278. /***/ }),
  16279. /***/ "./node_modules/core-js/modules/es.array.map.js":
  16280. /*!******************************************************!*\
  16281. !*** ./node_modules/core-js/modules/es.array.map.js ***!
  16282. \******************************************************/
  16283. /*! unknown exports (runtime-defined) */
  16284. /*! runtime requirements: __webpack_require__ */
  16285. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16286. "use strict";
  16287. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16288. var $map = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").map;
  16289. var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
  16290. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  16291. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  16292. // FF49- issue
  16293. var USES_TO_LENGTH = arrayMethodUsesToLength('map');
  16294. // `Array.prototype.map` method
  16295. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  16296. // with adding support of @@species
  16297. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  16298. map: function map(callbackfn /* , thisArg */) {
  16299. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  16300. }
  16301. });
  16302. /***/ }),
  16303. /***/ "./node_modules/core-js/modules/es.array.slice.js":
  16304. /*!********************************************************!*\
  16305. !*** ./node_modules/core-js/modules/es.array.slice.js ***!
  16306. \********************************************************/
  16307. /*! unknown exports (runtime-defined) */
  16308. /*! runtime requirements: __webpack_require__ */
  16309. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16310. "use strict";
  16311. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16312. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  16313. var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
  16314. var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
  16315. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  16316. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  16317. var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
  16318. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  16319. var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
  16320. var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
  16321. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  16322. var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
  16323. var SPECIES = wellKnownSymbol('species');
  16324. var nativeSlice = [].slice;
  16325. var max = Math.max;
  16326. // `Array.prototype.slice` method
  16327. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  16328. // fallback for not array-like ES3 strings and DOM objects
  16329. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  16330. slice: function slice(start, end) {
  16331. var O = toIndexedObject(this);
  16332. var length = toLength(O.length);
  16333. var k = toAbsoluteIndex(start, length);
  16334. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  16335. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  16336. var Constructor, result, n;
  16337. if (isArray(O)) {
  16338. Constructor = O.constructor;
  16339. // cross-realm fallback
  16340. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  16341. Constructor = undefined;
  16342. } else if (isObject(Constructor)) {
  16343. Constructor = Constructor[SPECIES];
  16344. if (Constructor === null) Constructor = undefined;
  16345. }
  16346. if (Constructor === Array || Constructor === undefined) {
  16347. return nativeSlice.call(O, k, fin);
  16348. }
  16349. }
  16350. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  16351. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  16352. result.length = n;
  16353. return result;
  16354. }
  16355. });
  16356. /***/ }),
  16357. /***/ "./node_modules/core-js/modules/es.map.js":
  16358. /*!************************************************!*\
  16359. !*** ./node_modules/core-js/modules/es.map.js ***!
  16360. \************************************************/
  16361. /*! unknown exports (runtime-defined) */
  16362. /*! runtime requirements: module, __webpack_require__ */
  16363. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  16364. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  16365. "use strict";
  16366. var collection = __webpack_require__(/*! ../internals/collection */ "./node_modules/core-js/internals/collection.js");
  16367. var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "./node_modules/core-js/internals/collection-strong.js");
  16368. // `Map` constructor
  16369. // https://tc39.github.io/ecma262/#sec-map-objects
  16370. module.exports = collection('Map', function (init) {
  16371. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  16372. }, collectionStrong);
  16373. /***/ }),
  16374. /***/ "./node_modules/core-js/modules/es.number.constructor.js":
  16375. /*!***************************************************************!*\
  16376. !*** ./node_modules/core-js/modules/es.number.constructor.js ***!
  16377. \***************************************************************/
  16378. /*! unknown exports (runtime-defined) */
  16379. /*! runtime requirements: __webpack_require__ */
  16380. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16381. "use strict";
  16382. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  16383. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  16384. var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
  16385. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  16386. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  16387. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  16388. var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
  16389. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  16390. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  16391. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  16392. var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
  16393. var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
  16394. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  16395. var trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim;
  16396. var NUMBER = 'Number';
  16397. var NativeNumber = global[NUMBER];
  16398. var NumberPrototype = NativeNumber.prototype;
  16399. // Opera ~12 has broken Object#toString
  16400. var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
  16401. // `ToNumber` abstract operation
  16402. // https://tc39.github.io/ecma262/#sec-tonumber
  16403. var toNumber = function (argument) {
  16404. var it = toPrimitive(argument, false);
  16405. var first, third, radix, maxCode, digits, length, index, code;
  16406. if (typeof it == 'string' && it.length > 2) {
  16407. it = trim(it);
  16408. first = it.charCodeAt(0);
  16409. if (first === 43 || first === 45) {
  16410. third = it.charCodeAt(2);
  16411. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  16412. } else if (first === 48) {
  16413. switch (it.charCodeAt(1)) {
  16414. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  16415. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  16416. default: return +it;
  16417. }
  16418. digits = it.slice(2);
  16419. length = digits.length;
  16420. for (index = 0; index < length; index++) {
  16421. code = digits.charCodeAt(index);
  16422. // parseInt parses a string to a first unavailable symbol
  16423. // but ToNumber should return NaN if a string contains unavailable symbols
  16424. if (code < 48 || code > maxCode) return NaN;
  16425. } return parseInt(digits, radix);
  16426. }
  16427. } return +it;
  16428. };
  16429. // `Number` constructor
  16430. // https://tc39.github.io/ecma262/#sec-number-constructor
  16431. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  16432. var NumberWrapper = function Number(value) {
  16433. var it = arguments.length < 1 ? 0 : value;
  16434. var dummy = this;
  16435. return dummy instanceof NumberWrapper
  16436. // check on 1..constructor(foo) case
  16437. && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
  16438. ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
  16439. };
  16440. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  16441. // ES3:
  16442. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  16443. // ES2015 (in case, if modules with ES2015 Number statics required before):
  16444. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  16445. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  16446. ).split(','), j = 0, key; keys.length > j; j++) {
  16447. if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
  16448. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  16449. }
  16450. }
  16451. NumberWrapper.prototype = NumberPrototype;
  16452. NumberPrototype.constructor = NumberWrapper;
  16453. redefine(global, NUMBER, NumberWrapper);
  16454. }
  16455. /***/ }),
  16456. /***/ "./node_modules/core-js/modules/es.number.to-fixed.js":
  16457. /*!************************************************************!*\
  16458. !*** ./node_modules/core-js/modules/es.number.to-fixed.js ***!
  16459. \************************************************************/
  16460. /*! unknown exports (runtime-defined) */
  16461. /*! runtime requirements: __webpack_require__ */
  16462. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16463. "use strict";
  16464. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16465. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  16466. var thisNumberValue = __webpack_require__(/*! ../internals/this-number-value */ "./node_modules/core-js/internals/this-number-value.js");
  16467. var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
  16468. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  16469. var nativeToFixed = 1.0.toFixed;
  16470. var floor = Math.floor;
  16471. var pow = function (x, n, acc) {
  16472. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  16473. };
  16474. var log = function (x) {
  16475. var n = 0;
  16476. var x2 = x;
  16477. while (x2 >= 4096) {
  16478. n += 12;
  16479. x2 /= 4096;
  16480. }
  16481. while (x2 >= 2) {
  16482. n += 1;
  16483. x2 /= 2;
  16484. } return n;
  16485. };
  16486. var FORCED = nativeToFixed && (
  16487. 0.00008.toFixed(3) !== '0.000' ||
  16488. 0.9.toFixed(0) !== '1' ||
  16489. 1.255.toFixed(2) !== '1.25' ||
  16490. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  16491. ) || !fails(function () {
  16492. // V8 ~ Android 4.3-
  16493. nativeToFixed.call({});
  16494. });
  16495. // `Number.prototype.toFixed` method
  16496. // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
  16497. $({ target: 'Number', proto: true, forced: FORCED }, {
  16498. // eslint-disable-next-line max-statements
  16499. toFixed: function toFixed(fractionDigits) {
  16500. var number = thisNumberValue(this);
  16501. var fractDigits = toInteger(fractionDigits);
  16502. var data = [0, 0, 0, 0, 0, 0];
  16503. var sign = '';
  16504. var result = '0';
  16505. var e, z, j, k;
  16506. var multiply = function (n, c) {
  16507. var index = -1;
  16508. var c2 = c;
  16509. while (++index < 6) {
  16510. c2 += n * data[index];
  16511. data[index] = c2 % 1e7;
  16512. c2 = floor(c2 / 1e7);
  16513. }
  16514. };
  16515. var divide = function (n) {
  16516. var index = 6;
  16517. var c = 0;
  16518. while (--index >= 0) {
  16519. c += data[index];
  16520. data[index] = floor(c / n);
  16521. c = (c % n) * 1e7;
  16522. }
  16523. };
  16524. var dataToString = function () {
  16525. var index = 6;
  16526. var s = '';
  16527. while (--index >= 0) {
  16528. if (s !== '' || index === 0 || data[index] !== 0) {
  16529. var t = String(data[index]);
  16530. s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
  16531. }
  16532. } return s;
  16533. };
  16534. if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
  16535. // eslint-disable-next-line no-self-compare
  16536. if (number != number) return 'NaN';
  16537. if (number <= -1e21 || number >= 1e21) return String(number);
  16538. if (number < 0) {
  16539. sign = '-';
  16540. number = -number;
  16541. }
  16542. if (number > 1e-21) {
  16543. e = log(number * pow(2, 69, 1)) - 69;
  16544. z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
  16545. z *= 0x10000000000000;
  16546. e = 52 - e;
  16547. if (e > 0) {
  16548. multiply(0, z);
  16549. j = fractDigits;
  16550. while (j >= 7) {
  16551. multiply(1e7, 0);
  16552. j -= 7;
  16553. }
  16554. multiply(pow(10, j, 1), 0);
  16555. j = e - 1;
  16556. while (j >= 23) {
  16557. divide(1 << 23);
  16558. j -= 23;
  16559. }
  16560. divide(1 << j);
  16561. multiply(1, 1);
  16562. divide(2);
  16563. result = dataToString();
  16564. } else {
  16565. multiply(0, z);
  16566. multiply(1 << -e, 0);
  16567. result = dataToString() + repeat.call('0', fractDigits);
  16568. }
  16569. }
  16570. if (fractDigits > 0) {
  16571. k = result.length;
  16572. result = sign + (k <= fractDigits
  16573. ? '0.' + repeat.call('0', fractDigits - k) + result
  16574. : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
  16575. } else {
  16576. result = sign + result;
  16577. } return result;
  16578. }
  16579. });
  16580. /***/ }),
  16581. /***/ "./node_modules/core-js/modules/es.object.assign.js":
  16582. /*!**********************************************************!*\
  16583. !*** ./node_modules/core-js/modules/es.object.assign.js ***!
  16584. \**********************************************************/
  16585. /*! unknown exports (runtime-defined) */
  16586. /*! runtime requirements: __webpack_require__ */
  16587. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16588. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16589. var assign = __webpack_require__(/*! ../internals/object-assign */ "./node_modules/core-js/internals/object-assign.js");
  16590. // `Object.assign` method
  16591. // https://tc39.github.io/ecma262/#sec-object.assign
  16592. $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
  16593. assign: assign
  16594. });
  16595. /***/ }),
  16596. /***/ "./node_modules/core-js/modules/es.object.entries.js":
  16597. /*!***********************************************************!*\
  16598. !*** ./node_modules/core-js/modules/es.object.entries.js ***!
  16599. \***********************************************************/
  16600. /*! unknown exports (runtime-defined) */
  16601. /*! runtime requirements: __webpack_require__ */
  16602. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16603. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16604. var $entries = __webpack_require__(/*! ../internals/object-to-array */ "./node_modules/core-js/internals/object-to-array.js").entries;
  16605. // `Object.entries` method
  16606. // https://tc39.github.io/ecma262/#sec-object.entries
  16607. $({ target: 'Object', stat: true }, {
  16608. entries: function entries(O) {
  16609. return $entries(O);
  16610. }
  16611. });
  16612. /***/ }),
  16613. /***/ "./node_modules/core-js/modules/es.object.get-prototype-of.js":
  16614. /*!********************************************************************!*\
  16615. !*** ./node_modules/core-js/modules/es.object.get-prototype-of.js ***!
  16616. \********************************************************************/
  16617. /*! unknown exports (runtime-defined) */
  16618. /*! runtime requirements: __webpack_require__ */
  16619. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16620. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16621. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  16622. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  16623. var nativeGetPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
  16624. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/core-js/internals/correct-prototype-getter.js");
  16625. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
  16626. // `Object.getPrototypeOf` method
  16627. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  16628. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
  16629. getPrototypeOf: function getPrototypeOf(it) {
  16630. return nativeGetPrototypeOf(toObject(it));
  16631. }
  16632. });
  16633. /***/ }),
  16634. /***/ "./node_modules/core-js/modules/es.object.keys.js":
  16635. /*!********************************************************!*\
  16636. !*** ./node_modules/core-js/modules/es.object.keys.js ***!
  16637. \********************************************************/
  16638. /*! unknown exports (runtime-defined) */
  16639. /*! runtime requirements: __webpack_require__ */
  16640. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16641. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16642. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  16643. var nativeKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
  16644. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  16645. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  16646. // `Object.keys` method
  16647. // https://tc39.github.io/ecma262/#sec-object.keys
  16648. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  16649. keys: function keys(it) {
  16650. return nativeKeys(toObject(it));
  16651. }
  16652. });
  16653. /***/ }),
  16654. /***/ "./node_modules/core-js/modules/es.object.to-string.js":
  16655. /*!*************************************************************!*\
  16656. !*** ./node_modules/core-js/modules/es.object.to-string.js ***!
  16657. \*************************************************************/
  16658. /*! unknown exports (runtime-defined) */
  16659. /*! runtime requirements: __webpack_require__ */
  16660. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16661. var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
  16662. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  16663. var toString = __webpack_require__(/*! ../internals/object-to-string */ "./node_modules/core-js/internals/object-to-string.js");
  16664. // `Object.prototype.toString` method
  16665. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  16666. if (!TO_STRING_TAG_SUPPORT) {
  16667. redefine(Object.prototype, 'toString', toString, { unsafe: true });
  16668. }
  16669. /***/ }),
  16670. /***/ "./node_modules/core-js/modules/es.promise.js":
  16671. /*!****************************************************!*\
  16672. !*** ./node_modules/core-js/modules/es.promise.js ***!
  16673. \****************************************************/
  16674. /*! unknown exports (runtime-defined) */
  16675. /*! runtime requirements: __webpack_require__ */
  16676. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  16677. "use strict";
  16678. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  16679. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  16680. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  16681. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  16682. var NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ "./node_modules/core-js/internals/native-promise-constructor.js");
  16683. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  16684. var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
  16685. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  16686. var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
  16687. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  16688. var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
  16689. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  16690. var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
  16691. var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
  16692. var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
  16693. var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
  16694. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  16695. var task = __webpack_require__(/*! ../internals/task */ "./node_modules/core-js/internals/task.js").set;
  16696. var microtask = __webpack_require__(/*! ../internals/microtask */ "./node_modules/core-js/internals/microtask.js");
  16697. var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "./node_modules/core-js/internals/promise-resolve.js");
  16698. var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "./node_modules/core-js/internals/host-report-errors.js");
  16699. var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/core-js/internals/new-promise-capability.js");
  16700. var perform = __webpack_require__(/*! ../internals/perform */ "./node_modules/core-js/internals/perform.js");
  16701. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  16702. var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
  16703. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  16704. var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
  16705. var SPECIES = wellKnownSymbol('species');
  16706. var PROMISE = 'Promise';
  16707. var getInternalState = InternalStateModule.get;
  16708. var setInternalState = InternalStateModule.set;
  16709. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  16710. var PromiseConstructor = NativePromise;
  16711. var TypeError = global.TypeError;
  16712. var document = global.document;
  16713. var process = global.process;
  16714. var $fetch = getBuiltIn('fetch');
  16715. var newPromiseCapability = newPromiseCapabilityModule.f;
  16716. var newGenericPromiseCapability = newPromiseCapability;
  16717. var IS_NODE = classof(process) == 'process';
  16718. var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
  16719. var UNHANDLED_REJECTION = 'unhandledrejection';
  16720. var REJECTION_HANDLED = 'rejectionhandled';
  16721. var PENDING = 0;
  16722. var FULFILLED = 1;
  16723. var REJECTED = 2;
  16724. var HANDLED = 1;
  16725. var UNHANDLED = 2;
  16726. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  16727. var FORCED = isForced(PROMISE, function () {
  16728. var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
  16729. if (!GLOBAL_CORE_JS_PROMISE) {
  16730. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  16731. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  16732. // We can't detect it synchronously, so just check versions
  16733. if (V8_VERSION === 66) return true;
  16734. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  16735. if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
  16736. }
  16737. // We need Promise#finally in the pure version for preventing prototype pollution
  16738. if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
  16739. // We can't use @@species feature detection in V8 since it causes
  16740. // deoptimization and performance degradation
  16741. // https://github.com/zloirock/core-js/issues/679
  16742. if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
  16743. // Detect correctness of subclassing with @@species support
  16744. var promise = PromiseConstructor.resolve(1);
  16745. var FakePromise = function (exec) {
  16746. exec(function () { /* empty */ }, function () { /* empty */ });
  16747. };
  16748. var constructor = promise.constructor = {};
  16749. constructor[SPECIES] = FakePromise;
  16750. return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
  16751. });
  16752. var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
  16753. PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
  16754. });
  16755. // helpers
  16756. var isThenable = function (it) {
  16757. var then;
  16758. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  16759. };
  16760. var notify = function (promise, state, isReject) {
  16761. if (state.notified) return;
  16762. state.notified = true;
  16763. var chain = state.reactions;
  16764. microtask(function () {
  16765. var value = state.value;
  16766. var ok = state.state == FULFILLED;
  16767. var index = 0;
  16768. // variable length - can't use forEach
  16769. while (chain.length > index) {
  16770. var reaction = chain[index++];
  16771. var handler = ok ? reaction.ok : reaction.fail;
  16772. var resolve = reaction.resolve;
  16773. var reject = reaction.reject;
  16774. var domain = reaction.domain;
  16775. var result, then, exited;
  16776. try {
  16777. if (handler) {
  16778. if (!ok) {
  16779. if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
  16780. state.rejection = HANDLED;
  16781. }
  16782. if (handler === true) result = value;
  16783. else {
  16784. if (domain) domain.enter();
  16785. result = handler(value); // can throw
  16786. if (domain) {
  16787. domain.exit();
  16788. exited = true;
  16789. }
  16790. }
  16791. if (result === reaction.promise) {
  16792. reject(TypeError('Promise-chain cycle'));
  16793. } else if (then = isThenable(result)) {
  16794. then.call(result, resolve, reject);
  16795. } else resolve(result);
  16796. } else reject(value);
  16797. } catch (error) {
  16798. if (domain && !exited) domain.exit();
  16799. reject(error);
  16800. }
  16801. }
  16802. state.reactions = [];
  16803. state.notified = false;
  16804. if (isReject && !state.rejection) onUnhandled(promise, state);
  16805. });
  16806. };
  16807. var dispatchEvent = function (name, promise, reason) {
  16808. var event, handler;
  16809. if (DISPATCH_EVENT) {
  16810. event = document.createEvent('Event');
  16811. event.promise = promise;
  16812. event.reason = reason;
  16813. event.initEvent(name, false, true);
  16814. global.dispatchEvent(event);
  16815. } else event = { promise: promise, reason: reason };
  16816. if (handler = global['on' + name]) handler(event);
  16817. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  16818. };
  16819. var onUnhandled = function (promise, state) {
  16820. task.call(global, function () {
  16821. var value = state.value;
  16822. var IS_UNHANDLED = isUnhandled(state);
  16823. var result;
  16824. if (IS_UNHANDLED) {
  16825. result = perform(function () {
  16826. if (IS_NODE) {
  16827. process.emit('unhandledRejection', value, promise);
  16828. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  16829. });
  16830. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  16831. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  16832. if (result.error) throw result.value;
  16833. }
  16834. });
  16835. };
  16836. var isUnhandled = function (state) {
  16837. return state.rejection !== HANDLED && !state.parent;
  16838. };
  16839. var onHandleUnhandled = function (promise, state) {
  16840. task.call(global, function () {
  16841. if (IS_NODE) {
  16842. process.emit('rejectionHandled', promise);
  16843. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  16844. });
  16845. };
  16846. var bind = function (fn, promise, state, unwrap) {
  16847. return function (value) {
  16848. fn(promise, state, value, unwrap);
  16849. };
  16850. };
  16851. var internalReject = function (promise, state, value, unwrap) {
  16852. if (state.done) return;
  16853. state.done = true;
  16854. if (unwrap) state = unwrap;
  16855. state.value = value;
  16856. state.state = REJECTED;
  16857. notify(promise, state, true);
  16858. };
  16859. var internalResolve = function (promise, state, value, unwrap) {
  16860. if (state.done) return;
  16861. state.done = true;
  16862. if (unwrap) state = unwrap;
  16863. try {
  16864. if (promise === value) throw TypeError("Promise can't be resolved itself");
  16865. var then = isThenable(value);
  16866. if (then) {
  16867. microtask(function () {
  16868. var wrapper = { done: false };
  16869. try {
  16870. then.call(value,
  16871. bind(internalResolve, promise, wrapper, state),
  16872. bind(internalReject, promise, wrapper, state)
  16873. );
  16874. } catch (error) {
  16875. internalReject(promise, wrapper, error, state);
  16876. }
  16877. });
  16878. } else {
  16879. state.value = value;
  16880. state.state = FULFILLED;
  16881. notify(promise, state, false);
  16882. }
  16883. } catch (error) {
  16884. internalReject(promise, { done: false }, error, state);
  16885. }
  16886. };
  16887. // constructor polyfill
  16888. if (FORCED) {
  16889. // 25.4.3.1 Promise(executor)
  16890. PromiseConstructor = function Promise(executor) {
  16891. anInstance(this, PromiseConstructor, PROMISE);
  16892. aFunction(executor);
  16893. Internal.call(this);
  16894. var state = getInternalState(this);
  16895. try {
  16896. executor(bind(internalResolve, this, state), bind(internalReject, this, state));
  16897. } catch (error) {
  16898. internalReject(this, state, error);
  16899. }
  16900. };
  16901. // eslint-disable-next-line no-unused-vars
  16902. Internal = function Promise(executor) {
  16903. setInternalState(this, {
  16904. type: PROMISE,
  16905. done: false,
  16906. notified: false,
  16907. parent: false,
  16908. reactions: [],
  16909. rejection: false,
  16910. state: PENDING,
  16911. value: undefined
  16912. });
  16913. };
  16914. Internal.prototype = redefineAll(PromiseConstructor.prototype, {
  16915. // `Promise.prototype.then` method
  16916. // https://tc39.github.io/ecma262/#sec-promise.prototype.then
  16917. then: function then(onFulfilled, onRejected) {
  16918. var state = getInternalPromiseState(this);
  16919. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  16920. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  16921. reaction.fail = typeof onRejected == 'function' && onRejected;
  16922. reaction.domain = IS_NODE ? process.domain : undefined;
  16923. state.parent = true;
  16924. state.reactions.push(reaction);
  16925. if (state.state != PENDING) notify(this, state, false);
  16926. return reaction.promise;
  16927. },
  16928. // `Promise.prototype.catch` method
  16929. // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
  16930. 'catch': function (onRejected) {
  16931. return this.then(undefined, onRejected);
  16932. }
  16933. });
  16934. OwnPromiseCapability = function () {
  16935. var promise = new Internal();
  16936. var state = getInternalState(promise);
  16937. this.promise = promise;
  16938. this.resolve = bind(internalResolve, promise, state);
  16939. this.reject = bind(internalReject, promise, state);
  16940. };
  16941. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  16942. return C === PromiseConstructor || C === PromiseWrapper
  16943. ? new OwnPromiseCapability(C)
  16944. : newGenericPromiseCapability(C);
  16945. };
  16946. if (!IS_PURE && typeof NativePromise == 'function') {
  16947. nativeThen = NativePromise.prototype.then;
  16948. // wrap native Promise#then for native async functions
  16949. redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
  16950. var that = this;
  16951. return new PromiseConstructor(function (resolve, reject) {
  16952. nativeThen.call(that, resolve, reject);
  16953. }).then(onFulfilled, onRejected);
  16954. // https://github.com/zloirock/core-js/issues/640
  16955. }, { unsafe: true });
  16956. // wrap fetch result
  16957. if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
  16958. // eslint-disable-next-line no-unused-vars
  16959. fetch: function fetch(input /* , init */) {
  16960. return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
  16961. }
  16962. });
  16963. }
  16964. }
  16965. $({ global: true, wrap: true, forced: FORCED }, {
  16966. Promise: PromiseConstructor
  16967. });
  16968. setToStringTag(PromiseConstructor, PROMISE, false, true);
  16969. setSpecies(PROMISE);
  16970. PromiseWrapper = getBuiltIn(PROMISE);
  16971. // statics
  16972. $({ target: PROMISE, stat: true, forced: FORCED }, {
  16973. // `Promise.reject` method
  16974. // https://tc39.github.io/ecma262/#sec-promise.reject
  16975. reject: function reject(r) {
  16976. var capability = newPromiseCapability(this);
  16977. capability.reject.call(undefined, r);
  16978. return capability.promise;
  16979. }
  16980. });
  16981. $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
  16982. // `Promise.resolve` method
  16983. // https://tc39.github.io/ecma262/#sec-promise.resolve
  16984. resolve: function resolve(x) {
  16985. return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
  16986. }
  16987. });
  16988. $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
  16989. // `Promise.all` method
  16990. // https://tc39.github.io/ecma262/#sec-promise.all
  16991. all: function all(iterable) {
  16992. var C = this;
  16993. var capability = newPromiseCapability(C);
  16994. var resolve = capability.resolve;
  16995. var reject = capability.reject;
  16996. var result = perform(function () {
  16997. var $promiseResolve = aFunction(C.resolve);
  16998. var values = [];
  16999. var counter = 0;
  17000. var remaining = 1;
  17001. iterate(iterable, function (promise) {
  17002. var index = counter++;
  17003. var alreadyCalled = false;
  17004. values.push(undefined);
  17005. remaining++;
  17006. $promiseResolve.call(C, promise).then(function (value) {
  17007. if (alreadyCalled) return;
  17008. alreadyCalled = true;
  17009. values[index] = value;
  17010. --remaining || resolve(values);
  17011. }, reject);
  17012. });
  17013. --remaining || resolve(values);
  17014. });
  17015. if (result.error) reject(result.value);
  17016. return capability.promise;
  17017. },
  17018. // `Promise.race` method
  17019. // https://tc39.github.io/ecma262/#sec-promise.race
  17020. race: function race(iterable) {
  17021. var C = this;
  17022. var capability = newPromiseCapability(C);
  17023. var reject = capability.reject;
  17024. var result = perform(function () {
  17025. var $promiseResolve = aFunction(C.resolve);
  17026. iterate(iterable, function (promise) {
  17027. $promiseResolve.call(C, promise).then(capability.resolve, reject);
  17028. });
  17029. });
  17030. if (result.error) reject(result.value);
  17031. return capability.promise;
  17032. }
  17033. });
  17034. /***/ }),
  17035. /***/ "./node_modules/core-js/modules/es.regexp.exec.js":
  17036. /*!********************************************************!*\
  17037. !*** ./node_modules/core-js/modules/es.regexp.exec.js ***!
  17038. \********************************************************/
  17039. /*! unknown exports (runtime-defined) */
  17040. /*! runtime requirements: __webpack_require__ */
  17041. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17042. "use strict";
  17043. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17044. var exec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
  17045. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  17046. exec: exec
  17047. });
  17048. /***/ }),
  17049. /***/ "./node_modules/core-js/modules/es.regexp.to-string.js":
  17050. /*!*************************************************************!*\
  17051. !*** ./node_modules/core-js/modules/es.regexp.to-string.js ***!
  17052. \*************************************************************/
  17053. /*! unknown exports (runtime-defined) */
  17054. /*! runtime requirements: __webpack_require__ */
  17055. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17056. "use strict";
  17057. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  17058. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  17059. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  17060. var flags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");
  17061. var TO_STRING = 'toString';
  17062. var RegExpPrototype = RegExp.prototype;
  17063. var nativeToString = RegExpPrototype[TO_STRING];
  17064. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  17065. // FF44- RegExp#toString has a wrong name
  17066. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  17067. // `RegExp.prototype.toString` method
  17068. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  17069. if (NOT_GENERIC || INCORRECT_NAME) {
  17070. redefine(RegExp.prototype, TO_STRING, function toString() {
  17071. var R = anObject(this);
  17072. var p = String(R.source);
  17073. var rf = R.flags;
  17074. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
  17075. return '/' + p + '/' + f;
  17076. }, { unsafe: true });
  17077. }
  17078. /***/ }),
  17079. /***/ "./node_modules/core-js/modules/es.set.js":
  17080. /*!************************************************!*\
  17081. !*** ./node_modules/core-js/modules/es.set.js ***!
  17082. \************************************************/
  17083. /*! unknown exports (runtime-defined) */
  17084. /*! runtime requirements: module, __webpack_require__ */
  17085. /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
  17086. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  17087. "use strict";
  17088. var collection = __webpack_require__(/*! ../internals/collection */ "./node_modules/core-js/internals/collection.js");
  17089. var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "./node_modules/core-js/internals/collection-strong.js");
  17090. // `Set` constructor
  17091. // https://tc39.github.io/ecma262/#sec-set-objects
  17092. module.exports = collection('Set', function (init) {
  17093. return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
  17094. }, collectionStrong);
  17095. /***/ }),
  17096. /***/ "./node_modules/core-js/modules/es.string.iterator.js":
  17097. /*!************************************************************!*\
  17098. !*** ./node_modules/core-js/modules/es.string.iterator.js ***!
  17099. \************************************************************/
  17100. /*! unknown exports (runtime-defined) */
  17101. /*! runtime requirements: __webpack_require__ */
  17102. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17103. "use strict";
  17104. var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").charAt;
  17105. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  17106. var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
  17107. var STRING_ITERATOR = 'String Iterator';
  17108. var setInternalState = InternalStateModule.set;
  17109. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  17110. // `String.prototype[@@iterator]` method
  17111. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  17112. defineIterator(String, 'String', function (iterated) {
  17113. setInternalState(this, {
  17114. type: STRING_ITERATOR,
  17115. string: String(iterated),
  17116. index: 0
  17117. });
  17118. // `%StringIteratorPrototype%.next` method
  17119. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  17120. }, function next() {
  17121. var state = getInternalState(this);
  17122. var string = state.string;
  17123. var index = state.index;
  17124. var point;
  17125. if (index >= string.length) return { value: undefined, done: true };
  17126. point = charAt(string, index);
  17127. state.index += point.length;
  17128. return { value: point, done: false };
  17129. });
  17130. /***/ }),
  17131. /***/ "./node_modules/core-js/modules/es.string.match.js":
  17132. /*!*********************************************************!*\
  17133. !*** ./node_modules/core-js/modules/es.string.match.js ***!
  17134. \*********************************************************/
  17135. /*! unknown exports (runtime-defined) */
  17136. /*! runtime requirements: __webpack_require__ */
  17137. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17138. "use strict";
  17139. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  17140. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  17141. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  17142. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  17143. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
  17144. var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
  17145. // @@match logic
  17146. fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  17147. return [
  17148. // `String.prototype.match` method
  17149. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  17150. function match(regexp) {
  17151. var O = requireObjectCoercible(this);
  17152. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  17153. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  17154. },
  17155. // `RegExp.prototype[@@match]` method
  17156. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  17157. function (regexp) {
  17158. var res = maybeCallNative(nativeMatch, regexp, this);
  17159. if (res.done) return res.value;
  17160. var rx = anObject(regexp);
  17161. var S = String(this);
  17162. if (!rx.global) return regExpExec(rx, S);
  17163. var fullUnicode = rx.unicode;
  17164. rx.lastIndex = 0;
  17165. var A = [];
  17166. var n = 0;
  17167. var result;
  17168. while ((result = regExpExec(rx, S)) !== null) {
  17169. var matchStr = String(result[0]);
  17170. A[n] = matchStr;
  17171. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  17172. n++;
  17173. }
  17174. return n === 0 ? null : A;
  17175. }
  17176. ];
  17177. });
  17178. /***/ }),
  17179. /***/ "./node_modules/core-js/modules/es.string.pad-start.js":
  17180. /*!*************************************************************!*\
  17181. !*** ./node_modules/core-js/modules/es.string.pad-start.js ***!
  17182. \*************************************************************/
  17183. /*! unknown exports (runtime-defined) */
  17184. /*! runtime requirements: __webpack_require__ */
  17185. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17186. "use strict";
  17187. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17188. var $padStart = __webpack_require__(/*! ../internals/string-pad */ "./node_modules/core-js/internals/string-pad.js").start;
  17189. var WEBKIT_BUG = __webpack_require__(/*! ../internals/string-pad-webkit-bug */ "./node_modules/core-js/internals/string-pad-webkit-bug.js");
  17190. // `String.prototype.padStart` method
  17191. // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
  17192. $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  17193. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  17194. return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  17195. }
  17196. });
  17197. /***/ }),
  17198. /***/ "./node_modules/core-js/modules/es.string.repeat.js":
  17199. /*!**********************************************************!*\
  17200. !*** ./node_modules/core-js/modules/es.string.repeat.js ***!
  17201. \**********************************************************/
  17202. /*! unknown exports (runtime-defined) */
  17203. /*! runtime requirements: __webpack_require__ */
  17204. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17205. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17206. var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
  17207. // `String.prototype.repeat` method
  17208. // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
  17209. $({ target: 'String', proto: true }, {
  17210. repeat: repeat
  17211. });
  17212. /***/ }),
  17213. /***/ "./node_modules/core-js/modules/es.string.replace.js":
  17214. /*!***********************************************************!*\
  17215. !*** ./node_modules/core-js/modules/es.string.replace.js ***!
  17216. \***********************************************************/
  17217. /*! unknown exports (runtime-defined) */
  17218. /*! runtime requirements: __webpack_require__ */
  17219. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17220. "use strict";
  17221. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  17222. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  17223. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  17224. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  17225. var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
  17226. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  17227. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
  17228. var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
  17229. var max = Math.max;
  17230. var min = Math.min;
  17231. var floor = Math.floor;
  17232. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  17233. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  17234. var maybeToString = function (it) {
  17235. return it === undefined ? it : String(it);
  17236. };
  17237. // @@replace logic
  17238. fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  17239. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  17240. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  17241. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  17242. return [
  17243. // `String.prototype.replace` method
  17244. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  17245. function replace(searchValue, replaceValue) {
  17246. var O = requireObjectCoercible(this);
  17247. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  17248. return replacer !== undefined
  17249. ? replacer.call(searchValue, O, replaceValue)
  17250. : nativeReplace.call(String(O), searchValue, replaceValue);
  17251. },
  17252. // `RegExp.prototype[@@replace]` method
  17253. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  17254. function (regexp, replaceValue) {
  17255. if (
  17256. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  17257. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  17258. ) {
  17259. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  17260. if (res.done) return res.value;
  17261. }
  17262. var rx = anObject(regexp);
  17263. var S = String(this);
  17264. var functionalReplace = typeof replaceValue === 'function';
  17265. if (!functionalReplace) replaceValue = String(replaceValue);
  17266. var global = rx.global;
  17267. if (global) {
  17268. var fullUnicode = rx.unicode;
  17269. rx.lastIndex = 0;
  17270. }
  17271. var results = [];
  17272. while (true) {
  17273. var result = regExpExec(rx, S);
  17274. if (result === null) break;
  17275. results.push(result);
  17276. if (!global) break;
  17277. var matchStr = String(result[0]);
  17278. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  17279. }
  17280. var accumulatedResult = '';
  17281. var nextSourcePosition = 0;
  17282. for (var i = 0; i < results.length; i++) {
  17283. result = results[i];
  17284. var matched = String(result[0]);
  17285. var position = max(min(toInteger(result.index), S.length), 0);
  17286. var captures = [];
  17287. // NOTE: This is equivalent to
  17288. // captures = result.slice(1).map(maybeToString)
  17289. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  17290. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  17291. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  17292. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  17293. var namedCaptures = result.groups;
  17294. if (functionalReplace) {
  17295. var replacerArgs = [matched].concat(captures, position, S);
  17296. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  17297. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  17298. } else {
  17299. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  17300. }
  17301. if (position >= nextSourcePosition) {
  17302. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  17303. nextSourcePosition = position + matched.length;
  17304. }
  17305. }
  17306. return accumulatedResult + S.slice(nextSourcePosition);
  17307. }
  17308. ];
  17309. // https://tc39.github.io/ecma262/#sec-getsubstitution
  17310. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  17311. var tailPos = position + matched.length;
  17312. var m = captures.length;
  17313. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  17314. if (namedCaptures !== undefined) {
  17315. namedCaptures = toObject(namedCaptures);
  17316. symbols = SUBSTITUTION_SYMBOLS;
  17317. }
  17318. return nativeReplace.call(replacement, symbols, function (match, ch) {
  17319. var capture;
  17320. switch (ch.charAt(0)) {
  17321. case '$': return '$';
  17322. case '&': return matched;
  17323. case '`': return str.slice(0, position);
  17324. case "'": return str.slice(tailPos);
  17325. case '<':
  17326. capture = namedCaptures[ch.slice(1, -1)];
  17327. break;
  17328. default: // \d\d?
  17329. var n = +ch;
  17330. if (n === 0) return match;
  17331. if (n > m) {
  17332. var f = floor(n / 10);
  17333. if (f === 0) return match;
  17334. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  17335. return match;
  17336. }
  17337. capture = captures[n - 1];
  17338. }
  17339. return capture === undefined ? '' : capture;
  17340. });
  17341. }
  17342. });
  17343. /***/ }),
  17344. /***/ "./node_modules/core-js/modules/es.string.split.js":
  17345. /*!*********************************************************!*\
  17346. !*** ./node_modules/core-js/modules/es.string.split.js ***!
  17347. \*********************************************************/
  17348. /*! unknown exports (runtime-defined) */
  17349. /*! runtime requirements: __webpack_require__ */
  17350. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17351. "use strict";
  17352. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  17353. var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/core-js/internals/is-regexp.js");
  17354. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  17355. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
  17356. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  17357. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
  17358. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  17359. var callRegExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
  17360. var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
  17361. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  17362. var arrayPush = [].push;
  17363. var min = Math.min;
  17364. var MAX_UINT32 = 0xFFFFFFFF;
  17365. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  17366. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  17367. // @@split logic
  17368. fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  17369. var internalSplit;
  17370. if (
  17371. 'abbc'.split(/(b)*/)[1] == 'c' ||
  17372. 'test'.split(/(?:)/, -1).length != 4 ||
  17373. 'ab'.split(/(?:ab)*/).length != 2 ||
  17374. '.'.split(/(.?)(.?)/).length != 4 ||
  17375. '.'.split(/()()/).length > 1 ||
  17376. ''.split(/.?/).length
  17377. ) {
  17378. // based on es5-shim implementation, need to rework it
  17379. internalSplit = function (separator, limit) {
  17380. var string = String(requireObjectCoercible(this));
  17381. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  17382. if (lim === 0) return [];
  17383. if (separator === undefined) return [string];
  17384. // If `separator` is not a regex, use native split
  17385. if (!isRegExp(separator)) {
  17386. return nativeSplit.call(string, separator, lim);
  17387. }
  17388. var output = [];
  17389. var flags = (separator.ignoreCase ? 'i' : '') +
  17390. (separator.multiline ? 'm' : '') +
  17391. (separator.unicode ? 'u' : '') +
  17392. (separator.sticky ? 'y' : '');
  17393. var lastLastIndex = 0;
  17394. // Make `global` and avoid `lastIndex` issues by working with a copy
  17395. var separatorCopy = new RegExp(separator.source, flags + 'g');
  17396. var match, lastIndex, lastLength;
  17397. while (match = regexpExec.call(separatorCopy, string)) {
  17398. lastIndex = separatorCopy.lastIndex;
  17399. if (lastIndex > lastLastIndex) {
  17400. output.push(string.slice(lastLastIndex, match.index));
  17401. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  17402. lastLength = match[0].length;
  17403. lastLastIndex = lastIndex;
  17404. if (output.length >= lim) break;
  17405. }
  17406. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  17407. }
  17408. if (lastLastIndex === string.length) {
  17409. if (lastLength || !separatorCopy.test('')) output.push('');
  17410. } else output.push(string.slice(lastLastIndex));
  17411. return output.length > lim ? output.slice(0, lim) : output;
  17412. };
  17413. // Chakra, V8
  17414. } else if ('0'.split(undefined, 0).length) {
  17415. internalSplit = function (separator, limit) {
  17416. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  17417. };
  17418. } else internalSplit = nativeSplit;
  17419. return [
  17420. // `String.prototype.split` method
  17421. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  17422. function split(separator, limit) {
  17423. var O = requireObjectCoercible(this);
  17424. var splitter = separator == undefined ? undefined : separator[SPLIT];
  17425. return splitter !== undefined
  17426. ? splitter.call(separator, O, limit)
  17427. : internalSplit.call(String(O), separator, limit);
  17428. },
  17429. // `RegExp.prototype[@@split]` method
  17430. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  17431. //
  17432. // NOTE: This cannot be properly polyfilled in engines that don't support
  17433. // the 'y' flag.
  17434. function (regexp, limit) {
  17435. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  17436. if (res.done) return res.value;
  17437. var rx = anObject(regexp);
  17438. var S = String(this);
  17439. var C = speciesConstructor(rx, RegExp);
  17440. var unicodeMatching = rx.unicode;
  17441. var flags = (rx.ignoreCase ? 'i' : '') +
  17442. (rx.multiline ? 'm' : '') +
  17443. (rx.unicode ? 'u' : '') +
  17444. (SUPPORTS_Y ? 'y' : 'g');
  17445. // ^(? + rx + ) is needed, in combination with some S slicing, to
  17446. // simulate the 'y' flag.
  17447. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  17448. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  17449. if (lim === 0) return [];
  17450. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  17451. var p = 0;
  17452. var q = 0;
  17453. var A = [];
  17454. while (q < S.length) {
  17455. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  17456. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  17457. var e;
  17458. if (
  17459. z === null ||
  17460. (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  17461. ) {
  17462. q = advanceStringIndex(S, q, unicodeMatching);
  17463. } else {
  17464. A.push(S.slice(p, q));
  17465. if (A.length === lim) return A;
  17466. for (var i = 1; i <= z.length - 1; i++) {
  17467. A.push(z[i]);
  17468. if (A.length === lim) return A;
  17469. }
  17470. q = p = e;
  17471. }
  17472. }
  17473. A.push(S.slice(p));
  17474. return A;
  17475. }
  17476. ];
  17477. }, !SUPPORTS_Y);
  17478. /***/ }),
  17479. /***/ "./node_modules/core-js/modules/es.string.trim.js":
  17480. /*!********************************************************!*\
  17481. !*** ./node_modules/core-js/modules/es.string.trim.js ***!
  17482. \********************************************************/
  17483. /*! unknown exports (runtime-defined) */
  17484. /*! runtime requirements: __webpack_require__ */
  17485. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17486. "use strict";
  17487. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17488. var $trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim;
  17489. var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "./node_modules/core-js/internals/string-trim-forced.js");
  17490. // `String.prototype.trim` method
  17491. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  17492. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  17493. trim: function trim() {
  17494. return $trim(this);
  17495. }
  17496. });
  17497. /***/ }),
  17498. /***/ "./node_modules/core-js/modules/es.symbol.description.js":
  17499. /*!***************************************************************!*\
  17500. !*** ./node_modules/core-js/modules/es.symbol.description.js ***!
  17501. \***************************************************************/
  17502. /*! unknown exports (runtime-defined) */
  17503. /*! runtime requirements: __webpack_require__ */
  17504. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17505. "use strict";
  17506. // `Symbol.prototype.description` getter
  17507. // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
  17508. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17509. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  17510. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  17511. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  17512. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  17513. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
  17514. var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
  17515. var NativeSymbol = global.Symbol;
  17516. if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  17517. // Safari 12 bug
  17518. NativeSymbol().description !== undefined
  17519. )) {
  17520. var EmptyStringDescriptionStore = {};
  17521. // wrap Symbol constructor for correct work with undefined description
  17522. var SymbolWrapper = function Symbol() {
  17523. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  17524. var result = this instanceof SymbolWrapper
  17525. ? new NativeSymbol(description)
  17526. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  17527. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  17528. if (description === '') EmptyStringDescriptionStore[result] = true;
  17529. return result;
  17530. };
  17531. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  17532. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  17533. symbolPrototype.constructor = SymbolWrapper;
  17534. var symbolToString = symbolPrototype.toString;
  17535. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  17536. var regexp = /^Symbol\((.*)\)[^)]+$/;
  17537. defineProperty(symbolPrototype, 'description', {
  17538. configurable: true,
  17539. get: function description() {
  17540. var symbol = isObject(this) ? this.valueOf() : this;
  17541. var string = symbolToString.call(symbol);
  17542. if (has(EmptyStringDescriptionStore, symbol)) return '';
  17543. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  17544. return desc === '' ? undefined : desc;
  17545. }
  17546. });
  17547. $({ global: true, forced: true }, {
  17548. Symbol: SymbolWrapper
  17549. });
  17550. }
  17551. /***/ }),
  17552. /***/ "./node_modules/core-js/modules/es.symbol.iterator.js":
  17553. /*!************************************************************!*\
  17554. !*** ./node_modules/core-js/modules/es.symbol.iterator.js ***!
  17555. \************************************************************/
  17556. /*! unknown exports (runtime-defined) */
  17557. /*! runtime requirements: __webpack_require__ */
  17558. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17559. var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/core-js/internals/define-well-known-symbol.js");
  17560. // `Symbol.iterator` well-known symbol
  17561. // https://tc39.github.io/ecma262/#sec-symbol.iterator
  17562. defineWellKnownSymbol('iterator');
  17563. /***/ }),
  17564. /***/ "./node_modules/core-js/modules/es.symbol.js":
  17565. /*!***************************************************!*\
  17566. !*** ./node_modules/core-js/modules/es.symbol.js ***!
  17567. \***************************************************/
  17568. /*! unknown exports (runtime-defined) */
  17569. /*! runtime requirements: __webpack_require__ */
  17570. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17571. "use strict";
  17572. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  17573. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  17574. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  17575. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
  17576. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  17577. var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
  17578. var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
  17579. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  17580. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  17581. var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
  17582. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  17583. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  17584. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  17585. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
  17586. var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
  17587. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  17588. var nativeObjectCreate = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  17589. var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
  17590. var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
  17591. var getOwnPropertyNamesExternal = __webpack_require__(/*! ../internals/object-get-own-property-names-external */ "./node_modules/core-js/internals/object-get-own-property-names-external.js");
  17592. var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
  17593. var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
  17594. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
  17595. var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
  17596. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  17597. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  17598. var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
  17599. var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
  17600. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
  17601. var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
  17602. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  17603. var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/core-js/internals/well-known-symbol-wrapped.js");
  17604. var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/core-js/internals/define-well-known-symbol.js");
  17605. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  17606. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  17607. var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
  17608. var HIDDEN = sharedKey('hidden');
  17609. var SYMBOL = 'Symbol';
  17610. var PROTOTYPE = 'prototype';
  17611. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  17612. var setInternalState = InternalStateModule.set;
  17613. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  17614. var ObjectPrototype = Object[PROTOTYPE];
  17615. var $Symbol = global.Symbol;
  17616. var $stringify = getBuiltIn('JSON', 'stringify');
  17617. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  17618. var nativeDefineProperty = definePropertyModule.f;
  17619. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  17620. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  17621. var AllSymbols = shared('symbols');
  17622. var ObjectPrototypeSymbols = shared('op-symbols');
  17623. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  17624. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  17625. var WellKnownSymbolsStore = shared('wks');
  17626. var QObject = global.QObject;
  17627. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  17628. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  17629. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  17630. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  17631. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  17632. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  17633. })).a != 7;
  17634. }) ? function (O, P, Attributes) {
  17635. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  17636. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  17637. nativeDefineProperty(O, P, Attributes);
  17638. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  17639. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  17640. }
  17641. } : nativeDefineProperty;
  17642. var wrap = function (tag, description) {
  17643. var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
  17644. setInternalState(symbol, {
  17645. type: SYMBOL,
  17646. tag: tag,
  17647. description: description
  17648. });
  17649. if (!DESCRIPTORS) symbol.description = description;
  17650. return symbol;
  17651. };
  17652. var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
  17653. return typeof it == 'symbol';
  17654. } : function (it) {
  17655. return Object(it) instanceof $Symbol;
  17656. };
  17657. var $defineProperty = function defineProperty(O, P, Attributes) {
  17658. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  17659. anObject(O);
  17660. var key = toPrimitive(P, true);
  17661. anObject(Attributes);
  17662. if (has(AllSymbols, key)) {
  17663. if (!Attributes.enumerable) {
  17664. if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  17665. O[HIDDEN][key] = true;
  17666. } else {
  17667. if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  17668. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  17669. } return setSymbolDescriptor(O, key, Attributes);
  17670. } return nativeDefineProperty(O, key, Attributes);
  17671. };
  17672. var $defineProperties = function defineProperties(O, Properties) {
  17673. anObject(O);
  17674. var properties = toIndexedObject(Properties);
  17675. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  17676. $forEach(keys, function (key) {
  17677. if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  17678. });
  17679. return O;
  17680. };
  17681. var $create = function create(O, Properties) {
  17682. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  17683. };
  17684. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  17685. var P = toPrimitive(V, true);
  17686. var enumerable = nativePropertyIsEnumerable.call(this, P);
  17687. if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
  17688. return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  17689. };
  17690. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  17691. var it = toIndexedObject(O);
  17692. var key = toPrimitive(P, true);
  17693. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  17694. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  17695. if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
  17696. descriptor.enumerable = true;
  17697. }
  17698. return descriptor;
  17699. };
  17700. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  17701. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  17702. var result = [];
  17703. $forEach(names, function (key) {
  17704. if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
  17705. });
  17706. return result;
  17707. };
  17708. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  17709. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  17710. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  17711. var result = [];
  17712. $forEach(names, function (key) {
  17713. if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
  17714. result.push(AllSymbols[key]);
  17715. }
  17716. });
  17717. return result;
  17718. };
  17719. // `Symbol` constructor
  17720. // https://tc39.github.io/ecma262/#sec-symbol-constructor
  17721. if (!NATIVE_SYMBOL) {
  17722. $Symbol = function Symbol() {
  17723. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  17724. var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
  17725. var tag = uid(description);
  17726. var setter = function (value) {
  17727. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  17728. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  17729. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  17730. };
  17731. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  17732. return wrap(tag, description);
  17733. };
  17734. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  17735. return getInternalState(this).tag;
  17736. });
  17737. redefine($Symbol, 'withoutSetter', function (description) {
  17738. return wrap(uid(description), description);
  17739. });
  17740. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  17741. definePropertyModule.f = $defineProperty;
  17742. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  17743. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  17744. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  17745. wrappedWellKnownSymbolModule.f = function (name) {
  17746. return wrap(wellKnownSymbol(name), name);
  17747. };
  17748. if (DESCRIPTORS) {
  17749. // https://github.com/tc39/proposal-Symbol-description
  17750. nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
  17751. configurable: true,
  17752. get: function description() {
  17753. return getInternalState(this).description;
  17754. }
  17755. });
  17756. if (!IS_PURE) {
  17757. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  17758. }
  17759. }
  17760. }
  17761. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  17762. Symbol: $Symbol
  17763. });
  17764. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  17765. defineWellKnownSymbol(name);
  17766. });
  17767. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  17768. // `Symbol.for` method
  17769. // https://tc39.github.io/ecma262/#sec-symbol.for
  17770. 'for': function (key) {
  17771. var string = String(key);
  17772. if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  17773. var symbol = $Symbol(string);
  17774. StringToSymbolRegistry[string] = symbol;
  17775. SymbolToStringRegistry[symbol] = string;
  17776. return symbol;
  17777. },
  17778. // `Symbol.keyFor` method
  17779. // https://tc39.github.io/ecma262/#sec-symbol.keyfor
  17780. keyFor: function keyFor(sym) {
  17781. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  17782. if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  17783. },
  17784. useSetter: function () { USE_SETTER = true; },
  17785. useSimple: function () { USE_SETTER = false; }
  17786. });
  17787. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  17788. // `Object.create` method
  17789. // https://tc39.github.io/ecma262/#sec-object.create
  17790. create: $create,
  17791. // `Object.defineProperty` method
  17792. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  17793. defineProperty: $defineProperty,
  17794. // `Object.defineProperties` method
  17795. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  17796. defineProperties: $defineProperties,
  17797. // `Object.getOwnPropertyDescriptor` method
  17798. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  17799. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  17800. });
  17801. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  17802. // `Object.getOwnPropertyNames` method
  17803. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  17804. getOwnPropertyNames: $getOwnPropertyNames,
  17805. // `Object.getOwnPropertySymbols` method
  17806. // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
  17807. getOwnPropertySymbols: $getOwnPropertySymbols
  17808. });
  17809. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  17810. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  17811. $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
  17812. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  17813. return getOwnPropertySymbolsModule.f(toObject(it));
  17814. }
  17815. });
  17816. // `JSON.stringify` method behavior with symbols
  17817. // https://tc39.github.io/ecma262/#sec-json.stringify
  17818. if ($stringify) {
  17819. var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
  17820. var symbol = $Symbol();
  17821. // MS Edge converts symbol values to JSON as {}
  17822. return $stringify([symbol]) != '[null]'
  17823. // WebKit converts symbol values to JSON as null
  17824. || $stringify({ a: symbol }) != '{}'
  17825. // V8 throws on boxed symbols
  17826. || $stringify(Object(symbol)) != '{}';
  17827. });
  17828. $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
  17829. // eslint-disable-next-line no-unused-vars
  17830. stringify: function stringify(it, replacer, space) {
  17831. var args = [it];
  17832. var index = 1;
  17833. var $replacer;
  17834. while (arguments.length > index) args.push(arguments[index++]);
  17835. $replacer = replacer;
  17836. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  17837. if (!isArray(replacer)) replacer = function (key, value) {
  17838. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  17839. if (!isSymbol(value)) return value;
  17840. };
  17841. args[1] = replacer;
  17842. return $stringify.apply(null, args);
  17843. }
  17844. });
  17845. }
  17846. // `Symbol.prototype[@@toPrimitive]` method
  17847. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
  17848. if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
  17849. createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  17850. }
  17851. // `Symbol.prototype[@@toStringTag]` property
  17852. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
  17853. setToStringTag($Symbol, SYMBOL);
  17854. hiddenKeys[HIDDEN] = true;
  17855. /***/ }),
  17856. /***/ "./node_modules/core-js/modules/es.typed-array.copy-within.js":
  17857. /*!********************************************************************!*\
  17858. !*** ./node_modules/core-js/modules/es.typed-array.copy-within.js ***!
  17859. \********************************************************************/
  17860. /*! unknown exports (runtime-defined) */
  17861. /*! runtime requirements: __webpack_require__ */
  17862. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17863. "use strict";
  17864. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17865. var $copyWithin = __webpack_require__(/*! ../internals/array-copy-within */ "./node_modules/core-js/internals/array-copy-within.js");
  17866. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17867. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17868. // `%TypedArray%.prototype.copyWithin` method
  17869. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin
  17870. exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
  17871. return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
  17872. });
  17873. /***/ }),
  17874. /***/ "./node_modules/core-js/modules/es.typed-array.every.js":
  17875. /*!**************************************************************!*\
  17876. !*** ./node_modules/core-js/modules/es.typed-array.every.js ***!
  17877. \**************************************************************/
  17878. /*! unknown exports (runtime-defined) */
  17879. /*! runtime requirements: __webpack_require__ */
  17880. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17881. "use strict";
  17882. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17883. var $every = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").every;
  17884. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17885. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17886. // `%TypedArray%.prototype.every` method
  17887. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every
  17888. exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
  17889. return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  17890. });
  17891. /***/ }),
  17892. /***/ "./node_modules/core-js/modules/es.typed-array.fill.js":
  17893. /*!*************************************************************!*\
  17894. !*** ./node_modules/core-js/modules/es.typed-array.fill.js ***!
  17895. \*************************************************************/
  17896. /*! unknown exports (runtime-defined) */
  17897. /*! runtime requirements: __webpack_require__ */
  17898. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17899. "use strict";
  17900. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17901. var $fill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
  17902. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17903. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17904. // `%TypedArray%.prototype.fill` method
  17905. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill
  17906. // eslint-disable-next-line no-unused-vars
  17907. exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
  17908. return $fill.apply(aTypedArray(this), arguments);
  17909. });
  17910. /***/ }),
  17911. /***/ "./node_modules/core-js/modules/es.typed-array.filter.js":
  17912. /*!***************************************************************!*\
  17913. !*** ./node_modules/core-js/modules/es.typed-array.filter.js ***!
  17914. \***************************************************************/
  17915. /*! unknown exports (runtime-defined) */
  17916. /*! runtime requirements: __webpack_require__ */
  17917. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17918. "use strict";
  17919. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17920. var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").filter;
  17921. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  17922. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17923. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  17924. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17925. // `%TypedArray%.prototype.filter` method
  17926. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter
  17927. exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
  17928. var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  17929. var C = speciesConstructor(this, this.constructor);
  17930. var index = 0;
  17931. var length = list.length;
  17932. var result = new (aTypedArrayConstructor(C))(length);
  17933. while (length > index) result[index] = list[index++];
  17934. return result;
  17935. });
  17936. /***/ }),
  17937. /***/ "./node_modules/core-js/modules/es.typed-array.find-index.js":
  17938. /*!*******************************************************************!*\
  17939. !*** ./node_modules/core-js/modules/es.typed-array.find-index.js ***!
  17940. \*******************************************************************/
  17941. /*! unknown exports (runtime-defined) */
  17942. /*! runtime requirements: __webpack_require__ */
  17943. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17944. "use strict";
  17945. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17946. var $findIndex = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").findIndex;
  17947. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17948. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17949. // `%TypedArray%.prototype.findIndex` method
  17950. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex
  17951. exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
  17952. return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  17953. });
  17954. /***/ }),
  17955. /***/ "./node_modules/core-js/modules/es.typed-array.find.js":
  17956. /*!*************************************************************!*\
  17957. !*** ./node_modules/core-js/modules/es.typed-array.find.js ***!
  17958. \*************************************************************/
  17959. /*! unknown exports (runtime-defined) */
  17960. /*! runtime requirements: __webpack_require__ */
  17961. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17962. "use strict";
  17963. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17964. var $find = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").find;
  17965. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17966. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17967. // `%TypedArray%.prototype.find` method
  17968. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find
  17969. exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
  17970. return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  17971. });
  17972. /***/ }),
  17973. /***/ "./node_modules/core-js/modules/es.typed-array.for-each.js":
  17974. /*!*****************************************************************!*\
  17975. !*** ./node_modules/core-js/modules/es.typed-array.for-each.js ***!
  17976. \*****************************************************************/
  17977. /*! unknown exports (runtime-defined) */
  17978. /*! runtime requirements: __webpack_require__ */
  17979. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17980. "use strict";
  17981. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  17982. var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
  17983. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  17984. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  17985. // `%TypedArray%.prototype.forEach` method
  17986. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach
  17987. exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
  17988. $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  17989. });
  17990. /***/ }),
  17991. /***/ "./node_modules/core-js/modules/es.typed-array.includes.js":
  17992. /*!*****************************************************************!*\
  17993. !*** ./node_modules/core-js/modules/es.typed-array.includes.js ***!
  17994. \*****************************************************************/
  17995. /*! unknown exports (runtime-defined) */
  17996. /*! runtime requirements: __webpack_require__ */
  17997. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  17998. "use strict";
  17999. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18000. var $includes = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").includes;
  18001. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18002. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18003. // `%TypedArray%.prototype.includes` method
  18004. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes
  18005. exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {
  18006. return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  18007. });
  18008. /***/ }),
  18009. /***/ "./node_modules/core-js/modules/es.typed-array.index-of.js":
  18010. /*!*****************************************************************!*\
  18011. !*** ./node_modules/core-js/modules/es.typed-array.index-of.js ***!
  18012. \*****************************************************************/
  18013. /*! unknown exports (runtime-defined) */
  18014. /*! runtime requirements: __webpack_require__ */
  18015. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18016. "use strict";
  18017. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18018. var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
  18019. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18020. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18021. // `%TypedArray%.prototype.indexOf` method
  18022. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof
  18023. exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {
  18024. return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  18025. });
  18026. /***/ }),
  18027. /***/ "./node_modules/core-js/modules/es.typed-array.int16-array.js":
  18028. /*!********************************************************************!*\
  18029. !*** ./node_modules/core-js/modules/es.typed-array.int16-array.js ***!
  18030. \********************************************************************/
  18031. /*! unknown exports (runtime-defined) */
  18032. /*! runtime requirements: __webpack_require__ */
  18033. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18034. var createTypedArrayConstructor = __webpack_require__(/*! ../internals/typed-array-constructor */ "./node_modules/core-js/internals/typed-array-constructor.js");
  18035. // `Int16Array` constructor
  18036. // https://tc39.github.io/ecma262/#sec-typedarray-objects
  18037. createTypedArrayConstructor('Int16', function (init) {
  18038. return function Int16Array(data, byteOffset, length) {
  18039. return init(this, data, byteOffset, length);
  18040. };
  18041. });
  18042. /***/ }),
  18043. /***/ "./node_modules/core-js/modules/es.typed-array.iterator.js":
  18044. /*!*****************************************************************!*\
  18045. !*** ./node_modules/core-js/modules/es.typed-array.iterator.js ***!
  18046. \*****************************************************************/
  18047. /*! unknown exports (runtime-defined) */
  18048. /*! runtime requirements: __webpack_require__ */
  18049. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18050. "use strict";
  18051. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18052. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18053. var ArrayIterators = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  18054. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  18055. var ITERATOR = wellKnownSymbol('iterator');
  18056. var Uint8Array = global.Uint8Array;
  18057. var arrayValues = ArrayIterators.values;
  18058. var arrayKeys = ArrayIterators.keys;
  18059. var arrayEntries = ArrayIterators.entries;
  18060. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18061. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18062. var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
  18063. var CORRECT_ITER_NAME = !!nativeTypedArrayIterator
  18064. && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);
  18065. var typedArrayValues = function values() {
  18066. return arrayValues.call(aTypedArray(this));
  18067. };
  18068. // `%TypedArray%.prototype.entries` method
  18069. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries
  18070. exportTypedArrayMethod('entries', function entries() {
  18071. return arrayEntries.call(aTypedArray(this));
  18072. });
  18073. // `%TypedArray%.prototype.keys` method
  18074. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys
  18075. exportTypedArrayMethod('keys', function keys() {
  18076. return arrayKeys.call(aTypedArray(this));
  18077. });
  18078. // `%TypedArray%.prototype.values` method
  18079. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values
  18080. exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);
  18081. // `%TypedArray%.prototype[@@iterator]` method
  18082. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator
  18083. exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
  18084. /***/ }),
  18085. /***/ "./node_modules/core-js/modules/es.typed-array.join.js":
  18086. /*!*************************************************************!*\
  18087. !*** ./node_modules/core-js/modules/es.typed-array.join.js ***!
  18088. \*************************************************************/
  18089. /*! unknown exports (runtime-defined) */
  18090. /*! runtime requirements: __webpack_require__ */
  18091. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18092. "use strict";
  18093. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18094. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18095. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18096. var $join = [].join;
  18097. // `%TypedArray%.prototype.join` method
  18098. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join
  18099. // eslint-disable-next-line no-unused-vars
  18100. exportTypedArrayMethod('join', function join(separator) {
  18101. return $join.apply(aTypedArray(this), arguments);
  18102. });
  18103. /***/ }),
  18104. /***/ "./node_modules/core-js/modules/es.typed-array.last-index-of.js":
  18105. /*!**********************************************************************!*\
  18106. !*** ./node_modules/core-js/modules/es.typed-array.last-index-of.js ***!
  18107. \**********************************************************************/
  18108. /*! unknown exports (runtime-defined) */
  18109. /*! runtime requirements: __webpack_require__ */
  18110. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18111. "use strict";
  18112. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18113. var $lastIndexOf = __webpack_require__(/*! ../internals/array-last-index-of */ "./node_modules/core-js/internals/array-last-index-of.js");
  18114. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18115. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18116. // `%TypedArray%.prototype.lastIndexOf` method
  18117. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof
  18118. // eslint-disable-next-line no-unused-vars
  18119. exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
  18120. return $lastIndexOf.apply(aTypedArray(this), arguments);
  18121. });
  18122. /***/ }),
  18123. /***/ "./node_modules/core-js/modules/es.typed-array.map.js":
  18124. /*!************************************************************!*\
  18125. !*** ./node_modules/core-js/modules/es.typed-array.map.js ***!
  18126. \************************************************************/
  18127. /*! unknown exports (runtime-defined) */
  18128. /*! runtime requirements: __webpack_require__ */
  18129. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18130. "use strict";
  18131. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18132. var $map = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").map;
  18133. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  18134. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18135. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  18136. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18137. // `%TypedArray%.prototype.map` method
  18138. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map
  18139. exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {
  18140. return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
  18141. return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length);
  18142. });
  18143. });
  18144. /***/ }),
  18145. /***/ "./node_modules/core-js/modules/es.typed-array.reduce-right.js":
  18146. /*!*********************************************************************!*\
  18147. !*** ./node_modules/core-js/modules/es.typed-array.reduce-right.js ***!
  18148. \*********************************************************************/
  18149. /*! unknown exports (runtime-defined) */
  18150. /*! runtime requirements: __webpack_require__ */
  18151. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18152. "use strict";
  18153. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18154. var $reduceRight = __webpack_require__(/*! ../internals/array-reduce */ "./node_modules/core-js/internals/array-reduce.js").right;
  18155. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18156. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18157. // `%TypedArray%.prototype.reduceRicht` method
  18158. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright
  18159. exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
  18160. return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  18161. });
  18162. /***/ }),
  18163. /***/ "./node_modules/core-js/modules/es.typed-array.reduce.js":
  18164. /*!***************************************************************!*\
  18165. !*** ./node_modules/core-js/modules/es.typed-array.reduce.js ***!
  18166. \***************************************************************/
  18167. /*! unknown exports (runtime-defined) */
  18168. /*! runtime requirements: __webpack_require__ */
  18169. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18170. "use strict";
  18171. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18172. var $reduce = __webpack_require__(/*! ../internals/array-reduce */ "./node_modules/core-js/internals/array-reduce.js").left;
  18173. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18174. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18175. // `%TypedArray%.prototype.reduce` method
  18176. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce
  18177. exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {
  18178. return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  18179. });
  18180. /***/ }),
  18181. /***/ "./node_modules/core-js/modules/es.typed-array.reverse.js":
  18182. /*!****************************************************************!*\
  18183. !*** ./node_modules/core-js/modules/es.typed-array.reverse.js ***!
  18184. \****************************************************************/
  18185. /*! unknown exports (runtime-defined) */
  18186. /*! runtime requirements: __webpack_require__ */
  18187. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18188. "use strict";
  18189. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18190. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18191. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18192. var floor = Math.floor;
  18193. // `%TypedArray%.prototype.reverse` method
  18194. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse
  18195. exportTypedArrayMethod('reverse', function reverse() {
  18196. var that = this;
  18197. var length = aTypedArray(that).length;
  18198. var middle = floor(length / 2);
  18199. var index = 0;
  18200. var value;
  18201. while (index < middle) {
  18202. value = that[index];
  18203. that[index++] = that[--length];
  18204. that[length] = value;
  18205. } return that;
  18206. });
  18207. /***/ }),
  18208. /***/ "./node_modules/core-js/modules/es.typed-array.set.js":
  18209. /*!************************************************************!*\
  18210. !*** ./node_modules/core-js/modules/es.typed-array.set.js ***!
  18211. \************************************************************/
  18212. /*! unknown exports (runtime-defined) */
  18213. /*! runtime requirements: __webpack_require__ */
  18214. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18215. "use strict";
  18216. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18217. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  18218. var toOffset = __webpack_require__(/*! ../internals/to-offset */ "./node_modules/core-js/internals/to-offset.js");
  18219. var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
  18220. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  18221. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18222. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18223. var FORCED = fails(function () {
  18224. // eslint-disable-next-line no-undef
  18225. new Int8Array(1).set({});
  18226. });
  18227. // `%TypedArray%.prototype.set` method
  18228. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set
  18229. exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
  18230. aTypedArray(this);
  18231. var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
  18232. var length = this.length;
  18233. var src = toObject(arrayLike);
  18234. var len = toLength(src.length);
  18235. var index = 0;
  18236. if (len + offset > length) throw RangeError('Wrong length');
  18237. while (index < len) this[offset + index] = src[index++];
  18238. }, FORCED);
  18239. /***/ }),
  18240. /***/ "./node_modules/core-js/modules/es.typed-array.slice.js":
  18241. /*!**************************************************************!*\
  18242. !*** ./node_modules/core-js/modules/es.typed-array.slice.js ***!
  18243. \**************************************************************/
  18244. /*! unknown exports (runtime-defined) */
  18245. /*! runtime requirements: __webpack_require__ */
  18246. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18247. "use strict";
  18248. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18249. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  18250. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  18251. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18252. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  18253. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18254. var $slice = [].slice;
  18255. var FORCED = fails(function () {
  18256. // eslint-disable-next-line no-undef
  18257. new Int8Array(1).slice();
  18258. });
  18259. // `%TypedArray%.prototype.slice` method
  18260. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice
  18261. exportTypedArrayMethod('slice', function slice(start, end) {
  18262. var list = $slice.call(aTypedArray(this), start, end);
  18263. var C = speciesConstructor(this, this.constructor);
  18264. var index = 0;
  18265. var length = list.length;
  18266. var result = new (aTypedArrayConstructor(C))(length);
  18267. while (length > index) result[index] = list[index++];
  18268. return result;
  18269. }, FORCED);
  18270. /***/ }),
  18271. /***/ "./node_modules/core-js/modules/es.typed-array.some.js":
  18272. /*!*************************************************************!*\
  18273. !*** ./node_modules/core-js/modules/es.typed-array.some.js ***!
  18274. \*************************************************************/
  18275. /*! unknown exports (runtime-defined) */
  18276. /*! runtime requirements: __webpack_require__ */
  18277. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18278. "use strict";
  18279. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18280. var $some = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").some;
  18281. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18282. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18283. // `%TypedArray%.prototype.some` method
  18284. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some
  18285. exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
  18286. return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  18287. });
  18288. /***/ }),
  18289. /***/ "./node_modules/core-js/modules/es.typed-array.sort.js":
  18290. /*!*************************************************************!*\
  18291. !*** ./node_modules/core-js/modules/es.typed-array.sort.js ***!
  18292. \*************************************************************/
  18293. /*! unknown exports (runtime-defined) */
  18294. /*! runtime requirements: __webpack_require__ */
  18295. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18296. "use strict";
  18297. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18298. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18299. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18300. var $sort = [].sort;
  18301. // `%TypedArray%.prototype.sort` method
  18302. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort
  18303. exportTypedArrayMethod('sort', function sort(comparefn) {
  18304. return $sort.call(aTypedArray(this), comparefn);
  18305. });
  18306. /***/ }),
  18307. /***/ "./node_modules/core-js/modules/es.typed-array.subarray.js":
  18308. /*!*****************************************************************!*\
  18309. !*** ./node_modules/core-js/modules/es.typed-array.subarray.js ***!
  18310. \*****************************************************************/
  18311. /*! unknown exports (runtime-defined) */
  18312. /*! runtime requirements: __webpack_require__ */
  18313. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18314. "use strict";
  18315. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18316. var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
  18317. var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
  18318. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
  18319. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18320. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18321. // `%TypedArray%.prototype.subarray` method
  18322. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray
  18323. exportTypedArrayMethod('subarray', function subarray(begin, end) {
  18324. var O = aTypedArray(this);
  18325. var length = O.length;
  18326. var beginIndex = toAbsoluteIndex(begin, length);
  18327. return new (speciesConstructor(O, O.constructor))(
  18328. O.buffer,
  18329. O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
  18330. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
  18331. );
  18332. });
  18333. /***/ }),
  18334. /***/ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js":
  18335. /*!*************************************************************************!*\
  18336. !*** ./node_modules/core-js/modules/es.typed-array.to-locale-string.js ***!
  18337. \*************************************************************************/
  18338. /*! unknown exports (runtime-defined) */
  18339. /*! runtime requirements: __webpack_require__ */
  18340. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18341. "use strict";
  18342. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18343. var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
  18344. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  18345. var Int8Array = global.Int8Array;
  18346. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  18347. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  18348. var $toLocaleString = [].toLocaleString;
  18349. var $slice = [].slice;
  18350. // iOS Safari 6.x fails here
  18351. var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
  18352. $toLocaleString.call(new Int8Array(1));
  18353. });
  18354. var FORCED = fails(function () {
  18355. return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
  18356. }) || !fails(function () {
  18357. Int8Array.prototype.toLocaleString.call([1, 2]);
  18358. });
  18359. // `%TypedArray%.prototype.toLocaleString` method
  18360. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring
  18361. exportTypedArrayMethod('toLocaleString', function toLocaleString() {
  18362. return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
  18363. }, FORCED);
  18364. /***/ }),
  18365. /***/ "./node_modules/core-js/modules/es.typed-array.to-string.js":
  18366. /*!******************************************************************!*\
  18367. !*** ./node_modules/core-js/modules/es.typed-array.to-string.js ***!
  18368. \******************************************************************/
  18369. /*! unknown exports (runtime-defined) */
  18370. /*! runtime requirements: __webpack_require__ */
  18371. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18372. "use strict";
  18373. var exportTypedArrayMethod = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js").exportTypedArrayMethod;
  18374. var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
  18375. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18376. var Uint8Array = global.Uint8Array;
  18377. var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
  18378. var arrayToString = [].toString;
  18379. var arrayJoin = [].join;
  18380. if (fails(function () { arrayToString.call({}); })) {
  18381. arrayToString = function toString() {
  18382. return arrayJoin.call(this);
  18383. };
  18384. }
  18385. var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
  18386. // `%TypedArray%.prototype.toString` method
  18387. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring
  18388. exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);
  18389. /***/ }),
  18390. /***/ "./node_modules/core-js/modules/es.typed-array.uint8-array.js":
  18391. /*!********************************************************************!*\
  18392. !*** ./node_modules/core-js/modules/es.typed-array.uint8-array.js ***!
  18393. \********************************************************************/
  18394. /*! unknown exports (runtime-defined) */
  18395. /*! runtime requirements: __webpack_require__ */
  18396. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18397. var createTypedArrayConstructor = __webpack_require__(/*! ../internals/typed-array-constructor */ "./node_modules/core-js/internals/typed-array-constructor.js");
  18398. // `Uint8Array` constructor
  18399. // https://tc39.github.io/ecma262/#sec-typedarray-objects
  18400. createTypedArrayConstructor('Uint8', function (init) {
  18401. return function Uint8Array(data, byteOffset, length) {
  18402. return init(this, data, byteOffset, length);
  18403. };
  18404. });
  18405. /***/ }),
  18406. /***/ "./node_modules/core-js/modules/web.dom-collections.for-each.js":
  18407. /*!**********************************************************************!*\
  18408. !*** ./node_modules/core-js/modules/web.dom-collections.for-each.js ***!
  18409. \**********************************************************************/
  18410. /*! unknown exports (runtime-defined) */
  18411. /*! runtime requirements: __webpack_require__ */
  18412. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18413. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18414. var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/core-js/internals/dom-iterables.js");
  18415. var forEach = __webpack_require__(/*! ../internals/array-for-each */ "./node_modules/core-js/internals/array-for-each.js");
  18416. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  18417. for (var COLLECTION_NAME in DOMIterables) {
  18418. var Collection = global[COLLECTION_NAME];
  18419. var CollectionPrototype = Collection && Collection.prototype;
  18420. // some Chrome versions have non-configurable methods on DOMTokenList
  18421. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  18422. createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  18423. } catch (error) {
  18424. CollectionPrototype.forEach = forEach;
  18425. }
  18426. }
  18427. /***/ }),
  18428. /***/ "./node_modules/core-js/modules/web.dom-collections.iterator.js":
  18429. /*!**********************************************************************!*\
  18430. !*** ./node_modules/core-js/modules/web.dom-collections.iterator.js ***!
  18431. \**********************************************************************/
  18432. /*! unknown exports (runtime-defined) */
  18433. /*! runtime requirements: __webpack_require__ */
  18434. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18435. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18436. var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/core-js/internals/dom-iterables.js");
  18437. var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  18438. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
  18439. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  18440. var ITERATOR = wellKnownSymbol('iterator');
  18441. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  18442. var ArrayValues = ArrayIteratorMethods.values;
  18443. for (var COLLECTION_NAME in DOMIterables) {
  18444. var Collection = global[COLLECTION_NAME];
  18445. var CollectionPrototype = Collection && Collection.prototype;
  18446. if (CollectionPrototype) {
  18447. // some Chrome versions have non-configurable methods on DOMTokenList
  18448. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  18449. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  18450. } catch (error) {
  18451. CollectionPrototype[ITERATOR] = ArrayValues;
  18452. }
  18453. if (!CollectionPrototype[TO_STRING_TAG]) {
  18454. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  18455. }
  18456. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  18457. // some Chrome versions have non-configurable methods on DOMTokenList
  18458. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  18459. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  18460. } catch (error) {
  18461. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  18462. }
  18463. }
  18464. }
  18465. }
  18466. /***/ }),
  18467. /***/ "./node_modules/core-js/modules/web.url-search-params.js":
  18468. /*!***************************************************************!*\
  18469. !*** ./node_modules/core-js/modules/web.url-search-params.js ***!
  18470. \***************************************************************/
  18471. /*! unknown exports (runtime-defined) */
  18472. /*! runtime requirements: module, __webpack_require__ */
  18473. /*! CommonJS bailout: module.exports is used directly at 344:0-14 */
  18474. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  18475. "use strict";
  18476. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  18477. __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
  18478. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  18479. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
  18480. var USE_NATIVE_URL = __webpack_require__(/*! ../internals/native-url */ "./node_modules/core-js/internals/native-url.js");
  18481. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  18482. var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
  18483. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  18484. var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "./node_modules/core-js/internals/create-iterator-constructor.js");
  18485. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  18486. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  18487. var hasOwn = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  18488. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
  18489. var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
  18490. var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
  18491. var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
  18492. var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
  18493. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
  18494. var getIterator = __webpack_require__(/*! ../internals/get-iterator */ "./node_modules/core-js/internals/get-iterator.js");
  18495. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
  18496. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
  18497. var $fetch = getBuiltIn('fetch');
  18498. var Headers = getBuiltIn('Headers');
  18499. var ITERATOR = wellKnownSymbol('iterator');
  18500. var URL_SEARCH_PARAMS = 'URLSearchParams';
  18501. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  18502. var setInternalState = InternalStateModule.set;
  18503. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  18504. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  18505. var plus = /\+/g;
  18506. var sequences = Array(4);
  18507. var percentSequence = function (bytes) {
  18508. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  18509. };
  18510. var percentDecode = function (sequence) {
  18511. try {
  18512. return decodeURIComponent(sequence);
  18513. } catch (error) {
  18514. return sequence;
  18515. }
  18516. };
  18517. var deserialize = function (it) {
  18518. var result = it.replace(plus, ' ');
  18519. var bytes = 4;
  18520. try {
  18521. return decodeURIComponent(result);
  18522. } catch (error) {
  18523. while (bytes) {
  18524. result = result.replace(percentSequence(bytes--), percentDecode);
  18525. }
  18526. return result;
  18527. }
  18528. };
  18529. var find = /[!'()~]|%20/g;
  18530. var replace = {
  18531. '!': '%21',
  18532. "'": '%27',
  18533. '(': '%28',
  18534. ')': '%29',
  18535. '~': '%7E',
  18536. '%20': '+'
  18537. };
  18538. var replacer = function (match) {
  18539. return replace[match];
  18540. };
  18541. var serialize = function (it) {
  18542. return encodeURIComponent(it).replace(find, replacer);
  18543. };
  18544. var parseSearchParams = function (result, query) {
  18545. if (query) {
  18546. var attributes = query.split('&');
  18547. var index = 0;
  18548. var attribute, entry;
  18549. while (index < attributes.length) {
  18550. attribute = attributes[index++];
  18551. if (attribute.length) {
  18552. entry = attribute.split('=');
  18553. result.push({
  18554. key: deserialize(entry.shift()),
  18555. value: deserialize(entry.join('='))
  18556. });
  18557. }
  18558. }
  18559. }
  18560. };
  18561. var updateSearchParams = function (query) {
  18562. this.entries.length = 0;
  18563. parseSearchParams(this.entries, query);
  18564. };
  18565. var validateArgumentsLength = function (passed, required) {
  18566. if (passed < required) throw TypeError('Not enough arguments');
  18567. };
  18568. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  18569. setInternalState(this, {
  18570. type: URL_SEARCH_PARAMS_ITERATOR,
  18571. iterator: getIterator(getInternalParamsState(params).entries),
  18572. kind: kind
  18573. });
  18574. }, 'Iterator', function next() {
  18575. var state = getInternalIteratorState(this);
  18576. var kind = state.kind;
  18577. var step = state.iterator.next();
  18578. var entry = step.value;
  18579. if (!step.done) {
  18580. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  18581. } return step;
  18582. });
  18583. // `URLSearchParams` constructor
  18584. // https://url.spec.whatwg.org/#interface-urlsearchparams
  18585. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  18586. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  18587. var init = arguments.length > 0 ? arguments[0] : undefined;
  18588. var that = this;
  18589. var entries = [];
  18590. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  18591. setInternalState(that, {
  18592. type: URL_SEARCH_PARAMS,
  18593. entries: entries,
  18594. updateURL: function () { /* empty */ },
  18595. updateSearchParams: updateSearchParams
  18596. });
  18597. if (init !== undefined) {
  18598. if (isObject(init)) {
  18599. iteratorMethod = getIteratorMethod(init);
  18600. if (typeof iteratorMethod === 'function') {
  18601. iterator = iteratorMethod.call(init);
  18602. next = iterator.next;
  18603. while (!(step = next.call(iterator)).done) {
  18604. entryIterator = getIterator(anObject(step.value));
  18605. entryNext = entryIterator.next;
  18606. if (
  18607. (first = entryNext.call(entryIterator)).done ||
  18608. (second = entryNext.call(entryIterator)).done ||
  18609. !entryNext.call(entryIterator).done
  18610. ) throw TypeError('Expected sequence with length 2');
  18611. entries.push({ key: first.value + '', value: second.value + '' });
  18612. }
  18613. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
  18614. } else {
  18615. parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
  18616. }
  18617. }
  18618. };
  18619. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  18620. redefineAll(URLSearchParamsPrototype, {
  18621. // `URLSearchParams.prototype.appent` method
  18622. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  18623. append: function append(name, value) {
  18624. validateArgumentsLength(arguments.length, 2);
  18625. var state = getInternalParamsState(this);
  18626. state.entries.push({ key: name + '', value: value + '' });
  18627. state.updateURL();
  18628. },
  18629. // `URLSearchParams.prototype.delete` method
  18630. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  18631. 'delete': function (name) {
  18632. validateArgumentsLength(arguments.length, 1);
  18633. var state = getInternalParamsState(this);
  18634. var entries = state.entries;
  18635. var key = name + '';
  18636. var index = 0;
  18637. while (index < entries.length) {
  18638. if (entries[index].key === key) entries.splice(index, 1);
  18639. else index++;
  18640. }
  18641. state.updateURL();
  18642. },
  18643. // `URLSearchParams.prototype.get` method
  18644. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  18645. get: function get(name) {
  18646. validateArgumentsLength(arguments.length, 1);
  18647. var entries = getInternalParamsState(this).entries;
  18648. var key = name + '';
  18649. var index = 0;
  18650. for (; index < entries.length; index++) {
  18651. if (entries[index].key === key) return entries[index].value;
  18652. }
  18653. return null;
  18654. },
  18655. // `URLSearchParams.prototype.getAll` method
  18656. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  18657. getAll: function getAll(name) {
  18658. validateArgumentsLength(arguments.length, 1);
  18659. var entries = getInternalParamsState(this).entries;
  18660. var key = name + '';
  18661. var result = [];
  18662. var index = 0;
  18663. for (; index < entries.length; index++) {
  18664. if (entries[index].key === key) result.push(entries[index].value);
  18665. }
  18666. return result;
  18667. },
  18668. // `URLSearchParams.prototype.has` method
  18669. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  18670. has: function has(name) {
  18671. validateArgumentsLength(arguments.length, 1);
  18672. var entries = getInternalParamsState(this).entries;
  18673. var key = name + '';
  18674. var index = 0;
  18675. while (index < entries.length) {
  18676. if (entries[index++].key === key) return true;
  18677. }
  18678. return false;
  18679. },
  18680. // `URLSearchParams.prototype.set` method
  18681. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  18682. set: function set(name, value) {
  18683. validateArgumentsLength(arguments.length, 1);
  18684. var state = getInternalParamsState(this);
  18685. var entries = state.entries;
  18686. var found = false;
  18687. var key = name + '';
  18688. var val = value + '';
  18689. var index = 0;
  18690. var entry;
  18691. for (; index < entries.length; index++) {
  18692. entry = entries[index];
  18693. if (entry.key === key) {
  18694. if (found) entries.splice(index--, 1);
  18695. else {
  18696. found = true;
  18697. entry.value = val;
  18698. }
  18699. }
  18700. }
  18701. if (!found) entries.push({ key: key, value: val });
  18702. state.updateURL();
  18703. },
  18704. // `URLSearchParams.prototype.sort` method
  18705. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  18706. sort: function sort() {
  18707. var state = getInternalParamsState(this);
  18708. var entries = state.entries;
  18709. // Array#sort is not stable in some engines
  18710. var slice = entries.slice();
  18711. var entry, entriesIndex, sliceIndex;
  18712. entries.length = 0;
  18713. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  18714. entry = slice[sliceIndex];
  18715. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  18716. if (entries[entriesIndex].key > entry.key) {
  18717. entries.splice(entriesIndex, 0, entry);
  18718. break;
  18719. }
  18720. }
  18721. if (entriesIndex === sliceIndex) entries.push(entry);
  18722. }
  18723. state.updateURL();
  18724. },
  18725. // `URLSearchParams.prototype.forEach` method
  18726. forEach: function forEach(callback /* , thisArg */) {
  18727. var entries = getInternalParamsState(this).entries;
  18728. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  18729. var index = 0;
  18730. var entry;
  18731. while (index < entries.length) {
  18732. entry = entries[index++];
  18733. boundFunction(entry.value, entry.key, this);
  18734. }
  18735. },
  18736. // `URLSearchParams.prototype.keys` method
  18737. keys: function keys() {
  18738. return new URLSearchParamsIterator(this, 'keys');
  18739. },
  18740. // `URLSearchParams.prototype.values` method
  18741. values: function values() {
  18742. return new URLSearchParamsIterator(this, 'values');
  18743. },
  18744. // `URLSearchParams.prototype.entries` method
  18745. entries: function entries() {
  18746. return new URLSearchParamsIterator(this, 'entries');
  18747. }
  18748. }, { enumerable: true });
  18749. // `URLSearchParams.prototype[@@iterator]` method
  18750. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
  18751. // `URLSearchParams.prototype.toString` method
  18752. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  18753. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  18754. var entries = getInternalParamsState(this).entries;
  18755. var result = [];
  18756. var index = 0;
  18757. var entry;
  18758. while (index < entries.length) {
  18759. entry = entries[index++];
  18760. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  18761. } return result.join('&');
  18762. }, { enumerable: true });
  18763. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  18764. $({ global: true, forced: !USE_NATIVE_URL }, {
  18765. URLSearchParams: URLSearchParamsConstructor
  18766. });
  18767. // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
  18768. // https://github.com/zloirock/core-js/issues/674
  18769. if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
  18770. $({ global: true, enumerable: true, forced: true }, {
  18771. fetch: function fetch(input /* , init */) {
  18772. var args = [input];
  18773. var init, body, headers;
  18774. if (arguments.length > 1) {
  18775. init = arguments[1];
  18776. if (isObject(init)) {
  18777. body = init.body;
  18778. if (classof(body) === URL_SEARCH_PARAMS) {
  18779. headers = init.headers ? new Headers(init.headers) : new Headers();
  18780. if (!headers.has('content-type')) {
  18781. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  18782. }
  18783. init = create(init, {
  18784. body: createPropertyDescriptor(0, String(body)),
  18785. headers: createPropertyDescriptor(0, headers)
  18786. });
  18787. }
  18788. }
  18789. args.push(init);
  18790. } return $fetch.apply(this, args);
  18791. }
  18792. });
  18793. }
  18794. module.exports = {
  18795. URLSearchParams: URLSearchParamsConstructor,
  18796. getState: getInternalParamsState
  18797. };
  18798. /***/ }),
  18799. /***/ "./node_modules/core-js/modules/web.url.js":
  18800. /*!*************************************************!*\
  18801. !*** ./node_modules/core-js/modules/web.url.js ***!
  18802. \*************************************************/
  18803. /*! unknown exports (runtime-defined) */
  18804. /*! runtime requirements: __webpack_require__ */
  18805. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18806. "use strict";
  18807. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  18808. __webpack_require__(/*! ../modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
  18809. var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
  18810. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
  18811. var USE_NATIVE_URL = __webpack_require__(/*! ../internals/native-url */ "./node_modules/core-js/internals/native-url.js");
  18812. var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
  18813. var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js");
  18814. var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
  18815. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
  18816. var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
  18817. var assign = __webpack_require__(/*! ../internals/object-assign */ "./node_modules/core-js/internals/object-assign.js");
  18818. var arrayFrom = __webpack_require__(/*! ../internals/array-from */ "./node_modules/core-js/internals/array-from.js");
  18819. var codeAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").codeAt;
  18820. var toASCII = __webpack_require__(/*! ../internals/string-punycode-to-ascii */ "./node_modules/core-js/internals/string-punycode-to-ascii.js");
  18821. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
  18822. var URLSearchParamsModule = __webpack_require__(/*! ../modules/web.url-search-params */ "./node_modules/core-js/modules/web.url-search-params.js");
  18823. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
  18824. var NativeURL = global.URL;
  18825. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  18826. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  18827. var setInternalState = InternalStateModule.set;
  18828. var getInternalURLState = InternalStateModule.getterFor('URL');
  18829. var floor = Math.floor;
  18830. var pow = Math.pow;
  18831. var INVALID_AUTHORITY = 'Invalid authority';
  18832. var INVALID_SCHEME = 'Invalid scheme';
  18833. var INVALID_HOST = 'Invalid host';
  18834. var INVALID_PORT = 'Invalid port';
  18835. var ALPHA = /[A-Za-z]/;
  18836. var ALPHANUMERIC = /[\d+-.A-Za-z]/;
  18837. var DIGIT = /\d/;
  18838. var HEX_START = /^(0x|0X)/;
  18839. var OCT = /^[0-7]+$/;
  18840. var DEC = /^\d+$/;
  18841. var HEX = /^[\dA-Fa-f]+$/;
  18842. // eslint-disable-next-line no-control-regex
  18843. var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
  18844. // eslint-disable-next-line no-control-regex
  18845. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
  18846. // eslint-disable-next-line no-control-regex
  18847. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
  18848. // eslint-disable-next-line no-control-regex
  18849. var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
  18850. var EOF;
  18851. var parseHost = function (url, input) {
  18852. var result, codePoints, index;
  18853. if (input.charAt(0) == '[') {
  18854. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  18855. result = parseIPv6(input.slice(1, -1));
  18856. if (!result) return INVALID_HOST;
  18857. url.host = result;
  18858. // opaque host
  18859. } else if (!isSpecial(url)) {
  18860. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  18861. result = '';
  18862. codePoints = arrayFrom(input);
  18863. for (index = 0; index < codePoints.length; index++) {
  18864. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  18865. }
  18866. url.host = result;
  18867. } else {
  18868. input = toASCII(input);
  18869. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  18870. result = parseIPv4(input);
  18871. if (result === null) return INVALID_HOST;
  18872. url.host = result;
  18873. }
  18874. };
  18875. var parseIPv4 = function (input) {
  18876. var parts = input.split('.');
  18877. var partsLength, numbers, index, part, radix, number, ipv4;
  18878. if (parts.length && parts[parts.length - 1] == '') {
  18879. parts.pop();
  18880. }
  18881. partsLength = parts.length;
  18882. if (partsLength > 4) return input;
  18883. numbers = [];
  18884. for (index = 0; index < partsLength; index++) {
  18885. part = parts[index];
  18886. if (part == '') return input;
  18887. radix = 10;
  18888. if (part.length > 1 && part.charAt(0) == '0') {
  18889. radix = HEX_START.test(part) ? 16 : 8;
  18890. part = part.slice(radix == 8 ? 1 : 2);
  18891. }
  18892. if (part === '') {
  18893. number = 0;
  18894. } else {
  18895. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  18896. number = parseInt(part, radix);
  18897. }
  18898. numbers.push(number);
  18899. }
  18900. for (index = 0; index < partsLength; index++) {
  18901. number = numbers[index];
  18902. if (index == partsLength - 1) {
  18903. if (number >= pow(256, 5 - partsLength)) return null;
  18904. } else if (number > 255) return null;
  18905. }
  18906. ipv4 = numbers.pop();
  18907. for (index = 0; index < numbers.length; index++) {
  18908. ipv4 += numbers[index] * pow(256, 3 - index);
  18909. }
  18910. return ipv4;
  18911. };
  18912. // eslint-disable-next-line max-statements
  18913. var parseIPv6 = function (input) {
  18914. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  18915. var pieceIndex = 0;
  18916. var compress = null;
  18917. var pointer = 0;
  18918. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  18919. var char = function () {
  18920. return input.charAt(pointer);
  18921. };
  18922. if (char() == ':') {
  18923. if (input.charAt(1) != ':') return;
  18924. pointer += 2;
  18925. pieceIndex++;
  18926. compress = pieceIndex;
  18927. }
  18928. while (char()) {
  18929. if (pieceIndex == 8) return;
  18930. if (char() == ':') {
  18931. if (compress !== null) return;
  18932. pointer++;
  18933. pieceIndex++;
  18934. compress = pieceIndex;
  18935. continue;
  18936. }
  18937. value = length = 0;
  18938. while (length < 4 && HEX.test(char())) {
  18939. value = value * 16 + parseInt(char(), 16);
  18940. pointer++;
  18941. length++;
  18942. }
  18943. if (char() == '.') {
  18944. if (length == 0) return;
  18945. pointer -= length;
  18946. if (pieceIndex > 6) return;
  18947. numbersSeen = 0;
  18948. while (char()) {
  18949. ipv4Piece = null;
  18950. if (numbersSeen > 0) {
  18951. if (char() == '.' && numbersSeen < 4) pointer++;
  18952. else return;
  18953. }
  18954. if (!DIGIT.test(char())) return;
  18955. while (DIGIT.test(char())) {
  18956. number = parseInt(char(), 10);
  18957. if (ipv4Piece === null) ipv4Piece = number;
  18958. else if (ipv4Piece == 0) return;
  18959. else ipv4Piece = ipv4Piece * 10 + number;
  18960. if (ipv4Piece > 255) return;
  18961. pointer++;
  18962. }
  18963. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  18964. numbersSeen++;
  18965. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  18966. }
  18967. if (numbersSeen != 4) return;
  18968. break;
  18969. } else if (char() == ':') {
  18970. pointer++;
  18971. if (!char()) return;
  18972. } else if (char()) return;
  18973. address[pieceIndex++] = value;
  18974. }
  18975. if (compress !== null) {
  18976. swaps = pieceIndex - compress;
  18977. pieceIndex = 7;
  18978. while (pieceIndex != 0 && swaps > 0) {
  18979. swap = address[pieceIndex];
  18980. address[pieceIndex--] = address[compress + swaps - 1];
  18981. address[compress + --swaps] = swap;
  18982. }
  18983. } else if (pieceIndex != 8) return;
  18984. return address;
  18985. };
  18986. var findLongestZeroSequence = function (ipv6) {
  18987. var maxIndex = null;
  18988. var maxLength = 1;
  18989. var currStart = null;
  18990. var currLength = 0;
  18991. var index = 0;
  18992. for (; index < 8; index++) {
  18993. if (ipv6[index] !== 0) {
  18994. if (currLength > maxLength) {
  18995. maxIndex = currStart;
  18996. maxLength = currLength;
  18997. }
  18998. currStart = null;
  18999. currLength = 0;
  19000. } else {
  19001. if (currStart === null) currStart = index;
  19002. ++currLength;
  19003. }
  19004. }
  19005. if (currLength > maxLength) {
  19006. maxIndex = currStart;
  19007. maxLength = currLength;
  19008. }
  19009. return maxIndex;
  19010. };
  19011. var serializeHost = function (host) {
  19012. var result, index, compress, ignore0;
  19013. // ipv4
  19014. if (typeof host == 'number') {
  19015. result = [];
  19016. for (index = 0; index < 4; index++) {
  19017. result.unshift(host % 256);
  19018. host = floor(host / 256);
  19019. } return result.join('.');
  19020. // ipv6
  19021. } else if (typeof host == 'object') {
  19022. result = '';
  19023. compress = findLongestZeroSequence(host);
  19024. for (index = 0; index < 8; index++) {
  19025. if (ignore0 && host[index] === 0) continue;
  19026. if (ignore0) ignore0 = false;
  19027. if (compress === index) {
  19028. result += index ? ':' : '::';
  19029. ignore0 = true;
  19030. } else {
  19031. result += host[index].toString(16);
  19032. if (index < 7) result += ':';
  19033. }
  19034. }
  19035. return '[' + result + ']';
  19036. } return host;
  19037. };
  19038. var C0ControlPercentEncodeSet = {};
  19039. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  19040. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  19041. });
  19042. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  19043. '#': 1, '?': 1, '{': 1, '}': 1
  19044. });
  19045. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  19046. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  19047. });
  19048. var percentEncode = function (char, set) {
  19049. var code = codeAt(char, 0);
  19050. return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
  19051. };
  19052. var specialSchemes = {
  19053. ftp: 21,
  19054. file: null,
  19055. http: 80,
  19056. https: 443,
  19057. ws: 80,
  19058. wss: 443
  19059. };
  19060. var isSpecial = function (url) {
  19061. return has(specialSchemes, url.scheme);
  19062. };
  19063. var includesCredentials = function (url) {
  19064. return url.username != '' || url.password != '';
  19065. };
  19066. var cannotHaveUsernamePasswordPort = function (url) {
  19067. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  19068. };
  19069. var isWindowsDriveLetter = function (string, normalized) {
  19070. var second;
  19071. return string.length == 2 && ALPHA.test(string.charAt(0))
  19072. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  19073. };
  19074. var startsWithWindowsDriveLetter = function (string) {
  19075. var third;
  19076. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  19077. string.length == 2 ||
  19078. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  19079. );
  19080. };
  19081. var shortenURLsPath = function (url) {
  19082. var path = url.path;
  19083. var pathSize = path.length;
  19084. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  19085. path.pop();
  19086. }
  19087. };
  19088. var isSingleDot = function (segment) {
  19089. return segment === '.' || segment.toLowerCase() === '%2e';
  19090. };
  19091. var isDoubleDot = function (segment) {
  19092. segment = segment.toLowerCase();
  19093. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  19094. };
  19095. // States:
  19096. var SCHEME_START = {};
  19097. var SCHEME = {};
  19098. var NO_SCHEME = {};
  19099. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  19100. var PATH_OR_AUTHORITY = {};
  19101. var RELATIVE = {};
  19102. var RELATIVE_SLASH = {};
  19103. var SPECIAL_AUTHORITY_SLASHES = {};
  19104. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  19105. var AUTHORITY = {};
  19106. var HOST = {};
  19107. var HOSTNAME = {};
  19108. var PORT = {};
  19109. var FILE = {};
  19110. var FILE_SLASH = {};
  19111. var FILE_HOST = {};
  19112. var PATH_START = {};
  19113. var PATH = {};
  19114. var CANNOT_BE_A_BASE_URL_PATH = {};
  19115. var QUERY = {};
  19116. var FRAGMENT = {};
  19117. // eslint-disable-next-line max-statements
  19118. var parseURL = function (url, input, stateOverride, base) {
  19119. var state = stateOverride || SCHEME_START;
  19120. var pointer = 0;
  19121. var buffer = '';
  19122. var seenAt = false;
  19123. var seenBracket = false;
  19124. var seenPasswordToken = false;
  19125. var codePoints, char, bufferCodePoints, failure;
  19126. if (!stateOverride) {
  19127. url.scheme = '';
  19128. url.username = '';
  19129. url.password = '';
  19130. url.host = null;
  19131. url.port = null;
  19132. url.path = [];
  19133. url.query = null;
  19134. url.fragment = null;
  19135. url.cannotBeABaseURL = false;
  19136. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  19137. }
  19138. input = input.replace(TAB_AND_NEW_LINE, '');
  19139. codePoints = arrayFrom(input);
  19140. while (pointer <= codePoints.length) {
  19141. char = codePoints[pointer];
  19142. switch (state) {
  19143. case SCHEME_START:
  19144. if (char && ALPHA.test(char)) {
  19145. buffer += char.toLowerCase();
  19146. state = SCHEME;
  19147. } else if (!stateOverride) {
  19148. state = NO_SCHEME;
  19149. continue;
  19150. } else return INVALID_SCHEME;
  19151. break;
  19152. case SCHEME:
  19153. if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
  19154. buffer += char.toLowerCase();
  19155. } else if (char == ':') {
  19156. if (stateOverride && (
  19157. (isSpecial(url) != has(specialSchemes, buffer)) ||
  19158. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  19159. (url.scheme == 'file' && !url.host)
  19160. )) return;
  19161. url.scheme = buffer;
  19162. if (stateOverride) {
  19163. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  19164. return;
  19165. }
  19166. buffer = '';
  19167. if (url.scheme == 'file') {
  19168. state = FILE;
  19169. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  19170. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  19171. } else if (isSpecial(url)) {
  19172. state = SPECIAL_AUTHORITY_SLASHES;
  19173. } else if (codePoints[pointer + 1] == '/') {
  19174. state = PATH_OR_AUTHORITY;
  19175. pointer++;
  19176. } else {
  19177. url.cannotBeABaseURL = true;
  19178. url.path.push('');
  19179. state = CANNOT_BE_A_BASE_URL_PATH;
  19180. }
  19181. } else if (!stateOverride) {
  19182. buffer = '';
  19183. state = NO_SCHEME;
  19184. pointer = 0;
  19185. continue;
  19186. } else return INVALID_SCHEME;
  19187. break;
  19188. case NO_SCHEME:
  19189. if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
  19190. if (base.cannotBeABaseURL && char == '#') {
  19191. url.scheme = base.scheme;
  19192. url.path = base.path.slice();
  19193. url.query = base.query;
  19194. url.fragment = '';
  19195. url.cannotBeABaseURL = true;
  19196. state = FRAGMENT;
  19197. break;
  19198. }
  19199. state = base.scheme == 'file' ? FILE : RELATIVE;
  19200. continue;
  19201. case SPECIAL_RELATIVE_OR_AUTHORITY:
  19202. if (char == '/' && codePoints[pointer + 1] == '/') {
  19203. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  19204. pointer++;
  19205. } else {
  19206. state = RELATIVE;
  19207. continue;
  19208. } break;
  19209. case PATH_OR_AUTHORITY:
  19210. if (char == '/') {
  19211. state = AUTHORITY;
  19212. break;
  19213. } else {
  19214. state = PATH;
  19215. continue;
  19216. }
  19217. case RELATIVE:
  19218. url.scheme = base.scheme;
  19219. if (char == EOF) {
  19220. url.username = base.username;
  19221. url.password = base.password;
  19222. url.host = base.host;
  19223. url.port = base.port;
  19224. url.path = base.path.slice();
  19225. url.query = base.query;
  19226. } else if (char == '/' || (char == '\\' && isSpecial(url))) {
  19227. state = RELATIVE_SLASH;
  19228. } else if (char == '?') {
  19229. url.username = base.username;
  19230. url.password = base.password;
  19231. url.host = base.host;
  19232. url.port = base.port;
  19233. url.path = base.path.slice();
  19234. url.query = '';
  19235. state = QUERY;
  19236. } else if (char == '#') {
  19237. url.username = base.username;
  19238. url.password = base.password;
  19239. url.host = base.host;
  19240. url.port = base.port;
  19241. url.path = base.path.slice();
  19242. url.query = base.query;
  19243. url.fragment = '';
  19244. state = FRAGMENT;
  19245. } else {
  19246. url.username = base.username;
  19247. url.password = base.password;
  19248. url.host = base.host;
  19249. url.port = base.port;
  19250. url.path = base.path.slice();
  19251. url.path.pop();
  19252. state = PATH;
  19253. continue;
  19254. } break;
  19255. case RELATIVE_SLASH:
  19256. if (isSpecial(url) && (char == '/' || char == '\\')) {
  19257. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  19258. } else if (char == '/') {
  19259. state = AUTHORITY;
  19260. } else {
  19261. url.username = base.username;
  19262. url.password = base.password;
  19263. url.host = base.host;
  19264. url.port = base.port;
  19265. state = PATH;
  19266. continue;
  19267. } break;
  19268. case SPECIAL_AUTHORITY_SLASHES:
  19269. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  19270. if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
  19271. pointer++;
  19272. break;
  19273. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  19274. if (char != '/' && char != '\\') {
  19275. state = AUTHORITY;
  19276. continue;
  19277. } break;
  19278. case AUTHORITY:
  19279. if (char == '@') {
  19280. if (seenAt) buffer = '%40' + buffer;
  19281. seenAt = true;
  19282. bufferCodePoints = arrayFrom(buffer);
  19283. for (var i = 0; i < bufferCodePoints.length; i++) {
  19284. var codePoint = bufferCodePoints[i];
  19285. if (codePoint == ':' && !seenPasswordToken) {
  19286. seenPasswordToken = true;
  19287. continue;
  19288. }
  19289. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  19290. if (seenPasswordToken) url.password += encodedCodePoints;
  19291. else url.username += encodedCodePoints;
  19292. }
  19293. buffer = '';
  19294. } else if (
  19295. char == EOF || char == '/' || char == '?' || char == '#' ||
  19296. (char == '\\' && isSpecial(url))
  19297. ) {
  19298. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  19299. pointer -= arrayFrom(buffer).length + 1;
  19300. buffer = '';
  19301. state = HOST;
  19302. } else buffer += char;
  19303. break;
  19304. case HOST:
  19305. case HOSTNAME:
  19306. if (stateOverride && url.scheme == 'file') {
  19307. state = FILE_HOST;
  19308. continue;
  19309. } else if (char == ':' && !seenBracket) {
  19310. if (buffer == '') return INVALID_HOST;
  19311. failure = parseHost(url, buffer);
  19312. if (failure) return failure;
  19313. buffer = '';
  19314. state = PORT;
  19315. if (stateOverride == HOSTNAME) return;
  19316. } else if (
  19317. char == EOF || char == '/' || char == '?' || char == '#' ||
  19318. (char == '\\' && isSpecial(url))
  19319. ) {
  19320. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  19321. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  19322. failure = parseHost(url, buffer);
  19323. if (failure) return failure;
  19324. buffer = '';
  19325. state = PATH_START;
  19326. if (stateOverride) return;
  19327. continue;
  19328. } else {
  19329. if (char == '[') seenBracket = true;
  19330. else if (char == ']') seenBracket = false;
  19331. buffer += char;
  19332. } break;
  19333. case PORT:
  19334. if (DIGIT.test(char)) {
  19335. buffer += char;
  19336. } else if (
  19337. char == EOF || char == '/' || char == '?' || char == '#' ||
  19338. (char == '\\' && isSpecial(url)) ||
  19339. stateOverride
  19340. ) {
  19341. if (buffer != '') {
  19342. var port = parseInt(buffer, 10);
  19343. if (port > 0xFFFF) return INVALID_PORT;
  19344. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  19345. buffer = '';
  19346. }
  19347. if (stateOverride) return;
  19348. state = PATH_START;
  19349. continue;
  19350. } else return INVALID_PORT;
  19351. break;
  19352. case FILE:
  19353. url.scheme = 'file';
  19354. if (char == '/' || char == '\\') state = FILE_SLASH;
  19355. else if (base && base.scheme == 'file') {
  19356. if (char == EOF) {
  19357. url.host = base.host;
  19358. url.path = base.path.slice();
  19359. url.query = base.query;
  19360. } else if (char == '?') {
  19361. url.host = base.host;
  19362. url.path = base.path.slice();
  19363. url.query = '';
  19364. state = QUERY;
  19365. } else if (char == '#') {
  19366. url.host = base.host;
  19367. url.path = base.path.slice();
  19368. url.query = base.query;
  19369. url.fragment = '';
  19370. state = FRAGMENT;
  19371. } else {
  19372. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  19373. url.host = base.host;
  19374. url.path = base.path.slice();
  19375. shortenURLsPath(url);
  19376. }
  19377. state = PATH;
  19378. continue;
  19379. }
  19380. } else {
  19381. state = PATH;
  19382. continue;
  19383. } break;
  19384. case FILE_SLASH:
  19385. if (char == '/' || char == '\\') {
  19386. state = FILE_HOST;
  19387. break;
  19388. }
  19389. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  19390. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  19391. else url.host = base.host;
  19392. }
  19393. state = PATH;
  19394. continue;
  19395. case FILE_HOST:
  19396. if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
  19397. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  19398. state = PATH;
  19399. } else if (buffer == '') {
  19400. url.host = '';
  19401. if (stateOverride) return;
  19402. state = PATH_START;
  19403. } else {
  19404. failure = parseHost(url, buffer);
  19405. if (failure) return failure;
  19406. if (url.host == 'localhost') url.host = '';
  19407. if (stateOverride) return;
  19408. buffer = '';
  19409. state = PATH_START;
  19410. } continue;
  19411. } else buffer += char;
  19412. break;
  19413. case PATH_START:
  19414. if (isSpecial(url)) {
  19415. state = PATH;
  19416. if (char != '/' && char != '\\') continue;
  19417. } else if (!stateOverride && char == '?') {
  19418. url.query = '';
  19419. state = QUERY;
  19420. } else if (!stateOverride && char == '#') {
  19421. url.fragment = '';
  19422. state = FRAGMENT;
  19423. } else if (char != EOF) {
  19424. state = PATH;
  19425. if (char != '/') continue;
  19426. } break;
  19427. case PATH:
  19428. if (
  19429. char == EOF || char == '/' ||
  19430. (char == '\\' && isSpecial(url)) ||
  19431. (!stateOverride && (char == '?' || char == '#'))
  19432. ) {
  19433. if (isDoubleDot(buffer)) {
  19434. shortenURLsPath(url);
  19435. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  19436. url.path.push('');
  19437. }
  19438. } else if (isSingleDot(buffer)) {
  19439. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  19440. url.path.push('');
  19441. }
  19442. } else {
  19443. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  19444. if (url.host) url.host = '';
  19445. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  19446. }
  19447. url.path.push(buffer);
  19448. }
  19449. buffer = '';
  19450. if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
  19451. while (url.path.length > 1 && url.path[0] === '') {
  19452. url.path.shift();
  19453. }
  19454. }
  19455. if (char == '?') {
  19456. url.query = '';
  19457. state = QUERY;
  19458. } else if (char == '#') {
  19459. url.fragment = '';
  19460. state = FRAGMENT;
  19461. }
  19462. } else {
  19463. buffer += percentEncode(char, pathPercentEncodeSet);
  19464. } break;
  19465. case CANNOT_BE_A_BASE_URL_PATH:
  19466. if (char == '?') {
  19467. url.query = '';
  19468. state = QUERY;
  19469. } else if (char == '#') {
  19470. url.fragment = '';
  19471. state = FRAGMENT;
  19472. } else if (char != EOF) {
  19473. url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
  19474. } break;
  19475. case QUERY:
  19476. if (!stateOverride && char == '#') {
  19477. url.fragment = '';
  19478. state = FRAGMENT;
  19479. } else if (char != EOF) {
  19480. if (char == "'" && isSpecial(url)) url.query += '%27';
  19481. else if (char == '#') url.query += '%23';
  19482. else url.query += percentEncode(char, C0ControlPercentEncodeSet);
  19483. } break;
  19484. case FRAGMENT:
  19485. if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
  19486. break;
  19487. }
  19488. pointer++;
  19489. }
  19490. };
  19491. // `URL` constructor
  19492. // https://url.spec.whatwg.org/#url-class
  19493. var URLConstructor = function URL(url /* , base */) {
  19494. var that = anInstance(this, URLConstructor, 'URL');
  19495. var base = arguments.length > 1 ? arguments[1] : undefined;
  19496. var urlString = String(url);
  19497. var state = setInternalState(that, { type: 'URL' });
  19498. var baseState, failure;
  19499. if (base !== undefined) {
  19500. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  19501. else {
  19502. failure = parseURL(baseState = {}, String(base));
  19503. if (failure) throw TypeError(failure);
  19504. }
  19505. }
  19506. failure = parseURL(state, urlString, null, baseState);
  19507. if (failure) throw TypeError(failure);
  19508. var searchParams = state.searchParams = new URLSearchParams();
  19509. var searchParamsState = getInternalSearchParamsState(searchParams);
  19510. searchParamsState.updateSearchParams(state.query);
  19511. searchParamsState.updateURL = function () {
  19512. state.query = String(searchParams) || null;
  19513. };
  19514. if (!DESCRIPTORS) {
  19515. that.href = serializeURL.call(that);
  19516. that.origin = getOrigin.call(that);
  19517. that.protocol = getProtocol.call(that);
  19518. that.username = getUsername.call(that);
  19519. that.password = getPassword.call(that);
  19520. that.host = getHost.call(that);
  19521. that.hostname = getHostname.call(that);
  19522. that.port = getPort.call(that);
  19523. that.pathname = getPathname.call(that);
  19524. that.search = getSearch.call(that);
  19525. that.searchParams = getSearchParams.call(that);
  19526. that.hash = getHash.call(that);
  19527. }
  19528. };
  19529. var URLPrototype = URLConstructor.prototype;
  19530. var serializeURL = function () {
  19531. var url = getInternalURLState(this);
  19532. var scheme = url.scheme;
  19533. var username = url.username;
  19534. var password = url.password;
  19535. var host = url.host;
  19536. var port = url.port;
  19537. var path = url.path;
  19538. var query = url.query;
  19539. var fragment = url.fragment;
  19540. var output = scheme + ':';
  19541. if (host !== null) {
  19542. output += '//';
  19543. if (includesCredentials(url)) {
  19544. output += username + (password ? ':' + password : '') + '@';
  19545. }
  19546. output += serializeHost(host);
  19547. if (port !== null) output += ':' + port;
  19548. } else if (scheme == 'file') output += '//';
  19549. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  19550. if (query !== null) output += '?' + query;
  19551. if (fragment !== null) output += '#' + fragment;
  19552. return output;
  19553. };
  19554. var getOrigin = function () {
  19555. var url = getInternalURLState(this);
  19556. var scheme = url.scheme;
  19557. var port = url.port;
  19558. if (scheme == 'blob') try {
  19559. return new URL(scheme.path[0]).origin;
  19560. } catch (error) {
  19561. return 'null';
  19562. }
  19563. if (scheme == 'file' || !isSpecial(url)) return 'null';
  19564. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  19565. };
  19566. var getProtocol = function () {
  19567. return getInternalURLState(this).scheme + ':';
  19568. };
  19569. var getUsername = function () {
  19570. return getInternalURLState(this).username;
  19571. };
  19572. var getPassword = function () {
  19573. return getInternalURLState(this).password;
  19574. };
  19575. var getHost = function () {
  19576. var url = getInternalURLState(this);
  19577. var host = url.host;
  19578. var port = url.port;
  19579. return host === null ? ''
  19580. : port === null ? serializeHost(host)
  19581. : serializeHost(host) + ':' + port;
  19582. };
  19583. var getHostname = function () {
  19584. var host = getInternalURLState(this).host;
  19585. return host === null ? '' : serializeHost(host);
  19586. };
  19587. var getPort = function () {
  19588. var port = getInternalURLState(this).port;
  19589. return port === null ? '' : String(port);
  19590. };
  19591. var getPathname = function () {
  19592. var url = getInternalURLState(this);
  19593. var path = url.path;
  19594. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  19595. };
  19596. var getSearch = function () {
  19597. var query = getInternalURLState(this).query;
  19598. return query ? '?' + query : '';
  19599. };
  19600. var getSearchParams = function () {
  19601. return getInternalURLState(this).searchParams;
  19602. };
  19603. var getHash = function () {
  19604. var fragment = getInternalURLState(this).fragment;
  19605. return fragment ? '#' + fragment : '';
  19606. };
  19607. var accessorDescriptor = function (getter, setter) {
  19608. return { get: getter, set: setter, configurable: true, enumerable: true };
  19609. };
  19610. if (DESCRIPTORS) {
  19611. defineProperties(URLPrototype, {
  19612. // `URL.prototype.href` accessors pair
  19613. // https://url.spec.whatwg.org/#dom-url-href
  19614. href: accessorDescriptor(serializeURL, function (href) {
  19615. var url = getInternalURLState(this);
  19616. var urlString = String(href);
  19617. var failure = parseURL(url, urlString);
  19618. if (failure) throw TypeError(failure);
  19619. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  19620. }),
  19621. // `URL.prototype.origin` getter
  19622. // https://url.spec.whatwg.org/#dom-url-origin
  19623. origin: accessorDescriptor(getOrigin),
  19624. // `URL.prototype.protocol` accessors pair
  19625. // https://url.spec.whatwg.org/#dom-url-protocol
  19626. protocol: accessorDescriptor(getProtocol, function (protocol) {
  19627. var url = getInternalURLState(this);
  19628. parseURL(url, String(protocol) + ':', SCHEME_START);
  19629. }),
  19630. // `URL.prototype.username` accessors pair
  19631. // https://url.spec.whatwg.org/#dom-url-username
  19632. username: accessorDescriptor(getUsername, function (username) {
  19633. var url = getInternalURLState(this);
  19634. var codePoints = arrayFrom(String(username));
  19635. if (cannotHaveUsernamePasswordPort(url)) return;
  19636. url.username = '';
  19637. for (var i = 0; i < codePoints.length; i++) {
  19638. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  19639. }
  19640. }),
  19641. // `URL.prototype.password` accessors pair
  19642. // https://url.spec.whatwg.org/#dom-url-password
  19643. password: accessorDescriptor(getPassword, function (password) {
  19644. var url = getInternalURLState(this);
  19645. var codePoints = arrayFrom(String(password));
  19646. if (cannotHaveUsernamePasswordPort(url)) return;
  19647. url.password = '';
  19648. for (var i = 0; i < codePoints.length; i++) {
  19649. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  19650. }
  19651. }),
  19652. // `URL.prototype.host` accessors pair
  19653. // https://url.spec.whatwg.org/#dom-url-host
  19654. host: accessorDescriptor(getHost, function (host) {
  19655. var url = getInternalURLState(this);
  19656. if (url.cannotBeABaseURL) return;
  19657. parseURL(url, String(host), HOST);
  19658. }),
  19659. // `URL.prototype.hostname` accessors pair
  19660. // https://url.spec.whatwg.org/#dom-url-hostname
  19661. hostname: accessorDescriptor(getHostname, function (hostname) {
  19662. var url = getInternalURLState(this);
  19663. if (url.cannotBeABaseURL) return;
  19664. parseURL(url, String(hostname), HOSTNAME);
  19665. }),
  19666. // `URL.prototype.port` accessors pair
  19667. // https://url.spec.whatwg.org/#dom-url-port
  19668. port: accessorDescriptor(getPort, function (port) {
  19669. var url = getInternalURLState(this);
  19670. if (cannotHaveUsernamePasswordPort(url)) return;
  19671. port = String(port);
  19672. if (port == '') url.port = null;
  19673. else parseURL(url, port, PORT);
  19674. }),
  19675. // `URL.prototype.pathname` accessors pair
  19676. // https://url.spec.whatwg.org/#dom-url-pathname
  19677. pathname: accessorDescriptor(getPathname, function (pathname) {
  19678. var url = getInternalURLState(this);
  19679. if (url.cannotBeABaseURL) return;
  19680. url.path = [];
  19681. parseURL(url, pathname + '', PATH_START);
  19682. }),
  19683. // `URL.prototype.search` accessors pair
  19684. // https://url.spec.whatwg.org/#dom-url-search
  19685. search: accessorDescriptor(getSearch, function (search) {
  19686. var url = getInternalURLState(this);
  19687. search = String(search);
  19688. if (search == '') {
  19689. url.query = null;
  19690. } else {
  19691. if ('?' == search.charAt(0)) search = search.slice(1);
  19692. url.query = '';
  19693. parseURL(url, search, QUERY);
  19694. }
  19695. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  19696. }),
  19697. // `URL.prototype.searchParams` getter
  19698. // https://url.spec.whatwg.org/#dom-url-searchparams
  19699. searchParams: accessorDescriptor(getSearchParams),
  19700. // `URL.prototype.hash` accessors pair
  19701. // https://url.spec.whatwg.org/#dom-url-hash
  19702. hash: accessorDescriptor(getHash, function (hash) {
  19703. var url = getInternalURLState(this);
  19704. hash = String(hash);
  19705. if (hash == '') {
  19706. url.fragment = null;
  19707. return;
  19708. }
  19709. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  19710. url.fragment = '';
  19711. parseURL(url, hash, FRAGMENT);
  19712. })
  19713. });
  19714. }
  19715. // `URL.prototype.toJSON` method
  19716. // https://url.spec.whatwg.org/#dom-url-tojson
  19717. redefine(URLPrototype, 'toJSON', function toJSON() {
  19718. return serializeURL.call(this);
  19719. }, { enumerable: true });
  19720. // `URL.prototype.toString` method
  19721. // https://url.spec.whatwg.org/#URL-stringification-behavior
  19722. redefine(URLPrototype, 'toString', function toString() {
  19723. return serializeURL.call(this);
  19724. }, { enumerable: true });
  19725. if (NativeURL) {
  19726. var nativeCreateObjectURL = NativeURL.createObjectURL;
  19727. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  19728. // `URL.createObjectURL` method
  19729. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  19730. // eslint-disable-next-line no-unused-vars
  19731. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  19732. return nativeCreateObjectURL.apply(NativeURL, arguments);
  19733. });
  19734. // `URL.revokeObjectURL` method
  19735. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  19736. // eslint-disable-next-line no-unused-vars
  19737. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  19738. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  19739. });
  19740. }
  19741. setToStringTag(URLConstructor, 'URL');
  19742. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  19743. URL: URLConstructor
  19744. });
  19745. /***/ }),
  19746. /***/ "./node_modules/debug/src/browser.js":
  19747. /*!*******************************************!*\
  19748. !*** ./node_modules/debug/src/browser.js ***!
  19749. \*******************************************/
  19750. /*! unknown exports (runtime-defined) */
  19751. /*! runtime requirements: __webpack_exports__, module, __webpack_require__ */
  19752. /*! CommonJS bailout: module.exports.humanize(...) prevents optimization as module.exports is passed as call context at 142:8-31 */
  19753. /*! CommonJS bailout: exports is used directly at 245:37-44 */
  19754. /*! CommonJS bailout: module.exports is used directly at 245:0-14 */
  19755. /*! CommonJS bailout: module.exports is used directly at 247:21-35 */
  19756. /***/ ((module, exports, __webpack_require__) => {
  19757. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  19758. /* eslint-env browser */
  19759. /**
  19760. * This is the web browser implementation of `debug()`.
  19761. */
  19762. exports.formatArgs = formatArgs;
  19763. exports.save = save;
  19764. exports.load = load;
  19765. exports.useColors = useColors;
  19766. exports.storage = localstorage();
  19767. /**
  19768. * Colors.
  19769. */
  19770. exports.colors = [
  19771. '#0000CC',
  19772. '#0000FF',
  19773. '#0033CC',
  19774. '#0033FF',
  19775. '#0066CC',
  19776. '#0066FF',
  19777. '#0099CC',
  19778. '#0099FF',
  19779. '#00CC00',
  19780. '#00CC33',
  19781. '#00CC66',
  19782. '#00CC99',
  19783. '#00CCCC',
  19784. '#00CCFF',
  19785. '#3300CC',
  19786. '#3300FF',
  19787. '#3333CC',
  19788. '#3333FF',
  19789. '#3366CC',
  19790. '#3366FF',
  19791. '#3399CC',
  19792. '#3399FF',
  19793. '#33CC00',
  19794. '#33CC33',
  19795. '#33CC66',
  19796. '#33CC99',
  19797. '#33CCCC',
  19798. '#33CCFF',
  19799. '#6600CC',
  19800. '#6600FF',
  19801. '#6633CC',
  19802. '#6633FF',
  19803. '#66CC00',
  19804. '#66CC33',
  19805. '#9900CC',
  19806. '#9900FF',
  19807. '#9933CC',
  19808. '#9933FF',
  19809. '#99CC00',
  19810. '#99CC33',
  19811. '#CC0000',
  19812. '#CC0033',
  19813. '#CC0066',
  19814. '#CC0099',
  19815. '#CC00CC',
  19816. '#CC00FF',
  19817. '#CC3300',
  19818. '#CC3333',
  19819. '#CC3366',
  19820. '#CC3399',
  19821. '#CC33CC',
  19822. '#CC33FF',
  19823. '#CC6600',
  19824. '#CC6633',
  19825. '#CC9900',
  19826. '#CC9933',
  19827. '#CCCC00',
  19828. '#CCCC33',
  19829. '#FF0000',
  19830. '#FF0033',
  19831. '#FF0066',
  19832. '#FF0099',
  19833. '#FF00CC',
  19834. '#FF00FF',
  19835. '#FF3300',
  19836. '#FF3333',
  19837. '#FF3366',
  19838. '#FF3399',
  19839. '#FF33CC',
  19840. '#FF33FF',
  19841. '#FF6600',
  19842. '#FF6633',
  19843. '#FF9900',
  19844. '#FF9933',
  19845. '#FFCC00',
  19846. '#FFCC33'
  19847. ];
  19848. /**
  19849. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  19850. * and the Firebug extension (any Firefox version) are known
  19851. * to support "%c" CSS customizations.
  19852. *
  19853. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  19854. */
  19855. // eslint-disable-next-line complexity
  19856. function useColors() {
  19857. // NB: In an Electron preload script, document will be defined but not fully
  19858. // initialized. Since we know we're in Chrome, we'll just detect this case
  19859. // explicitly
  19860. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  19861. return true;
  19862. }
  19863. // Internet Explorer and Edge do not support colors.
  19864. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  19865. return false;
  19866. }
  19867. // Is webkit? http://stackoverflow.com/a/16459606/376773
  19868. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  19869. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  19870. // Is firebug? http://stackoverflow.com/a/398120/376773
  19871. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  19872. // Is firefox >= v31?
  19873. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  19874. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  19875. // Double check webkit in userAgent just in case we are in a worker
  19876. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  19877. }
  19878. /**
  19879. * Colorize log arguments if enabled.
  19880. *
  19881. * @api public
  19882. */
  19883. function formatArgs(args) {
  19884. args[0] = (this.useColors ? '%c' : '') +
  19885. this.namespace +
  19886. (this.useColors ? ' %c' : ' ') +
  19887. args[0] +
  19888. (this.useColors ? '%c ' : ' ') +
  19889. '+' + module.exports.humanize(this.diff);
  19890. if (!this.useColors) {
  19891. return;
  19892. }
  19893. const c = 'color: ' + this.color;
  19894. args.splice(1, 0, c, 'color: inherit');
  19895. // The final "%c" is somewhat tricky, because there could be other
  19896. // arguments passed either before or after the %c, so we need to
  19897. // figure out the correct index to insert the CSS into
  19898. let index = 0;
  19899. let lastC = 0;
  19900. args[0].replace(/%[a-zA-Z%]/g, match => {
  19901. if (match === '%%') {
  19902. return;
  19903. }
  19904. index++;
  19905. if (match === '%c') {
  19906. // We only are interested in the *last* %c
  19907. // (the user may have provided their own)
  19908. lastC = index;
  19909. }
  19910. });
  19911. args.splice(lastC, 0, c);
  19912. }
  19913. /**
  19914. * Invokes `console.debug()` when available.
  19915. * No-op when `console.debug` is not a "function".
  19916. * If `console.debug` is not available, falls back
  19917. * to `console.log`.
  19918. *
  19919. * @api public
  19920. */
  19921. exports.log = console.debug || console.log || (() => {});
  19922. /**
  19923. * Save `namespaces`.
  19924. *
  19925. * @param {String} namespaces
  19926. * @api private
  19927. */
  19928. function save(namespaces) {
  19929. try {
  19930. if (namespaces) {
  19931. exports.storage.setItem('debug', namespaces);
  19932. } else {
  19933. exports.storage.removeItem('debug');
  19934. }
  19935. } catch (error) {
  19936. // Swallow
  19937. // XXX (@Qix-) should we be logging these?
  19938. }
  19939. }
  19940. /**
  19941. * Load `namespaces`.
  19942. *
  19943. * @return {String} returns the previously persisted debug modes
  19944. * @api private
  19945. */
  19946. function load() {
  19947. let r;
  19948. try {
  19949. r = exports.storage.getItem('debug');
  19950. } catch (error) {
  19951. // Swallow
  19952. // XXX (@Qix-) should we be logging these?
  19953. }
  19954. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  19955. if (!r && typeof process !== 'undefined' && 'env' in process) {
  19956. r = process.env.DEBUG;
  19957. }
  19958. return r;
  19959. }
  19960. /**
  19961. * Localstorage attempts to return the localstorage.
  19962. *
  19963. * This is necessary because safari throws
  19964. * when a user disables cookies/localstorage
  19965. * and you attempt to access it.
  19966. *
  19967. * @return {LocalStorage}
  19968. * @api private
  19969. */
  19970. function localstorage() {
  19971. try {
  19972. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  19973. // The Browser also has localStorage in the global context.
  19974. return localStorage;
  19975. } catch (error) {
  19976. // Swallow
  19977. // XXX (@Qix-) should we be logging these?
  19978. }
  19979. }
  19980. module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports);
  19981. const {formatters} = module.exports;
  19982. /**
  19983. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  19984. */
  19985. formatters.j = function (v) {
  19986. try {
  19987. return JSON.stringify(v);
  19988. } catch (error) {
  19989. return '[UnexpectedJSONParseError]: ' + error.message;
  19990. }
  19991. };
  19992. /***/ }),
  19993. /***/ "./node_modules/debug/src/common.js":
  19994. /*!******************************************!*\
  19995. !*** ./node_modules/debug/src/common.js ***!
  19996. \******************************************/
  19997. /*! unknown exports (runtime-defined) */
  19998. /*! runtime requirements: module, __webpack_require__ */
  19999. /*! CommonJS bailout: module.exports is used directly at 264:0-14 */
  20000. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  20001. /**
  20002. * This is the common logic for both the Node.js and web browser
  20003. * implementations of `debug()`.
  20004. */
  20005. function setup(env) {
  20006. createDebug.debug = createDebug;
  20007. createDebug.default = createDebug;
  20008. createDebug.coerce = coerce;
  20009. createDebug.disable = disable;
  20010. createDebug.enable = enable;
  20011. createDebug.enabled = enabled;
  20012. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
  20013. Object.keys(env).forEach(key => {
  20014. createDebug[key] = env[key];
  20015. });
  20016. /**
  20017. * Active `debug` instances.
  20018. */
  20019. createDebug.instances = [];
  20020. /**
  20021. * The currently active debug mode names, and names to skip.
  20022. */
  20023. createDebug.names = [];
  20024. createDebug.skips = [];
  20025. /**
  20026. * Map of special "%n" handling functions, for the debug "format" argument.
  20027. *
  20028. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  20029. */
  20030. createDebug.formatters = {};
  20031. /**
  20032. * Selects a color for a debug namespace
  20033. * @param {String} namespace The namespace string for the for the debug instance to be colored
  20034. * @return {Number|String} An ANSI color code for the given namespace
  20035. * @api private
  20036. */
  20037. function selectColor(namespace) {
  20038. let hash = 0;
  20039. for (let i = 0; i < namespace.length; i++) {
  20040. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  20041. hash |= 0; // Convert to 32bit integer
  20042. }
  20043. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  20044. }
  20045. createDebug.selectColor = selectColor;
  20046. /**
  20047. * Create a debugger with the given `namespace`.
  20048. *
  20049. * @param {String} namespace
  20050. * @return {Function}
  20051. * @api public
  20052. */
  20053. function createDebug(namespace) {
  20054. let prevTime;
  20055. function debug(...args) {
  20056. // Disabled?
  20057. if (!debug.enabled) {
  20058. return;
  20059. }
  20060. const self = debug;
  20061. // Set `diff` timestamp
  20062. const curr = Number(new Date());
  20063. const ms = curr - (prevTime || curr);
  20064. self.diff = ms;
  20065. self.prev = prevTime;
  20066. self.curr = curr;
  20067. prevTime = curr;
  20068. args[0] = createDebug.coerce(args[0]);
  20069. if (typeof args[0] !== 'string') {
  20070. // Anything else let's inspect with %O
  20071. args.unshift('%O');
  20072. }
  20073. // Apply any `formatters` transformations
  20074. let index = 0;
  20075. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  20076. // If we encounter an escaped % then don't increase the array index
  20077. if (match === '%%') {
  20078. return match;
  20079. }
  20080. index++;
  20081. const formatter = createDebug.formatters[format];
  20082. if (typeof formatter === 'function') {
  20083. const val = args[index];
  20084. match = formatter.call(self, val);
  20085. // Now we need to remove `args[index]` since it's inlined in the `format`
  20086. args.splice(index, 1);
  20087. index--;
  20088. }
  20089. return match;
  20090. });
  20091. // Apply env-specific formatting (colors, etc.)
  20092. createDebug.formatArgs.call(self, args);
  20093. const logFn = self.log || createDebug.log;
  20094. logFn.apply(self, args);
  20095. }
  20096. debug.namespace = namespace;
  20097. debug.enabled = createDebug.enabled(namespace);
  20098. debug.useColors = createDebug.useColors();
  20099. debug.color = createDebug.selectColor(namespace);
  20100. debug.destroy = destroy;
  20101. debug.extend = extend;
  20102. // Env-specific initialization logic for debug instances
  20103. if (typeof createDebug.init === 'function') {
  20104. createDebug.init(debug);
  20105. }
  20106. createDebug.instances.push(debug);
  20107. return debug;
  20108. }
  20109. function destroy() {
  20110. const index = createDebug.instances.indexOf(this);
  20111. if (index !== -1) {
  20112. createDebug.instances.splice(index, 1);
  20113. return true;
  20114. }
  20115. return false;
  20116. }
  20117. function extend(namespace, delimiter) {
  20118. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  20119. newDebug.log = this.log;
  20120. return newDebug;
  20121. }
  20122. /**
  20123. * Enables a debug mode by namespaces. This can include modes
  20124. * separated by a colon and wildcards.
  20125. *
  20126. * @param {String} namespaces
  20127. * @api public
  20128. */
  20129. function enable(namespaces) {
  20130. createDebug.save(namespaces);
  20131. createDebug.names = [];
  20132. createDebug.skips = [];
  20133. let i;
  20134. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  20135. const len = split.length;
  20136. for (i = 0; i < len; i++) {
  20137. if (!split[i]) {
  20138. // ignore empty strings
  20139. continue;
  20140. }
  20141. namespaces = split[i].replace(/\*/g, '.*?');
  20142. if (namespaces[0] === '-') {
  20143. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  20144. } else {
  20145. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  20146. }
  20147. }
  20148. for (i = 0; i < createDebug.instances.length; i++) {
  20149. const instance = createDebug.instances[i];
  20150. instance.enabled = createDebug.enabled(instance.namespace);
  20151. }
  20152. }
  20153. /**
  20154. * Disable debug output.
  20155. *
  20156. * @return {String} namespaces
  20157. * @api public
  20158. */
  20159. function disable() {
  20160. const namespaces = [
  20161. ...createDebug.names.map(toNamespace),
  20162. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  20163. ].join(',');
  20164. createDebug.enable('');
  20165. return namespaces;
  20166. }
  20167. /**
  20168. * Returns true if the given mode name is enabled, false otherwise.
  20169. *
  20170. * @param {String} name
  20171. * @return {Boolean}
  20172. * @api public
  20173. */
  20174. function enabled(name) {
  20175. if (name[name.length - 1] === '*') {
  20176. return true;
  20177. }
  20178. let i;
  20179. let len;
  20180. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  20181. if (createDebug.skips[i].test(name)) {
  20182. return false;
  20183. }
  20184. }
  20185. for (i = 0, len = createDebug.names.length; i < len; i++) {
  20186. if (createDebug.names[i].test(name)) {
  20187. return true;
  20188. }
  20189. }
  20190. return false;
  20191. }
  20192. /**
  20193. * Convert regexp to namespace
  20194. *
  20195. * @param {RegExp} regxep
  20196. * @return {String} namespace
  20197. * @api private
  20198. */
  20199. function toNamespace(regexp) {
  20200. return regexp.toString()
  20201. .substring(2, regexp.toString().length - 2)
  20202. .replace(/\.\*\?$/, '*');
  20203. }
  20204. /**
  20205. * Coerce `val`.
  20206. *
  20207. * @param {Mixed} val
  20208. * @return {Mixed}
  20209. * @api private
  20210. */
  20211. function coerce(val) {
  20212. if (val instanceof Error) {
  20213. return val.stack || val.message;
  20214. }
  20215. return val;
  20216. }
  20217. createDebug.enable(createDebug.load());
  20218. return createDebug;
  20219. }
  20220. module.exports = setup;
  20221. /***/ }),
  20222. /***/ "./node_modules/events/events.js":
  20223. /*!***************************************!*\
  20224. !*** ./node_modules/events/events.js ***!
  20225. \***************************************/
  20226. /*! unknown exports (runtime-defined) */
  20227. /*! runtime requirements: module */
  20228. /*! CommonJS bailout: module.exports is used directly at 56:0-14 */
  20229. /***/ ((module) => {
  20230. "use strict";
  20231. // Copyright Joyent, Inc. and other Node contributors.
  20232. //
  20233. // Permission is hereby granted, free of charge, to any person obtaining a
  20234. // copy of this software and associated documentation files (the
  20235. // "Software"), to deal in the Software without restriction, including
  20236. // without limitation the rights to use, copy, modify, merge, publish,
  20237. // distribute, sublicense, and/or sell copies of the Software, and to permit
  20238. // persons to whom the Software is furnished to do so, subject to the
  20239. // following conditions:
  20240. //
  20241. // The above copyright notice and this permission notice shall be included
  20242. // in all copies or substantial portions of the Software.
  20243. //
  20244. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20245. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20246. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  20247. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  20248. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20249. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20250. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  20251. var R = typeof Reflect === 'object' ? Reflect : null
  20252. var ReflectApply = R && typeof R.apply === 'function'
  20253. ? R.apply
  20254. : function ReflectApply(target, receiver, args) {
  20255. return Function.prototype.apply.call(target, receiver, args);
  20256. }
  20257. var ReflectOwnKeys
  20258. if (R && typeof R.ownKeys === 'function') {
  20259. ReflectOwnKeys = R.ownKeys
  20260. } else if (Object.getOwnPropertySymbols) {
  20261. ReflectOwnKeys = function ReflectOwnKeys(target) {
  20262. return Object.getOwnPropertyNames(target)
  20263. .concat(Object.getOwnPropertySymbols(target));
  20264. };
  20265. } else {
  20266. ReflectOwnKeys = function ReflectOwnKeys(target) {
  20267. return Object.getOwnPropertyNames(target);
  20268. };
  20269. }
  20270. function ProcessEmitWarning(warning) {
  20271. if (console && console.warn) console.warn(warning);
  20272. }
  20273. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  20274. return value !== value;
  20275. }
  20276. function EventEmitter() {
  20277. EventEmitter.init.call(this);
  20278. }
  20279. module.exports = EventEmitter;
  20280. module.exports.once = once;
  20281. // Backwards-compat with node 0.10.x
  20282. EventEmitter.EventEmitter = EventEmitter;
  20283. EventEmitter.prototype._events = undefined;
  20284. EventEmitter.prototype._eventsCount = 0;
  20285. EventEmitter.prototype._maxListeners = undefined;
  20286. // By default EventEmitters will print a warning if more than 10 listeners are
  20287. // added to it. This is a useful default which helps finding memory leaks.
  20288. var defaultMaxListeners = 10;
  20289. function checkListener(listener) {
  20290. if (typeof listener !== 'function') {
  20291. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  20292. }
  20293. }
  20294. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  20295. enumerable: true,
  20296. get: function() {
  20297. return defaultMaxListeners;
  20298. },
  20299. set: function(arg) {
  20300. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  20301. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  20302. }
  20303. defaultMaxListeners = arg;
  20304. }
  20305. });
  20306. EventEmitter.init = function() {
  20307. if (this._events === undefined ||
  20308. this._events === Object.getPrototypeOf(this)._events) {
  20309. this._events = Object.create(null);
  20310. this._eventsCount = 0;
  20311. }
  20312. this._maxListeners = this._maxListeners || undefined;
  20313. };
  20314. // Obviously not all Emitters should be limited to 10. This function allows
  20315. // that to be increased. Set to zero for unlimited.
  20316. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  20317. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  20318. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  20319. }
  20320. this._maxListeners = n;
  20321. return this;
  20322. };
  20323. function _getMaxListeners(that) {
  20324. if (that._maxListeners === undefined)
  20325. return EventEmitter.defaultMaxListeners;
  20326. return that._maxListeners;
  20327. }
  20328. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  20329. return _getMaxListeners(this);
  20330. };
  20331. EventEmitter.prototype.emit = function emit(type) {
  20332. var args = [];
  20333. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  20334. var doError = (type === 'error');
  20335. var events = this._events;
  20336. if (events !== undefined)
  20337. doError = (doError && events.error === undefined);
  20338. else if (!doError)
  20339. return false;
  20340. // If there is no 'error' event listener then throw.
  20341. if (doError) {
  20342. var er;
  20343. if (args.length > 0)
  20344. er = args[0];
  20345. if (er instanceof Error) {
  20346. // Note: The comments on the `throw` lines are intentional, they show
  20347. // up in Node's output if this results in an unhandled exception.
  20348. throw er; // Unhandled 'error' event
  20349. }
  20350. // At least give some kind of context to the user
  20351. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  20352. err.context = er;
  20353. throw err; // Unhandled 'error' event
  20354. }
  20355. var handler = events[type];
  20356. if (handler === undefined)
  20357. return false;
  20358. if (typeof handler === 'function') {
  20359. ReflectApply(handler, this, args);
  20360. } else {
  20361. var len = handler.length;
  20362. var listeners = arrayClone(handler, len);
  20363. for (var i = 0; i < len; ++i)
  20364. ReflectApply(listeners[i], this, args);
  20365. }
  20366. return true;
  20367. };
  20368. function _addListener(target, type, listener, prepend) {
  20369. var m;
  20370. var events;
  20371. var existing;
  20372. checkListener(listener);
  20373. events = target._events;
  20374. if (events === undefined) {
  20375. events = target._events = Object.create(null);
  20376. target._eventsCount = 0;
  20377. } else {
  20378. // To avoid recursion in the case that type === "newListener"! Before
  20379. // adding it to the listeners, first emit "newListener".
  20380. if (events.newListener !== undefined) {
  20381. target.emit('newListener', type,
  20382. listener.listener ? listener.listener : listener);
  20383. // Re-assign `events` because a newListener handler could have caused the
  20384. // this._events to be assigned to a new object
  20385. events = target._events;
  20386. }
  20387. existing = events[type];
  20388. }
  20389. if (existing === undefined) {
  20390. // Optimize the case of one listener. Don't need the extra array object.
  20391. existing = events[type] = listener;
  20392. ++target._eventsCount;
  20393. } else {
  20394. if (typeof existing === 'function') {
  20395. // Adding the second element, need to change to array.
  20396. existing = events[type] =
  20397. prepend ? [listener, existing] : [existing, listener];
  20398. // If we've already got an array, just append.
  20399. } else if (prepend) {
  20400. existing.unshift(listener);
  20401. } else {
  20402. existing.push(listener);
  20403. }
  20404. // Check for listener leak
  20405. m = _getMaxListeners(target);
  20406. if (m > 0 && existing.length > m && !existing.warned) {
  20407. existing.warned = true;
  20408. // No error code for this since it is a Warning
  20409. // eslint-disable-next-line no-restricted-syntax
  20410. var w = new Error('Possible EventEmitter memory leak detected. ' +
  20411. existing.length + ' ' + String(type) + ' listeners ' +
  20412. 'added. Use emitter.setMaxListeners() to ' +
  20413. 'increase limit');
  20414. w.name = 'MaxListenersExceededWarning';
  20415. w.emitter = target;
  20416. w.type = type;
  20417. w.count = existing.length;
  20418. ProcessEmitWarning(w);
  20419. }
  20420. }
  20421. return target;
  20422. }
  20423. EventEmitter.prototype.addListener = function addListener(type, listener) {
  20424. return _addListener(this, type, listener, false);
  20425. };
  20426. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  20427. EventEmitter.prototype.prependListener =
  20428. function prependListener(type, listener) {
  20429. return _addListener(this, type, listener, true);
  20430. };
  20431. function onceWrapper() {
  20432. if (!this.fired) {
  20433. this.target.removeListener(this.type, this.wrapFn);
  20434. this.fired = true;
  20435. if (arguments.length === 0)
  20436. return this.listener.call(this.target);
  20437. return this.listener.apply(this.target, arguments);
  20438. }
  20439. }
  20440. function _onceWrap(target, type, listener) {
  20441. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  20442. var wrapped = onceWrapper.bind(state);
  20443. wrapped.listener = listener;
  20444. state.wrapFn = wrapped;
  20445. return wrapped;
  20446. }
  20447. EventEmitter.prototype.once = function once(type, listener) {
  20448. checkListener(listener);
  20449. this.on(type, _onceWrap(this, type, listener));
  20450. return this;
  20451. };
  20452. EventEmitter.prototype.prependOnceListener =
  20453. function prependOnceListener(type, listener) {
  20454. checkListener(listener);
  20455. this.prependListener(type, _onceWrap(this, type, listener));
  20456. return this;
  20457. };
  20458. // Emits a 'removeListener' event if and only if the listener was removed.
  20459. EventEmitter.prototype.removeListener =
  20460. function removeListener(type, listener) {
  20461. var list, events, position, i, originalListener;
  20462. checkListener(listener);
  20463. events = this._events;
  20464. if (events === undefined)
  20465. return this;
  20466. list = events[type];
  20467. if (list === undefined)
  20468. return this;
  20469. if (list === listener || list.listener === listener) {
  20470. if (--this._eventsCount === 0)
  20471. this._events = Object.create(null);
  20472. else {
  20473. delete events[type];
  20474. if (events.removeListener)
  20475. this.emit('removeListener', type, list.listener || listener);
  20476. }
  20477. } else if (typeof list !== 'function') {
  20478. position = -1;
  20479. for (i = list.length - 1; i >= 0; i--) {
  20480. if (list[i] === listener || list[i].listener === listener) {
  20481. originalListener = list[i].listener;
  20482. position = i;
  20483. break;
  20484. }
  20485. }
  20486. if (position < 0)
  20487. return this;
  20488. if (position === 0)
  20489. list.shift();
  20490. else {
  20491. spliceOne(list, position);
  20492. }
  20493. if (list.length === 1)
  20494. events[type] = list[0];
  20495. if (events.removeListener !== undefined)
  20496. this.emit('removeListener', type, originalListener || listener);
  20497. }
  20498. return this;
  20499. };
  20500. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  20501. EventEmitter.prototype.removeAllListeners =
  20502. function removeAllListeners(type) {
  20503. var listeners, events, i;
  20504. events = this._events;
  20505. if (events === undefined)
  20506. return this;
  20507. // not listening for removeListener, no need to emit
  20508. if (events.removeListener === undefined) {
  20509. if (arguments.length === 0) {
  20510. this._events = Object.create(null);
  20511. this._eventsCount = 0;
  20512. } else if (events[type] !== undefined) {
  20513. if (--this._eventsCount === 0)
  20514. this._events = Object.create(null);
  20515. else
  20516. delete events[type];
  20517. }
  20518. return this;
  20519. }
  20520. // emit removeListener for all listeners on all events
  20521. if (arguments.length === 0) {
  20522. var keys = Object.keys(events);
  20523. var key;
  20524. for (i = 0; i < keys.length; ++i) {
  20525. key = keys[i];
  20526. if (key === 'removeListener') continue;
  20527. this.removeAllListeners(key);
  20528. }
  20529. this.removeAllListeners('removeListener');
  20530. this._events = Object.create(null);
  20531. this._eventsCount = 0;
  20532. return this;
  20533. }
  20534. listeners = events[type];
  20535. if (typeof listeners === 'function') {
  20536. this.removeListener(type, listeners);
  20537. } else if (listeners !== undefined) {
  20538. // LIFO order
  20539. for (i = listeners.length - 1; i >= 0; i--) {
  20540. this.removeListener(type, listeners[i]);
  20541. }
  20542. }
  20543. return this;
  20544. };
  20545. function _listeners(target, type, unwrap) {
  20546. var events = target._events;
  20547. if (events === undefined)
  20548. return [];
  20549. var evlistener = events[type];
  20550. if (evlistener === undefined)
  20551. return [];
  20552. if (typeof evlistener === 'function')
  20553. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  20554. return unwrap ?
  20555. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  20556. }
  20557. EventEmitter.prototype.listeners = function listeners(type) {
  20558. return _listeners(this, type, true);
  20559. };
  20560. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  20561. return _listeners(this, type, false);
  20562. };
  20563. EventEmitter.listenerCount = function(emitter, type) {
  20564. if (typeof emitter.listenerCount === 'function') {
  20565. return emitter.listenerCount(type);
  20566. } else {
  20567. return listenerCount.call(emitter, type);
  20568. }
  20569. };
  20570. EventEmitter.prototype.listenerCount = listenerCount;
  20571. function listenerCount(type) {
  20572. var events = this._events;
  20573. if (events !== undefined) {
  20574. var evlistener = events[type];
  20575. if (typeof evlistener === 'function') {
  20576. return 1;
  20577. } else if (evlistener !== undefined) {
  20578. return evlistener.length;
  20579. }
  20580. }
  20581. return 0;
  20582. }
  20583. EventEmitter.prototype.eventNames = function eventNames() {
  20584. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  20585. };
  20586. function arrayClone(arr, n) {
  20587. var copy = new Array(n);
  20588. for (var i = 0; i < n; ++i)
  20589. copy[i] = arr[i];
  20590. return copy;
  20591. }
  20592. function spliceOne(list, index) {
  20593. for (; index + 1 < list.length; index++)
  20594. list[index] = list[index + 1];
  20595. list.pop();
  20596. }
  20597. function unwrapListeners(arr) {
  20598. var ret = new Array(arr.length);
  20599. for (var i = 0; i < ret.length; ++i) {
  20600. ret[i] = arr[i].listener || arr[i];
  20601. }
  20602. return ret;
  20603. }
  20604. function once(emitter, name) {
  20605. return new Promise(function (resolve, reject) {
  20606. function errorListener(err) {
  20607. emitter.removeListener(name, resolver);
  20608. reject(err);
  20609. }
  20610. function resolver() {
  20611. if (typeof emitter.removeListener === 'function') {
  20612. emitter.removeListener('error', errorListener);
  20613. }
  20614. resolve([].slice.call(arguments));
  20615. };
  20616. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  20617. if (name !== 'error') {
  20618. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  20619. }
  20620. });
  20621. }
  20622. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  20623. if (typeof emitter.on === 'function') {
  20624. eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  20625. }
  20626. }
  20627. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  20628. if (typeof emitter.on === 'function') {
  20629. if (flags.once) {
  20630. emitter.once(name, listener);
  20631. } else {
  20632. emitter.on(name, listener);
  20633. }
  20634. } else if (typeof emitter.addEventListener === 'function') {
  20635. // EventTarget does not have `error` event semantics like Node
  20636. // EventEmitters, we do not listen for `error` events here.
  20637. emitter.addEventListener(name, function wrapListener(arg) {
  20638. // IE does not have builtin `{ once: true }` support so we
  20639. // have to do it manually.
  20640. if (flags.once) {
  20641. emitter.removeEventListener(name, wrapListener);
  20642. }
  20643. listener(arg);
  20644. });
  20645. } else {
  20646. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  20647. }
  20648. }
  20649. /***/ }),
  20650. /***/ "./node_modules/hash-base/index.js":
  20651. /*!*****************************************!*\
  20652. !*** ./node_modules/hash-base/index.js ***!
  20653. \*****************************************/
  20654. /*! unknown exports (runtime-defined) */
  20655. /*! runtime requirements: __webpack_require__, module */
  20656. /*! CommonJS bailout: module.exports is used directly at 95:0-14 */
  20657. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  20658. "use strict";
  20659. var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/hash-base/node_modules/safe-buffer/index.js").Buffer
  20660. var Transform = __webpack_require__(/*! readable-stream */ "./node_modules/hash-base/node_modules/readable-stream/readable-browser.js").Transform
  20661. var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")
  20662. function throwIfNotStringOrBuffer (val, prefix) {
  20663. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  20664. throw new TypeError(prefix + ' must be a string or a buffer')
  20665. }
  20666. }
  20667. function HashBase (blockSize) {
  20668. Transform.call(this)
  20669. this._block = Buffer.allocUnsafe(blockSize)
  20670. this._blockSize = blockSize
  20671. this._blockOffset = 0
  20672. this._length = [0, 0, 0, 0]
  20673. this._finalized = false
  20674. }
  20675. inherits(HashBase, Transform)
  20676. HashBase.prototype._transform = function (chunk, encoding, callback) {
  20677. var error = null
  20678. try {
  20679. this.update(chunk, encoding)
  20680. } catch (err) {
  20681. error = err
  20682. }
  20683. callback(error)
  20684. }
  20685. HashBase.prototype._flush = function (callback) {
  20686. var error = null
  20687. try {
  20688. this.push(this.digest())
  20689. } catch (err) {
  20690. error = err
  20691. }
  20692. callback(error)
  20693. }
  20694. HashBase.prototype.update = function (data, encoding) {
  20695. throwIfNotStringOrBuffer(data, 'Data')
  20696. if (this._finalized) throw new Error('Digest already called')
  20697. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  20698. // consume data
  20699. var block = this._block
  20700. var offset = 0
  20701. while (this._blockOffset + data.length - offset >= this._blockSize) {
  20702. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  20703. this._update()
  20704. this._blockOffset = 0
  20705. }
  20706. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  20707. // update length
  20708. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  20709. this._length[j] += carry
  20710. carry = (this._length[j] / 0x0100000000) | 0
  20711. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  20712. }
  20713. return this
  20714. }
  20715. HashBase.prototype._update = function () {
  20716. throw new Error('_update is not implemented')
  20717. }
  20718. HashBase.prototype.digest = function (encoding) {
  20719. if (this._finalized) throw new Error('Digest already called')
  20720. this._finalized = true
  20721. var digest = this._digest()
  20722. if (encoding !== undefined) digest = digest.toString(encoding)
  20723. // reset state
  20724. this._block.fill(0)
  20725. this._blockOffset = 0
  20726. for (var i = 0; i < 4; ++i) this._length[i] = 0
  20727. return digest
  20728. }
  20729. HashBase.prototype._digest = function () {
  20730. throw new Error('_digest is not implemented')
  20731. }
  20732. module.exports = HashBase
  20733. /***/ }),
  20734. /***/ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js":
  20735. /*!*******************************************************************************!*\
  20736. !*** ./node_modules/hash-base/node_modules/readable-stream/errors-browser.js ***!
  20737. \*******************************************************************************/
  20738. /*! default exports */
  20739. /*! export codes [provided] [no usage info] [missing usage info prevents renaming] */
  20740. /*! other exports [not provided] [no usage info] */
  20741. /*! runtime requirements: module */
  20742. /***/ ((module) => {
  20743. "use strict";
  20744. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  20745. var codes = {};
  20746. function createErrorType(code, message, Base) {
  20747. if (!Base) {
  20748. Base = Error;
  20749. }
  20750. function getMessage(arg1, arg2, arg3) {
  20751. if (typeof message === 'string') {
  20752. return message;
  20753. } else {
  20754. return message(arg1, arg2, arg3);
  20755. }
  20756. }
  20757. var NodeError =
  20758. /*#__PURE__*/
  20759. function (_Base) {
  20760. _inheritsLoose(NodeError, _Base);
  20761. function NodeError(arg1, arg2, arg3) {
  20762. return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
  20763. }
  20764. return NodeError;
  20765. }(Base);
  20766. NodeError.prototype.name = Base.name;
  20767. NodeError.prototype.code = code;
  20768. codes[code] = NodeError;
  20769. } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
  20770. function oneOf(expected, thing) {
  20771. if (Array.isArray(expected)) {
  20772. var len = expected.length;
  20773. expected = expected.map(function (i) {
  20774. return String(i);
  20775. });
  20776. if (len > 2) {
  20777. return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
  20778. } else if (len === 2) {
  20779. return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
  20780. } else {
  20781. return "of ".concat(thing, " ").concat(expected[0]);
  20782. }
  20783. } else {
  20784. return "of ".concat(thing, " ").concat(String(expected));
  20785. }
  20786. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
  20787. function startsWith(str, search, pos) {
  20788. return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
  20789. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
  20790. function endsWith(str, search, this_len) {
  20791. if (this_len === undefined || this_len > str.length) {
  20792. this_len = str.length;
  20793. }
  20794. return str.substring(this_len - search.length, this_len) === search;
  20795. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
  20796. function includes(str, search, start) {
  20797. if (typeof start !== 'number') {
  20798. start = 0;
  20799. }
  20800. if (start + search.length > str.length) {
  20801. return false;
  20802. } else {
  20803. return str.indexOf(search, start) !== -1;
  20804. }
  20805. }
  20806. createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
  20807. return 'The value "' + value + '" is invalid for option "' + name + '"';
  20808. }, TypeError);
  20809. createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
  20810. // determiner: 'must be' or 'must not be'
  20811. var determiner;
  20812. if (typeof expected === 'string' && startsWith(expected, 'not ')) {
  20813. determiner = 'must not be';
  20814. expected = expected.replace(/^not /, '');
  20815. } else {
  20816. determiner = 'must be';
  20817. }
  20818. var msg;
  20819. if (endsWith(name, ' argument')) {
  20820. // For cases like 'first argument'
  20821. msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  20822. } else {
  20823. var type = includes(name, '.') ? 'property' : 'argument';
  20824. msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  20825. }
  20826. msg += ". Received type ".concat(typeof actual);
  20827. return msg;
  20828. }, TypeError);
  20829. createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
  20830. createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
  20831. return 'The ' + name + ' method is not implemented';
  20832. });
  20833. createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
  20834. createErrorType('ERR_STREAM_DESTROYED', function (name) {
  20835. return 'Cannot call ' + name + ' after a stream was destroyed';
  20836. });
  20837. createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
  20838. createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
  20839. createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
  20840. createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
  20841. createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
  20842. return 'Unknown encoding: ' + arg;
  20843. }, TypeError);
  20844. createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
  20845. module.exports.codes = codes;
  20846. /***/ }),
  20847. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js":
  20848. /*!***********************************************************************************!*\
  20849. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js ***!
  20850. \***********************************************************************************/
  20851. /*! unknown exports (runtime-defined) */
  20852. /*! runtime requirements: module, __webpack_require__ */
  20853. /*! CommonJS bailout: module.exports is used directly at 40:0-14 */
  20854. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  20855. "use strict";
  20856. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  20857. // Copyright Joyent, Inc. and other Node contributors.
  20858. //
  20859. // Permission is hereby granted, free of charge, to any person obtaining a
  20860. // copy of this software and associated documentation files (the
  20861. // "Software"), to deal in the Software without restriction, including
  20862. // without limitation the rights to use, copy, modify, merge, publish,
  20863. // distribute, sublicense, and/or sell copies of the Software, and to permit
  20864. // persons to whom the Software is furnished to do so, subject to the
  20865. // following conditions:
  20866. //
  20867. // The above copyright notice and this permission notice shall be included
  20868. // in all copies or substantial portions of the Software.
  20869. //
  20870. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20871. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20872. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  20873. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  20874. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20875. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20876. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  20877. // a duplex stream is just a stream that is both readable and writable.
  20878. // Since JS doesn't have multiple prototypal inheritance, this class
  20879. // prototypally inherits from Readable, and then parasitically from
  20880. // Writable.
  20881. /*<replacement>*/
  20882. var objectKeys = Object.keys || function (obj) {
  20883. var keys = [];
  20884. for (var key in obj) {
  20885. keys.push(key);
  20886. }
  20887. return keys;
  20888. };
  20889. /*</replacement>*/
  20890. module.exports = Duplex;
  20891. var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js");
  20892. var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js");
  20893. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable);
  20894. {
  20895. // Allow the keys array to be GC'ed.
  20896. var keys = objectKeys(Writable.prototype);
  20897. for (var v = 0; v < keys.length; v++) {
  20898. var method = keys[v];
  20899. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  20900. }
  20901. }
  20902. function Duplex(options) {
  20903. if (!(this instanceof Duplex)) return new Duplex(options);
  20904. Readable.call(this, options);
  20905. Writable.call(this, options);
  20906. this.allowHalfOpen = true;
  20907. if (options) {
  20908. if (options.readable === false) this.readable = false;
  20909. if (options.writable === false) this.writable = false;
  20910. if (options.allowHalfOpen === false) {
  20911. this.allowHalfOpen = false;
  20912. this.once('end', onend);
  20913. }
  20914. }
  20915. }
  20916. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  20917. // making it explicit this property is not enumerable
  20918. // because otherwise some prototype manipulation in
  20919. // userland will fail
  20920. enumerable: false,
  20921. get: function get() {
  20922. return this._writableState.highWaterMark;
  20923. }
  20924. });
  20925. Object.defineProperty(Duplex.prototype, 'writableBuffer', {
  20926. // making it explicit this property is not enumerable
  20927. // because otherwise some prototype manipulation in
  20928. // userland will fail
  20929. enumerable: false,
  20930. get: function get() {
  20931. return this._writableState && this._writableState.getBuffer();
  20932. }
  20933. });
  20934. Object.defineProperty(Duplex.prototype, 'writableLength', {
  20935. // making it explicit this property is not enumerable
  20936. // because otherwise some prototype manipulation in
  20937. // userland will fail
  20938. enumerable: false,
  20939. get: function get() {
  20940. return this._writableState.length;
  20941. }
  20942. }); // the no-half-open enforcer
  20943. function onend() {
  20944. // If the writable side ended, then we're ok.
  20945. if (this._writableState.ended) return; // no more data can be written.
  20946. // But allow more writes to happen in this tick.
  20947. process.nextTick(onEndNT, this);
  20948. }
  20949. function onEndNT(self) {
  20950. self.end();
  20951. }
  20952. Object.defineProperty(Duplex.prototype, 'destroyed', {
  20953. // making it explicit this property is not enumerable
  20954. // because otherwise some prototype manipulation in
  20955. // userland will fail
  20956. enumerable: false,
  20957. get: function get() {
  20958. if (this._readableState === undefined || this._writableState === undefined) {
  20959. return false;
  20960. }
  20961. return this._readableState.destroyed && this._writableState.destroyed;
  20962. },
  20963. set: function set(value) {
  20964. // we ignore the value if the stream
  20965. // has not been initialized yet
  20966. if (this._readableState === undefined || this._writableState === undefined) {
  20967. return;
  20968. } // backward compatibility, the user is explicitly
  20969. // managing destroyed
  20970. this._readableState.destroyed = value;
  20971. this._writableState.destroyed = value;
  20972. }
  20973. });
  20974. /***/ }),
  20975. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js":
  20976. /*!****************************************************************************************!*\
  20977. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js ***!
  20978. \****************************************************************************************/
  20979. /*! unknown exports (runtime-defined) */
  20980. /*! runtime requirements: module, __webpack_require__ */
  20981. /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
  20982. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  20983. "use strict";
  20984. // Copyright Joyent, Inc. and other Node contributors.
  20985. //
  20986. // Permission is hereby granted, free of charge, to any person obtaining a
  20987. // copy of this software and associated documentation files (the
  20988. // "Software"), to deal in the Software without restriction, including
  20989. // without limitation the rights to use, copy, modify, merge, publish,
  20990. // distribute, sublicense, and/or sell copies of the Software, and to permit
  20991. // persons to whom the Software is furnished to do so, subject to the
  20992. // following conditions:
  20993. //
  20994. // The above copyright notice and this permission notice shall be included
  20995. // in all copies or substantial portions of the Software.
  20996. //
  20997. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20998. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20999. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  21000. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  21001. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21002. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21003. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  21004. // a passthrough stream.
  21005. // basically just the most minimal sort of Transform stream.
  21006. // Every written chunk gets output as-is.
  21007. module.exports = PassThrough;
  21008. var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js");
  21009. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform);
  21010. function PassThrough(options) {
  21011. if (!(this instanceof PassThrough)) return new PassThrough(options);
  21012. Transform.call(this, options);
  21013. }
  21014. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  21015. cb(null, chunk);
  21016. };
  21017. /***/ }),
  21018. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js":
  21019. /*!*************************************************************************************!*\
  21020. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js ***!
  21021. \*************************************************************************************/
  21022. /*! unknown exports (runtime-defined) */
  21023. /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
  21024. /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
  21025. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  21026. "use strict";
  21027. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  21028. // Copyright Joyent, Inc. and other Node contributors.
  21029. //
  21030. // Permission is hereby granted, free of charge, to any person obtaining a
  21031. // copy of this software and associated documentation files (the
  21032. // "Software"), to deal in the Software without restriction, including
  21033. // without limitation the rights to use, copy, modify, merge, publish,
  21034. // distribute, sublicense, and/or sell copies of the Software, and to permit
  21035. // persons to whom the Software is furnished to do so, subject to the
  21036. // following conditions:
  21037. //
  21038. // The above copyright notice and this permission notice shall be included
  21039. // in all copies or substantial portions of the Software.
  21040. //
  21041. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21042. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21043. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  21044. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  21045. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21046. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21047. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  21048. module.exports = Readable;
  21049. /*<replacement>*/
  21050. var Duplex;
  21051. /*</replacement>*/
  21052. Readable.ReadableState = ReadableState;
  21053. /*<replacement>*/
  21054. var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
  21055. var EElistenerCount = function EElistenerCount(emitter, type) {
  21056. return emitter.listeners(type).length;
  21057. };
  21058. /*</replacement>*/
  21059. /*<replacement>*/
  21060. var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
  21061. /*</replacement>*/
  21062. var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
  21063. var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
  21064. function _uint8ArrayToBuffer(chunk) {
  21065. return Buffer.from(chunk);
  21066. }
  21067. function _isUint8Array(obj) {
  21068. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  21069. }
  21070. /*<replacement>*/
  21071. var debugUtil = __webpack_require__(/*! util */ "?0bed");
  21072. var debug;
  21073. if (debugUtil && debugUtil.debuglog) {
  21074. debug = debugUtil.debuglog('stream');
  21075. } else {
  21076. debug = function debug() {};
  21077. }
  21078. /*</replacement>*/
  21079. var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js");
  21080. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js");
  21081. var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js"),
  21082. getHighWaterMark = _require.getHighWaterMark;
  21083. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
  21084. ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  21085. ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
  21086. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  21087. ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.
  21088. var StringDecoder;
  21089. var createReadableStreamAsyncIterator;
  21090. var from;
  21091. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream);
  21092. var errorOrDestroy = destroyImpl.errorOrDestroy;
  21093. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  21094. function prependListener(emitter, event, fn) {
  21095. // Sadly this is not cacheable as some libraries bundle their own
  21096. // event emitter implementation with them.
  21097. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any
  21098. // userland ones. NEVER DO THIS. This is here only because this code needs
  21099. // to continue to work with older versions of Node.js that do not include
  21100. // the prependListener() method. The goal is to eventually remove this hack.
  21101. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  21102. }
  21103. function ReadableState(options, stream, isDuplex) {
  21104. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
  21105. options = options || {}; // Duplex streams are both readable and writable, but share
  21106. // the same options object.
  21107. // However, some cases require setting options to different
  21108. // values for the readable and the writable sides of the duplex stream.
  21109. // These options can be provided separately as readableXXX and writableXXX.
  21110. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to
  21111. // make all the buffer merging and length checks go away
  21112. this.objectMode = !!options.objectMode;
  21113. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
  21114. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  21115. this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the
  21116. // linked list can remove elements from the beginning faster than
  21117. // array.shift()
  21118. this.buffer = new BufferList();
  21119. this.length = 0;
  21120. this.pipes = null;
  21121. this.pipesCount = 0;
  21122. this.flowing = null;
  21123. this.ended = false;
  21124. this.endEmitted = false;
  21125. this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted
  21126. // immediately, or on a later tick. We set this to true at first, because
  21127. // any actions that shouldn't happen until "later" should generally also
  21128. // not happen before the first read call.
  21129. this.sync = true; // whenever we return null, then we set a flag to say
  21130. // that we're awaiting a 'readable' event emission.
  21131. this.needReadable = false;
  21132. this.emittedReadable = false;
  21133. this.readableListening = false;
  21134. this.resumeScheduled = false;
  21135. this.paused = true; // Should close be emitted on destroy. Defaults to true.
  21136. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')
  21137. this.autoDestroy = !!options.autoDestroy; // has it been destroyed
  21138. this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string
  21139. // encoding is 'binary' so we have to make this configurable.
  21140. // Everything else in the universe uses 'utf8', though.
  21141. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s
  21142. this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
  21143. this.readingMore = false;
  21144. this.decoder = null;
  21145. this.encoding = null;
  21146. if (options.encoding) {
  21147. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
  21148. this.decoder = new StringDecoder(options.encoding);
  21149. this.encoding = options.encoding;
  21150. }
  21151. }
  21152. function Readable(options) {
  21153. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
  21154. if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
  21155. // the ReadableState constructor, at least with V8 6.5
  21156. var isDuplex = this instanceof Duplex;
  21157. this._readableState = new ReadableState(options, this, isDuplex); // legacy
  21158. this.readable = true;
  21159. if (options) {
  21160. if (typeof options.read === 'function') this._read = options.read;
  21161. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  21162. }
  21163. Stream.call(this);
  21164. }
  21165. Object.defineProperty(Readable.prototype, 'destroyed', {
  21166. // making it explicit this property is not enumerable
  21167. // because otherwise some prototype manipulation in
  21168. // userland will fail
  21169. enumerable: false,
  21170. get: function get() {
  21171. if (this._readableState === undefined) {
  21172. return false;
  21173. }
  21174. return this._readableState.destroyed;
  21175. },
  21176. set: function set(value) {
  21177. // we ignore the value if the stream
  21178. // has not been initialized yet
  21179. if (!this._readableState) {
  21180. return;
  21181. } // backward compatibility, the user is explicitly
  21182. // managing destroyed
  21183. this._readableState.destroyed = value;
  21184. }
  21185. });
  21186. Readable.prototype.destroy = destroyImpl.destroy;
  21187. Readable.prototype._undestroy = destroyImpl.undestroy;
  21188. Readable.prototype._destroy = function (err, cb) {
  21189. cb(err);
  21190. }; // Manually shove something into the read() buffer.
  21191. // This returns true if the highWaterMark has not been hit yet,
  21192. // similar to how Writable.write() returns true if you should
  21193. // write() some more.
  21194. Readable.prototype.push = function (chunk, encoding) {
  21195. var state = this._readableState;
  21196. var skipChunkCheck;
  21197. if (!state.objectMode) {
  21198. if (typeof chunk === 'string') {
  21199. encoding = encoding || state.defaultEncoding;
  21200. if (encoding !== state.encoding) {
  21201. chunk = Buffer.from(chunk, encoding);
  21202. encoding = '';
  21203. }
  21204. skipChunkCheck = true;
  21205. }
  21206. } else {
  21207. skipChunkCheck = true;
  21208. }
  21209. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  21210. }; // Unshift should *always* be something directly out of read()
  21211. Readable.prototype.unshift = function (chunk) {
  21212. return readableAddChunk(this, chunk, null, true, false);
  21213. };
  21214. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  21215. debug('readableAddChunk', chunk);
  21216. var state = stream._readableState;
  21217. if (chunk === null) {
  21218. state.reading = false;
  21219. onEofChunk(stream, state);
  21220. } else {
  21221. var er;
  21222. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  21223. if (er) {
  21224. errorOrDestroy(stream, er);
  21225. } else if (state.objectMode || chunk && chunk.length > 0) {
  21226. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  21227. chunk = _uint8ArrayToBuffer(chunk);
  21228. }
  21229. if (addToFront) {
  21230. if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
  21231. } else if (state.ended) {
  21232. errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
  21233. } else if (state.destroyed) {
  21234. return false;
  21235. } else {
  21236. state.reading = false;
  21237. if (state.decoder && !encoding) {
  21238. chunk = state.decoder.write(chunk);
  21239. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  21240. } else {
  21241. addChunk(stream, state, chunk, false);
  21242. }
  21243. }
  21244. } else if (!addToFront) {
  21245. state.reading = false;
  21246. maybeReadMore(stream, state);
  21247. }
  21248. } // We can push more data if we are below the highWaterMark.
  21249. // Also, if we have no data yet, we can stand some more bytes.
  21250. // This is to work around cases where hwm=0, such as the repl.
  21251. return !state.ended && (state.length < state.highWaterMark || state.length === 0);
  21252. }
  21253. function addChunk(stream, state, chunk, addToFront) {
  21254. if (state.flowing && state.length === 0 && !state.sync) {
  21255. state.awaitDrain = 0;
  21256. stream.emit('data', chunk);
  21257. } else {
  21258. // update the buffer info.
  21259. state.length += state.objectMode ? 1 : chunk.length;
  21260. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  21261. if (state.needReadable) emitReadable(stream);
  21262. }
  21263. maybeReadMore(stream, state);
  21264. }
  21265. function chunkInvalid(state, chunk) {
  21266. var er;
  21267. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  21268. er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
  21269. }
  21270. return er;
  21271. }
  21272. Readable.prototype.isPaused = function () {
  21273. return this._readableState.flowing === false;
  21274. }; // backwards compatibility.
  21275. Readable.prototype.setEncoding = function (enc) {
  21276. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
  21277. var decoder = new StringDecoder(enc);
  21278. this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
  21279. this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:
  21280. var p = this._readableState.buffer.head;
  21281. var content = '';
  21282. while (p !== null) {
  21283. content += decoder.write(p.data);
  21284. p = p.next;
  21285. }
  21286. this._readableState.buffer.clear();
  21287. if (content !== '') this._readableState.buffer.push(content);
  21288. this._readableState.length = content.length;
  21289. return this;
  21290. }; // Don't raise the hwm > 1GB
  21291. var MAX_HWM = 0x40000000;
  21292. function computeNewHighWaterMark(n) {
  21293. if (n >= MAX_HWM) {
  21294. // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
  21295. n = MAX_HWM;
  21296. } else {
  21297. // Get the next highest power of 2 to prevent increasing hwm excessively in
  21298. // tiny amounts
  21299. n--;
  21300. n |= n >>> 1;
  21301. n |= n >>> 2;
  21302. n |= n >>> 4;
  21303. n |= n >>> 8;
  21304. n |= n >>> 16;
  21305. n++;
  21306. }
  21307. return n;
  21308. } // This function is designed to be inlinable, so please take care when making
  21309. // changes to the function body.
  21310. function howMuchToRead(n, state) {
  21311. if (n <= 0 || state.length === 0 && state.ended) return 0;
  21312. if (state.objectMode) return 1;
  21313. if (n !== n) {
  21314. // Only flow one buffer at a time
  21315. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  21316. } // If we're asking for more than the current hwm, then raise the hwm.
  21317. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  21318. if (n <= state.length) return n; // Don't have enough
  21319. if (!state.ended) {
  21320. state.needReadable = true;
  21321. return 0;
  21322. }
  21323. return state.length;
  21324. } // you can override either this method, or the async _read(n) below.
  21325. Readable.prototype.read = function (n) {
  21326. debug('read', n);
  21327. n = parseInt(n, 10);
  21328. var state = this._readableState;
  21329. var nOrig = n;
  21330. if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
  21331. // already have a bunch of data in the buffer, then just trigger
  21332. // the 'readable' event and move on.
  21333. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
  21334. debug('read: emitReadable', state.length, state.ended);
  21335. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  21336. return null;
  21337. }
  21338. n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
  21339. if (n === 0 && state.ended) {
  21340. if (state.length === 0) endReadable(this);
  21341. return null;
  21342. } // All the actual chunk generation logic needs to be
  21343. // *below* the call to _read. The reason is that in certain
  21344. // synthetic stream cases, such as passthrough streams, _read
  21345. // may be a completely synchronous operation which may change
  21346. // the state of the read buffer, providing enough data when
  21347. // before there was *not* enough.
  21348. //
  21349. // So, the steps are:
  21350. // 1. Figure out what the state of things will be after we do
  21351. // a read from the buffer.
  21352. //
  21353. // 2. If that resulting state will trigger a _read, then call _read.
  21354. // Note that this may be asynchronous, or synchronous. Yes, it is
  21355. // deeply ugly to write APIs this way, but that still doesn't mean
  21356. // that the Readable class should behave improperly, as streams are
  21357. // designed to be sync/async agnostic.
  21358. // Take note if the _read call is sync or async (ie, if the read call
  21359. // has returned yet), so that we know whether or not it's safe to emit
  21360. // 'readable' etc.
  21361. //
  21362. // 3. Actually pull the requested chunks out of the buffer and return.
  21363. // if we need a readable event, then we need to do some reading.
  21364. var doRead = state.needReadable;
  21365. debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
  21366. if (state.length === 0 || state.length - n < state.highWaterMark) {
  21367. doRead = true;
  21368. debug('length less than watermark', doRead);
  21369. } // however, if we've ended, then there's no point, and if we're already
  21370. // reading, then it's unnecessary.
  21371. if (state.ended || state.reading) {
  21372. doRead = false;
  21373. debug('reading or ended', doRead);
  21374. } else if (doRead) {
  21375. debug('do read');
  21376. state.reading = true;
  21377. state.sync = true; // if the length is currently zero, then we *need* a readable event.
  21378. if (state.length === 0) state.needReadable = true; // call internal read method
  21379. this._read(state.highWaterMark);
  21380. state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
  21381. // and we need to re-evaluate how much data we can return to the user.
  21382. if (!state.reading) n = howMuchToRead(nOrig, state);
  21383. }
  21384. var ret;
  21385. if (n > 0) ret = fromList(n, state);else ret = null;
  21386. if (ret === null) {
  21387. state.needReadable = state.length <= state.highWaterMark;
  21388. n = 0;
  21389. } else {
  21390. state.length -= n;
  21391. state.awaitDrain = 0;
  21392. }
  21393. if (state.length === 0) {
  21394. // If we have nothing in the buffer, then we want to know
  21395. // as soon as we *do* get something into the buffer.
  21396. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
  21397. if (nOrig !== n && state.ended) endReadable(this);
  21398. }
  21399. if (ret !== null) this.emit('data', ret);
  21400. return ret;
  21401. };
  21402. function onEofChunk(stream, state) {
  21403. debug('onEofChunk');
  21404. if (state.ended) return;
  21405. if (state.decoder) {
  21406. var chunk = state.decoder.end();
  21407. if (chunk && chunk.length) {
  21408. state.buffer.push(chunk);
  21409. state.length += state.objectMode ? 1 : chunk.length;
  21410. }
  21411. }
  21412. state.ended = true;
  21413. if (state.sync) {
  21414. // if we are sync, wait until next tick to emit the data.
  21415. // Otherwise we risk emitting data in the flow()
  21416. // the readable code triggers during a read() call
  21417. emitReadable(stream);
  21418. } else {
  21419. // emit 'readable' now to make sure it gets picked up.
  21420. state.needReadable = false;
  21421. if (!state.emittedReadable) {
  21422. state.emittedReadable = true;
  21423. emitReadable_(stream);
  21424. }
  21425. }
  21426. } // Don't emit readable right away in sync mode, because this can trigger
  21427. // another read() call => stack overflow. This way, it might trigger
  21428. // a nextTick recursion warning, but that's not so bad.
  21429. function emitReadable(stream) {
  21430. var state = stream._readableState;
  21431. debug('emitReadable', state.needReadable, state.emittedReadable);
  21432. state.needReadable = false;
  21433. if (!state.emittedReadable) {
  21434. debug('emitReadable', state.flowing);
  21435. state.emittedReadable = true;
  21436. process.nextTick(emitReadable_, stream);
  21437. }
  21438. }
  21439. function emitReadable_(stream) {
  21440. var state = stream._readableState;
  21441. debug('emitReadable_', state.destroyed, state.length, state.ended);
  21442. if (!state.destroyed && (state.length || state.ended)) {
  21443. stream.emit('readable');
  21444. state.emittedReadable = false;
  21445. } // The stream needs another readable event if
  21446. // 1. It is not flowing, as the flow mechanism will take
  21447. // care of it.
  21448. // 2. It is not ended.
  21449. // 3. It is below the highWaterMark, so we can schedule
  21450. // another readable later.
  21451. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
  21452. flow(stream);
  21453. } // at this point, the user has presumably seen the 'readable' event,
  21454. // and called read() to consume some data. that may have triggered
  21455. // in turn another _read(n) call, in which case reading = true if
  21456. // it's in progress.
  21457. // However, if we're not ended, or reading, and the length < hwm,
  21458. // then go ahead and try to read some more preemptively.
  21459. function maybeReadMore(stream, state) {
  21460. if (!state.readingMore) {
  21461. state.readingMore = true;
  21462. process.nextTick(maybeReadMore_, stream, state);
  21463. }
  21464. }
  21465. function maybeReadMore_(stream, state) {
  21466. // Attempt to read more data if we should.
  21467. //
  21468. // The conditions for reading more data are (one of):
  21469. // - Not enough data buffered (state.length < state.highWaterMark). The loop
  21470. // is responsible for filling the buffer with enough data if such data
  21471. // is available. If highWaterMark is 0 and we are not in the flowing mode
  21472. // we should _not_ attempt to buffer any extra data. We'll get more data
  21473. // when the stream consumer calls read() instead.
  21474. // - No data in the buffer, and the stream is in flowing mode. In this mode
  21475. // the loop below is responsible for ensuring read() is called. Failing to
  21476. // call read here would abort the flow and there's no other mechanism for
  21477. // continuing the flow if the stream consumer has just subscribed to the
  21478. // 'data' event.
  21479. //
  21480. // In addition to the above conditions to keep reading data, the following
  21481. // conditions prevent the data from being read:
  21482. // - The stream has ended (state.ended).
  21483. // - There is already a pending 'read' operation (state.reading). This is a
  21484. // case where the the stream has called the implementation defined _read()
  21485. // method, but they are processing the call asynchronously and have _not_
  21486. // called push() with new data. In this case we skip performing more
  21487. // read()s. The execution ends in this method again after the _read() ends
  21488. // up calling push() with more data.
  21489. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
  21490. var len = state.length;
  21491. debug('maybeReadMore read 0');
  21492. stream.read(0);
  21493. if (len === state.length) // didn't get any data, stop spinning.
  21494. break;
  21495. }
  21496. state.readingMore = false;
  21497. } // abstract method. to be overridden in specific implementation classes.
  21498. // call cb(er, data) where data is <= n in length.
  21499. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  21500. // arbitrary, and perhaps not very meaningful.
  21501. Readable.prototype._read = function (n) {
  21502. errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
  21503. };
  21504. Readable.prototype.pipe = function (dest, pipeOpts) {
  21505. var src = this;
  21506. var state = this._readableState;
  21507. switch (state.pipesCount) {
  21508. case 0:
  21509. state.pipes = dest;
  21510. break;
  21511. case 1:
  21512. state.pipes = [state.pipes, dest];
  21513. break;
  21514. default:
  21515. state.pipes.push(dest);
  21516. break;
  21517. }
  21518. state.pipesCount += 1;
  21519. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  21520. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  21521. var endFn = doEnd ? onend : unpipe;
  21522. if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
  21523. dest.on('unpipe', onunpipe);
  21524. function onunpipe(readable, unpipeInfo) {
  21525. debug('onunpipe');
  21526. if (readable === src) {
  21527. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  21528. unpipeInfo.hasUnpiped = true;
  21529. cleanup();
  21530. }
  21531. }
  21532. }
  21533. function onend() {
  21534. debug('onend');
  21535. dest.end();
  21536. } // when the dest drains, it reduces the awaitDrain counter
  21537. // on the source. This would be more elegant with a .once()
  21538. // handler in flow(), but adding and removing repeatedly is
  21539. // too slow.
  21540. var ondrain = pipeOnDrain(src);
  21541. dest.on('drain', ondrain);
  21542. var cleanedUp = false;
  21543. function cleanup() {
  21544. debug('cleanup'); // cleanup event handlers once the pipe is broken
  21545. dest.removeListener('close', onclose);
  21546. dest.removeListener('finish', onfinish);
  21547. dest.removeListener('drain', ondrain);
  21548. dest.removeListener('error', onerror);
  21549. dest.removeListener('unpipe', onunpipe);
  21550. src.removeListener('end', onend);
  21551. src.removeListener('end', unpipe);
  21552. src.removeListener('data', ondata);
  21553. cleanedUp = true; // if the reader is waiting for a drain event from this
  21554. // specific writer, then it would cause it to never start
  21555. // flowing again.
  21556. // So, if this is awaiting a drain, then we just call it now.
  21557. // If we don't know, then assume that we are waiting for one.
  21558. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  21559. }
  21560. src.on('data', ondata);
  21561. function ondata(chunk) {
  21562. debug('ondata');
  21563. var ret = dest.write(chunk);
  21564. debug('dest.write', ret);
  21565. if (ret === false) {
  21566. // If the user unpiped during `dest.write()`, it is possible
  21567. // to get stuck in a permanently paused state if that write
  21568. // also returned false.
  21569. // => Check whether `dest` is still a piping destination.
  21570. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  21571. debug('false write response, pause', state.awaitDrain);
  21572. state.awaitDrain++;
  21573. }
  21574. src.pause();
  21575. }
  21576. } // if the dest has an error, then stop piping into it.
  21577. // however, don't suppress the throwing behavior for this.
  21578. function onerror(er) {
  21579. debug('onerror', er);
  21580. unpipe();
  21581. dest.removeListener('error', onerror);
  21582. if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
  21583. } // Make sure our error handler is attached before userland ones.
  21584. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
  21585. function onclose() {
  21586. dest.removeListener('finish', onfinish);
  21587. unpipe();
  21588. }
  21589. dest.once('close', onclose);
  21590. function onfinish() {
  21591. debug('onfinish');
  21592. dest.removeListener('close', onclose);
  21593. unpipe();
  21594. }
  21595. dest.once('finish', onfinish);
  21596. function unpipe() {
  21597. debug('unpipe');
  21598. src.unpipe(dest);
  21599. } // tell the dest that it's being piped to
  21600. dest.emit('pipe', src); // start the flow if it hasn't been started already.
  21601. if (!state.flowing) {
  21602. debug('pipe resume');
  21603. src.resume();
  21604. }
  21605. return dest;
  21606. };
  21607. function pipeOnDrain(src) {
  21608. return function pipeOnDrainFunctionResult() {
  21609. var state = src._readableState;
  21610. debug('pipeOnDrain', state.awaitDrain);
  21611. if (state.awaitDrain) state.awaitDrain--;
  21612. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  21613. state.flowing = true;
  21614. flow(src);
  21615. }
  21616. };
  21617. }
  21618. Readable.prototype.unpipe = function (dest) {
  21619. var state = this._readableState;
  21620. var unpipeInfo = {
  21621. hasUnpiped: false
  21622. }; // if we're not piping anywhere, then do nothing.
  21623. if (state.pipesCount === 0) return this; // just one destination. most common case.
  21624. if (state.pipesCount === 1) {
  21625. // passed in one, but it's not the right one.
  21626. if (dest && dest !== state.pipes) return this;
  21627. if (!dest) dest = state.pipes; // got a match.
  21628. state.pipes = null;
  21629. state.pipesCount = 0;
  21630. state.flowing = false;
  21631. if (dest) dest.emit('unpipe', this, unpipeInfo);
  21632. return this;
  21633. } // slow case. multiple pipe destinations.
  21634. if (!dest) {
  21635. // remove all.
  21636. var dests = state.pipes;
  21637. var len = state.pipesCount;
  21638. state.pipes = null;
  21639. state.pipesCount = 0;
  21640. state.flowing = false;
  21641. for (var i = 0; i < len; i++) {
  21642. dests[i].emit('unpipe', this, {
  21643. hasUnpiped: false
  21644. });
  21645. }
  21646. return this;
  21647. } // try to find the right one.
  21648. var index = indexOf(state.pipes, dest);
  21649. if (index === -1) return this;
  21650. state.pipes.splice(index, 1);
  21651. state.pipesCount -= 1;
  21652. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  21653. dest.emit('unpipe', this, unpipeInfo);
  21654. return this;
  21655. }; // set up data events if they are asked for
  21656. // Ensure readable listeners eventually get something
  21657. Readable.prototype.on = function (ev, fn) {
  21658. var res = Stream.prototype.on.call(this, ev, fn);
  21659. var state = this._readableState;
  21660. if (ev === 'data') {
  21661. // update readableListening so that resume() may be a no-op
  21662. // a few lines down. This is needed to support once('readable').
  21663. state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused
  21664. if (state.flowing !== false) this.resume();
  21665. } else if (ev === 'readable') {
  21666. if (!state.endEmitted && !state.readableListening) {
  21667. state.readableListening = state.needReadable = true;
  21668. state.flowing = false;
  21669. state.emittedReadable = false;
  21670. debug('on readable', state.length, state.reading);
  21671. if (state.length) {
  21672. emitReadable(this);
  21673. } else if (!state.reading) {
  21674. process.nextTick(nReadingNextTick, this);
  21675. }
  21676. }
  21677. }
  21678. return res;
  21679. };
  21680. Readable.prototype.addListener = Readable.prototype.on;
  21681. Readable.prototype.removeListener = function (ev, fn) {
  21682. var res = Stream.prototype.removeListener.call(this, ev, fn);
  21683. if (ev === 'readable') {
  21684. // We need to check if there is someone still listening to
  21685. // readable and reset the state. However this needs to happen
  21686. // after readable has been emitted but before I/O (nextTick) to
  21687. // support once('readable', fn) cycles. This means that calling
  21688. // resume within the same tick will have no
  21689. // effect.
  21690. process.nextTick(updateReadableListening, this);
  21691. }
  21692. return res;
  21693. };
  21694. Readable.prototype.removeAllListeners = function (ev) {
  21695. var res = Stream.prototype.removeAllListeners.apply(this, arguments);
  21696. if (ev === 'readable' || ev === undefined) {
  21697. // We need to check if there is someone still listening to
  21698. // readable and reset the state. However this needs to happen
  21699. // after readable has been emitted but before I/O (nextTick) to
  21700. // support once('readable', fn) cycles. This means that calling
  21701. // resume within the same tick will have no
  21702. // effect.
  21703. process.nextTick(updateReadableListening, this);
  21704. }
  21705. return res;
  21706. };
  21707. function updateReadableListening(self) {
  21708. var state = self._readableState;
  21709. state.readableListening = self.listenerCount('readable') > 0;
  21710. if (state.resumeScheduled && !state.paused) {
  21711. // flowing needs to be set to true now, otherwise
  21712. // the upcoming resume will not flow.
  21713. state.flowing = true; // crude way to check if we should resume
  21714. } else if (self.listenerCount('data') > 0) {
  21715. self.resume();
  21716. }
  21717. }
  21718. function nReadingNextTick(self) {
  21719. debug('readable nexttick read 0');
  21720. self.read(0);
  21721. } // pause() and resume() are remnants of the legacy readable stream API
  21722. // If the user uses them, then switch into old mode.
  21723. Readable.prototype.resume = function () {
  21724. var state = this._readableState;
  21725. if (!state.flowing) {
  21726. debug('resume'); // we flow only if there is no one listening
  21727. // for readable, but we still have to call
  21728. // resume()
  21729. state.flowing = !state.readableListening;
  21730. resume(this, state);
  21731. }
  21732. state.paused = false;
  21733. return this;
  21734. };
  21735. function resume(stream, state) {
  21736. if (!state.resumeScheduled) {
  21737. state.resumeScheduled = true;
  21738. process.nextTick(resume_, stream, state);
  21739. }
  21740. }
  21741. function resume_(stream, state) {
  21742. debug('resume', state.reading);
  21743. if (!state.reading) {
  21744. stream.read(0);
  21745. }
  21746. state.resumeScheduled = false;
  21747. stream.emit('resume');
  21748. flow(stream);
  21749. if (state.flowing && !state.reading) stream.read(0);
  21750. }
  21751. Readable.prototype.pause = function () {
  21752. debug('call pause flowing=%j', this._readableState.flowing);
  21753. if (this._readableState.flowing !== false) {
  21754. debug('pause');
  21755. this._readableState.flowing = false;
  21756. this.emit('pause');
  21757. }
  21758. this._readableState.paused = true;
  21759. return this;
  21760. };
  21761. function flow(stream) {
  21762. var state = stream._readableState;
  21763. debug('flow', state.flowing);
  21764. while (state.flowing && stream.read() !== null) {
  21765. ;
  21766. }
  21767. } // wrap an old-style stream as the async data source.
  21768. // This is *not* part of the readable stream interface.
  21769. // It is an ugly unfortunate mess of history.
  21770. Readable.prototype.wrap = function (stream) {
  21771. var _this = this;
  21772. var state = this._readableState;
  21773. var paused = false;
  21774. stream.on('end', function () {
  21775. debug('wrapped end');
  21776. if (state.decoder && !state.ended) {
  21777. var chunk = state.decoder.end();
  21778. if (chunk && chunk.length) _this.push(chunk);
  21779. }
  21780. _this.push(null);
  21781. });
  21782. stream.on('data', function (chunk) {
  21783. debug('wrapped data');
  21784. if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
  21785. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  21786. var ret = _this.push(chunk);
  21787. if (!ret) {
  21788. paused = true;
  21789. stream.pause();
  21790. }
  21791. }); // proxy all the other methods.
  21792. // important when wrapping filters and duplexes.
  21793. for (var i in stream) {
  21794. if (this[i] === undefined && typeof stream[i] === 'function') {
  21795. this[i] = function methodWrap(method) {
  21796. return function methodWrapReturnFunction() {
  21797. return stream[method].apply(stream, arguments);
  21798. };
  21799. }(i);
  21800. }
  21801. } // proxy certain important events.
  21802. for (var n = 0; n < kProxyEvents.length; n++) {
  21803. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  21804. } // when we try to consume some more bytes, simply unpause the
  21805. // underlying stream.
  21806. this._read = function (n) {
  21807. debug('wrapped _read', n);
  21808. if (paused) {
  21809. paused = false;
  21810. stream.resume();
  21811. }
  21812. };
  21813. return this;
  21814. };
  21815. if (typeof Symbol === 'function') {
  21816. Readable.prototype[Symbol.asyncIterator] = function () {
  21817. if (createReadableStreamAsyncIterator === undefined) {
  21818. createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js");
  21819. }
  21820. return createReadableStreamAsyncIterator(this);
  21821. };
  21822. }
  21823. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  21824. // making it explicit this property is not enumerable
  21825. // because otherwise some prototype manipulation in
  21826. // userland will fail
  21827. enumerable: false,
  21828. get: function get() {
  21829. return this._readableState.highWaterMark;
  21830. }
  21831. });
  21832. Object.defineProperty(Readable.prototype, 'readableBuffer', {
  21833. // making it explicit this property is not enumerable
  21834. // because otherwise some prototype manipulation in
  21835. // userland will fail
  21836. enumerable: false,
  21837. get: function get() {
  21838. return this._readableState && this._readableState.buffer;
  21839. }
  21840. });
  21841. Object.defineProperty(Readable.prototype, 'readableFlowing', {
  21842. // making it explicit this property is not enumerable
  21843. // because otherwise some prototype manipulation in
  21844. // userland will fail
  21845. enumerable: false,
  21846. get: function get() {
  21847. return this._readableState.flowing;
  21848. },
  21849. set: function set(state) {
  21850. if (this._readableState) {
  21851. this._readableState.flowing = state;
  21852. }
  21853. }
  21854. }); // exposed for testing purposes only.
  21855. Readable._fromList = fromList;
  21856. Object.defineProperty(Readable.prototype, 'readableLength', {
  21857. // making it explicit this property is not enumerable
  21858. // because otherwise some prototype manipulation in
  21859. // userland will fail
  21860. enumerable: false,
  21861. get: function get() {
  21862. return this._readableState.length;
  21863. }
  21864. }); // Pluck off n bytes from an array of buffers.
  21865. // Length is the combined lengths of all the buffers in the list.
  21866. // This function is designed to be inlinable, so please take care when making
  21867. // changes to the function body.
  21868. function fromList(n, state) {
  21869. // nothing buffered
  21870. if (state.length === 0) return null;
  21871. var ret;
  21872. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  21873. // read it all, truncate the list
  21874. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
  21875. state.buffer.clear();
  21876. } else {
  21877. // read part of list
  21878. ret = state.buffer.consume(n, state.decoder);
  21879. }
  21880. return ret;
  21881. }
  21882. function endReadable(stream) {
  21883. var state = stream._readableState;
  21884. debug('endReadable', state.endEmitted);
  21885. if (!state.endEmitted) {
  21886. state.ended = true;
  21887. process.nextTick(endReadableNT, state, stream);
  21888. }
  21889. }
  21890. function endReadableNT(state, stream) {
  21891. debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.
  21892. if (!state.endEmitted && state.length === 0) {
  21893. state.endEmitted = true;
  21894. stream.readable = false;
  21895. stream.emit('end');
  21896. if (state.autoDestroy) {
  21897. // In case of duplex streams we need a way to detect
  21898. // if the writable side is ready for autoDestroy as well
  21899. var wState = stream._writableState;
  21900. if (!wState || wState.autoDestroy && wState.finished) {
  21901. stream.destroy();
  21902. }
  21903. }
  21904. }
  21905. }
  21906. if (typeof Symbol === 'function') {
  21907. Readable.from = function (iterable, opts) {
  21908. if (from === undefined) {
  21909. from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js");
  21910. }
  21911. return from(Readable, iterable, opts);
  21912. };
  21913. }
  21914. function indexOf(xs, x) {
  21915. for (var i = 0, l = xs.length; i < l; i++) {
  21916. if (xs[i] === x) return i;
  21917. }
  21918. return -1;
  21919. }
  21920. /***/ }),
  21921. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js":
  21922. /*!**************************************************************************************!*\
  21923. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js ***!
  21924. \**************************************************************************************/
  21925. /*! unknown exports (runtime-defined) */
  21926. /*! runtime requirements: module, __webpack_require__ */
  21927. /*! CommonJS bailout: module.exports is used directly at 64:0-14 */
  21928. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  21929. "use strict";
  21930. // Copyright Joyent, Inc. and other Node contributors.
  21931. //
  21932. // Permission is hereby granted, free of charge, to any person obtaining a
  21933. // copy of this software and associated documentation files (the
  21934. // "Software"), to deal in the Software without restriction, including
  21935. // without limitation the rights to use, copy, modify, merge, publish,
  21936. // distribute, sublicense, and/or sell copies of the Software, and to permit
  21937. // persons to whom the Software is furnished to do so, subject to the
  21938. // following conditions:
  21939. //
  21940. // The above copyright notice and this permission notice shall be included
  21941. // in all copies or substantial portions of the Software.
  21942. //
  21943. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21944. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21945. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  21946. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  21947. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21948. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21949. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  21950. // a transform stream is a readable/writable stream where you do
  21951. // something with the data. Sometimes it's called a "filter",
  21952. // but that's not a great name for it, since that implies a thing where
  21953. // some bits pass through, and others are simply ignored. (That would
  21954. // be a valid example of a transform, of course.)
  21955. //
  21956. // While the output is causally related to the input, it's not a
  21957. // necessarily symmetric or synchronous transformation. For example,
  21958. // a zlib stream might take multiple plain-text writes(), and then
  21959. // emit a single compressed chunk some time in the future.
  21960. //
  21961. // Here's how this works:
  21962. //
  21963. // The Transform stream has all the aspects of the readable and writable
  21964. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  21965. // internally, and returns false if there's a lot of pending writes
  21966. // buffered up. When you call read(), that calls _read(n) until
  21967. // there's enough pending readable data buffered up.
  21968. //
  21969. // In a transform stream, the written data is placed in a buffer. When
  21970. // _read(n) is called, it transforms the queued up data, calling the
  21971. // buffered _write cb's as it consumes chunks. If consuming a single
  21972. // written chunk would result in multiple output chunks, then the first
  21973. // outputted bit calls the readcb, and subsequent chunks just go into
  21974. // the read buffer, and will cause it to emit 'readable' if necessary.
  21975. //
  21976. // This way, back-pressure is actually determined by the reading side,
  21977. // since _read has to be called to start processing a new chunk. However,
  21978. // a pathological inflate type of transform can cause excessive buffering
  21979. // here. For example, imagine a stream where every byte of input is
  21980. // interpreted as an integer from 0-255, and then results in that many
  21981. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  21982. // 1kb of data being output. In this case, you could write a very small
  21983. // amount of input, and end up with a very large amount of output. In
  21984. // such a pathological inflating mechanism, there'd be no way to tell
  21985. // the system to stop doing the transform. A single 4MB write could
  21986. // cause the system to run out of memory.
  21987. //
  21988. // However, even in such a pathological case, only a single written chunk
  21989. // would be consumed, and then the rest would wait (un-transformed) until
  21990. // the results of the previous transformed chunk were consumed.
  21991. module.exports = Transform;
  21992. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
  21993. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  21994. ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  21995. ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
  21996. ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
  21997. var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
  21998. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex);
  21999. function afterTransform(er, data) {
  22000. var ts = this._transformState;
  22001. ts.transforming = false;
  22002. var cb = ts.writecb;
  22003. if (cb === null) {
  22004. return this.emit('error', new ERR_MULTIPLE_CALLBACK());
  22005. }
  22006. ts.writechunk = null;
  22007. ts.writecb = null;
  22008. if (data != null) // single equals check for both `null` and `undefined`
  22009. this.push(data);
  22010. cb(er);
  22011. var rs = this._readableState;
  22012. rs.reading = false;
  22013. if (rs.needReadable || rs.length < rs.highWaterMark) {
  22014. this._read(rs.highWaterMark);
  22015. }
  22016. }
  22017. function Transform(options) {
  22018. if (!(this instanceof Transform)) return new Transform(options);
  22019. Duplex.call(this, options);
  22020. this._transformState = {
  22021. afterTransform: afterTransform.bind(this),
  22022. needTransform: false,
  22023. transforming: false,
  22024. writecb: null,
  22025. writechunk: null,
  22026. writeencoding: null
  22027. }; // start out asking for a readable event once data is transformed.
  22028. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
  22029. // that Readable wants before the first _read call, so unset the
  22030. // sync guard flag.
  22031. this._readableState.sync = false;
  22032. if (options) {
  22033. if (typeof options.transform === 'function') this._transform = options.transform;
  22034. if (typeof options.flush === 'function') this._flush = options.flush;
  22035. } // When the writable side finishes, then flush out anything remaining.
  22036. this.on('prefinish', prefinish);
  22037. }
  22038. function prefinish() {
  22039. var _this = this;
  22040. if (typeof this._flush === 'function' && !this._readableState.destroyed) {
  22041. this._flush(function (er, data) {
  22042. done(_this, er, data);
  22043. });
  22044. } else {
  22045. done(this, null, null);
  22046. }
  22047. }
  22048. Transform.prototype.push = function (chunk, encoding) {
  22049. this._transformState.needTransform = false;
  22050. return Duplex.prototype.push.call(this, chunk, encoding);
  22051. }; // This is the part where you do stuff!
  22052. // override this function in implementation classes.
  22053. // 'chunk' is an input chunk.
  22054. //
  22055. // Call `push(newChunk)` to pass along transformed output
  22056. // to the readable side. You may call 'push' zero or more times.
  22057. //
  22058. // Call `cb(err)` when you are done with this chunk. If you pass
  22059. // an error, then that'll put the hurt on the whole operation. If you
  22060. // never call cb(), then you'll never get another chunk.
  22061. Transform.prototype._transform = function (chunk, encoding, cb) {
  22062. cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
  22063. };
  22064. Transform.prototype._write = function (chunk, encoding, cb) {
  22065. var ts = this._transformState;
  22066. ts.writecb = cb;
  22067. ts.writechunk = chunk;
  22068. ts.writeencoding = encoding;
  22069. if (!ts.transforming) {
  22070. var rs = this._readableState;
  22071. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  22072. }
  22073. }; // Doesn't matter what the args are here.
  22074. // _transform does all the work.
  22075. // That we got here means that the readable side wants more data.
  22076. Transform.prototype._read = function (n) {
  22077. var ts = this._transformState;
  22078. if (ts.writechunk !== null && !ts.transforming) {
  22079. ts.transforming = true;
  22080. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  22081. } else {
  22082. // mark that we need a transform, so that any data that comes in
  22083. // will get processed, now that we've asked for it.
  22084. ts.needTransform = true;
  22085. }
  22086. };
  22087. Transform.prototype._destroy = function (err, cb) {
  22088. Duplex.prototype._destroy.call(this, err, function (err2) {
  22089. cb(err2);
  22090. });
  22091. };
  22092. function done(stream, er, data) {
  22093. if (er) return stream.emit('error', er);
  22094. if (data != null) // single equals check for both `null` and `undefined`
  22095. stream.push(data); // TODO(BridgeAR): Write a test for these two error cases
  22096. // if there's nothing in the write buffer, then that means
  22097. // that nothing more will ever be provided
  22098. if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
  22099. if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
  22100. return stream.push(null);
  22101. }
  22102. /***/ }),
  22103. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js":
  22104. /*!*************************************************************************************!*\
  22105. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js ***!
  22106. \*************************************************************************************/
  22107. /*! unknown exports (runtime-defined) */
  22108. /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
  22109. /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
  22110. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  22111. "use strict";
  22112. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  22113. // Copyright Joyent, Inc. and other Node contributors.
  22114. //
  22115. // Permission is hereby granted, free of charge, to any person obtaining a
  22116. // copy of this software and associated documentation files (the
  22117. // "Software"), to deal in the Software without restriction, including
  22118. // without limitation the rights to use, copy, modify, merge, publish,
  22119. // distribute, sublicense, and/or sell copies of the Software, and to permit
  22120. // persons to whom the Software is furnished to do so, subject to the
  22121. // following conditions:
  22122. //
  22123. // The above copyright notice and this permission notice shall be included
  22124. // in all copies or substantial portions of the Software.
  22125. //
  22126. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  22127. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22128. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  22129. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  22130. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22131. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  22132. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  22133. // A bit simpler than readable streams.
  22134. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  22135. // the drain event emission and buffering.
  22136. module.exports = Writable;
  22137. /* <replacement> */
  22138. function WriteReq(chunk, encoding, cb) {
  22139. this.chunk = chunk;
  22140. this.encoding = encoding;
  22141. this.callback = cb;
  22142. this.next = null;
  22143. } // It seems a linked list but it is not
  22144. // there will be only 2 of these for each stream
  22145. function CorkedRequest(state) {
  22146. var _this = this;
  22147. this.next = null;
  22148. this.entry = null;
  22149. this.finish = function () {
  22150. onCorkedFinish(_this, state);
  22151. };
  22152. }
  22153. /* </replacement> */
  22154. /*<replacement>*/
  22155. var Duplex;
  22156. /*</replacement>*/
  22157. Writable.WritableState = WritableState;
  22158. /*<replacement>*/
  22159. var internalUtil = {
  22160. deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js")
  22161. };
  22162. /*</replacement>*/
  22163. /*<replacement>*/
  22164. var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
  22165. /*</replacement>*/
  22166. var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
  22167. var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
  22168. function _uint8ArrayToBuffer(chunk) {
  22169. return Buffer.from(chunk);
  22170. }
  22171. function _isUint8Array(obj) {
  22172. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  22173. }
  22174. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js");
  22175. var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js"),
  22176. getHighWaterMark = _require.getHighWaterMark;
  22177. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
  22178. ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  22179. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  22180. ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  22181. ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
  22182. ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
  22183. ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
  22184. ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
  22185. ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
  22186. var errorOrDestroy = destroyImpl.errorOrDestroy;
  22187. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream);
  22188. function nop() {}
  22189. function WritableState(options, stream, isDuplex) {
  22190. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
  22191. options = options || {}; // Duplex streams are both readable and writable, but share
  22192. // the same options object.
  22193. // However, some cases require setting options to different
  22194. // values for the readable and the writable sides of the duplex stream,
  22195. // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
  22196. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream
  22197. // contains buffers or objects.
  22198. this.objectMode = !!options.objectMode;
  22199. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
  22200. // Note: 0 is a valid value, means that we always return false if
  22201. // the entire buffer is not flushed immediately on write()
  22202. this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called
  22203. this.finalCalled = false; // drain event flag.
  22204. this.needDrain = false; // at the start of calling end()
  22205. this.ending = false; // when end() has been called, and returned
  22206. this.ended = false; // when 'finish' is emitted
  22207. this.finished = false; // has it been destroyed
  22208. this.destroyed = false; // should we decode strings into buffers before passing to _write?
  22209. // this is here so that some node-core streams can optimize string
  22210. // handling at a lower level.
  22211. var noDecode = options.decodeStrings === false;
  22212. this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string
  22213. // encoding is 'binary' so we have to make this configurable.
  22214. // Everything else in the universe uses 'utf8', though.
  22215. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
  22216. // of how much we're waiting to get pushed to some underlying
  22217. // socket or file.
  22218. this.length = 0; // a flag to see when we're in the middle of a write.
  22219. this.writing = false; // when true all writes will be buffered until .uncork() call
  22220. this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
  22221. // or on a later tick. We set this to true at first, because any
  22222. // actions that shouldn't happen until "later" should generally also
  22223. // not happen before the first write call.
  22224. this.sync = true; // a flag to know if we're processing previously buffered items, which
  22225. // may call the _write() callback in the same tick, so that we don't
  22226. // end up in an overlapped onwrite situation.
  22227. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
  22228. this.onwrite = function (er) {
  22229. onwrite(stream, er);
  22230. }; // the callback that the user supplies to write(chunk,encoding,cb)
  22231. this.writecb = null; // the amount that is being written when _write is called.
  22232. this.writelen = 0;
  22233. this.bufferedRequest = null;
  22234. this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
  22235. // this must be 0 before 'finish' can be emitted
  22236. this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
  22237. // This is relevant for synchronous Transform streams
  22238. this.prefinished = false; // True if the error was already emitted and should not be thrown again
  22239. this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.
  22240. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')
  22241. this.autoDestroy = !!options.autoDestroy; // count buffered requests
  22242. this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
  22243. // one allocated and free to use, and we maintain at most two
  22244. this.corkedRequestsFree = new CorkedRequest(this);
  22245. }
  22246. WritableState.prototype.getBuffer = function getBuffer() {
  22247. var current = this.bufferedRequest;
  22248. var out = [];
  22249. while (current) {
  22250. out.push(current);
  22251. current = current.next;
  22252. }
  22253. return out;
  22254. };
  22255. (function () {
  22256. try {
  22257. Object.defineProperty(WritableState.prototype, 'buffer', {
  22258. get: internalUtil.deprecate(function writableStateBufferGetter() {
  22259. return this.getBuffer();
  22260. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  22261. });
  22262. } catch (_) {}
  22263. })(); // Test _writableState for inheritance to account for Duplex streams,
  22264. // whose prototype chain only points to Readable.
  22265. var realHasInstance;
  22266. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  22267. realHasInstance = Function.prototype[Symbol.hasInstance];
  22268. Object.defineProperty(Writable, Symbol.hasInstance, {
  22269. value: function value(object) {
  22270. if (realHasInstance.call(this, object)) return true;
  22271. if (this !== Writable) return false;
  22272. return object && object._writableState instanceof WritableState;
  22273. }
  22274. });
  22275. } else {
  22276. realHasInstance = function realHasInstance(object) {
  22277. return object instanceof this;
  22278. };
  22279. }
  22280. function Writable(options) {
  22281. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js"); // Writable ctor is applied to Duplexes, too.
  22282. // `realHasInstance` is necessary because using plain `instanceof`
  22283. // would return false, as no `_writableState` property is attached.
  22284. // Trying to use the custom `instanceof` for Writable here will also break the
  22285. // Node.js LazyTransform implementation, which has a non-trivial getter for
  22286. // `_writableState` that would lead to infinite recursion.
  22287. // Checking for a Stream.Duplex instance is faster here instead of inside
  22288. // the WritableState constructor, at least with V8 6.5
  22289. var isDuplex = this instanceof Duplex;
  22290. if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
  22291. this._writableState = new WritableState(options, this, isDuplex); // legacy.
  22292. this.writable = true;
  22293. if (options) {
  22294. if (typeof options.write === 'function') this._write = options.write;
  22295. if (typeof options.writev === 'function') this._writev = options.writev;
  22296. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  22297. if (typeof options.final === 'function') this._final = options.final;
  22298. }
  22299. Stream.call(this);
  22300. } // Otherwise people can pipe Writable streams, which is just wrong.
  22301. Writable.prototype.pipe = function () {
  22302. errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
  22303. };
  22304. function writeAfterEnd(stream, cb) {
  22305. var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb
  22306. errorOrDestroy(stream, er);
  22307. process.nextTick(cb, er);
  22308. } // Checks that a user-supplied chunk is valid, especially for the particular
  22309. // mode the stream is in. Currently this means that `null` is never accepted
  22310. // and undefined/non-string values are only allowed in object mode.
  22311. function validChunk(stream, state, chunk, cb) {
  22312. var er;
  22313. if (chunk === null) {
  22314. er = new ERR_STREAM_NULL_VALUES();
  22315. } else if (typeof chunk !== 'string' && !state.objectMode) {
  22316. er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
  22317. }
  22318. if (er) {
  22319. errorOrDestroy(stream, er);
  22320. process.nextTick(cb, er);
  22321. return false;
  22322. }
  22323. return true;
  22324. }
  22325. Writable.prototype.write = function (chunk, encoding, cb) {
  22326. var state = this._writableState;
  22327. var ret = false;
  22328. var isBuf = !state.objectMode && _isUint8Array(chunk);
  22329. if (isBuf && !Buffer.isBuffer(chunk)) {
  22330. chunk = _uint8ArrayToBuffer(chunk);
  22331. }
  22332. if (typeof encoding === 'function') {
  22333. cb = encoding;
  22334. encoding = null;
  22335. }
  22336. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  22337. if (typeof cb !== 'function') cb = nop;
  22338. if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  22339. state.pendingcb++;
  22340. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  22341. }
  22342. return ret;
  22343. };
  22344. Writable.prototype.cork = function () {
  22345. this._writableState.corked++;
  22346. };
  22347. Writable.prototype.uncork = function () {
  22348. var state = this._writableState;
  22349. if (state.corked) {
  22350. state.corked--;
  22351. if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  22352. }
  22353. };
  22354. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  22355. // node::ParseEncoding() requires lower case.
  22356. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  22357. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
  22358. this._writableState.defaultEncoding = encoding;
  22359. return this;
  22360. };
  22361. Object.defineProperty(Writable.prototype, 'writableBuffer', {
  22362. // making it explicit this property is not enumerable
  22363. // because otherwise some prototype manipulation in
  22364. // userland will fail
  22365. enumerable: false,
  22366. get: function get() {
  22367. return this._writableState && this._writableState.getBuffer();
  22368. }
  22369. });
  22370. function decodeChunk(state, chunk, encoding) {
  22371. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  22372. chunk = Buffer.from(chunk, encoding);
  22373. }
  22374. return chunk;
  22375. }
  22376. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  22377. // making it explicit this property is not enumerable
  22378. // because otherwise some prototype manipulation in
  22379. // userland will fail
  22380. enumerable: false,
  22381. get: function get() {
  22382. return this._writableState.highWaterMark;
  22383. }
  22384. }); // if we're already writing something, then just put this
  22385. // in the queue, and wait our turn. Otherwise, call _write
  22386. // If we return false, then we need a drain event, so set that flag.
  22387. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  22388. if (!isBuf) {
  22389. var newChunk = decodeChunk(state, chunk, encoding);
  22390. if (chunk !== newChunk) {
  22391. isBuf = true;
  22392. encoding = 'buffer';
  22393. chunk = newChunk;
  22394. }
  22395. }
  22396. var len = state.objectMode ? 1 : chunk.length;
  22397. state.length += len;
  22398. var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
  22399. if (!ret) state.needDrain = true;
  22400. if (state.writing || state.corked) {
  22401. var last = state.lastBufferedRequest;
  22402. state.lastBufferedRequest = {
  22403. chunk: chunk,
  22404. encoding: encoding,
  22405. isBuf: isBuf,
  22406. callback: cb,
  22407. next: null
  22408. };
  22409. if (last) {
  22410. last.next = state.lastBufferedRequest;
  22411. } else {
  22412. state.bufferedRequest = state.lastBufferedRequest;
  22413. }
  22414. state.bufferedRequestCount += 1;
  22415. } else {
  22416. doWrite(stream, state, false, len, chunk, encoding, cb);
  22417. }
  22418. return ret;
  22419. }
  22420. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  22421. state.writelen = len;
  22422. state.writecb = cb;
  22423. state.writing = true;
  22424. state.sync = true;
  22425. if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  22426. state.sync = false;
  22427. }
  22428. function onwriteError(stream, state, sync, er, cb) {
  22429. --state.pendingcb;
  22430. if (sync) {
  22431. // defer the callback if we are being called synchronously
  22432. // to avoid piling up things on the stack
  22433. process.nextTick(cb, er); // this can emit finish, and it will always happen
  22434. // after error
  22435. process.nextTick(finishMaybe, stream, state);
  22436. stream._writableState.errorEmitted = true;
  22437. errorOrDestroy(stream, er);
  22438. } else {
  22439. // the caller expect this to happen before if
  22440. // it is async
  22441. cb(er);
  22442. stream._writableState.errorEmitted = true;
  22443. errorOrDestroy(stream, er); // this can emit finish, but finish must
  22444. // always follow error
  22445. finishMaybe(stream, state);
  22446. }
  22447. }
  22448. function onwriteStateUpdate(state) {
  22449. state.writing = false;
  22450. state.writecb = null;
  22451. state.length -= state.writelen;
  22452. state.writelen = 0;
  22453. }
  22454. function onwrite(stream, er) {
  22455. var state = stream._writableState;
  22456. var sync = state.sync;
  22457. var cb = state.writecb;
  22458. if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
  22459. onwriteStateUpdate(state);
  22460. if (er) onwriteError(stream, state, sync, er, cb);else {
  22461. // Check if we're actually ready to finish, but don't emit yet
  22462. var finished = needFinish(state) || stream.destroyed;
  22463. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  22464. clearBuffer(stream, state);
  22465. }
  22466. if (sync) {
  22467. process.nextTick(afterWrite, stream, state, finished, cb);
  22468. } else {
  22469. afterWrite(stream, state, finished, cb);
  22470. }
  22471. }
  22472. }
  22473. function afterWrite(stream, state, finished, cb) {
  22474. if (!finished) onwriteDrain(stream, state);
  22475. state.pendingcb--;
  22476. cb();
  22477. finishMaybe(stream, state);
  22478. } // Must force callback to be called on nextTick, so that we don't
  22479. // emit 'drain' before the write() consumer gets the 'false' return
  22480. // value, and has a chance to attach a 'drain' listener.
  22481. function onwriteDrain(stream, state) {
  22482. if (state.length === 0 && state.needDrain) {
  22483. state.needDrain = false;
  22484. stream.emit('drain');
  22485. }
  22486. } // if there's something in the buffer waiting, then process it
  22487. function clearBuffer(stream, state) {
  22488. state.bufferProcessing = true;
  22489. var entry = state.bufferedRequest;
  22490. if (stream._writev && entry && entry.next) {
  22491. // Fast case, write everything using _writev()
  22492. var l = state.bufferedRequestCount;
  22493. var buffer = new Array(l);
  22494. var holder = state.corkedRequestsFree;
  22495. holder.entry = entry;
  22496. var count = 0;
  22497. var allBuffers = true;
  22498. while (entry) {
  22499. buffer[count] = entry;
  22500. if (!entry.isBuf) allBuffers = false;
  22501. entry = entry.next;
  22502. count += 1;
  22503. }
  22504. buffer.allBuffers = allBuffers;
  22505. doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
  22506. // as the hot path ends with doWrite
  22507. state.pendingcb++;
  22508. state.lastBufferedRequest = null;
  22509. if (holder.next) {
  22510. state.corkedRequestsFree = holder.next;
  22511. holder.next = null;
  22512. } else {
  22513. state.corkedRequestsFree = new CorkedRequest(state);
  22514. }
  22515. state.bufferedRequestCount = 0;
  22516. } else {
  22517. // Slow case, write chunks one-by-one
  22518. while (entry) {
  22519. var chunk = entry.chunk;
  22520. var encoding = entry.encoding;
  22521. var cb = entry.callback;
  22522. var len = state.objectMode ? 1 : chunk.length;
  22523. doWrite(stream, state, false, len, chunk, encoding, cb);
  22524. entry = entry.next;
  22525. state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then
  22526. // it means that we need to wait until it does.
  22527. // also, that means that the chunk and cb are currently
  22528. // being processed, so move the buffer counter past them.
  22529. if (state.writing) {
  22530. break;
  22531. }
  22532. }
  22533. if (entry === null) state.lastBufferedRequest = null;
  22534. }
  22535. state.bufferedRequest = entry;
  22536. state.bufferProcessing = false;
  22537. }
  22538. Writable.prototype._write = function (chunk, encoding, cb) {
  22539. cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
  22540. };
  22541. Writable.prototype._writev = null;
  22542. Writable.prototype.end = function (chunk, encoding, cb) {
  22543. var state = this._writableState;
  22544. if (typeof chunk === 'function') {
  22545. cb = chunk;
  22546. chunk = null;
  22547. encoding = null;
  22548. } else if (typeof encoding === 'function') {
  22549. cb = encoding;
  22550. encoding = null;
  22551. }
  22552. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
  22553. if (state.corked) {
  22554. state.corked = 1;
  22555. this.uncork();
  22556. } // ignore unnecessary end() calls.
  22557. if (!state.ending) endWritable(this, state, cb);
  22558. return this;
  22559. };
  22560. Object.defineProperty(Writable.prototype, 'writableLength', {
  22561. // making it explicit this property is not enumerable
  22562. // because otherwise some prototype manipulation in
  22563. // userland will fail
  22564. enumerable: false,
  22565. get: function get() {
  22566. return this._writableState.length;
  22567. }
  22568. });
  22569. function needFinish(state) {
  22570. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  22571. }
  22572. function callFinal(stream, state) {
  22573. stream._final(function (err) {
  22574. state.pendingcb--;
  22575. if (err) {
  22576. errorOrDestroy(stream, err);
  22577. }
  22578. state.prefinished = true;
  22579. stream.emit('prefinish');
  22580. finishMaybe(stream, state);
  22581. });
  22582. }
  22583. function prefinish(stream, state) {
  22584. if (!state.prefinished && !state.finalCalled) {
  22585. if (typeof stream._final === 'function' && !state.destroyed) {
  22586. state.pendingcb++;
  22587. state.finalCalled = true;
  22588. process.nextTick(callFinal, stream, state);
  22589. } else {
  22590. state.prefinished = true;
  22591. stream.emit('prefinish');
  22592. }
  22593. }
  22594. }
  22595. function finishMaybe(stream, state) {
  22596. var need = needFinish(state);
  22597. if (need) {
  22598. prefinish(stream, state);
  22599. if (state.pendingcb === 0) {
  22600. state.finished = true;
  22601. stream.emit('finish');
  22602. if (state.autoDestroy) {
  22603. // In case of duplex streams we need a way to detect
  22604. // if the readable side is ready for autoDestroy as well
  22605. var rState = stream._readableState;
  22606. if (!rState || rState.autoDestroy && rState.endEmitted) {
  22607. stream.destroy();
  22608. }
  22609. }
  22610. }
  22611. }
  22612. return need;
  22613. }
  22614. function endWritable(stream, state, cb) {
  22615. state.ending = true;
  22616. finishMaybe(stream, state);
  22617. if (cb) {
  22618. if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
  22619. }
  22620. state.ended = true;
  22621. stream.writable = false;
  22622. }
  22623. function onCorkedFinish(corkReq, state, err) {
  22624. var entry = corkReq.entry;
  22625. corkReq.entry = null;
  22626. while (entry) {
  22627. var cb = entry.callback;
  22628. state.pendingcb--;
  22629. cb(err);
  22630. entry = entry.next;
  22631. } // reuse the free corkReq.
  22632. state.corkedRequestsFree.next = corkReq;
  22633. }
  22634. Object.defineProperty(Writable.prototype, 'destroyed', {
  22635. // making it explicit this property is not enumerable
  22636. // because otherwise some prototype manipulation in
  22637. // userland will fail
  22638. enumerable: false,
  22639. get: function get() {
  22640. if (this._writableState === undefined) {
  22641. return false;
  22642. }
  22643. return this._writableState.destroyed;
  22644. },
  22645. set: function set(value) {
  22646. // we ignore the value if the stream
  22647. // has not been initialized yet
  22648. if (!this._writableState) {
  22649. return;
  22650. } // backward compatibility, the user is explicitly
  22651. // managing destroyed
  22652. this._writableState.destroyed = value;
  22653. }
  22654. });
  22655. Writable.prototype.destroy = destroyImpl.destroy;
  22656. Writable.prototype._undestroy = destroyImpl.undestroy;
  22657. Writable.prototype._destroy = function (err, cb) {
  22658. cb(err);
  22659. };
  22660. /***/ }),
  22661. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js":
  22662. /*!****************************************************************************************************!*\
  22663. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js ***!
  22664. \****************************************************************************************************/
  22665. /*! unknown exports (runtime-defined) */
  22666. /*! runtime requirements: __webpack_require__, module */
  22667. /*! CommonJS bailout: module.exports is used directly at 207:0-14 */
  22668. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  22669. "use strict";
  22670. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  22671. var _Object$setPrototypeO;
  22672. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  22673. var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
  22674. var kLastResolve = Symbol('lastResolve');
  22675. var kLastReject = Symbol('lastReject');
  22676. var kError = Symbol('error');
  22677. var kEnded = Symbol('ended');
  22678. var kLastPromise = Symbol('lastPromise');
  22679. var kHandlePromise = Symbol('handlePromise');
  22680. var kStream = Symbol('stream');
  22681. function createIterResult(value, done) {
  22682. return {
  22683. value: value,
  22684. done: done
  22685. };
  22686. }
  22687. function readAndResolve(iter) {
  22688. var resolve = iter[kLastResolve];
  22689. if (resolve !== null) {
  22690. var data = iter[kStream].read(); // we defer if data is null
  22691. // we can be expecting either 'end' or
  22692. // 'error'
  22693. if (data !== null) {
  22694. iter[kLastPromise] = null;
  22695. iter[kLastResolve] = null;
  22696. iter[kLastReject] = null;
  22697. resolve(createIterResult(data, false));
  22698. }
  22699. }
  22700. }
  22701. function onReadable(iter) {
  22702. // we wait for the next tick, because it might
  22703. // emit an error with process.nextTick
  22704. process.nextTick(readAndResolve, iter);
  22705. }
  22706. function wrapForNext(lastPromise, iter) {
  22707. return function (resolve, reject) {
  22708. lastPromise.then(function () {
  22709. if (iter[kEnded]) {
  22710. resolve(createIterResult(undefined, true));
  22711. return;
  22712. }
  22713. iter[kHandlePromise](resolve, reject);
  22714. }, reject);
  22715. };
  22716. }
  22717. var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
  22718. var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
  22719. get stream() {
  22720. return this[kStream];
  22721. },
  22722. next: function next() {
  22723. var _this = this;
  22724. // if we have detected an error in the meanwhile
  22725. // reject straight away
  22726. var error = this[kError];
  22727. if (error !== null) {
  22728. return Promise.reject(error);
  22729. }
  22730. if (this[kEnded]) {
  22731. return Promise.resolve(createIterResult(undefined, true));
  22732. }
  22733. if (this[kStream].destroyed) {
  22734. // We need to defer via nextTick because if .destroy(err) is
  22735. // called, the error will be emitted via nextTick, and
  22736. // we cannot guarantee that there is no error lingering around
  22737. // waiting to be emitted.
  22738. return new Promise(function (resolve, reject) {
  22739. process.nextTick(function () {
  22740. if (_this[kError]) {
  22741. reject(_this[kError]);
  22742. } else {
  22743. resolve(createIterResult(undefined, true));
  22744. }
  22745. });
  22746. });
  22747. } // if we have multiple next() calls
  22748. // we will wait for the previous Promise to finish
  22749. // this logic is optimized to support for await loops,
  22750. // where next() is only called once at a time
  22751. var lastPromise = this[kLastPromise];
  22752. var promise;
  22753. if (lastPromise) {
  22754. promise = new Promise(wrapForNext(lastPromise, this));
  22755. } else {
  22756. // fast path needed to support multiple this.push()
  22757. // without triggering the next() queue
  22758. var data = this[kStream].read();
  22759. if (data !== null) {
  22760. return Promise.resolve(createIterResult(data, false));
  22761. }
  22762. promise = new Promise(this[kHandlePromise]);
  22763. }
  22764. this[kLastPromise] = promise;
  22765. return promise;
  22766. }
  22767. }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
  22768. return this;
  22769. }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
  22770. var _this2 = this;
  22771. // destroy(err, cb) is a private API
  22772. // we can guarantee we have that here, because we control the
  22773. // Readable class this is attached to
  22774. return new Promise(function (resolve, reject) {
  22775. _this2[kStream].destroy(null, function (err) {
  22776. if (err) {
  22777. reject(err);
  22778. return;
  22779. }
  22780. resolve(createIterResult(undefined, true));
  22781. });
  22782. });
  22783. }), _Object$setPrototypeO), AsyncIteratorPrototype);
  22784. var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
  22785. var _Object$create;
  22786. var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
  22787. value: stream,
  22788. writable: true
  22789. }), _defineProperty(_Object$create, kLastResolve, {
  22790. value: null,
  22791. writable: true
  22792. }), _defineProperty(_Object$create, kLastReject, {
  22793. value: null,
  22794. writable: true
  22795. }), _defineProperty(_Object$create, kError, {
  22796. value: null,
  22797. writable: true
  22798. }), _defineProperty(_Object$create, kEnded, {
  22799. value: stream._readableState.endEmitted,
  22800. writable: true
  22801. }), _defineProperty(_Object$create, kHandlePromise, {
  22802. value: function value(resolve, reject) {
  22803. var data = iterator[kStream].read();
  22804. if (data) {
  22805. iterator[kLastPromise] = null;
  22806. iterator[kLastResolve] = null;
  22807. iterator[kLastReject] = null;
  22808. resolve(createIterResult(data, false));
  22809. } else {
  22810. iterator[kLastResolve] = resolve;
  22811. iterator[kLastReject] = reject;
  22812. }
  22813. },
  22814. writable: true
  22815. }), _Object$create));
  22816. iterator[kLastPromise] = null;
  22817. finished(stream, function (err) {
  22818. if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
  22819. var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise
  22820. // returned by next() and store the error
  22821. if (reject !== null) {
  22822. iterator[kLastPromise] = null;
  22823. iterator[kLastResolve] = null;
  22824. iterator[kLastReject] = null;
  22825. reject(err);
  22826. }
  22827. iterator[kError] = err;
  22828. return;
  22829. }
  22830. var resolve = iterator[kLastResolve];
  22831. if (resolve !== null) {
  22832. iterator[kLastPromise] = null;
  22833. iterator[kLastResolve] = null;
  22834. iterator[kLastReject] = null;
  22835. resolve(createIterResult(undefined, true));
  22836. }
  22837. iterator[kEnded] = true;
  22838. });
  22839. stream.on('readable', onReadable.bind(null, iterator));
  22840. return iterator;
  22841. };
  22842. module.exports = createReadableStreamAsyncIterator;
  22843. /***/ }),
  22844. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js":
  22845. /*!*************************************************************************************************!*\
  22846. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js ***!
  22847. \*************************************************************************************************/
  22848. /*! unknown exports (runtime-defined) */
  22849. /*! runtime requirements: module, __webpack_require__ */
  22850. /*! CommonJS bailout: module.exports is used directly at 27:0-14 */
  22851. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  22852. "use strict";
  22853. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  22854. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  22855. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  22856. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22857. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22858. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  22859. var _require = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js"),
  22860. Buffer = _require.Buffer;
  22861. var _require2 = __webpack_require__(/*! util */ "?0bed"),
  22862. inspect = _require2.inspect;
  22863. var custom = inspect && inspect.custom || 'inspect';
  22864. function copyBuffer(src, target, offset) {
  22865. Buffer.prototype.copy.call(src, target, offset);
  22866. }
  22867. module.exports =
  22868. /*#__PURE__*/
  22869. function () {
  22870. function BufferList() {
  22871. _classCallCheck(this, BufferList);
  22872. this.head = null;
  22873. this.tail = null;
  22874. this.length = 0;
  22875. }
  22876. _createClass(BufferList, [{
  22877. key: "push",
  22878. value: function push(v) {
  22879. var entry = {
  22880. data: v,
  22881. next: null
  22882. };
  22883. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  22884. this.tail = entry;
  22885. ++this.length;
  22886. }
  22887. }, {
  22888. key: "unshift",
  22889. value: function unshift(v) {
  22890. var entry = {
  22891. data: v,
  22892. next: this.head
  22893. };
  22894. if (this.length === 0) this.tail = entry;
  22895. this.head = entry;
  22896. ++this.length;
  22897. }
  22898. }, {
  22899. key: "shift",
  22900. value: function shift() {
  22901. if (this.length === 0) return;
  22902. var ret = this.head.data;
  22903. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  22904. --this.length;
  22905. return ret;
  22906. }
  22907. }, {
  22908. key: "clear",
  22909. value: function clear() {
  22910. this.head = this.tail = null;
  22911. this.length = 0;
  22912. }
  22913. }, {
  22914. key: "join",
  22915. value: function join(s) {
  22916. if (this.length === 0) return '';
  22917. var p = this.head;
  22918. var ret = '' + p.data;
  22919. while (p = p.next) {
  22920. ret += s + p.data;
  22921. }
  22922. return ret;
  22923. }
  22924. }, {
  22925. key: "concat",
  22926. value: function concat(n) {
  22927. if (this.length === 0) return Buffer.alloc(0);
  22928. var ret = Buffer.allocUnsafe(n >>> 0);
  22929. var p = this.head;
  22930. var i = 0;
  22931. while (p) {
  22932. copyBuffer(p.data, ret, i);
  22933. i += p.data.length;
  22934. p = p.next;
  22935. }
  22936. return ret;
  22937. } // Consumes a specified amount of bytes or characters from the buffered data.
  22938. }, {
  22939. key: "consume",
  22940. value: function consume(n, hasStrings) {
  22941. var ret;
  22942. if (n < this.head.data.length) {
  22943. // `slice` is the same for buffers and strings.
  22944. ret = this.head.data.slice(0, n);
  22945. this.head.data = this.head.data.slice(n);
  22946. } else if (n === this.head.data.length) {
  22947. // First chunk is a perfect match.
  22948. ret = this.shift();
  22949. } else {
  22950. // Result spans more than one buffer.
  22951. ret = hasStrings ? this._getString(n) : this._getBuffer(n);
  22952. }
  22953. return ret;
  22954. }
  22955. }, {
  22956. key: "first",
  22957. value: function first() {
  22958. return this.head.data;
  22959. } // Consumes a specified amount of characters from the buffered data.
  22960. }, {
  22961. key: "_getString",
  22962. value: function _getString(n) {
  22963. var p = this.head;
  22964. var c = 1;
  22965. var ret = p.data;
  22966. n -= ret.length;
  22967. while (p = p.next) {
  22968. var str = p.data;
  22969. var nb = n > str.length ? str.length : n;
  22970. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  22971. n -= nb;
  22972. if (n === 0) {
  22973. if (nb === str.length) {
  22974. ++c;
  22975. if (p.next) this.head = p.next;else this.head = this.tail = null;
  22976. } else {
  22977. this.head = p;
  22978. p.data = str.slice(nb);
  22979. }
  22980. break;
  22981. }
  22982. ++c;
  22983. }
  22984. this.length -= c;
  22985. return ret;
  22986. } // Consumes a specified amount of bytes from the buffered data.
  22987. }, {
  22988. key: "_getBuffer",
  22989. value: function _getBuffer(n) {
  22990. var ret = Buffer.allocUnsafe(n);
  22991. var p = this.head;
  22992. var c = 1;
  22993. p.data.copy(ret);
  22994. n -= p.data.length;
  22995. while (p = p.next) {
  22996. var buf = p.data;
  22997. var nb = n > buf.length ? buf.length : n;
  22998. buf.copy(ret, ret.length - n, 0, nb);
  22999. n -= nb;
  23000. if (n === 0) {
  23001. if (nb === buf.length) {
  23002. ++c;
  23003. if (p.next) this.head = p.next;else this.head = this.tail = null;
  23004. } else {
  23005. this.head = p;
  23006. p.data = buf.slice(nb);
  23007. }
  23008. break;
  23009. }
  23010. ++c;
  23011. }
  23012. this.length -= c;
  23013. return ret;
  23014. } // Make sure the linked list only shows the minimal necessary information.
  23015. }, {
  23016. key: custom,
  23017. value: function value(_, options) {
  23018. return inspect(this, _objectSpread({}, options, {
  23019. // Only inspect one level.
  23020. depth: 0,
  23021. // It should not recurse.
  23022. customInspect: false
  23023. }));
  23024. }
  23025. }]);
  23026. return BufferList;
  23027. }();
  23028. /***/ }),
  23029. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js":
  23030. /*!*********************************************************************************************!*\
  23031. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  23032. \*********************************************************************************************/
  23033. /*! unknown exports (runtime-defined) */
  23034. /*! runtime requirements: __webpack_require__, module */
  23035. /*! CommonJS bailout: module.exports is used directly at 101:0-14 */
  23036. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23037. "use strict";
  23038. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  23039. // undocumented cb() API, needed for core, not for public API
  23040. function destroy(err, cb) {
  23041. var _this = this;
  23042. var readableDestroyed = this._readableState && this._readableState.destroyed;
  23043. var writableDestroyed = this._writableState && this._writableState.destroyed;
  23044. if (readableDestroyed || writableDestroyed) {
  23045. if (cb) {
  23046. cb(err);
  23047. } else if (err) {
  23048. if (!this._writableState) {
  23049. process.nextTick(emitErrorNT, this, err);
  23050. } else if (!this._writableState.errorEmitted) {
  23051. this._writableState.errorEmitted = true;
  23052. process.nextTick(emitErrorNT, this, err);
  23053. }
  23054. }
  23055. return this;
  23056. } // we set destroyed to true before firing error callbacks in order
  23057. // to make it re-entrance safe in case destroy() is called within callbacks
  23058. if (this._readableState) {
  23059. this._readableState.destroyed = true;
  23060. } // if this is a duplex stream mark the writable part as destroyed as well
  23061. if (this._writableState) {
  23062. this._writableState.destroyed = true;
  23063. }
  23064. this._destroy(err || null, function (err) {
  23065. if (!cb && err) {
  23066. if (!_this._writableState) {
  23067. process.nextTick(emitErrorAndCloseNT, _this, err);
  23068. } else if (!_this._writableState.errorEmitted) {
  23069. _this._writableState.errorEmitted = true;
  23070. process.nextTick(emitErrorAndCloseNT, _this, err);
  23071. } else {
  23072. process.nextTick(emitCloseNT, _this);
  23073. }
  23074. } else if (cb) {
  23075. process.nextTick(emitCloseNT, _this);
  23076. cb(err);
  23077. } else {
  23078. process.nextTick(emitCloseNT, _this);
  23079. }
  23080. });
  23081. return this;
  23082. }
  23083. function emitErrorAndCloseNT(self, err) {
  23084. emitErrorNT(self, err);
  23085. emitCloseNT(self);
  23086. }
  23087. function emitCloseNT(self) {
  23088. if (self._writableState && !self._writableState.emitClose) return;
  23089. if (self._readableState && !self._readableState.emitClose) return;
  23090. self.emit('close');
  23091. }
  23092. function undestroy() {
  23093. if (this._readableState) {
  23094. this._readableState.destroyed = false;
  23095. this._readableState.reading = false;
  23096. this._readableState.ended = false;
  23097. this._readableState.endEmitted = false;
  23098. }
  23099. if (this._writableState) {
  23100. this._writableState.destroyed = false;
  23101. this._writableState.ended = false;
  23102. this._writableState.ending = false;
  23103. this._writableState.finalCalled = false;
  23104. this._writableState.prefinished = false;
  23105. this._writableState.finished = false;
  23106. this._writableState.errorEmitted = false;
  23107. }
  23108. }
  23109. function emitErrorNT(self, err) {
  23110. self.emit('error', err);
  23111. }
  23112. function errorOrDestroy(stream, err) {
  23113. // We have tests that rely on errors being emitted
  23114. // in the same tick, so changing this is semver major.
  23115. // For now when you opt-in to autoDestroy we allow
  23116. // the error to be emitted nextTick. In a future
  23117. // semver major update we should change the default to this.
  23118. var rState = stream._readableState;
  23119. var wState = stream._writableState;
  23120. if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
  23121. }
  23122. module.exports = {
  23123. destroy: destroy,
  23124. undestroy: undestroy,
  23125. errorOrDestroy: errorOrDestroy
  23126. };
  23127. /***/ }),
  23128. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js":
  23129. /*!***************************************************************************************************!*\
  23130. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***!
  23131. \***************************************************************************************************/
  23132. /*! unknown exports (runtime-defined) */
  23133. /*! runtime requirements: __webpack_require__, module */
  23134. /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
  23135. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23136. "use strict";
  23137. // Ported from https://github.com/mafintosh/end-of-stream with
  23138. // permission from the author, Mathias Buus (@mafintosh).
  23139. var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE;
  23140. function once(callback) {
  23141. var called = false;
  23142. return function () {
  23143. if (called) return;
  23144. called = true;
  23145. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  23146. args[_key] = arguments[_key];
  23147. }
  23148. callback.apply(this, args);
  23149. };
  23150. }
  23151. function noop() {}
  23152. function isRequest(stream) {
  23153. return stream.setHeader && typeof stream.abort === 'function';
  23154. }
  23155. function eos(stream, opts, callback) {
  23156. if (typeof opts === 'function') return eos(stream, null, opts);
  23157. if (!opts) opts = {};
  23158. callback = once(callback || noop);
  23159. var readable = opts.readable || opts.readable !== false && stream.readable;
  23160. var writable = opts.writable || opts.writable !== false && stream.writable;
  23161. var onlegacyfinish = function onlegacyfinish() {
  23162. if (!stream.writable) onfinish();
  23163. };
  23164. var writableEnded = stream._writableState && stream._writableState.finished;
  23165. var onfinish = function onfinish() {
  23166. writable = false;
  23167. writableEnded = true;
  23168. if (!readable) callback.call(stream);
  23169. };
  23170. var readableEnded = stream._readableState && stream._readableState.endEmitted;
  23171. var onend = function onend() {
  23172. readable = false;
  23173. readableEnded = true;
  23174. if (!writable) callback.call(stream);
  23175. };
  23176. var onerror = function onerror(err) {
  23177. callback.call(stream, err);
  23178. };
  23179. var onclose = function onclose() {
  23180. var err;
  23181. if (readable && !readableEnded) {
  23182. if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
  23183. return callback.call(stream, err);
  23184. }
  23185. if (writable && !writableEnded) {
  23186. if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
  23187. return callback.call(stream, err);
  23188. }
  23189. };
  23190. var onrequest = function onrequest() {
  23191. stream.req.on('finish', onfinish);
  23192. };
  23193. if (isRequest(stream)) {
  23194. stream.on('complete', onfinish);
  23195. stream.on('abort', onclose);
  23196. if (stream.req) onrequest();else stream.on('request', onrequest);
  23197. } else if (writable && !stream._writableState) {
  23198. // legacy streams
  23199. stream.on('end', onlegacyfinish);
  23200. stream.on('close', onlegacyfinish);
  23201. }
  23202. stream.on('end', onend);
  23203. stream.on('finish', onfinish);
  23204. if (opts.error !== false) stream.on('error', onerror);
  23205. stream.on('close', onclose);
  23206. return function () {
  23207. stream.removeListener('complete', onfinish);
  23208. stream.removeListener('abort', onclose);
  23209. stream.removeListener('request', onrequest);
  23210. if (stream.req) stream.req.removeListener('finish', onfinish);
  23211. stream.removeListener('end', onlegacyfinish);
  23212. stream.removeListener('close', onlegacyfinish);
  23213. stream.removeListener('finish', onfinish);
  23214. stream.removeListener('end', onend);
  23215. stream.removeListener('error', onerror);
  23216. stream.removeListener('close', onclose);
  23217. };
  23218. }
  23219. module.exports = eos;
  23220. /***/ }),
  23221. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js":
  23222. /*!**************************************************************************************************!*\
  23223. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js ***!
  23224. \**************************************************************************************************/
  23225. /*! unknown exports (runtime-defined) */
  23226. /*! runtime requirements: module */
  23227. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  23228. /***/ ((module) => {
  23229. module.exports = function () {
  23230. throw new Error('Readable.from is not available in the browser')
  23231. };
  23232. /***/ }),
  23233. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js":
  23234. /*!**********************************************************************************************!*\
  23235. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js ***!
  23236. \**********************************************************************************************/
  23237. /*! unknown exports (runtime-defined) */
  23238. /*! runtime requirements: __webpack_require__, module */
  23239. /*! CommonJS bailout: module.exports is used directly at 97:0-14 */
  23240. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23241. "use strict";
  23242. // Ported from https://github.com/mafintosh/pump with
  23243. // permission from the author, Mathias Buus (@mafintosh).
  23244. var eos;
  23245. function once(callback) {
  23246. var called = false;
  23247. return function () {
  23248. if (called) return;
  23249. called = true;
  23250. callback.apply(void 0, arguments);
  23251. };
  23252. }
  23253. var _require$codes = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
  23254. ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
  23255. ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
  23256. function noop(err) {
  23257. // Rethrow the error if it exists to avoid swallowing it
  23258. if (err) throw err;
  23259. }
  23260. function isRequest(stream) {
  23261. return stream.setHeader && typeof stream.abort === 'function';
  23262. }
  23263. function destroyer(stream, reading, writing, callback) {
  23264. callback = once(callback);
  23265. var closed = false;
  23266. stream.on('close', function () {
  23267. closed = true;
  23268. });
  23269. if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
  23270. eos(stream, {
  23271. readable: reading,
  23272. writable: writing
  23273. }, function (err) {
  23274. if (err) return callback(err);
  23275. closed = true;
  23276. callback();
  23277. });
  23278. var destroyed = false;
  23279. return function (err) {
  23280. if (closed) return;
  23281. if (destroyed) return;
  23282. destroyed = true; // request.destroy just do .end - .abort is what we want
  23283. if (isRequest(stream)) return stream.abort();
  23284. if (typeof stream.destroy === 'function') return stream.destroy();
  23285. callback(err || new ERR_STREAM_DESTROYED('pipe'));
  23286. };
  23287. }
  23288. function call(fn) {
  23289. fn();
  23290. }
  23291. function pipe(from, to) {
  23292. return from.pipe(to);
  23293. }
  23294. function popCallback(streams) {
  23295. if (!streams.length) return noop;
  23296. if (typeof streams[streams.length - 1] !== 'function') return noop;
  23297. return streams.pop();
  23298. }
  23299. function pipeline() {
  23300. for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
  23301. streams[_key] = arguments[_key];
  23302. }
  23303. var callback = popCallback(streams);
  23304. if (Array.isArray(streams[0])) streams = streams[0];
  23305. if (streams.length < 2) {
  23306. throw new ERR_MISSING_ARGS('streams');
  23307. }
  23308. var error;
  23309. var destroys = streams.map(function (stream, i) {
  23310. var reading = i < streams.length - 1;
  23311. var writing = i > 0;
  23312. return destroyer(stream, reading, writing, function (err) {
  23313. if (!error) error = err;
  23314. if (err) destroys.forEach(call);
  23315. if (reading) return;
  23316. destroys.forEach(call);
  23317. callback(error);
  23318. });
  23319. });
  23320. return streams.reduce(pipe);
  23321. }
  23322. module.exports = pipeline;
  23323. /***/ }),
  23324. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js":
  23325. /*!*******************************************************************************************!*\
  23326. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js ***!
  23327. \*******************************************************************************************/
  23328. /*! unknown exports (runtime-defined) */
  23329. /*! runtime requirements: __webpack_require__, module */
  23330. /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
  23331. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23332. "use strict";
  23333. var ERR_INVALID_OPT_VALUE = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE;
  23334. function highWaterMarkFrom(options, isDuplex, duplexKey) {
  23335. return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
  23336. }
  23337. function getHighWaterMark(state, options, duplexKey, isDuplex) {
  23338. var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
  23339. if (hwm != null) {
  23340. if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
  23341. var name = isDuplex ? duplexKey : 'highWaterMark';
  23342. throw new ERR_INVALID_OPT_VALUE(name, hwm);
  23343. }
  23344. return Math.floor(hwm);
  23345. } // Default value
  23346. return state.objectMode ? 16 : 16 * 1024;
  23347. }
  23348. module.exports = {
  23349. getHighWaterMark: getHighWaterMark
  23350. };
  23351. /***/ }),
  23352. /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
  23353. /*!****************************************************************************************************!*\
  23354. !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  23355. \****************************************************************************************************/
  23356. /*! dynamic exports */
  23357. /*! exports [maybe provided (runtime-defined)] [no usage info] */
  23358. /*! runtime requirements: module, __webpack_require__ */
  23359. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23360. module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
  23361. /***/ }),
  23362. /***/ "./node_modules/hash-base/node_modules/readable-stream/readable-browser.js":
  23363. /*!*********************************************************************************!*\
  23364. !*** ./node_modules/hash-base/node_modules/readable-stream/readable-browser.js ***!
  23365. \*********************************************************************************/
  23366. /*! unknown exports (runtime-defined) */
  23367. /*! runtime requirements: __webpack_exports__, module, __webpack_require__ */
  23368. /*! CommonJS bailout: exports is used directly at 1:0-7 */
  23369. /*! CommonJS bailout: exports is used directly at 2:17-24 */
  23370. /*! CommonJS bailout: exports is used directly at 3:19-26 */
  23371. /***/ ((module, exports, __webpack_require__) => {
  23372. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js");
  23373. exports.Stream = exports;
  23374. exports.Readable = exports;
  23375. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js");
  23376. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
  23377. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js");
  23378. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js");
  23379. exports.finished = __webpack_require__(/*! ./lib/internal/streams/end-of-stream.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
  23380. exports.pipeline = __webpack_require__(/*! ./lib/internal/streams/pipeline.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js");
  23381. /***/ }),
  23382. /***/ "./node_modules/hash-base/node_modules/safe-buffer/index.js":
  23383. /*!******************************************************************!*\
  23384. !*** ./node_modules/hash-base/node_modules/safe-buffer/index.js ***!
  23385. \******************************************************************/
  23386. /*! unknown exports (runtime-defined) */
  23387. /*! runtime requirements: module, __webpack_exports__, __webpack_require__ */
  23388. /*! CommonJS bailout: module.exports is used directly at 13:2-16 */
  23389. /*! CommonJS bailout: exports is used directly at 16:20-27 */
  23390. /***/ ((module, exports, __webpack_require__) => {
  23391. /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  23392. /* eslint-disable node/no-deprecated-api */
  23393. var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
  23394. var Buffer = buffer.Buffer
  23395. // alternative to using Object.keys for old browsers
  23396. function copyProps (src, dst) {
  23397. for (var key in src) {
  23398. dst[key] = src[key]
  23399. }
  23400. }
  23401. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  23402. module.exports = buffer
  23403. } else {
  23404. // Copy properties from require('buffer')
  23405. copyProps(buffer, exports)
  23406. exports.Buffer = SafeBuffer
  23407. }
  23408. function SafeBuffer (arg, encodingOrOffset, length) {
  23409. return Buffer(arg, encodingOrOffset, length)
  23410. }
  23411. SafeBuffer.prototype = Object.create(Buffer.prototype)
  23412. // Copy static methods from Buffer
  23413. copyProps(Buffer, SafeBuffer)
  23414. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  23415. if (typeof arg === 'number') {
  23416. throw new TypeError('Argument must not be a number')
  23417. }
  23418. return Buffer(arg, encodingOrOffset, length)
  23419. }
  23420. SafeBuffer.alloc = function (size, fill, encoding) {
  23421. if (typeof size !== 'number') {
  23422. throw new TypeError('Argument must be a number')
  23423. }
  23424. var buf = Buffer(size)
  23425. if (fill !== undefined) {
  23426. if (typeof encoding === 'string') {
  23427. buf.fill(fill, encoding)
  23428. } else {
  23429. buf.fill(fill)
  23430. }
  23431. } else {
  23432. buf.fill(0)
  23433. }
  23434. return buf
  23435. }
  23436. SafeBuffer.allocUnsafe = function (size) {
  23437. if (typeof size !== 'number') {
  23438. throw new TypeError('Argument must be a number')
  23439. }
  23440. return Buffer(size)
  23441. }
  23442. SafeBuffer.allocUnsafeSlow = function (size) {
  23443. if (typeof size !== 'number') {
  23444. throw new TypeError('Argument must be a number')
  23445. }
  23446. return buffer.SlowBuffer(size)
  23447. }
  23448. /***/ }),
  23449. /***/ "./node_modules/ieee754/index.js":
  23450. /*!***************************************!*\
  23451. !*** ./node_modules/ieee754/index.js ***!
  23452. \***************************************/
  23453. /*! default exports */
  23454. /*! export read [provided] [no usage info] [missing usage info prevents renaming] */
  23455. /*! export write [provided] [no usage info] [missing usage info prevents renaming] */
  23456. /*! other exports [not provided] [no usage info] */
  23457. /*! runtime requirements: __webpack_exports__ */
  23458. /***/ ((__unused_webpack_module, exports) => {
  23459. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  23460. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  23461. var e, m
  23462. var eLen = (nBytes * 8) - mLen - 1
  23463. var eMax = (1 << eLen) - 1
  23464. var eBias = eMax >> 1
  23465. var nBits = -7
  23466. var i = isLE ? (nBytes - 1) : 0
  23467. var d = isLE ? -1 : 1
  23468. var s = buffer[offset + i]
  23469. i += d
  23470. e = s & ((1 << (-nBits)) - 1)
  23471. s >>= (-nBits)
  23472. nBits += eLen
  23473. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  23474. m = e & ((1 << (-nBits)) - 1)
  23475. e >>= (-nBits)
  23476. nBits += mLen
  23477. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  23478. if (e === 0) {
  23479. e = 1 - eBias
  23480. } else if (e === eMax) {
  23481. return m ? NaN : ((s ? -1 : 1) * Infinity)
  23482. } else {
  23483. m = m + Math.pow(2, mLen)
  23484. e = e - eBias
  23485. }
  23486. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  23487. }
  23488. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  23489. var e, m, c
  23490. var eLen = (nBytes * 8) - mLen - 1
  23491. var eMax = (1 << eLen) - 1
  23492. var eBias = eMax >> 1
  23493. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  23494. var i = isLE ? 0 : (nBytes - 1)
  23495. var d = isLE ? 1 : -1
  23496. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  23497. value = Math.abs(value)
  23498. if (isNaN(value) || value === Infinity) {
  23499. m = isNaN(value) ? 1 : 0
  23500. e = eMax
  23501. } else {
  23502. e = Math.floor(Math.log(value) / Math.LN2)
  23503. if (value * (c = Math.pow(2, -e)) < 1) {
  23504. e--
  23505. c *= 2
  23506. }
  23507. if (e + eBias >= 1) {
  23508. value += rt / c
  23509. } else {
  23510. value += rt * Math.pow(2, 1 - eBias)
  23511. }
  23512. if (value * c >= 2) {
  23513. e++
  23514. c /= 2
  23515. }
  23516. if (e + eBias >= eMax) {
  23517. m = 0
  23518. e = eMax
  23519. } else if (e + eBias >= 1) {
  23520. m = ((value * c) - 1) * Math.pow(2, mLen)
  23521. e = e + eBias
  23522. } else {
  23523. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  23524. e = 0
  23525. }
  23526. }
  23527. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  23528. e = (e << mLen) | m
  23529. eLen += mLen
  23530. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  23531. buffer[offset + i - d] |= s * 128
  23532. }
  23533. /***/ }),
  23534. /***/ "./node_modules/inherits/inherits_browser.js":
  23535. /*!***************************************************!*\
  23536. !*** ./node_modules/inherits/inherits_browser.js ***!
  23537. \***************************************************/
  23538. /*! unknown exports (runtime-defined) */
  23539. /*! runtime requirements: module */
  23540. /*! CommonJS bailout: module.exports is used directly at 3:2-16 */
  23541. /*! CommonJS bailout: module.exports is used directly at 18:2-16 */
  23542. /***/ ((module) => {
  23543. if (typeof Object.create === 'function') {
  23544. // implementation from standard node.js 'util' module
  23545. module.exports = function inherits(ctor, superCtor) {
  23546. if (superCtor) {
  23547. ctor.super_ = superCtor
  23548. ctor.prototype = Object.create(superCtor.prototype, {
  23549. constructor: {
  23550. value: ctor,
  23551. enumerable: false,
  23552. writable: true,
  23553. configurable: true
  23554. }
  23555. })
  23556. }
  23557. };
  23558. } else {
  23559. // old school shim for old browsers
  23560. module.exports = function inherits(ctor, superCtor) {
  23561. if (superCtor) {
  23562. ctor.super_ = superCtor
  23563. var TempCtor = function () {}
  23564. TempCtor.prototype = superCtor.prototype
  23565. ctor.prototype = new TempCtor()
  23566. ctor.prototype.constructor = ctor
  23567. }
  23568. }
  23569. }
  23570. /***/ }),
  23571. /***/ "./node_modules/md5.js/index.js":
  23572. /*!**************************************!*\
  23573. !*** ./node_modules/md5.js/index.js ***!
  23574. \**************************************/
  23575. /*! unknown exports (runtime-defined) */
  23576. /*! runtime requirements: __webpack_require__, module */
  23577. /*! CommonJS bailout: module.exports is used directly at 146:0-14 */
  23578. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  23579. "use strict";
  23580. var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")
  23581. var HashBase = __webpack_require__(/*! hash-base */ "./node_modules/hash-base/index.js")
  23582. var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer
  23583. var ARRAY16 = new Array(16)
  23584. function MD5 () {
  23585. HashBase.call(this, 64)
  23586. // state
  23587. this._a = 0x67452301
  23588. this._b = 0xefcdab89
  23589. this._c = 0x98badcfe
  23590. this._d = 0x10325476
  23591. }
  23592. inherits(MD5, HashBase)
  23593. MD5.prototype._update = function () {
  23594. var M = ARRAY16
  23595. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  23596. var a = this._a
  23597. var b = this._b
  23598. var c = this._c
  23599. var d = this._d
  23600. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  23601. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  23602. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  23603. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  23604. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  23605. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  23606. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  23607. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  23608. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  23609. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  23610. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  23611. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  23612. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  23613. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  23614. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  23615. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  23616. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  23617. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  23618. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  23619. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  23620. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  23621. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  23622. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  23623. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  23624. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  23625. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  23626. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  23627. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  23628. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  23629. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  23630. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  23631. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  23632. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  23633. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  23634. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  23635. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  23636. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  23637. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  23638. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  23639. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  23640. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  23641. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  23642. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  23643. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  23644. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  23645. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  23646. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  23647. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  23648. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  23649. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  23650. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  23651. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  23652. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  23653. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  23654. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  23655. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  23656. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  23657. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  23658. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  23659. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  23660. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  23661. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  23662. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  23663. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  23664. this._a = (this._a + a) | 0
  23665. this._b = (this._b + b) | 0
  23666. this._c = (this._c + c) | 0
  23667. this._d = (this._d + d) | 0
  23668. }
  23669. MD5.prototype._digest = function () {
  23670. // create padding and handle blocks
  23671. this._block[this._blockOffset++] = 0x80
  23672. if (this._blockOffset > 56) {
  23673. this._block.fill(0, this._blockOffset, 64)
  23674. this._update()
  23675. this._blockOffset = 0
  23676. }
  23677. this._block.fill(0, this._blockOffset, 56)
  23678. this._block.writeUInt32LE(this._length[0], 56)
  23679. this._block.writeUInt32LE(this._length[1], 60)
  23680. this._update()
  23681. // produce result
  23682. var buffer = Buffer.allocUnsafe(16)
  23683. buffer.writeInt32LE(this._a, 0)
  23684. buffer.writeInt32LE(this._b, 4)
  23685. buffer.writeInt32LE(this._c, 8)
  23686. buffer.writeInt32LE(this._d, 12)
  23687. return buffer
  23688. }
  23689. function rotl (x, n) {
  23690. return (x << n) | (x >>> (32 - n))
  23691. }
  23692. function fnF (a, b, c, d, m, k, s) {
  23693. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  23694. }
  23695. function fnG (a, b, c, d, m, k, s) {
  23696. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  23697. }
  23698. function fnH (a, b, c, d, m, k, s) {
  23699. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  23700. }
  23701. function fnI (a, b, c, d, m, k, s) {
  23702. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  23703. }
  23704. module.exports = MD5
  23705. /***/ }),
  23706. /***/ "./node_modules/ms/index.js":
  23707. /*!**********************************!*\
  23708. !*** ./node_modules/ms/index.js ***!
  23709. \**********************************/
  23710. /*! unknown exports (runtime-defined) */
  23711. /*! runtime requirements: module */
  23712. /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
  23713. /***/ ((module) => {
  23714. /**
  23715. * Helpers.
  23716. */
  23717. var s = 1000;
  23718. var m = s * 60;
  23719. var h = m * 60;
  23720. var d = h * 24;
  23721. var w = d * 7;
  23722. var y = d * 365.25;
  23723. /**
  23724. * Parse or format the given `val`.
  23725. *
  23726. * Options:
  23727. *
  23728. * - `long` verbose formatting [false]
  23729. *
  23730. * @param {String|Number} val
  23731. * @param {Object} [options]
  23732. * @throws {Error} throw an error if val is not a non-empty string or a number
  23733. * @return {String|Number}
  23734. * @api public
  23735. */
  23736. module.exports = function(val, options) {
  23737. options = options || {};
  23738. var type = typeof val;
  23739. if (type === 'string' && val.length > 0) {
  23740. return parse(val);
  23741. } else if (type === 'number' && isFinite(val)) {
  23742. return options.long ? fmtLong(val) : fmtShort(val);
  23743. }
  23744. throw new Error(
  23745. 'val is not a non-empty string or a valid number. val=' +
  23746. JSON.stringify(val)
  23747. );
  23748. };
  23749. /**
  23750. * Parse the given `str` and return milliseconds.
  23751. *
  23752. * @param {String} str
  23753. * @return {Number}
  23754. * @api private
  23755. */
  23756. function parse(str) {
  23757. str = String(str);
  23758. if (str.length > 100) {
  23759. return;
  23760. }
  23761. 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(
  23762. str
  23763. );
  23764. if (!match) {
  23765. return;
  23766. }
  23767. var n = parseFloat(match[1]);
  23768. var type = (match[2] || 'ms').toLowerCase();
  23769. switch (type) {
  23770. case 'years':
  23771. case 'year':
  23772. case 'yrs':
  23773. case 'yr':
  23774. case 'y':
  23775. return n * y;
  23776. case 'weeks':
  23777. case 'week':
  23778. case 'w':
  23779. return n * w;
  23780. case 'days':
  23781. case 'day':
  23782. case 'd':
  23783. return n * d;
  23784. case 'hours':
  23785. case 'hour':
  23786. case 'hrs':
  23787. case 'hr':
  23788. case 'h':
  23789. return n * h;
  23790. case 'minutes':
  23791. case 'minute':
  23792. case 'mins':
  23793. case 'min':
  23794. case 'm':
  23795. return n * m;
  23796. case 'seconds':
  23797. case 'second':
  23798. case 'secs':
  23799. case 'sec':
  23800. case 's':
  23801. return n * s;
  23802. case 'milliseconds':
  23803. case 'millisecond':
  23804. case 'msecs':
  23805. case 'msec':
  23806. case 'ms':
  23807. return n;
  23808. default:
  23809. return undefined;
  23810. }
  23811. }
  23812. /**
  23813. * Short format for `ms`.
  23814. *
  23815. * @param {Number} ms
  23816. * @return {String}
  23817. * @api private
  23818. */
  23819. function fmtShort(ms) {
  23820. var msAbs = Math.abs(ms);
  23821. if (msAbs >= d) {
  23822. return Math.round(ms / d) + 'd';
  23823. }
  23824. if (msAbs >= h) {
  23825. return Math.round(ms / h) + 'h';
  23826. }
  23827. if (msAbs >= m) {
  23828. return Math.round(ms / m) + 'm';
  23829. }
  23830. if (msAbs >= s) {
  23831. return Math.round(ms / s) + 's';
  23832. }
  23833. return ms + 'ms';
  23834. }
  23835. /**
  23836. * Long format for `ms`.
  23837. *
  23838. * @param {Number} ms
  23839. * @return {String}
  23840. * @api private
  23841. */
  23842. function fmtLong(ms) {
  23843. var msAbs = Math.abs(ms);
  23844. if (msAbs >= d) {
  23845. return plural(ms, msAbs, d, 'day');
  23846. }
  23847. if (msAbs >= h) {
  23848. return plural(ms, msAbs, h, 'hour');
  23849. }
  23850. if (msAbs >= m) {
  23851. return plural(ms, msAbs, m, 'minute');
  23852. }
  23853. if (msAbs >= s) {
  23854. return plural(ms, msAbs, s, 'second');
  23855. }
  23856. return ms + ' ms';
  23857. }
  23858. /**
  23859. * Pluralization helper.
  23860. */
  23861. function plural(ms, msAbs, n, name) {
  23862. var isPlural = msAbs >= n * 1.5;
  23863. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  23864. }
  23865. /***/ }),
  23866. /***/ "./node_modules/process/browser.js":
  23867. /*!*****************************************!*\
  23868. !*** ./node_modules/process/browser.js ***!
  23869. \*****************************************/
  23870. /*! unknown exports (runtime-defined) */
  23871. /*! runtime requirements: module */
  23872. /*! CommonJS bailout: module.exports is used directly at 2:14-28 */
  23873. /***/ ((module) => {
  23874. // shim for using process in browser
  23875. var process = module.exports = {};
  23876. // cached from whatever global is present so that test runners that stub it
  23877. // don't break things. But we need to wrap it in a try catch in case it is
  23878. // wrapped in strict mode code which doesn't define any globals. It's inside a
  23879. // function because try/catches deoptimize in certain engines.
  23880. var cachedSetTimeout;
  23881. var cachedClearTimeout;
  23882. function defaultSetTimout() {
  23883. throw new Error('setTimeout has not been defined');
  23884. }
  23885. function defaultClearTimeout () {
  23886. throw new Error('clearTimeout has not been defined');
  23887. }
  23888. (function () {
  23889. try {
  23890. if (typeof setTimeout === 'function') {
  23891. cachedSetTimeout = setTimeout;
  23892. } else {
  23893. cachedSetTimeout = defaultSetTimout;
  23894. }
  23895. } catch (e) {
  23896. cachedSetTimeout = defaultSetTimout;
  23897. }
  23898. try {
  23899. if (typeof clearTimeout === 'function') {
  23900. cachedClearTimeout = clearTimeout;
  23901. } else {
  23902. cachedClearTimeout = defaultClearTimeout;
  23903. }
  23904. } catch (e) {
  23905. cachedClearTimeout = defaultClearTimeout;
  23906. }
  23907. } ())
  23908. function runTimeout(fun) {
  23909. if (cachedSetTimeout === setTimeout) {
  23910. //normal enviroments in sane situations
  23911. return setTimeout(fun, 0);
  23912. }
  23913. // if setTimeout wasn't available but was latter defined
  23914. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  23915. cachedSetTimeout = setTimeout;
  23916. return setTimeout(fun, 0);
  23917. }
  23918. try {
  23919. // when when somebody has screwed with setTimeout but no I.E. maddness
  23920. return cachedSetTimeout(fun, 0);
  23921. } catch(e){
  23922. try {
  23923. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  23924. return cachedSetTimeout.call(null, fun, 0);
  23925. } catch(e){
  23926. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  23927. return cachedSetTimeout.call(this, fun, 0);
  23928. }
  23929. }
  23930. }
  23931. function runClearTimeout(marker) {
  23932. if (cachedClearTimeout === clearTimeout) {
  23933. //normal enviroments in sane situations
  23934. return clearTimeout(marker);
  23935. }
  23936. // if clearTimeout wasn't available but was latter defined
  23937. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  23938. cachedClearTimeout = clearTimeout;
  23939. return clearTimeout(marker);
  23940. }
  23941. try {
  23942. // when when somebody has screwed with setTimeout but no I.E. maddness
  23943. return cachedClearTimeout(marker);
  23944. } catch (e){
  23945. try {
  23946. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  23947. return cachedClearTimeout.call(null, marker);
  23948. } catch (e){
  23949. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  23950. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  23951. return cachedClearTimeout.call(this, marker);
  23952. }
  23953. }
  23954. }
  23955. var queue = [];
  23956. var draining = false;
  23957. var currentQueue;
  23958. var queueIndex = -1;
  23959. function cleanUpNextTick() {
  23960. if (!draining || !currentQueue) {
  23961. return;
  23962. }
  23963. draining = false;
  23964. if (currentQueue.length) {
  23965. queue = currentQueue.concat(queue);
  23966. } else {
  23967. queueIndex = -1;
  23968. }
  23969. if (queue.length) {
  23970. drainQueue();
  23971. }
  23972. }
  23973. function drainQueue() {
  23974. if (draining) {
  23975. return;
  23976. }
  23977. var timeout = runTimeout(cleanUpNextTick);
  23978. draining = true;
  23979. var len = queue.length;
  23980. while(len) {
  23981. currentQueue = queue;
  23982. queue = [];
  23983. while (++queueIndex < len) {
  23984. if (currentQueue) {
  23985. currentQueue[queueIndex].run();
  23986. }
  23987. }
  23988. queueIndex = -1;
  23989. len = queue.length;
  23990. }
  23991. currentQueue = null;
  23992. draining = false;
  23993. runClearTimeout(timeout);
  23994. }
  23995. process.nextTick = function (fun) {
  23996. var args = new Array(arguments.length - 1);
  23997. if (arguments.length > 1) {
  23998. for (var i = 1; i < arguments.length; i++) {
  23999. args[i - 1] = arguments[i];
  24000. }
  24001. }
  24002. queue.push(new Item(fun, args));
  24003. if (queue.length === 1 && !draining) {
  24004. runTimeout(drainQueue);
  24005. }
  24006. };
  24007. // v8 likes predictible objects
  24008. function Item(fun, array) {
  24009. this.fun = fun;
  24010. this.array = array;
  24011. }
  24012. Item.prototype.run = function () {
  24013. this.fun.apply(null, this.array);
  24014. };
  24015. process.title = 'browser';
  24016. process.browser = true;
  24017. process.env = {};
  24018. process.argv = [];
  24019. process.version = ''; // empty string to avoid regexp issues
  24020. process.versions = {};
  24021. function noop() {}
  24022. process.on = noop;
  24023. process.addListener = noop;
  24024. process.once = noop;
  24025. process.off = noop;
  24026. process.removeListener = noop;
  24027. process.removeAllListeners = noop;
  24028. process.emit = noop;
  24029. process.prependListener = noop;
  24030. process.prependOnceListener = noop;
  24031. process.listeners = function (name) { return [] }
  24032. process.binding = function (name) {
  24033. throw new Error('process.binding is not supported');
  24034. };
  24035. process.cwd = function () { return '/' };
  24036. process.chdir = function (dir) {
  24037. throw new Error('process.chdir is not supported');
  24038. };
  24039. process.umask = function() { return 0; };
  24040. /***/ }),
  24041. /***/ "./node_modules/safe-buffer/index.js":
  24042. /*!*******************************************!*\
  24043. !*** ./node_modules/safe-buffer/index.js ***!
  24044. \*******************************************/
  24045. /*! unknown exports (runtime-defined) */
  24046. /*! runtime requirements: module, __webpack_exports__, __webpack_require__ */
  24047. /*! CommonJS bailout: module.exports is used directly at 12:2-16 */
  24048. /*! CommonJS bailout: exports is used directly at 15:20-27 */
  24049. /***/ ((module, exports, __webpack_require__) => {
  24050. /* eslint-disable node/no-deprecated-api */
  24051. var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
  24052. var Buffer = buffer.Buffer
  24053. // alternative to using Object.keys for old browsers
  24054. function copyProps (src, dst) {
  24055. for (var key in src) {
  24056. dst[key] = src[key]
  24057. }
  24058. }
  24059. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  24060. module.exports = buffer
  24061. } else {
  24062. // Copy properties from require('buffer')
  24063. copyProps(buffer, exports)
  24064. exports.Buffer = SafeBuffer
  24065. }
  24066. function SafeBuffer (arg, encodingOrOffset, length) {
  24067. return Buffer(arg, encodingOrOffset, length)
  24068. }
  24069. // Copy static methods from Buffer
  24070. copyProps(Buffer, SafeBuffer)
  24071. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  24072. if (typeof arg === 'number') {
  24073. throw new TypeError('Argument must not be a number')
  24074. }
  24075. return Buffer(arg, encodingOrOffset, length)
  24076. }
  24077. SafeBuffer.alloc = function (size, fill, encoding) {
  24078. if (typeof size !== 'number') {
  24079. throw new TypeError('Argument must be a number')
  24080. }
  24081. var buf = Buffer(size)
  24082. if (fill !== undefined) {
  24083. if (typeof encoding === 'string') {
  24084. buf.fill(fill, encoding)
  24085. } else {
  24086. buf.fill(fill)
  24087. }
  24088. } else {
  24089. buf.fill(0)
  24090. }
  24091. return buf
  24092. }
  24093. SafeBuffer.allocUnsafe = function (size) {
  24094. if (typeof size !== 'number') {
  24095. throw new TypeError('Argument must be a number')
  24096. }
  24097. return Buffer(size)
  24098. }
  24099. SafeBuffer.allocUnsafeSlow = function (size) {
  24100. if (typeof size !== 'number') {
  24101. throw new TypeError('Argument must be a number')
  24102. }
  24103. return buffer.SlowBuffer(size)
  24104. }
  24105. /***/ }),
  24106. /***/ "./node_modules/stream-browserify/index.js":
  24107. /*!*************************************************!*\
  24108. !*** ./node_modules/stream-browserify/index.js ***!
  24109. \*************************************************/
  24110. /*! unknown exports (runtime-defined) */
  24111. /*! runtime requirements: module, __webpack_require__ */
  24112. /*! CommonJS bailout: module.exports is used directly at 22:0-14 */
  24113. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  24114. // Copyright Joyent, Inc. and other Node contributors.
  24115. //
  24116. // Permission is hereby granted, free of charge, to any person obtaining a
  24117. // copy of this software and associated documentation files (the
  24118. // "Software"), to deal in the Software without restriction, including
  24119. // without limitation the rights to use, copy, modify, merge, publish,
  24120. // distribute, sublicense, and/or sell copies of the Software, and to permit
  24121. // persons to whom the Software is furnished to do so, subject to the
  24122. // following conditions:
  24123. //
  24124. // The above copyright notice and this permission notice shall be included
  24125. // in all copies or substantial portions of the Software.
  24126. //
  24127. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  24128. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24129. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  24130. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24131. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24132. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24133. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  24134. module.exports = Stream;
  24135. var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
  24136. var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");
  24137. inherits(Stream, EE);
  24138. Stream.Readable = __webpack_require__(/*! readable-stream/lib/_stream_readable.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js");
  24139. Stream.Writable = __webpack_require__(/*! readable-stream/lib/_stream_writable.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js");
  24140. Stream.Duplex = __webpack_require__(/*! readable-stream/lib/_stream_duplex.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
  24141. Stream.Transform = __webpack_require__(/*! readable-stream/lib/_stream_transform.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js");
  24142. Stream.PassThrough = __webpack_require__(/*! readable-stream/lib/_stream_passthrough.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js");
  24143. Stream.finished = __webpack_require__(/*! readable-stream/lib/internal/streams/end-of-stream.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js")
  24144. Stream.pipeline = __webpack_require__(/*! readable-stream/lib/internal/streams/pipeline.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js")
  24145. // Backwards-compat with node 0.4.x
  24146. Stream.Stream = Stream;
  24147. // old-style streams. Note that the pipe method (the only relevant
  24148. // part of this class) is overridden in the Readable class.
  24149. function Stream() {
  24150. EE.call(this);
  24151. }
  24152. Stream.prototype.pipe = function(dest, options) {
  24153. var source = this;
  24154. function ondata(chunk) {
  24155. if (dest.writable) {
  24156. if (false === dest.write(chunk) && source.pause) {
  24157. source.pause();
  24158. }
  24159. }
  24160. }
  24161. source.on('data', ondata);
  24162. function ondrain() {
  24163. if (source.readable && source.resume) {
  24164. source.resume();
  24165. }
  24166. }
  24167. dest.on('drain', ondrain);
  24168. // If the 'end' option is not supplied, dest.end() will be called when
  24169. // source gets the 'end' or 'close' events. Only dest.end() once.
  24170. if (!dest._isStdio && (!options || options.end !== false)) {
  24171. source.on('end', onend);
  24172. source.on('close', onclose);
  24173. }
  24174. var didOnEnd = false;
  24175. function onend() {
  24176. if (didOnEnd) return;
  24177. didOnEnd = true;
  24178. dest.end();
  24179. }
  24180. function onclose() {
  24181. if (didOnEnd) return;
  24182. didOnEnd = true;
  24183. if (typeof dest.destroy === 'function') dest.destroy();
  24184. }
  24185. // don't leave dangling pipes when there are errors.
  24186. function onerror(er) {
  24187. cleanup();
  24188. if (EE.listenerCount(this, 'error') === 0) {
  24189. throw er; // Unhandled stream error in pipe.
  24190. }
  24191. }
  24192. source.on('error', onerror);
  24193. dest.on('error', onerror);
  24194. // remove all the event listeners that were added.
  24195. function cleanup() {
  24196. source.removeListener('data', ondata);
  24197. dest.removeListener('drain', ondrain);
  24198. source.removeListener('end', onend);
  24199. source.removeListener('close', onclose);
  24200. source.removeListener('error', onerror);
  24201. dest.removeListener('error', onerror);
  24202. source.removeListener('end', cleanup);
  24203. source.removeListener('close', cleanup);
  24204. dest.removeListener('close', cleanup);
  24205. }
  24206. source.on('end', cleanup);
  24207. source.on('close', cleanup);
  24208. dest.on('close', cleanup);
  24209. dest.emit('pipe', source);
  24210. // Allow for unix-like usage: A.pipe(B).pipe(C)
  24211. return dest;
  24212. };
  24213. /***/ }),
  24214. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js":
  24215. /*!***************************************************************************************!*\
  24216. !*** ./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js ***!
  24217. \***************************************************************************************/
  24218. /*! default exports */
  24219. /*! export codes [provided] [no usage info] [missing usage info prevents renaming] */
  24220. /*! other exports [not provided] [no usage info] */
  24221. /*! runtime requirements: module */
  24222. /***/ ((module) => {
  24223. "use strict";
  24224. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  24225. var codes = {};
  24226. function createErrorType(code, message, Base) {
  24227. if (!Base) {
  24228. Base = Error;
  24229. }
  24230. function getMessage(arg1, arg2, arg3) {
  24231. if (typeof message === 'string') {
  24232. return message;
  24233. } else {
  24234. return message(arg1, arg2, arg3);
  24235. }
  24236. }
  24237. var NodeError =
  24238. /*#__PURE__*/
  24239. function (_Base) {
  24240. _inheritsLoose(NodeError, _Base);
  24241. function NodeError(arg1, arg2, arg3) {
  24242. return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
  24243. }
  24244. return NodeError;
  24245. }(Base);
  24246. NodeError.prototype.name = Base.name;
  24247. NodeError.prototype.code = code;
  24248. codes[code] = NodeError;
  24249. } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
  24250. function oneOf(expected, thing) {
  24251. if (Array.isArray(expected)) {
  24252. var len = expected.length;
  24253. expected = expected.map(function (i) {
  24254. return String(i);
  24255. });
  24256. if (len > 2) {
  24257. return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
  24258. } else if (len === 2) {
  24259. return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
  24260. } else {
  24261. return "of ".concat(thing, " ").concat(expected[0]);
  24262. }
  24263. } else {
  24264. return "of ".concat(thing, " ").concat(String(expected));
  24265. }
  24266. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
  24267. function startsWith(str, search, pos) {
  24268. return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
  24269. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
  24270. function endsWith(str, search, this_len) {
  24271. if (this_len === undefined || this_len > str.length) {
  24272. this_len = str.length;
  24273. }
  24274. return str.substring(this_len - search.length, this_len) === search;
  24275. } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
  24276. function includes(str, search, start) {
  24277. if (typeof start !== 'number') {
  24278. start = 0;
  24279. }
  24280. if (start + search.length > str.length) {
  24281. return false;
  24282. } else {
  24283. return str.indexOf(search, start) !== -1;
  24284. }
  24285. }
  24286. createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
  24287. return 'The value "' + value + '" is invalid for option "' + name + '"';
  24288. }, TypeError);
  24289. createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
  24290. // determiner: 'must be' or 'must not be'
  24291. var determiner;
  24292. if (typeof expected === 'string' && startsWith(expected, 'not ')) {
  24293. determiner = 'must not be';
  24294. expected = expected.replace(/^not /, '');
  24295. } else {
  24296. determiner = 'must be';
  24297. }
  24298. var msg;
  24299. if (endsWith(name, ' argument')) {
  24300. // For cases like 'first argument'
  24301. msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  24302. } else {
  24303. var type = includes(name, '.') ? 'property' : 'argument';
  24304. msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  24305. }
  24306. msg += ". Received type ".concat(typeof actual);
  24307. return msg;
  24308. }, TypeError);
  24309. createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
  24310. createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
  24311. return 'The ' + name + ' method is not implemented';
  24312. });
  24313. createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
  24314. createErrorType('ERR_STREAM_DESTROYED', function (name) {
  24315. return 'Cannot call ' + name + ' after a stream was destroyed';
  24316. });
  24317. createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
  24318. createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
  24319. createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
  24320. createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
  24321. createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
  24322. return 'Unknown encoding: ' + arg;
  24323. }, TypeError);
  24324. createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
  24325. module.exports.codes = codes;
  24326. /***/ }),
  24327. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js":
  24328. /*!*******************************************************************************************!*\
  24329. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js ***!
  24330. \*******************************************************************************************/
  24331. /*! unknown exports (runtime-defined) */
  24332. /*! runtime requirements: module, __webpack_require__ */
  24333. /*! CommonJS bailout: module.exports is used directly at 40:0-14 */
  24334. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  24335. "use strict";
  24336. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  24337. // Copyright Joyent, Inc. and other Node contributors.
  24338. //
  24339. // Permission is hereby granted, free of charge, to any person obtaining a
  24340. // copy of this software and associated documentation files (the
  24341. // "Software"), to deal in the Software without restriction, including
  24342. // without limitation the rights to use, copy, modify, merge, publish,
  24343. // distribute, sublicense, and/or sell copies of the Software, and to permit
  24344. // persons to whom the Software is furnished to do so, subject to the
  24345. // following conditions:
  24346. //
  24347. // The above copyright notice and this permission notice shall be included
  24348. // in all copies or substantial portions of the Software.
  24349. //
  24350. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  24351. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24352. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  24353. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24354. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24355. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24356. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  24357. // a duplex stream is just a stream that is both readable and writable.
  24358. // Since JS doesn't have multiple prototypal inheritance, this class
  24359. // prototypally inherits from Readable, and then parasitically from
  24360. // Writable.
  24361. /*<replacement>*/
  24362. var objectKeys = Object.keys || function (obj) {
  24363. var keys = [];
  24364. for (var key in obj) {
  24365. keys.push(key);
  24366. }
  24367. return keys;
  24368. };
  24369. /*</replacement>*/
  24370. module.exports = Duplex;
  24371. var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js");
  24372. var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js");
  24373. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable);
  24374. {
  24375. // Allow the keys array to be GC'ed.
  24376. var keys = objectKeys(Writable.prototype);
  24377. for (var v = 0; v < keys.length; v++) {
  24378. var method = keys[v];
  24379. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  24380. }
  24381. }
  24382. function Duplex(options) {
  24383. if (!(this instanceof Duplex)) return new Duplex(options);
  24384. Readable.call(this, options);
  24385. Writable.call(this, options);
  24386. this.allowHalfOpen = true;
  24387. if (options) {
  24388. if (options.readable === false) this.readable = false;
  24389. if (options.writable === false) this.writable = false;
  24390. if (options.allowHalfOpen === false) {
  24391. this.allowHalfOpen = false;
  24392. this.once('end', onend);
  24393. }
  24394. }
  24395. }
  24396. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  24397. // making it explicit this property is not enumerable
  24398. // because otherwise some prototype manipulation in
  24399. // userland will fail
  24400. enumerable: false,
  24401. get: function get() {
  24402. return this._writableState.highWaterMark;
  24403. }
  24404. });
  24405. Object.defineProperty(Duplex.prototype, 'writableBuffer', {
  24406. // making it explicit this property is not enumerable
  24407. // because otherwise some prototype manipulation in
  24408. // userland will fail
  24409. enumerable: false,
  24410. get: function get() {
  24411. return this._writableState && this._writableState.getBuffer();
  24412. }
  24413. });
  24414. Object.defineProperty(Duplex.prototype, 'writableLength', {
  24415. // making it explicit this property is not enumerable
  24416. // because otherwise some prototype manipulation in
  24417. // userland will fail
  24418. enumerable: false,
  24419. get: function get() {
  24420. return this._writableState.length;
  24421. }
  24422. }); // the no-half-open enforcer
  24423. function onend() {
  24424. // If the writable side ended, then we're ok.
  24425. if (this._writableState.ended) return; // no more data can be written.
  24426. // But allow more writes to happen in this tick.
  24427. process.nextTick(onEndNT, this);
  24428. }
  24429. function onEndNT(self) {
  24430. self.end();
  24431. }
  24432. Object.defineProperty(Duplex.prototype, 'destroyed', {
  24433. // making it explicit this property is not enumerable
  24434. // because otherwise some prototype manipulation in
  24435. // userland will fail
  24436. enumerable: false,
  24437. get: function get() {
  24438. if (this._readableState === undefined || this._writableState === undefined) {
  24439. return false;
  24440. }
  24441. return this._readableState.destroyed && this._writableState.destroyed;
  24442. },
  24443. set: function set(value) {
  24444. // we ignore the value if the stream
  24445. // has not been initialized yet
  24446. if (this._readableState === undefined || this._writableState === undefined) {
  24447. return;
  24448. } // backward compatibility, the user is explicitly
  24449. // managing destroyed
  24450. this._readableState.destroyed = value;
  24451. this._writableState.destroyed = value;
  24452. }
  24453. });
  24454. /***/ }),
  24455. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js":
  24456. /*!************************************************************************************************!*\
  24457. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js ***!
  24458. \************************************************************************************************/
  24459. /*! unknown exports (runtime-defined) */
  24460. /*! runtime requirements: module, __webpack_require__ */
  24461. /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
  24462. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  24463. "use strict";
  24464. // Copyright Joyent, Inc. and other Node contributors.
  24465. //
  24466. // Permission is hereby granted, free of charge, to any person obtaining a
  24467. // copy of this software and associated documentation files (the
  24468. // "Software"), to deal in the Software without restriction, including
  24469. // without limitation the rights to use, copy, modify, merge, publish,
  24470. // distribute, sublicense, and/or sell copies of the Software, and to permit
  24471. // persons to whom the Software is furnished to do so, subject to the
  24472. // following conditions:
  24473. //
  24474. // The above copyright notice and this permission notice shall be included
  24475. // in all copies or substantial portions of the Software.
  24476. //
  24477. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  24478. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24479. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  24480. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24481. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24482. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24483. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  24484. // a passthrough stream.
  24485. // basically just the most minimal sort of Transform stream.
  24486. // Every written chunk gets output as-is.
  24487. module.exports = PassThrough;
  24488. var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js");
  24489. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform);
  24490. function PassThrough(options) {
  24491. if (!(this instanceof PassThrough)) return new PassThrough(options);
  24492. Transform.call(this, options);
  24493. }
  24494. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  24495. cb(null, chunk);
  24496. };
  24497. /***/ }),
  24498. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js":
  24499. /*!*********************************************************************************************!*\
  24500. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js ***!
  24501. \*********************************************************************************************/
  24502. /*! unknown exports (runtime-defined) */
  24503. /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
  24504. /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
  24505. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  24506. "use strict";
  24507. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  24508. // Copyright Joyent, Inc. and other Node contributors.
  24509. //
  24510. // Permission is hereby granted, free of charge, to any person obtaining a
  24511. // copy of this software and associated documentation files (the
  24512. // "Software"), to deal in the Software without restriction, including
  24513. // without limitation the rights to use, copy, modify, merge, publish,
  24514. // distribute, sublicense, and/or sell copies of the Software, and to permit
  24515. // persons to whom the Software is furnished to do so, subject to the
  24516. // following conditions:
  24517. //
  24518. // The above copyright notice and this permission notice shall be included
  24519. // in all copies or substantial portions of the Software.
  24520. //
  24521. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  24522. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24523. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  24524. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24525. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24526. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24527. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  24528. module.exports = Readable;
  24529. /*<replacement>*/
  24530. var Duplex;
  24531. /*</replacement>*/
  24532. Readable.ReadableState = ReadableState;
  24533. /*<replacement>*/
  24534. var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
  24535. var EElistenerCount = function EElistenerCount(emitter, type) {
  24536. return emitter.listeners(type).length;
  24537. };
  24538. /*</replacement>*/
  24539. /*<replacement>*/
  24540. var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
  24541. /*</replacement>*/
  24542. var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
  24543. var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
  24544. function _uint8ArrayToBuffer(chunk) {
  24545. return Buffer.from(chunk);
  24546. }
  24547. function _isUint8Array(obj) {
  24548. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  24549. }
  24550. /*<replacement>*/
  24551. var debugUtil = __webpack_require__(/*! util */ "?0bed");
  24552. var debug;
  24553. if (debugUtil && debugUtil.debuglog) {
  24554. debug = debugUtil.debuglog('stream');
  24555. } else {
  24556. debug = function debug() {};
  24557. }
  24558. /*</replacement>*/
  24559. var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js");
  24560. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js");
  24561. var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"),
  24562. getHighWaterMark = _require.getHighWaterMark;
  24563. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
  24564. ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  24565. ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
  24566. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  24567. ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.
  24568. var StringDecoder;
  24569. var createReadableStreamAsyncIterator;
  24570. var from;
  24571. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream);
  24572. var errorOrDestroy = destroyImpl.errorOrDestroy;
  24573. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  24574. function prependListener(emitter, event, fn) {
  24575. // Sadly this is not cacheable as some libraries bundle their own
  24576. // event emitter implementation with them.
  24577. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any
  24578. // userland ones. NEVER DO THIS. This is here only because this code needs
  24579. // to continue to work with older versions of Node.js that do not include
  24580. // the prependListener() method. The goal is to eventually remove this hack.
  24581. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  24582. }
  24583. function ReadableState(options, stream, isDuplex) {
  24584. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
  24585. options = options || {}; // Duplex streams are both readable and writable, but share
  24586. // the same options object.
  24587. // However, some cases require setting options to different
  24588. // values for the readable and the writable sides of the duplex stream.
  24589. // These options can be provided separately as readableXXX and writableXXX.
  24590. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to
  24591. // make all the buffer merging and length checks go away
  24592. this.objectMode = !!options.objectMode;
  24593. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
  24594. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  24595. this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the
  24596. // linked list can remove elements from the beginning faster than
  24597. // array.shift()
  24598. this.buffer = new BufferList();
  24599. this.length = 0;
  24600. this.pipes = null;
  24601. this.pipesCount = 0;
  24602. this.flowing = null;
  24603. this.ended = false;
  24604. this.endEmitted = false;
  24605. this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted
  24606. // immediately, or on a later tick. We set this to true at first, because
  24607. // any actions that shouldn't happen until "later" should generally also
  24608. // not happen before the first read call.
  24609. this.sync = true; // whenever we return null, then we set a flag to say
  24610. // that we're awaiting a 'readable' event emission.
  24611. this.needReadable = false;
  24612. this.emittedReadable = false;
  24613. this.readableListening = false;
  24614. this.resumeScheduled = false;
  24615. this.paused = true; // Should close be emitted on destroy. Defaults to true.
  24616. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')
  24617. this.autoDestroy = !!options.autoDestroy; // has it been destroyed
  24618. this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string
  24619. // encoding is 'binary' so we have to make this configurable.
  24620. // Everything else in the universe uses 'utf8', though.
  24621. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s
  24622. this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
  24623. this.readingMore = false;
  24624. this.decoder = null;
  24625. this.encoding = null;
  24626. if (options.encoding) {
  24627. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
  24628. this.decoder = new StringDecoder(options.encoding);
  24629. this.encoding = options.encoding;
  24630. }
  24631. }
  24632. function Readable(options) {
  24633. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
  24634. if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
  24635. // the ReadableState constructor, at least with V8 6.5
  24636. var isDuplex = this instanceof Duplex;
  24637. this._readableState = new ReadableState(options, this, isDuplex); // legacy
  24638. this.readable = true;
  24639. if (options) {
  24640. if (typeof options.read === 'function') this._read = options.read;
  24641. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  24642. }
  24643. Stream.call(this);
  24644. }
  24645. Object.defineProperty(Readable.prototype, 'destroyed', {
  24646. // making it explicit this property is not enumerable
  24647. // because otherwise some prototype manipulation in
  24648. // userland will fail
  24649. enumerable: false,
  24650. get: function get() {
  24651. if (this._readableState === undefined) {
  24652. return false;
  24653. }
  24654. return this._readableState.destroyed;
  24655. },
  24656. set: function set(value) {
  24657. // we ignore the value if the stream
  24658. // has not been initialized yet
  24659. if (!this._readableState) {
  24660. return;
  24661. } // backward compatibility, the user is explicitly
  24662. // managing destroyed
  24663. this._readableState.destroyed = value;
  24664. }
  24665. });
  24666. Readable.prototype.destroy = destroyImpl.destroy;
  24667. Readable.prototype._undestroy = destroyImpl.undestroy;
  24668. Readable.prototype._destroy = function (err, cb) {
  24669. cb(err);
  24670. }; // Manually shove something into the read() buffer.
  24671. // This returns true if the highWaterMark has not been hit yet,
  24672. // similar to how Writable.write() returns true if you should
  24673. // write() some more.
  24674. Readable.prototype.push = function (chunk, encoding) {
  24675. var state = this._readableState;
  24676. var skipChunkCheck;
  24677. if (!state.objectMode) {
  24678. if (typeof chunk === 'string') {
  24679. encoding = encoding || state.defaultEncoding;
  24680. if (encoding !== state.encoding) {
  24681. chunk = Buffer.from(chunk, encoding);
  24682. encoding = '';
  24683. }
  24684. skipChunkCheck = true;
  24685. }
  24686. } else {
  24687. skipChunkCheck = true;
  24688. }
  24689. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  24690. }; // Unshift should *always* be something directly out of read()
  24691. Readable.prototype.unshift = function (chunk) {
  24692. return readableAddChunk(this, chunk, null, true, false);
  24693. };
  24694. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  24695. debug('readableAddChunk', chunk);
  24696. var state = stream._readableState;
  24697. if (chunk === null) {
  24698. state.reading = false;
  24699. onEofChunk(stream, state);
  24700. } else {
  24701. var er;
  24702. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  24703. if (er) {
  24704. errorOrDestroy(stream, er);
  24705. } else if (state.objectMode || chunk && chunk.length > 0) {
  24706. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  24707. chunk = _uint8ArrayToBuffer(chunk);
  24708. }
  24709. if (addToFront) {
  24710. if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
  24711. } else if (state.ended) {
  24712. errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
  24713. } else if (state.destroyed) {
  24714. return false;
  24715. } else {
  24716. state.reading = false;
  24717. if (state.decoder && !encoding) {
  24718. chunk = state.decoder.write(chunk);
  24719. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  24720. } else {
  24721. addChunk(stream, state, chunk, false);
  24722. }
  24723. }
  24724. } else if (!addToFront) {
  24725. state.reading = false;
  24726. maybeReadMore(stream, state);
  24727. }
  24728. } // We can push more data if we are below the highWaterMark.
  24729. // Also, if we have no data yet, we can stand some more bytes.
  24730. // This is to work around cases where hwm=0, such as the repl.
  24731. return !state.ended && (state.length < state.highWaterMark || state.length === 0);
  24732. }
  24733. function addChunk(stream, state, chunk, addToFront) {
  24734. if (state.flowing && state.length === 0 && !state.sync) {
  24735. state.awaitDrain = 0;
  24736. stream.emit('data', chunk);
  24737. } else {
  24738. // update the buffer info.
  24739. state.length += state.objectMode ? 1 : chunk.length;
  24740. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  24741. if (state.needReadable) emitReadable(stream);
  24742. }
  24743. maybeReadMore(stream, state);
  24744. }
  24745. function chunkInvalid(state, chunk) {
  24746. var er;
  24747. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  24748. er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
  24749. }
  24750. return er;
  24751. }
  24752. Readable.prototype.isPaused = function () {
  24753. return this._readableState.flowing === false;
  24754. }; // backwards compatibility.
  24755. Readable.prototype.setEncoding = function (enc) {
  24756. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
  24757. var decoder = new StringDecoder(enc);
  24758. this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
  24759. this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:
  24760. var p = this._readableState.buffer.head;
  24761. var content = '';
  24762. while (p !== null) {
  24763. content += decoder.write(p.data);
  24764. p = p.next;
  24765. }
  24766. this._readableState.buffer.clear();
  24767. if (content !== '') this._readableState.buffer.push(content);
  24768. this._readableState.length = content.length;
  24769. return this;
  24770. }; // Don't raise the hwm > 1GB
  24771. var MAX_HWM = 0x40000000;
  24772. function computeNewHighWaterMark(n) {
  24773. if (n >= MAX_HWM) {
  24774. // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
  24775. n = MAX_HWM;
  24776. } else {
  24777. // Get the next highest power of 2 to prevent increasing hwm excessively in
  24778. // tiny amounts
  24779. n--;
  24780. n |= n >>> 1;
  24781. n |= n >>> 2;
  24782. n |= n >>> 4;
  24783. n |= n >>> 8;
  24784. n |= n >>> 16;
  24785. n++;
  24786. }
  24787. return n;
  24788. } // This function is designed to be inlinable, so please take care when making
  24789. // changes to the function body.
  24790. function howMuchToRead(n, state) {
  24791. if (n <= 0 || state.length === 0 && state.ended) return 0;
  24792. if (state.objectMode) return 1;
  24793. if (n !== n) {
  24794. // Only flow one buffer at a time
  24795. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  24796. } // If we're asking for more than the current hwm, then raise the hwm.
  24797. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  24798. if (n <= state.length) return n; // Don't have enough
  24799. if (!state.ended) {
  24800. state.needReadable = true;
  24801. return 0;
  24802. }
  24803. return state.length;
  24804. } // you can override either this method, or the async _read(n) below.
  24805. Readable.prototype.read = function (n) {
  24806. debug('read', n);
  24807. n = parseInt(n, 10);
  24808. var state = this._readableState;
  24809. var nOrig = n;
  24810. if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
  24811. // already have a bunch of data in the buffer, then just trigger
  24812. // the 'readable' event and move on.
  24813. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
  24814. debug('read: emitReadable', state.length, state.ended);
  24815. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  24816. return null;
  24817. }
  24818. n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
  24819. if (n === 0 && state.ended) {
  24820. if (state.length === 0) endReadable(this);
  24821. return null;
  24822. } // All the actual chunk generation logic needs to be
  24823. // *below* the call to _read. The reason is that in certain
  24824. // synthetic stream cases, such as passthrough streams, _read
  24825. // may be a completely synchronous operation which may change
  24826. // the state of the read buffer, providing enough data when
  24827. // before there was *not* enough.
  24828. //
  24829. // So, the steps are:
  24830. // 1. Figure out what the state of things will be after we do
  24831. // a read from the buffer.
  24832. //
  24833. // 2. If that resulting state will trigger a _read, then call _read.
  24834. // Note that this may be asynchronous, or synchronous. Yes, it is
  24835. // deeply ugly to write APIs this way, but that still doesn't mean
  24836. // that the Readable class should behave improperly, as streams are
  24837. // designed to be sync/async agnostic.
  24838. // Take note if the _read call is sync or async (ie, if the read call
  24839. // has returned yet), so that we know whether or not it's safe to emit
  24840. // 'readable' etc.
  24841. //
  24842. // 3. Actually pull the requested chunks out of the buffer and return.
  24843. // if we need a readable event, then we need to do some reading.
  24844. var doRead = state.needReadable;
  24845. debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
  24846. if (state.length === 0 || state.length - n < state.highWaterMark) {
  24847. doRead = true;
  24848. debug('length less than watermark', doRead);
  24849. } // however, if we've ended, then there's no point, and if we're already
  24850. // reading, then it's unnecessary.
  24851. if (state.ended || state.reading) {
  24852. doRead = false;
  24853. debug('reading or ended', doRead);
  24854. } else if (doRead) {
  24855. debug('do read');
  24856. state.reading = true;
  24857. state.sync = true; // if the length is currently zero, then we *need* a readable event.
  24858. if (state.length === 0) state.needReadable = true; // call internal read method
  24859. this._read(state.highWaterMark);
  24860. state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
  24861. // and we need to re-evaluate how much data we can return to the user.
  24862. if (!state.reading) n = howMuchToRead(nOrig, state);
  24863. }
  24864. var ret;
  24865. if (n > 0) ret = fromList(n, state);else ret = null;
  24866. if (ret === null) {
  24867. state.needReadable = state.length <= state.highWaterMark;
  24868. n = 0;
  24869. } else {
  24870. state.length -= n;
  24871. state.awaitDrain = 0;
  24872. }
  24873. if (state.length === 0) {
  24874. // If we have nothing in the buffer, then we want to know
  24875. // as soon as we *do* get something into the buffer.
  24876. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
  24877. if (nOrig !== n && state.ended) endReadable(this);
  24878. }
  24879. if (ret !== null) this.emit('data', ret);
  24880. return ret;
  24881. };
  24882. function onEofChunk(stream, state) {
  24883. debug('onEofChunk');
  24884. if (state.ended) return;
  24885. if (state.decoder) {
  24886. var chunk = state.decoder.end();
  24887. if (chunk && chunk.length) {
  24888. state.buffer.push(chunk);
  24889. state.length += state.objectMode ? 1 : chunk.length;
  24890. }
  24891. }
  24892. state.ended = true;
  24893. if (state.sync) {
  24894. // if we are sync, wait until next tick to emit the data.
  24895. // Otherwise we risk emitting data in the flow()
  24896. // the readable code triggers during a read() call
  24897. emitReadable(stream);
  24898. } else {
  24899. // emit 'readable' now to make sure it gets picked up.
  24900. state.needReadable = false;
  24901. if (!state.emittedReadable) {
  24902. state.emittedReadable = true;
  24903. emitReadable_(stream);
  24904. }
  24905. }
  24906. } // Don't emit readable right away in sync mode, because this can trigger
  24907. // another read() call => stack overflow. This way, it might trigger
  24908. // a nextTick recursion warning, but that's not so bad.
  24909. function emitReadable(stream) {
  24910. var state = stream._readableState;
  24911. debug('emitReadable', state.needReadable, state.emittedReadable);
  24912. state.needReadable = false;
  24913. if (!state.emittedReadable) {
  24914. debug('emitReadable', state.flowing);
  24915. state.emittedReadable = true;
  24916. process.nextTick(emitReadable_, stream);
  24917. }
  24918. }
  24919. function emitReadable_(stream) {
  24920. var state = stream._readableState;
  24921. debug('emitReadable_', state.destroyed, state.length, state.ended);
  24922. if (!state.destroyed && (state.length || state.ended)) {
  24923. stream.emit('readable');
  24924. state.emittedReadable = false;
  24925. } // The stream needs another readable event if
  24926. // 1. It is not flowing, as the flow mechanism will take
  24927. // care of it.
  24928. // 2. It is not ended.
  24929. // 3. It is below the highWaterMark, so we can schedule
  24930. // another readable later.
  24931. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
  24932. flow(stream);
  24933. } // at this point, the user has presumably seen the 'readable' event,
  24934. // and called read() to consume some data. that may have triggered
  24935. // in turn another _read(n) call, in which case reading = true if
  24936. // it's in progress.
  24937. // However, if we're not ended, or reading, and the length < hwm,
  24938. // then go ahead and try to read some more preemptively.
  24939. function maybeReadMore(stream, state) {
  24940. if (!state.readingMore) {
  24941. state.readingMore = true;
  24942. process.nextTick(maybeReadMore_, stream, state);
  24943. }
  24944. }
  24945. function maybeReadMore_(stream, state) {
  24946. // Attempt to read more data if we should.
  24947. //
  24948. // The conditions for reading more data are (one of):
  24949. // - Not enough data buffered (state.length < state.highWaterMark). The loop
  24950. // is responsible for filling the buffer with enough data if such data
  24951. // is available. If highWaterMark is 0 and we are not in the flowing mode
  24952. // we should _not_ attempt to buffer any extra data. We'll get more data
  24953. // when the stream consumer calls read() instead.
  24954. // - No data in the buffer, and the stream is in flowing mode. In this mode
  24955. // the loop below is responsible for ensuring read() is called. Failing to
  24956. // call read here would abort the flow and there's no other mechanism for
  24957. // continuing the flow if the stream consumer has just subscribed to the
  24958. // 'data' event.
  24959. //
  24960. // In addition to the above conditions to keep reading data, the following
  24961. // conditions prevent the data from being read:
  24962. // - The stream has ended (state.ended).
  24963. // - There is already a pending 'read' operation (state.reading). This is a
  24964. // case where the the stream has called the implementation defined _read()
  24965. // method, but they are processing the call asynchronously and have _not_
  24966. // called push() with new data. In this case we skip performing more
  24967. // read()s. The execution ends in this method again after the _read() ends
  24968. // up calling push() with more data.
  24969. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
  24970. var len = state.length;
  24971. debug('maybeReadMore read 0');
  24972. stream.read(0);
  24973. if (len === state.length) // didn't get any data, stop spinning.
  24974. break;
  24975. }
  24976. state.readingMore = false;
  24977. } // abstract method. to be overridden in specific implementation classes.
  24978. // call cb(er, data) where data is <= n in length.
  24979. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  24980. // arbitrary, and perhaps not very meaningful.
  24981. Readable.prototype._read = function (n) {
  24982. errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
  24983. };
  24984. Readable.prototype.pipe = function (dest, pipeOpts) {
  24985. var src = this;
  24986. var state = this._readableState;
  24987. switch (state.pipesCount) {
  24988. case 0:
  24989. state.pipes = dest;
  24990. break;
  24991. case 1:
  24992. state.pipes = [state.pipes, dest];
  24993. break;
  24994. default:
  24995. state.pipes.push(dest);
  24996. break;
  24997. }
  24998. state.pipesCount += 1;
  24999. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  25000. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  25001. var endFn = doEnd ? onend : unpipe;
  25002. if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
  25003. dest.on('unpipe', onunpipe);
  25004. function onunpipe(readable, unpipeInfo) {
  25005. debug('onunpipe');
  25006. if (readable === src) {
  25007. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  25008. unpipeInfo.hasUnpiped = true;
  25009. cleanup();
  25010. }
  25011. }
  25012. }
  25013. function onend() {
  25014. debug('onend');
  25015. dest.end();
  25016. } // when the dest drains, it reduces the awaitDrain counter
  25017. // on the source. This would be more elegant with a .once()
  25018. // handler in flow(), but adding and removing repeatedly is
  25019. // too slow.
  25020. var ondrain = pipeOnDrain(src);
  25021. dest.on('drain', ondrain);
  25022. var cleanedUp = false;
  25023. function cleanup() {
  25024. debug('cleanup'); // cleanup event handlers once the pipe is broken
  25025. dest.removeListener('close', onclose);
  25026. dest.removeListener('finish', onfinish);
  25027. dest.removeListener('drain', ondrain);
  25028. dest.removeListener('error', onerror);
  25029. dest.removeListener('unpipe', onunpipe);
  25030. src.removeListener('end', onend);
  25031. src.removeListener('end', unpipe);
  25032. src.removeListener('data', ondata);
  25033. cleanedUp = true; // if the reader is waiting for a drain event from this
  25034. // specific writer, then it would cause it to never start
  25035. // flowing again.
  25036. // So, if this is awaiting a drain, then we just call it now.
  25037. // If we don't know, then assume that we are waiting for one.
  25038. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  25039. }
  25040. src.on('data', ondata);
  25041. function ondata(chunk) {
  25042. debug('ondata');
  25043. var ret = dest.write(chunk);
  25044. debug('dest.write', ret);
  25045. if (ret === false) {
  25046. // If the user unpiped during `dest.write()`, it is possible
  25047. // to get stuck in a permanently paused state if that write
  25048. // also returned false.
  25049. // => Check whether `dest` is still a piping destination.
  25050. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  25051. debug('false write response, pause', state.awaitDrain);
  25052. state.awaitDrain++;
  25053. }
  25054. src.pause();
  25055. }
  25056. } // if the dest has an error, then stop piping into it.
  25057. // however, don't suppress the throwing behavior for this.
  25058. function onerror(er) {
  25059. debug('onerror', er);
  25060. unpipe();
  25061. dest.removeListener('error', onerror);
  25062. if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
  25063. } // Make sure our error handler is attached before userland ones.
  25064. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
  25065. function onclose() {
  25066. dest.removeListener('finish', onfinish);
  25067. unpipe();
  25068. }
  25069. dest.once('close', onclose);
  25070. function onfinish() {
  25071. debug('onfinish');
  25072. dest.removeListener('close', onclose);
  25073. unpipe();
  25074. }
  25075. dest.once('finish', onfinish);
  25076. function unpipe() {
  25077. debug('unpipe');
  25078. src.unpipe(dest);
  25079. } // tell the dest that it's being piped to
  25080. dest.emit('pipe', src); // start the flow if it hasn't been started already.
  25081. if (!state.flowing) {
  25082. debug('pipe resume');
  25083. src.resume();
  25084. }
  25085. return dest;
  25086. };
  25087. function pipeOnDrain(src) {
  25088. return function pipeOnDrainFunctionResult() {
  25089. var state = src._readableState;
  25090. debug('pipeOnDrain', state.awaitDrain);
  25091. if (state.awaitDrain) state.awaitDrain--;
  25092. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  25093. state.flowing = true;
  25094. flow(src);
  25095. }
  25096. };
  25097. }
  25098. Readable.prototype.unpipe = function (dest) {
  25099. var state = this._readableState;
  25100. var unpipeInfo = {
  25101. hasUnpiped: false
  25102. }; // if we're not piping anywhere, then do nothing.
  25103. if (state.pipesCount === 0) return this; // just one destination. most common case.
  25104. if (state.pipesCount === 1) {
  25105. // passed in one, but it's not the right one.
  25106. if (dest && dest !== state.pipes) return this;
  25107. if (!dest) dest = state.pipes; // got a match.
  25108. state.pipes = null;
  25109. state.pipesCount = 0;
  25110. state.flowing = false;
  25111. if (dest) dest.emit('unpipe', this, unpipeInfo);
  25112. return this;
  25113. } // slow case. multiple pipe destinations.
  25114. if (!dest) {
  25115. // remove all.
  25116. var dests = state.pipes;
  25117. var len = state.pipesCount;
  25118. state.pipes = null;
  25119. state.pipesCount = 0;
  25120. state.flowing = false;
  25121. for (var i = 0; i < len; i++) {
  25122. dests[i].emit('unpipe', this, {
  25123. hasUnpiped: false
  25124. });
  25125. }
  25126. return this;
  25127. } // try to find the right one.
  25128. var index = indexOf(state.pipes, dest);
  25129. if (index === -1) return this;
  25130. state.pipes.splice(index, 1);
  25131. state.pipesCount -= 1;
  25132. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  25133. dest.emit('unpipe', this, unpipeInfo);
  25134. return this;
  25135. }; // set up data events if they are asked for
  25136. // Ensure readable listeners eventually get something
  25137. Readable.prototype.on = function (ev, fn) {
  25138. var res = Stream.prototype.on.call(this, ev, fn);
  25139. var state = this._readableState;
  25140. if (ev === 'data') {
  25141. // update readableListening so that resume() may be a no-op
  25142. // a few lines down. This is needed to support once('readable').
  25143. state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused
  25144. if (state.flowing !== false) this.resume();
  25145. } else if (ev === 'readable') {
  25146. if (!state.endEmitted && !state.readableListening) {
  25147. state.readableListening = state.needReadable = true;
  25148. state.flowing = false;
  25149. state.emittedReadable = false;
  25150. debug('on readable', state.length, state.reading);
  25151. if (state.length) {
  25152. emitReadable(this);
  25153. } else if (!state.reading) {
  25154. process.nextTick(nReadingNextTick, this);
  25155. }
  25156. }
  25157. }
  25158. return res;
  25159. };
  25160. Readable.prototype.addListener = Readable.prototype.on;
  25161. Readable.prototype.removeListener = function (ev, fn) {
  25162. var res = Stream.prototype.removeListener.call(this, ev, fn);
  25163. if (ev === 'readable') {
  25164. // We need to check if there is someone still listening to
  25165. // readable and reset the state. However this needs to happen
  25166. // after readable has been emitted but before I/O (nextTick) to
  25167. // support once('readable', fn) cycles. This means that calling
  25168. // resume within the same tick will have no
  25169. // effect.
  25170. process.nextTick(updateReadableListening, this);
  25171. }
  25172. return res;
  25173. };
  25174. Readable.prototype.removeAllListeners = function (ev) {
  25175. var res = Stream.prototype.removeAllListeners.apply(this, arguments);
  25176. if (ev === 'readable' || ev === undefined) {
  25177. // We need to check if there is someone still listening to
  25178. // readable and reset the state. However this needs to happen
  25179. // after readable has been emitted but before I/O (nextTick) to
  25180. // support once('readable', fn) cycles. This means that calling
  25181. // resume within the same tick will have no
  25182. // effect.
  25183. process.nextTick(updateReadableListening, this);
  25184. }
  25185. return res;
  25186. };
  25187. function updateReadableListening(self) {
  25188. var state = self._readableState;
  25189. state.readableListening = self.listenerCount('readable') > 0;
  25190. if (state.resumeScheduled && !state.paused) {
  25191. // flowing needs to be set to true now, otherwise
  25192. // the upcoming resume will not flow.
  25193. state.flowing = true; // crude way to check if we should resume
  25194. } else if (self.listenerCount('data') > 0) {
  25195. self.resume();
  25196. }
  25197. }
  25198. function nReadingNextTick(self) {
  25199. debug('readable nexttick read 0');
  25200. self.read(0);
  25201. } // pause() and resume() are remnants of the legacy readable stream API
  25202. // If the user uses them, then switch into old mode.
  25203. Readable.prototype.resume = function () {
  25204. var state = this._readableState;
  25205. if (!state.flowing) {
  25206. debug('resume'); // we flow only if there is no one listening
  25207. // for readable, but we still have to call
  25208. // resume()
  25209. state.flowing = !state.readableListening;
  25210. resume(this, state);
  25211. }
  25212. state.paused = false;
  25213. return this;
  25214. };
  25215. function resume(stream, state) {
  25216. if (!state.resumeScheduled) {
  25217. state.resumeScheduled = true;
  25218. process.nextTick(resume_, stream, state);
  25219. }
  25220. }
  25221. function resume_(stream, state) {
  25222. debug('resume', state.reading);
  25223. if (!state.reading) {
  25224. stream.read(0);
  25225. }
  25226. state.resumeScheduled = false;
  25227. stream.emit('resume');
  25228. flow(stream);
  25229. if (state.flowing && !state.reading) stream.read(0);
  25230. }
  25231. Readable.prototype.pause = function () {
  25232. debug('call pause flowing=%j', this._readableState.flowing);
  25233. if (this._readableState.flowing !== false) {
  25234. debug('pause');
  25235. this._readableState.flowing = false;
  25236. this.emit('pause');
  25237. }
  25238. this._readableState.paused = true;
  25239. return this;
  25240. };
  25241. function flow(stream) {
  25242. var state = stream._readableState;
  25243. debug('flow', state.flowing);
  25244. while (state.flowing && stream.read() !== null) {
  25245. ;
  25246. }
  25247. } // wrap an old-style stream as the async data source.
  25248. // This is *not* part of the readable stream interface.
  25249. // It is an ugly unfortunate mess of history.
  25250. Readable.prototype.wrap = function (stream) {
  25251. var _this = this;
  25252. var state = this._readableState;
  25253. var paused = false;
  25254. stream.on('end', function () {
  25255. debug('wrapped end');
  25256. if (state.decoder && !state.ended) {
  25257. var chunk = state.decoder.end();
  25258. if (chunk && chunk.length) _this.push(chunk);
  25259. }
  25260. _this.push(null);
  25261. });
  25262. stream.on('data', function (chunk) {
  25263. debug('wrapped data');
  25264. if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
  25265. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  25266. var ret = _this.push(chunk);
  25267. if (!ret) {
  25268. paused = true;
  25269. stream.pause();
  25270. }
  25271. }); // proxy all the other methods.
  25272. // important when wrapping filters and duplexes.
  25273. for (var i in stream) {
  25274. if (this[i] === undefined && typeof stream[i] === 'function') {
  25275. this[i] = function methodWrap(method) {
  25276. return function methodWrapReturnFunction() {
  25277. return stream[method].apply(stream, arguments);
  25278. };
  25279. }(i);
  25280. }
  25281. } // proxy certain important events.
  25282. for (var n = 0; n < kProxyEvents.length; n++) {
  25283. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  25284. } // when we try to consume some more bytes, simply unpause the
  25285. // underlying stream.
  25286. this._read = function (n) {
  25287. debug('wrapped _read', n);
  25288. if (paused) {
  25289. paused = false;
  25290. stream.resume();
  25291. }
  25292. };
  25293. return this;
  25294. };
  25295. if (typeof Symbol === 'function') {
  25296. Readable.prototype[Symbol.asyncIterator] = function () {
  25297. if (createReadableStreamAsyncIterator === undefined) {
  25298. createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js");
  25299. }
  25300. return createReadableStreamAsyncIterator(this);
  25301. };
  25302. }
  25303. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  25304. // making it explicit this property is not enumerable
  25305. // because otherwise some prototype manipulation in
  25306. // userland will fail
  25307. enumerable: false,
  25308. get: function get() {
  25309. return this._readableState.highWaterMark;
  25310. }
  25311. });
  25312. Object.defineProperty(Readable.prototype, 'readableBuffer', {
  25313. // making it explicit this property is not enumerable
  25314. // because otherwise some prototype manipulation in
  25315. // userland will fail
  25316. enumerable: false,
  25317. get: function get() {
  25318. return this._readableState && this._readableState.buffer;
  25319. }
  25320. });
  25321. Object.defineProperty(Readable.prototype, 'readableFlowing', {
  25322. // making it explicit this property is not enumerable
  25323. // because otherwise some prototype manipulation in
  25324. // userland will fail
  25325. enumerable: false,
  25326. get: function get() {
  25327. return this._readableState.flowing;
  25328. },
  25329. set: function set(state) {
  25330. if (this._readableState) {
  25331. this._readableState.flowing = state;
  25332. }
  25333. }
  25334. }); // exposed for testing purposes only.
  25335. Readable._fromList = fromList;
  25336. Object.defineProperty(Readable.prototype, 'readableLength', {
  25337. // making it explicit this property is not enumerable
  25338. // because otherwise some prototype manipulation in
  25339. // userland will fail
  25340. enumerable: false,
  25341. get: function get() {
  25342. return this._readableState.length;
  25343. }
  25344. }); // Pluck off n bytes from an array of buffers.
  25345. // Length is the combined lengths of all the buffers in the list.
  25346. // This function is designed to be inlinable, so please take care when making
  25347. // changes to the function body.
  25348. function fromList(n, state) {
  25349. // nothing buffered
  25350. if (state.length === 0) return null;
  25351. var ret;
  25352. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  25353. // read it all, truncate the list
  25354. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
  25355. state.buffer.clear();
  25356. } else {
  25357. // read part of list
  25358. ret = state.buffer.consume(n, state.decoder);
  25359. }
  25360. return ret;
  25361. }
  25362. function endReadable(stream) {
  25363. var state = stream._readableState;
  25364. debug('endReadable', state.endEmitted);
  25365. if (!state.endEmitted) {
  25366. state.ended = true;
  25367. process.nextTick(endReadableNT, state, stream);
  25368. }
  25369. }
  25370. function endReadableNT(state, stream) {
  25371. debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.
  25372. if (!state.endEmitted && state.length === 0) {
  25373. state.endEmitted = true;
  25374. stream.readable = false;
  25375. stream.emit('end');
  25376. if (state.autoDestroy) {
  25377. // In case of duplex streams we need a way to detect
  25378. // if the writable side is ready for autoDestroy as well
  25379. var wState = stream._writableState;
  25380. if (!wState || wState.autoDestroy && wState.finished) {
  25381. stream.destroy();
  25382. }
  25383. }
  25384. }
  25385. }
  25386. if (typeof Symbol === 'function') {
  25387. Readable.from = function (iterable, opts) {
  25388. if (from === undefined) {
  25389. from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js");
  25390. }
  25391. return from(Readable, iterable, opts);
  25392. };
  25393. }
  25394. function indexOf(xs, x) {
  25395. for (var i = 0, l = xs.length; i < l; i++) {
  25396. if (xs[i] === x) return i;
  25397. }
  25398. return -1;
  25399. }
  25400. /***/ }),
  25401. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js":
  25402. /*!**********************************************************************************************!*\
  25403. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js ***!
  25404. \**********************************************************************************************/
  25405. /*! unknown exports (runtime-defined) */
  25406. /*! runtime requirements: module, __webpack_require__ */
  25407. /*! CommonJS bailout: module.exports is used directly at 64:0-14 */
  25408. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  25409. "use strict";
  25410. // Copyright Joyent, Inc. and other Node contributors.
  25411. //
  25412. // Permission is hereby granted, free of charge, to any person obtaining a
  25413. // copy of this software and associated documentation files (the
  25414. // "Software"), to deal in the Software without restriction, including
  25415. // without limitation the rights to use, copy, modify, merge, publish,
  25416. // distribute, sublicense, and/or sell copies of the Software, and to permit
  25417. // persons to whom the Software is furnished to do so, subject to the
  25418. // following conditions:
  25419. //
  25420. // The above copyright notice and this permission notice shall be included
  25421. // in all copies or substantial portions of the Software.
  25422. //
  25423. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  25424. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25425. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  25426. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  25427. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  25428. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  25429. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  25430. // a transform stream is a readable/writable stream where you do
  25431. // something with the data. Sometimes it's called a "filter",
  25432. // but that's not a great name for it, since that implies a thing where
  25433. // some bits pass through, and others are simply ignored. (That would
  25434. // be a valid example of a transform, of course.)
  25435. //
  25436. // While the output is causally related to the input, it's not a
  25437. // necessarily symmetric or synchronous transformation. For example,
  25438. // a zlib stream might take multiple plain-text writes(), and then
  25439. // emit a single compressed chunk some time in the future.
  25440. //
  25441. // Here's how this works:
  25442. //
  25443. // The Transform stream has all the aspects of the readable and writable
  25444. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  25445. // internally, and returns false if there's a lot of pending writes
  25446. // buffered up. When you call read(), that calls _read(n) until
  25447. // there's enough pending readable data buffered up.
  25448. //
  25449. // In a transform stream, the written data is placed in a buffer. When
  25450. // _read(n) is called, it transforms the queued up data, calling the
  25451. // buffered _write cb's as it consumes chunks. If consuming a single
  25452. // written chunk would result in multiple output chunks, then the first
  25453. // outputted bit calls the readcb, and subsequent chunks just go into
  25454. // the read buffer, and will cause it to emit 'readable' if necessary.
  25455. //
  25456. // This way, back-pressure is actually determined by the reading side,
  25457. // since _read has to be called to start processing a new chunk. However,
  25458. // a pathological inflate type of transform can cause excessive buffering
  25459. // here. For example, imagine a stream where every byte of input is
  25460. // interpreted as an integer from 0-255, and then results in that many
  25461. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  25462. // 1kb of data being output. In this case, you could write a very small
  25463. // amount of input, and end up with a very large amount of output. In
  25464. // such a pathological inflating mechanism, there'd be no way to tell
  25465. // the system to stop doing the transform. A single 4MB write could
  25466. // cause the system to run out of memory.
  25467. //
  25468. // However, even in such a pathological case, only a single written chunk
  25469. // would be consumed, and then the rest would wait (un-transformed) until
  25470. // the results of the previous transformed chunk were consumed.
  25471. module.exports = Transform;
  25472. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
  25473. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  25474. ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  25475. ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
  25476. ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
  25477. var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
  25478. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex);
  25479. function afterTransform(er, data) {
  25480. var ts = this._transformState;
  25481. ts.transforming = false;
  25482. var cb = ts.writecb;
  25483. if (cb === null) {
  25484. return this.emit('error', new ERR_MULTIPLE_CALLBACK());
  25485. }
  25486. ts.writechunk = null;
  25487. ts.writecb = null;
  25488. if (data != null) // single equals check for both `null` and `undefined`
  25489. this.push(data);
  25490. cb(er);
  25491. var rs = this._readableState;
  25492. rs.reading = false;
  25493. if (rs.needReadable || rs.length < rs.highWaterMark) {
  25494. this._read(rs.highWaterMark);
  25495. }
  25496. }
  25497. function Transform(options) {
  25498. if (!(this instanceof Transform)) return new Transform(options);
  25499. Duplex.call(this, options);
  25500. this._transformState = {
  25501. afterTransform: afterTransform.bind(this),
  25502. needTransform: false,
  25503. transforming: false,
  25504. writecb: null,
  25505. writechunk: null,
  25506. writeencoding: null
  25507. }; // start out asking for a readable event once data is transformed.
  25508. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
  25509. // that Readable wants before the first _read call, so unset the
  25510. // sync guard flag.
  25511. this._readableState.sync = false;
  25512. if (options) {
  25513. if (typeof options.transform === 'function') this._transform = options.transform;
  25514. if (typeof options.flush === 'function') this._flush = options.flush;
  25515. } // When the writable side finishes, then flush out anything remaining.
  25516. this.on('prefinish', prefinish);
  25517. }
  25518. function prefinish() {
  25519. var _this = this;
  25520. if (typeof this._flush === 'function' && !this._readableState.destroyed) {
  25521. this._flush(function (er, data) {
  25522. done(_this, er, data);
  25523. });
  25524. } else {
  25525. done(this, null, null);
  25526. }
  25527. }
  25528. Transform.prototype.push = function (chunk, encoding) {
  25529. this._transformState.needTransform = false;
  25530. return Duplex.prototype.push.call(this, chunk, encoding);
  25531. }; // This is the part where you do stuff!
  25532. // override this function in implementation classes.
  25533. // 'chunk' is an input chunk.
  25534. //
  25535. // Call `push(newChunk)` to pass along transformed output
  25536. // to the readable side. You may call 'push' zero or more times.
  25537. //
  25538. // Call `cb(err)` when you are done with this chunk. If you pass
  25539. // an error, then that'll put the hurt on the whole operation. If you
  25540. // never call cb(), then you'll never get another chunk.
  25541. Transform.prototype._transform = function (chunk, encoding, cb) {
  25542. cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
  25543. };
  25544. Transform.prototype._write = function (chunk, encoding, cb) {
  25545. var ts = this._transformState;
  25546. ts.writecb = cb;
  25547. ts.writechunk = chunk;
  25548. ts.writeencoding = encoding;
  25549. if (!ts.transforming) {
  25550. var rs = this._readableState;
  25551. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  25552. }
  25553. }; // Doesn't matter what the args are here.
  25554. // _transform does all the work.
  25555. // That we got here means that the readable side wants more data.
  25556. Transform.prototype._read = function (n) {
  25557. var ts = this._transformState;
  25558. if (ts.writechunk !== null && !ts.transforming) {
  25559. ts.transforming = true;
  25560. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  25561. } else {
  25562. // mark that we need a transform, so that any data that comes in
  25563. // will get processed, now that we've asked for it.
  25564. ts.needTransform = true;
  25565. }
  25566. };
  25567. Transform.prototype._destroy = function (err, cb) {
  25568. Duplex.prototype._destroy.call(this, err, function (err2) {
  25569. cb(err2);
  25570. });
  25571. };
  25572. function done(stream, er, data) {
  25573. if (er) return stream.emit('error', er);
  25574. if (data != null) // single equals check for both `null` and `undefined`
  25575. stream.push(data); // TODO(BridgeAR): Write a test for these two error cases
  25576. // if there's nothing in the write buffer, then that means
  25577. // that nothing more will ever be provided
  25578. if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
  25579. if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
  25580. return stream.push(null);
  25581. }
  25582. /***/ }),
  25583. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js":
  25584. /*!*********************************************************************************************!*\
  25585. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js ***!
  25586. \*********************************************************************************************/
  25587. /*! unknown exports (runtime-defined) */
  25588. /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
  25589. /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
  25590. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  25591. "use strict";
  25592. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  25593. // Copyright Joyent, Inc. and other Node contributors.
  25594. //
  25595. // Permission is hereby granted, free of charge, to any person obtaining a
  25596. // copy of this software and associated documentation files (the
  25597. // "Software"), to deal in the Software without restriction, including
  25598. // without limitation the rights to use, copy, modify, merge, publish,
  25599. // distribute, sublicense, and/or sell copies of the Software, and to permit
  25600. // persons to whom the Software is furnished to do so, subject to the
  25601. // following conditions:
  25602. //
  25603. // The above copyright notice and this permission notice shall be included
  25604. // in all copies or substantial portions of the Software.
  25605. //
  25606. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  25607. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25608. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  25609. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  25610. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  25611. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  25612. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  25613. // A bit simpler than readable streams.
  25614. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  25615. // the drain event emission and buffering.
  25616. module.exports = Writable;
  25617. /* <replacement> */
  25618. function WriteReq(chunk, encoding, cb) {
  25619. this.chunk = chunk;
  25620. this.encoding = encoding;
  25621. this.callback = cb;
  25622. this.next = null;
  25623. } // It seems a linked list but it is not
  25624. // there will be only 2 of these for each stream
  25625. function CorkedRequest(state) {
  25626. var _this = this;
  25627. this.next = null;
  25628. this.entry = null;
  25629. this.finish = function () {
  25630. onCorkedFinish(_this, state);
  25631. };
  25632. }
  25633. /* </replacement> */
  25634. /*<replacement>*/
  25635. var Duplex;
  25636. /*</replacement>*/
  25637. Writable.WritableState = WritableState;
  25638. /*<replacement>*/
  25639. var internalUtil = {
  25640. deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js")
  25641. };
  25642. /*</replacement>*/
  25643. /*<replacement>*/
  25644. var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
  25645. /*</replacement>*/
  25646. var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
  25647. var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
  25648. function _uint8ArrayToBuffer(chunk) {
  25649. return Buffer.from(chunk);
  25650. }
  25651. function _isUint8Array(obj) {
  25652. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  25653. }
  25654. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js");
  25655. var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"),
  25656. getHighWaterMark = _require.getHighWaterMark;
  25657. var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
  25658. ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  25659. ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  25660. ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  25661. ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
  25662. ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
  25663. ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
  25664. ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
  25665. ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
  25666. var errorOrDestroy = destroyImpl.errorOrDestroy;
  25667. __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream);
  25668. function nop() {}
  25669. function WritableState(options, stream, isDuplex) {
  25670. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
  25671. options = options || {}; // Duplex streams are both readable and writable, but share
  25672. // the same options object.
  25673. // However, some cases require setting options to different
  25674. // values for the readable and the writable sides of the duplex stream,
  25675. // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
  25676. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream
  25677. // contains buffers or objects.
  25678. this.objectMode = !!options.objectMode;
  25679. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
  25680. // Note: 0 is a valid value, means that we always return false if
  25681. // the entire buffer is not flushed immediately on write()
  25682. this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called
  25683. this.finalCalled = false; // drain event flag.
  25684. this.needDrain = false; // at the start of calling end()
  25685. this.ending = false; // when end() has been called, and returned
  25686. this.ended = false; // when 'finish' is emitted
  25687. this.finished = false; // has it been destroyed
  25688. this.destroyed = false; // should we decode strings into buffers before passing to _write?
  25689. // this is here so that some node-core streams can optimize string
  25690. // handling at a lower level.
  25691. var noDecode = options.decodeStrings === false;
  25692. this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string
  25693. // encoding is 'binary' so we have to make this configurable.
  25694. // Everything else in the universe uses 'utf8', though.
  25695. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
  25696. // of how much we're waiting to get pushed to some underlying
  25697. // socket or file.
  25698. this.length = 0; // a flag to see when we're in the middle of a write.
  25699. this.writing = false; // when true all writes will be buffered until .uncork() call
  25700. this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
  25701. // or on a later tick. We set this to true at first, because any
  25702. // actions that shouldn't happen until "later" should generally also
  25703. // not happen before the first write call.
  25704. this.sync = true; // a flag to know if we're processing previously buffered items, which
  25705. // may call the _write() callback in the same tick, so that we don't
  25706. // end up in an overlapped onwrite situation.
  25707. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
  25708. this.onwrite = function (er) {
  25709. onwrite(stream, er);
  25710. }; // the callback that the user supplies to write(chunk,encoding,cb)
  25711. this.writecb = null; // the amount that is being written when _write is called.
  25712. this.writelen = 0;
  25713. this.bufferedRequest = null;
  25714. this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
  25715. // this must be 0 before 'finish' can be emitted
  25716. this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
  25717. // This is relevant for synchronous Transform streams
  25718. this.prefinished = false; // True if the error was already emitted and should not be thrown again
  25719. this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.
  25720. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')
  25721. this.autoDestroy = !!options.autoDestroy; // count buffered requests
  25722. this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
  25723. // one allocated and free to use, and we maintain at most two
  25724. this.corkedRequestsFree = new CorkedRequest(this);
  25725. }
  25726. WritableState.prototype.getBuffer = function getBuffer() {
  25727. var current = this.bufferedRequest;
  25728. var out = [];
  25729. while (current) {
  25730. out.push(current);
  25731. current = current.next;
  25732. }
  25733. return out;
  25734. };
  25735. (function () {
  25736. try {
  25737. Object.defineProperty(WritableState.prototype, 'buffer', {
  25738. get: internalUtil.deprecate(function writableStateBufferGetter() {
  25739. return this.getBuffer();
  25740. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  25741. });
  25742. } catch (_) {}
  25743. })(); // Test _writableState for inheritance to account for Duplex streams,
  25744. // whose prototype chain only points to Readable.
  25745. var realHasInstance;
  25746. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  25747. realHasInstance = Function.prototype[Symbol.hasInstance];
  25748. Object.defineProperty(Writable, Symbol.hasInstance, {
  25749. value: function value(object) {
  25750. if (realHasInstance.call(this, object)) return true;
  25751. if (this !== Writable) return false;
  25752. return object && object._writableState instanceof WritableState;
  25753. }
  25754. });
  25755. } else {
  25756. realHasInstance = function realHasInstance(object) {
  25757. return object instanceof this;
  25758. };
  25759. }
  25760. function Writable(options) {
  25761. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"); // Writable ctor is applied to Duplexes, too.
  25762. // `realHasInstance` is necessary because using plain `instanceof`
  25763. // would return false, as no `_writableState` property is attached.
  25764. // Trying to use the custom `instanceof` for Writable here will also break the
  25765. // Node.js LazyTransform implementation, which has a non-trivial getter for
  25766. // `_writableState` that would lead to infinite recursion.
  25767. // Checking for a Stream.Duplex instance is faster here instead of inside
  25768. // the WritableState constructor, at least with V8 6.5
  25769. var isDuplex = this instanceof Duplex;
  25770. if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
  25771. this._writableState = new WritableState(options, this, isDuplex); // legacy.
  25772. this.writable = true;
  25773. if (options) {
  25774. if (typeof options.write === 'function') this._write = options.write;
  25775. if (typeof options.writev === 'function') this._writev = options.writev;
  25776. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  25777. if (typeof options.final === 'function') this._final = options.final;
  25778. }
  25779. Stream.call(this);
  25780. } // Otherwise people can pipe Writable streams, which is just wrong.
  25781. Writable.prototype.pipe = function () {
  25782. errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
  25783. };
  25784. function writeAfterEnd(stream, cb) {
  25785. var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb
  25786. errorOrDestroy(stream, er);
  25787. process.nextTick(cb, er);
  25788. } // Checks that a user-supplied chunk is valid, especially for the particular
  25789. // mode the stream is in. Currently this means that `null` is never accepted
  25790. // and undefined/non-string values are only allowed in object mode.
  25791. function validChunk(stream, state, chunk, cb) {
  25792. var er;
  25793. if (chunk === null) {
  25794. er = new ERR_STREAM_NULL_VALUES();
  25795. } else if (typeof chunk !== 'string' && !state.objectMode) {
  25796. er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
  25797. }
  25798. if (er) {
  25799. errorOrDestroy(stream, er);
  25800. process.nextTick(cb, er);
  25801. return false;
  25802. }
  25803. return true;
  25804. }
  25805. Writable.prototype.write = function (chunk, encoding, cb) {
  25806. var state = this._writableState;
  25807. var ret = false;
  25808. var isBuf = !state.objectMode && _isUint8Array(chunk);
  25809. if (isBuf && !Buffer.isBuffer(chunk)) {
  25810. chunk = _uint8ArrayToBuffer(chunk);
  25811. }
  25812. if (typeof encoding === 'function') {
  25813. cb = encoding;
  25814. encoding = null;
  25815. }
  25816. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  25817. if (typeof cb !== 'function') cb = nop;
  25818. if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  25819. state.pendingcb++;
  25820. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  25821. }
  25822. return ret;
  25823. };
  25824. Writable.prototype.cork = function () {
  25825. this._writableState.corked++;
  25826. };
  25827. Writable.prototype.uncork = function () {
  25828. var state = this._writableState;
  25829. if (state.corked) {
  25830. state.corked--;
  25831. if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  25832. }
  25833. };
  25834. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  25835. // node::ParseEncoding() requires lower case.
  25836. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  25837. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
  25838. this._writableState.defaultEncoding = encoding;
  25839. return this;
  25840. };
  25841. Object.defineProperty(Writable.prototype, 'writableBuffer', {
  25842. // making it explicit this property is not enumerable
  25843. // because otherwise some prototype manipulation in
  25844. // userland will fail
  25845. enumerable: false,
  25846. get: function get() {
  25847. return this._writableState && this._writableState.getBuffer();
  25848. }
  25849. });
  25850. function decodeChunk(state, chunk, encoding) {
  25851. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  25852. chunk = Buffer.from(chunk, encoding);
  25853. }
  25854. return chunk;
  25855. }
  25856. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  25857. // making it explicit this property is not enumerable
  25858. // because otherwise some prototype manipulation in
  25859. // userland will fail
  25860. enumerable: false,
  25861. get: function get() {
  25862. return this._writableState.highWaterMark;
  25863. }
  25864. }); // if we're already writing something, then just put this
  25865. // in the queue, and wait our turn. Otherwise, call _write
  25866. // If we return false, then we need a drain event, so set that flag.
  25867. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  25868. if (!isBuf) {
  25869. var newChunk = decodeChunk(state, chunk, encoding);
  25870. if (chunk !== newChunk) {
  25871. isBuf = true;
  25872. encoding = 'buffer';
  25873. chunk = newChunk;
  25874. }
  25875. }
  25876. var len = state.objectMode ? 1 : chunk.length;
  25877. state.length += len;
  25878. var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
  25879. if (!ret) state.needDrain = true;
  25880. if (state.writing || state.corked) {
  25881. var last = state.lastBufferedRequest;
  25882. state.lastBufferedRequest = {
  25883. chunk: chunk,
  25884. encoding: encoding,
  25885. isBuf: isBuf,
  25886. callback: cb,
  25887. next: null
  25888. };
  25889. if (last) {
  25890. last.next = state.lastBufferedRequest;
  25891. } else {
  25892. state.bufferedRequest = state.lastBufferedRequest;
  25893. }
  25894. state.bufferedRequestCount += 1;
  25895. } else {
  25896. doWrite(stream, state, false, len, chunk, encoding, cb);
  25897. }
  25898. return ret;
  25899. }
  25900. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  25901. state.writelen = len;
  25902. state.writecb = cb;
  25903. state.writing = true;
  25904. state.sync = true;
  25905. if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  25906. state.sync = false;
  25907. }
  25908. function onwriteError(stream, state, sync, er, cb) {
  25909. --state.pendingcb;
  25910. if (sync) {
  25911. // defer the callback if we are being called synchronously
  25912. // to avoid piling up things on the stack
  25913. process.nextTick(cb, er); // this can emit finish, and it will always happen
  25914. // after error
  25915. process.nextTick(finishMaybe, stream, state);
  25916. stream._writableState.errorEmitted = true;
  25917. errorOrDestroy(stream, er);
  25918. } else {
  25919. // the caller expect this to happen before if
  25920. // it is async
  25921. cb(er);
  25922. stream._writableState.errorEmitted = true;
  25923. errorOrDestroy(stream, er); // this can emit finish, but finish must
  25924. // always follow error
  25925. finishMaybe(stream, state);
  25926. }
  25927. }
  25928. function onwriteStateUpdate(state) {
  25929. state.writing = false;
  25930. state.writecb = null;
  25931. state.length -= state.writelen;
  25932. state.writelen = 0;
  25933. }
  25934. function onwrite(stream, er) {
  25935. var state = stream._writableState;
  25936. var sync = state.sync;
  25937. var cb = state.writecb;
  25938. if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
  25939. onwriteStateUpdate(state);
  25940. if (er) onwriteError(stream, state, sync, er, cb);else {
  25941. // Check if we're actually ready to finish, but don't emit yet
  25942. var finished = needFinish(state) || stream.destroyed;
  25943. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  25944. clearBuffer(stream, state);
  25945. }
  25946. if (sync) {
  25947. process.nextTick(afterWrite, stream, state, finished, cb);
  25948. } else {
  25949. afterWrite(stream, state, finished, cb);
  25950. }
  25951. }
  25952. }
  25953. function afterWrite(stream, state, finished, cb) {
  25954. if (!finished) onwriteDrain(stream, state);
  25955. state.pendingcb--;
  25956. cb();
  25957. finishMaybe(stream, state);
  25958. } // Must force callback to be called on nextTick, so that we don't
  25959. // emit 'drain' before the write() consumer gets the 'false' return
  25960. // value, and has a chance to attach a 'drain' listener.
  25961. function onwriteDrain(stream, state) {
  25962. if (state.length === 0 && state.needDrain) {
  25963. state.needDrain = false;
  25964. stream.emit('drain');
  25965. }
  25966. } // if there's something in the buffer waiting, then process it
  25967. function clearBuffer(stream, state) {
  25968. state.bufferProcessing = true;
  25969. var entry = state.bufferedRequest;
  25970. if (stream._writev && entry && entry.next) {
  25971. // Fast case, write everything using _writev()
  25972. var l = state.bufferedRequestCount;
  25973. var buffer = new Array(l);
  25974. var holder = state.corkedRequestsFree;
  25975. holder.entry = entry;
  25976. var count = 0;
  25977. var allBuffers = true;
  25978. while (entry) {
  25979. buffer[count] = entry;
  25980. if (!entry.isBuf) allBuffers = false;
  25981. entry = entry.next;
  25982. count += 1;
  25983. }
  25984. buffer.allBuffers = allBuffers;
  25985. doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
  25986. // as the hot path ends with doWrite
  25987. state.pendingcb++;
  25988. state.lastBufferedRequest = null;
  25989. if (holder.next) {
  25990. state.corkedRequestsFree = holder.next;
  25991. holder.next = null;
  25992. } else {
  25993. state.corkedRequestsFree = new CorkedRequest(state);
  25994. }
  25995. state.bufferedRequestCount = 0;
  25996. } else {
  25997. // Slow case, write chunks one-by-one
  25998. while (entry) {
  25999. var chunk = entry.chunk;
  26000. var encoding = entry.encoding;
  26001. var cb = entry.callback;
  26002. var len = state.objectMode ? 1 : chunk.length;
  26003. doWrite(stream, state, false, len, chunk, encoding, cb);
  26004. entry = entry.next;
  26005. state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then
  26006. // it means that we need to wait until it does.
  26007. // also, that means that the chunk and cb are currently
  26008. // being processed, so move the buffer counter past them.
  26009. if (state.writing) {
  26010. break;
  26011. }
  26012. }
  26013. if (entry === null) state.lastBufferedRequest = null;
  26014. }
  26015. state.bufferedRequest = entry;
  26016. state.bufferProcessing = false;
  26017. }
  26018. Writable.prototype._write = function (chunk, encoding, cb) {
  26019. cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
  26020. };
  26021. Writable.prototype._writev = null;
  26022. Writable.prototype.end = function (chunk, encoding, cb) {
  26023. var state = this._writableState;
  26024. if (typeof chunk === 'function') {
  26025. cb = chunk;
  26026. chunk = null;
  26027. encoding = null;
  26028. } else if (typeof encoding === 'function') {
  26029. cb = encoding;
  26030. encoding = null;
  26031. }
  26032. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
  26033. if (state.corked) {
  26034. state.corked = 1;
  26035. this.uncork();
  26036. } // ignore unnecessary end() calls.
  26037. if (!state.ending) endWritable(this, state, cb);
  26038. return this;
  26039. };
  26040. Object.defineProperty(Writable.prototype, 'writableLength', {
  26041. // making it explicit this property is not enumerable
  26042. // because otherwise some prototype manipulation in
  26043. // userland will fail
  26044. enumerable: false,
  26045. get: function get() {
  26046. return this._writableState.length;
  26047. }
  26048. });
  26049. function needFinish(state) {
  26050. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  26051. }
  26052. function callFinal(stream, state) {
  26053. stream._final(function (err) {
  26054. state.pendingcb--;
  26055. if (err) {
  26056. errorOrDestroy(stream, err);
  26057. }
  26058. state.prefinished = true;
  26059. stream.emit('prefinish');
  26060. finishMaybe(stream, state);
  26061. });
  26062. }
  26063. function prefinish(stream, state) {
  26064. if (!state.prefinished && !state.finalCalled) {
  26065. if (typeof stream._final === 'function' && !state.destroyed) {
  26066. state.pendingcb++;
  26067. state.finalCalled = true;
  26068. process.nextTick(callFinal, stream, state);
  26069. } else {
  26070. state.prefinished = true;
  26071. stream.emit('prefinish');
  26072. }
  26073. }
  26074. }
  26075. function finishMaybe(stream, state) {
  26076. var need = needFinish(state);
  26077. if (need) {
  26078. prefinish(stream, state);
  26079. if (state.pendingcb === 0) {
  26080. state.finished = true;
  26081. stream.emit('finish');
  26082. if (state.autoDestroy) {
  26083. // In case of duplex streams we need a way to detect
  26084. // if the readable side is ready for autoDestroy as well
  26085. var rState = stream._readableState;
  26086. if (!rState || rState.autoDestroy && rState.endEmitted) {
  26087. stream.destroy();
  26088. }
  26089. }
  26090. }
  26091. }
  26092. return need;
  26093. }
  26094. function endWritable(stream, state, cb) {
  26095. state.ending = true;
  26096. finishMaybe(stream, state);
  26097. if (cb) {
  26098. if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
  26099. }
  26100. state.ended = true;
  26101. stream.writable = false;
  26102. }
  26103. function onCorkedFinish(corkReq, state, err) {
  26104. var entry = corkReq.entry;
  26105. corkReq.entry = null;
  26106. while (entry) {
  26107. var cb = entry.callback;
  26108. state.pendingcb--;
  26109. cb(err);
  26110. entry = entry.next;
  26111. } // reuse the free corkReq.
  26112. state.corkedRequestsFree.next = corkReq;
  26113. }
  26114. Object.defineProperty(Writable.prototype, 'destroyed', {
  26115. // making it explicit this property is not enumerable
  26116. // because otherwise some prototype manipulation in
  26117. // userland will fail
  26118. enumerable: false,
  26119. get: function get() {
  26120. if (this._writableState === undefined) {
  26121. return false;
  26122. }
  26123. return this._writableState.destroyed;
  26124. },
  26125. set: function set(value) {
  26126. // we ignore the value if the stream
  26127. // has not been initialized yet
  26128. if (!this._writableState) {
  26129. return;
  26130. } // backward compatibility, the user is explicitly
  26131. // managing destroyed
  26132. this._writableState.destroyed = value;
  26133. }
  26134. });
  26135. Writable.prototype.destroy = destroyImpl.destroy;
  26136. Writable.prototype._undestroy = destroyImpl.undestroy;
  26137. Writable.prototype._destroy = function (err, cb) {
  26138. cb(err);
  26139. };
  26140. /***/ }),
  26141. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js":
  26142. /*!************************************************************************************************************!*\
  26143. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js ***!
  26144. \************************************************************************************************************/
  26145. /*! unknown exports (runtime-defined) */
  26146. /*! runtime requirements: __webpack_require__, module */
  26147. /*! CommonJS bailout: module.exports is used directly at 207:0-14 */
  26148. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26149. "use strict";
  26150. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  26151. var _Object$setPrototypeO;
  26152. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  26153. var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
  26154. var kLastResolve = Symbol('lastResolve');
  26155. var kLastReject = Symbol('lastReject');
  26156. var kError = Symbol('error');
  26157. var kEnded = Symbol('ended');
  26158. var kLastPromise = Symbol('lastPromise');
  26159. var kHandlePromise = Symbol('handlePromise');
  26160. var kStream = Symbol('stream');
  26161. function createIterResult(value, done) {
  26162. return {
  26163. value: value,
  26164. done: done
  26165. };
  26166. }
  26167. function readAndResolve(iter) {
  26168. var resolve = iter[kLastResolve];
  26169. if (resolve !== null) {
  26170. var data = iter[kStream].read(); // we defer if data is null
  26171. // we can be expecting either 'end' or
  26172. // 'error'
  26173. if (data !== null) {
  26174. iter[kLastPromise] = null;
  26175. iter[kLastResolve] = null;
  26176. iter[kLastReject] = null;
  26177. resolve(createIterResult(data, false));
  26178. }
  26179. }
  26180. }
  26181. function onReadable(iter) {
  26182. // we wait for the next tick, because it might
  26183. // emit an error with process.nextTick
  26184. process.nextTick(readAndResolve, iter);
  26185. }
  26186. function wrapForNext(lastPromise, iter) {
  26187. return function (resolve, reject) {
  26188. lastPromise.then(function () {
  26189. if (iter[kEnded]) {
  26190. resolve(createIterResult(undefined, true));
  26191. return;
  26192. }
  26193. iter[kHandlePromise](resolve, reject);
  26194. }, reject);
  26195. };
  26196. }
  26197. var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
  26198. var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
  26199. get stream() {
  26200. return this[kStream];
  26201. },
  26202. next: function next() {
  26203. var _this = this;
  26204. // if we have detected an error in the meanwhile
  26205. // reject straight away
  26206. var error = this[kError];
  26207. if (error !== null) {
  26208. return Promise.reject(error);
  26209. }
  26210. if (this[kEnded]) {
  26211. return Promise.resolve(createIterResult(undefined, true));
  26212. }
  26213. if (this[kStream].destroyed) {
  26214. // We need to defer via nextTick because if .destroy(err) is
  26215. // called, the error will be emitted via nextTick, and
  26216. // we cannot guarantee that there is no error lingering around
  26217. // waiting to be emitted.
  26218. return new Promise(function (resolve, reject) {
  26219. process.nextTick(function () {
  26220. if (_this[kError]) {
  26221. reject(_this[kError]);
  26222. } else {
  26223. resolve(createIterResult(undefined, true));
  26224. }
  26225. });
  26226. });
  26227. } // if we have multiple next() calls
  26228. // we will wait for the previous Promise to finish
  26229. // this logic is optimized to support for await loops,
  26230. // where next() is only called once at a time
  26231. var lastPromise = this[kLastPromise];
  26232. var promise;
  26233. if (lastPromise) {
  26234. promise = new Promise(wrapForNext(lastPromise, this));
  26235. } else {
  26236. // fast path needed to support multiple this.push()
  26237. // without triggering the next() queue
  26238. var data = this[kStream].read();
  26239. if (data !== null) {
  26240. return Promise.resolve(createIterResult(data, false));
  26241. }
  26242. promise = new Promise(this[kHandlePromise]);
  26243. }
  26244. this[kLastPromise] = promise;
  26245. return promise;
  26246. }
  26247. }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
  26248. return this;
  26249. }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
  26250. var _this2 = this;
  26251. // destroy(err, cb) is a private API
  26252. // we can guarantee we have that here, because we control the
  26253. // Readable class this is attached to
  26254. return new Promise(function (resolve, reject) {
  26255. _this2[kStream].destroy(null, function (err) {
  26256. if (err) {
  26257. reject(err);
  26258. return;
  26259. }
  26260. resolve(createIterResult(undefined, true));
  26261. });
  26262. });
  26263. }), _Object$setPrototypeO), AsyncIteratorPrototype);
  26264. var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
  26265. var _Object$create;
  26266. var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
  26267. value: stream,
  26268. writable: true
  26269. }), _defineProperty(_Object$create, kLastResolve, {
  26270. value: null,
  26271. writable: true
  26272. }), _defineProperty(_Object$create, kLastReject, {
  26273. value: null,
  26274. writable: true
  26275. }), _defineProperty(_Object$create, kError, {
  26276. value: null,
  26277. writable: true
  26278. }), _defineProperty(_Object$create, kEnded, {
  26279. value: stream._readableState.endEmitted,
  26280. writable: true
  26281. }), _defineProperty(_Object$create, kHandlePromise, {
  26282. value: function value(resolve, reject) {
  26283. var data = iterator[kStream].read();
  26284. if (data) {
  26285. iterator[kLastPromise] = null;
  26286. iterator[kLastResolve] = null;
  26287. iterator[kLastReject] = null;
  26288. resolve(createIterResult(data, false));
  26289. } else {
  26290. iterator[kLastResolve] = resolve;
  26291. iterator[kLastReject] = reject;
  26292. }
  26293. },
  26294. writable: true
  26295. }), _Object$create));
  26296. iterator[kLastPromise] = null;
  26297. finished(stream, function (err) {
  26298. if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
  26299. var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise
  26300. // returned by next() and store the error
  26301. if (reject !== null) {
  26302. iterator[kLastPromise] = null;
  26303. iterator[kLastResolve] = null;
  26304. iterator[kLastReject] = null;
  26305. reject(err);
  26306. }
  26307. iterator[kError] = err;
  26308. return;
  26309. }
  26310. var resolve = iterator[kLastResolve];
  26311. if (resolve !== null) {
  26312. iterator[kLastPromise] = null;
  26313. iterator[kLastResolve] = null;
  26314. iterator[kLastReject] = null;
  26315. resolve(createIterResult(undefined, true));
  26316. }
  26317. iterator[kEnded] = true;
  26318. });
  26319. stream.on('readable', onReadable.bind(null, iterator));
  26320. return iterator;
  26321. };
  26322. module.exports = createReadableStreamAsyncIterator;
  26323. /***/ }),
  26324. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js":
  26325. /*!*********************************************************************************************************!*\
  26326. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js ***!
  26327. \*********************************************************************************************************/
  26328. /*! unknown exports (runtime-defined) */
  26329. /*! runtime requirements: module, __webpack_require__ */
  26330. /*! CommonJS bailout: module.exports is used directly at 27:0-14 */
  26331. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26332. "use strict";
  26333. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  26334. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  26335. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  26336. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26337. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26338. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  26339. var _require = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js"),
  26340. Buffer = _require.Buffer;
  26341. var _require2 = __webpack_require__(/*! util */ "?0bed"),
  26342. inspect = _require2.inspect;
  26343. var custom = inspect && inspect.custom || 'inspect';
  26344. function copyBuffer(src, target, offset) {
  26345. Buffer.prototype.copy.call(src, target, offset);
  26346. }
  26347. module.exports =
  26348. /*#__PURE__*/
  26349. function () {
  26350. function BufferList() {
  26351. _classCallCheck(this, BufferList);
  26352. this.head = null;
  26353. this.tail = null;
  26354. this.length = 0;
  26355. }
  26356. _createClass(BufferList, [{
  26357. key: "push",
  26358. value: function push(v) {
  26359. var entry = {
  26360. data: v,
  26361. next: null
  26362. };
  26363. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  26364. this.tail = entry;
  26365. ++this.length;
  26366. }
  26367. }, {
  26368. key: "unshift",
  26369. value: function unshift(v) {
  26370. var entry = {
  26371. data: v,
  26372. next: this.head
  26373. };
  26374. if (this.length === 0) this.tail = entry;
  26375. this.head = entry;
  26376. ++this.length;
  26377. }
  26378. }, {
  26379. key: "shift",
  26380. value: function shift() {
  26381. if (this.length === 0) return;
  26382. var ret = this.head.data;
  26383. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  26384. --this.length;
  26385. return ret;
  26386. }
  26387. }, {
  26388. key: "clear",
  26389. value: function clear() {
  26390. this.head = this.tail = null;
  26391. this.length = 0;
  26392. }
  26393. }, {
  26394. key: "join",
  26395. value: function join(s) {
  26396. if (this.length === 0) return '';
  26397. var p = this.head;
  26398. var ret = '' + p.data;
  26399. while (p = p.next) {
  26400. ret += s + p.data;
  26401. }
  26402. return ret;
  26403. }
  26404. }, {
  26405. key: "concat",
  26406. value: function concat(n) {
  26407. if (this.length === 0) return Buffer.alloc(0);
  26408. var ret = Buffer.allocUnsafe(n >>> 0);
  26409. var p = this.head;
  26410. var i = 0;
  26411. while (p) {
  26412. copyBuffer(p.data, ret, i);
  26413. i += p.data.length;
  26414. p = p.next;
  26415. }
  26416. return ret;
  26417. } // Consumes a specified amount of bytes or characters from the buffered data.
  26418. }, {
  26419. key: "consume",
  26420. value: function consume(n, hasStrings) {
  26421. var ret;
  26422. if (n < this.head.data.length) {
  26423. // `slice` is the same for buffers and strings.
  26424. ret = this.head.data.slice(0, n);
  26425. this.head.data = this.head.data.slice(n);
  26426. } else if (n === this.head.data.length) {
  26427. // First chunk is a perfect match.
  26428. ret = this.shift();
  26429. } else {
  26430. // Result spans more than one buffer.
  26431. ret = hasStrings ? this._getString(n) : this._getBuffer(n);
  26432. }
  26433. return ret;
  26434. }
  26435. }, {
  26436. key: "first",
  26437. value: function first() {
  26438. return this.head.data;
  26439. } // Consumes a specified amount of characters from the buffered data.
  26440. }, {
  26441. key: "_getString",
  26442. value: function _getString(n) {
  26443. var p = this.head;
  26444. var c = 1;
  26445. var ret = p.data;
  26446. n -= ret.length;
  26447. while (p = p.next) {
  26448. var str = p.data;
  26449. var nb = n > str.length ? str.length : n;
  26450. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  26451. n -= nb;
  26452. if (n === 0) {
  26453. if (nb === str.length) {
  26454. ++c;
  26455. if (p.next) this.head = p.next;else this.head = this.tail = null;
  26456. } else {
  26457. this.head = p;
  26458. p.data = str.slice(nb);
  26459. }
  26460. break;
  26461. }
  26462. ++c;
  26463. }
  26464. this.length -= c;
  26465. return ret;
  26466. } // Consumes a specified amount of bytes from the buffered data.
  26467. }, {
  26468. key: "_getBuffer",
  26469. value: function _getBuffer(n) {
  26470. var ret = Buffer.allocUnsafe(n);
  26471. var p = this.head;
  26472. var c = 1;
  26473. p.data.copy(ret);
  26474. n -= p.data.length;
  26475. while (p = p.next) {
  26476. var buf = p.data;
  26477. var nb = n > buf.length ? buf.length : n;
  26478. buf.copy(ret, ret.length - n, 0, nb);
  26479. n -= nb;
  26480. if (n === 0) {
  26481. if (nb === buf.length) {
  26482. ++c;
  26483. if (p.next) this.head = p.next;else this.head = this.tail = null;
  26484. } else {
  26485. this.head = p;
  26486. p.data = buf.slice(nb);
  26487. }
  26488. break;
  26489. }
  26490. ++c;
  26491. }
  26492. this.length -= c;
  26493. return ret;
  26494. } // Make sure the linked list only shows the minimal necessary information.
  26495. }, {
  26496. key: custom,
  26497. value: function value(_, options) {
  26498. return inspect(this, _objectSpread({}, options, {
  26499. // Only inspect one level.
  26500. depth: 0,
  26501. // It should not recurse.
  26502. customInspect: false
  26503. }));
  26504. }
  26505. }]);
  26506. return BufferList;
  26507. }();
  26508. /***/ }),
  26509. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js":
  26510. /*!*****************************************************************************************************!*\
  26511. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  26512. \*****************************************************************************************************/
  26513. /*! unknown exports (runtime-defined) */
  26514. /*! runtime requirements: __webpack_require__, module */
  26515. /*! CommonJS bailout: module.exports is used directly at 101:0-14 */
  26516. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26517. "use strict";
  26518. /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
  26519. // undocumented cb() API, needed for core, not for public API
  26520. function destroy(err, cb) {
  26521. var _this = this;
  26522. var readableDestroyed = this._readableState && this._readableState.destroyed;
  26523. var writableDestroyed = this._writableState && this._writableState.destroyed;
  26524. if (readableDestroyed || writableDestroyed) {
  26525. if (cb) {
  26526. cb(err);
  26527. } else if (err) {
  26528. if (!this._writableState) {
  26529. process.nextTick(emitErrorNT, this, err);
  26530. } else if (!this._writableState.errorEmitted) {
  26531. this._writableState.errorEmitted = true;
  26532. process.nextTick(emitErrorNT, this, err);
  26533. }
  26534. }
  26535. return this;
  26536. } // we set destroyed to true before firing error callbacks in order
  26537. // to make it re-entrance safe in case destroy() is called within callbacks
  26538. if (this._readableState) {
  26539. this._readableState.destroyed = true;
  26540. } // if this is a duplex stream mark the writable part as destroyed as well
  26541. if (this._writableState) {
  26542. this._writableState.destroyed = true;
  26543. }
  26544. this._destroy(err || null, function (err) {
  26545. if (!cb && err) {
  26546. if (!_this._writableState) {
  26547. process.nextTick(emitErrorAndCloseNT, _this, err);
  26548. } else if (!_this._writableState.errorEmitted) {
  26549. _this._writableState.errorEmitted = true;
  26550. process.nextTick(emitErrorAndCloseNT, _this, err);
  26551. } else {
  26552. process.nextTick(emitCloseNT, _this);
  26553. }
  26554. } else if (cb) {
  26555. process.nextTick(emitCloseNT, _this);
  26556. cb(err);
  26557. } else {
  26558. process.nextTick(emitCloseNT, _this);
  26559. }
  26560. });
  26561. return this;
  26562. }
  26563. function emitErrorAndCloseNT(self, err) {
  26564. emitErrorNT(self, err);
  26565. emitCloseNT(self);
  26566. }
  26567. function emitCloseNT(self) {
  26568. if (self._writableState && !self._writableState.emitClose) return;
  26569. if (self._readableState && !self._readableState.emitClose) return;
  26570. self.emit('close');
  26571. }
  26572. function undestroy() {
  26573. if (this._readableState) {
  26574. this._readableState.destroyed = false;
  26575. this._readableState.reading = false;
  26576. this._readableState.ended = false;
  26577. this._readableState.endEmitted = false;
  26578. }
  26579. if (this._writableState) {
  26580. this._writableState.destroyed = false;
  26581. this._writableState.ended = false;
  26582. this._writableState.ending = false;
  26583. this._writableState.finalCalled = false;
  26584. this._writableState.prefinished = false;
  26585. this._writableState.finished = false;
  26586. this._writableState.errorEmitted = false;
  26587. }
  26588. }
  26589. function emitErrorNT(self, err) {
  26590. self.emit('error', err);
  26591. }
  26592. function errorOrDestroy(stream, err) {
  26593. // We have tests that rely on errors being emitted
  26594. // in the same tick, so changing this is semver major.
  26595. // For now when you opt-in to autoDestroy we allow
  26596. // the error to be emitted nextTick. In a future
  26597. // semver major update we should change the default to this.
  26598. var rState = stream._readableState;
  26599. var wState = stream._writableState;
  26600. if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
  26601. }
  26602. module.exports = {
  26603. destroy: destroy,
  26604. undestroy: undestroy,
  26605. errorOrDestroy: errorOrDestroy
  26606. };
  26607. /***/ }),
  26608. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js":
  26609. /*!***********************************************************************************************************!*\
  26610. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***!
  26611. \***********************************************************************************************************/
  26612. /*! unknown exports (runtime-defined) */
  26613. /*! runtime requirements: __webpack_require__, module */
  26614. /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
  26615. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26616. "use strict";
  26617. // Ported from https://github.com/mafintosh/end-of-stream with
  26618. // permission from the author, Mathias Buus (@mafintosh).
  26619. var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE;
  26620. function once(callback) {
  26621. var called = false;
  26622. return function () {
  26623. if (called) return;
  26624. called = true;
  26625. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  26626. args[_key] = arguments[_key];
  26627. }
  26628. callback.apply(this, args);
  26629. };
  26630. }
  26631. function noop() {}
  26632. function isRequest(stream) {
  26633. return stream.setHeader && typeof stream.abort === 'function';
  26634. }
  26635. function eos(stream, opts, callback) {
  26636. if (typeof opts === 'function') return eos(stream, null, opts);
  26637. if (!opts) opts = {};
  26638. callback = once(callback || noop);
  26639. var readable = opts.readable || opts.readable !== false && stream.readable;
  26640. var writable = opts.writable || opts.writable !== false && stream.writable;
  26641. var onlegacyfinish = function onlegacyfinish() {
  26642. if (!stream.writable) onfinish();
  26643. };
  26644. var writableEnded = stream._writableState && stream._writableState.finished;
  26645. var onfinish = function onfinish() {
  26646. writable = false;
  26647. writableEnded = true;
  26648. if (!readable) callback.call(stream);
  26649. };
  26650. var readableEnded = stream._readableState && stream._readableState.endEmitted;
  26651. var onend = function onend() {
  26652. readable = false;
  26653. readableEnded = true;
  26654. if (!writable) callback.call(stream);
  26655. };
  26656. var onerror = function onerror(err) {
  26657. callback.call(stream, err);
  26658. };
  26659. var onclose = function onclose() {
  26660. var err;
  26661. if (readable && !readableEnded) {
  26662. if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
  26663. return callback.call(stream, err);
  26664. }
  26665. if (writable && !writableEnded) {
  26666. if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
  26667. return callback.call(stream, err);
  26668. }
  26669. };
  26670. var onrequest = function onrequest() {
  26671. stream.req.on('finish', onfinish);
  26672. };
  26673. if (isRequest(stream)) {
  26674. stream.on('complete', onfinish);
  26675. stream.on('abort', onclose);
  26676. if (stream.req) onrequest();else stream.on('request', onrequest);
  26677. } else if (writable && !stream._writableState) {
  26678. // legacy streams
  26679. stream.on('end', onlegacyfinish);
  26680. stream.on('close', onlegacyfinish);
  26681. }
  26682. stream.on('end', onend);
  26683. stream.on('finish', onfinish);
  26684. if (opts.error !== false) stream.on('error', onerror);
  26685. stream.on('close', onclose);
  26686. return function () {
  26687. stream.removeListener('complete', onfinish);
  26688. stream.removeListener('abort', onclose);
  26689. stream.removeListener('request', onrequest);
  26690. if (stream.req) stream.req.removeListener('finish', onfinish);
  26691. stream.removeListener('end', onlegacyfinish);
  26692. stream.removeListener('close', onlegacyfinish);
  26693. stream.removeListener('finish', onfinish);
  26694. stream.removeListener('end', onend);
  26695. stream.removeListener('error', onerror);
  26696. stream.removeListener('close', onclose);
  26697. };
  26698. }
  26699. module.exports = eos;
  26700. /***/ }),
  26701. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js":
  26702. /*!**********************************************************************************************************!*\
  26703. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js ***!
  26704. \**********************************************************************************************************/
  26705. /*! unknown exports (runtime-defined) */
  26706. /*! runtime requirements: module */
  26707. /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
  26708. /***/ ((module) => {
  26709. module.exports = function () {
  26710. throw new Error('Readable.from is not available in the browser')
  26711. };
  26712. /***/ }),
  26713. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js":
  26714. /*!******************************************************************************************************!*\
  26715. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js ***!
  26716. \******************************************************************************************************/
  26717. /*! unknown exports (runtime-defined) */
  26718. /*! runtime requirements: __webpack_require__, module */
  26719. /*! CommonJS bailout: module.exports is used directly at 97:0-14 */
  26720. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26721. "use strict";
  26722. // Ported from https://github.com/mafintosh/pump with
  26723. // permission from the author, Mathias Buus (@mafintosh).
  26724. var eos;
  26725. function once(callback) {
  26726. var called = false;
  26727. return function () {
  26728. if (called) return;
  26729. called = true;
  26730. callback.apply(void 0, arguments);
  26731. };
  26732. }
  26733. var _require$codes = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
  26734. ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
  26735. ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
  26736. function noop(err) {
  26737. // Rethrow the error if it exists to avoid swallowing it
  26738. if (err) throw err;
  26739. }
  26740. function isRequest(stream) {
  26741. return stream.setHeader && typeof stream.abort === 'function';
  26742. }
  26743. function destroyer(stream, reading, writing, callback) {
  26744. callback = once(callback);
  26745. var closed = false;
  26746. stream.on('close', function () {
  26747. closed = true;
  26748. });
  26749. if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
  26750. eos(stream, {
  26751. readable: reading,
  26752. writable: writing
  26753. }, function (err) {
  26754. if (err) return callback(err);
  26755. closed = true;
  26756. callback();
  26757. });
  26758. var destroyed = false;
  26759. return function (err) {
  26760. if (closed) return;
  26761. if (destroyed) return;
  26762. destroyed = true; // request.destroy just do .end - .abort is what we want
  26763. if (isRequest(stream)) return stream.abort();
  26764. if (typeof stream.destroy === 'function') return stream.destroy();
  26765. callback(err || new ERR_STREAM_DESTROYED('pipe'));
  26766. };
  26767. }
  26768. function call(fn) {
  26769. fn();
  26770. }
  26771. function pipe(from, to) {
  26772. return from.pipe(to);
  26773. }
  26774. function popCallback(streams) {
  26775. if (!streams.length) return noop;
  26776. if (typeof streams[streams.length - 1] !== 'function') return noop;
  26777. return streams.pop();
  26778. }
  26779. function pipeline() {
  26780. for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
  26781. streams[_key] = arguments[_key];
  26782. }
  26783. var callback = popCallback(streams);
  26784. if (Array.isArray(streams[0])) streams = streams[0];
  26785. if (streams.length < 2) {
  26786. throw new ERR_MISSING_ARGS('streams');
  26787. }
  26788. var error;
  26789. var destroys = streams.map(function (stream, i) {
  26790. var reading = i < streams.length - 1;
  26791. var writing = i > 0;
  26792. return destroyer(stream, reading, writing, function (err) {
  26793. if (!error) error = err;
  26794. if (err) destroys.forEach(call);
  26795. if (reading) return;
  26796. destroys.forEach(call);
  26797. callback(error);
  26798. });
  26799. });
  26800. return streams.reduce(pipe);
  26801. }
  26802. module.exports = pipeline;
  26803. /***/ }),
  26804. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js":
  26805. /*!***************************************************************************************************!*\
  26806. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js ***!
  26807. \***************************************************************************************************/
  26808. /*! unknown exports (runtime-defined) */
  26809. /*! runtime requirements: __webpack_require__, module */
  26810. /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
  26811. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26812. "use strict";
  26813. var ERR_INVALID_OPT_VALUE = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE;
  26814. function highWaterMarkFrom(options, isDuplex, duplexKey) {
  26815. return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
  26816. }
  26817. function getHighWaterMark(state, options, duplexKey, isDuplex) {
  26818. var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
  26819. if (hwm != null) {
  26820. if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
  26821. var name = isDuplex ? duplexKey : 'highWaterMark';
  26822. throw new ERR_INVALID_OPT_VALUE(name, hwm);
  26823. }
  26824. return Math.floor(hwm);
  26825. } // Default value
  26826. return state.objectMode ? 16 : 16 * 1024;
  26827. }
  26828. module.exports = {
  26829. getHighWaterMark: getHighWaterMark
  26830. };
  26831. /***/ }),
  26832. /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
  26833. /*!************************************************************************************************************!*\
  26834. !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  26835. \************************************************************************************************************/
  26836. /*! dynamic exports */
  26837. /*! exports [maybe provided (runtime-defined)] [no usage info] */
  26838. /*! runtime requirements: module, __webpack_require__ */
  26839. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  26840. module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
  26841. /***/ }),
  26842. /***/ "./node_modules/string_decoder/lib/string_decoder.js":
  26843. /*!***********************************************************!*\
  26844. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  26845. \***********************************************************/
  26846. /*! default exports */
  26847. /*! export StringDecoder [provided] [no usage info] [missing usage info prevents renaming] */
  26848. /*! other exports [not provided] [no usage info] */
  26849. /*! runtime requirements: __webpack_require__, __webpack_exports__ */
  26850. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  26851. "use strict";
  26852. // Copyright Joyent, Inc. and other Node contributors.
  26853. //
  26854. // Permission is hereby granted, free of charge, to any person obtaining a
  26855. // copy of this software and associated documentation files (the
  26856. // "Software"), to deal in the Software without restriction, including
  26857. // without limitation the rights to use, copy, modify, merge, publish,
  26858. // distribute, sublicense, and/or sell copies of the Software, and to permit
  26859. // persons to whom the Software is furnished to do so, subject to the
  26860. // following conditions:
  26861. //
  26862. // The above copyright notice and this permission notice shall be included
  26863. // in all copies or substantial portions of the Software.
  26864. //
  26865. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  26866. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26867. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  26868. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  26869. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  26870. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  26871. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  26872. /*<replacement>*/
  26873. var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
  26874. /*</replacement>*/
  26875. var isEncoding = Buffer.isEncoding || function (encoding) {
  26876. encoding = '' + encoding;
  26877. switch (encoding && encoding.toLowerCase()) {
  26878. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  26879. return true;
  26880. default:
  26881. return false;
  26882. }
  26883. };
  26884. function _normalizeEncoding(enc) {
  26885. if (!enc) return 'utf8';
  26886. var retried;
  26887. while (true) {
  26888. switch (enc) {
  26889. case 'utf8':
  26890. case 'utf-8':
  26891. return 'utf8';
  26892. case 'ucs2':
  26893. case 'ucs-2':
  26894. case 'utf16le':
  26895. case 'utf-16le':
  26896. return 'utf16le';
  26897. case 'latin1':
  26898. case 'binary':
  26899. return 'latin1';
  26900. case 'base64':
  26901. case 'ascii':
  26902. case 'hex':
  26903. return enc;
  26904. default:
  26905. if (retried) return; // undefined
  26906. enc = ('' + enc).toLowerCase();
  26907. retried = true;
  26908. }
  26909. }
  26910. };
  26911. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  26912. // modules monkey-patch it to support additional encodings
  26913. function normalizeEncoding(enc) {
  26914. var nenc = _normalizeEncoding(enc);
  26915. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  26916. return nenc || enc;
  26917. }
  26918. // StringDecoder provides an interface for efficiently splitting a series of
  26919. // buffers into a series of JS strings without breaking apart multi-byte
  26920. // characters.
  26921. exports.StringDecoder = StringDecoder;
  26922. function StringDecoder(encoding) {
  26923. this.encoding = normalizeEncoding(encoding);
  26924. var nb;
  26925. switch (this.encoding) {
  26926. case 'utf16le':
  26927. this.text = utf16Text;
  26928. this.end = utf16End;
  26929. nb = 4;
  26930. break;
  26931. case 'utf8':
  26932. this.fillLast = utf8FillLast;
  26933. nb = 4;
  26934. break;
  26935. case 'base64':
  26936. this.text = base64Text;
  26937. this.end = base64End;
  26938. nb = 3;
  26939. break;
  26940. default:
  26941. this.write = simpleWrite;
  26942. this.end = simpleEnd;
  26943. return;
  26944. }
  26945. this.lastNeed = 0;
  26946. this.lastTotal = 0;
  26947. this.lastChar = Buffer.allocUnsafe(nb);
  26948. }
  26949. StringDecoder.prototype.write = function (buf) {
  26950. if (buf.length === 0) return '';
  26951. var r;
  26952. var i;
  26953. if (this.lastNeed) {
  26954. r = this.fillLast(buf);
  26955. if (r === undefined) return '';
  26956. i = this.lastNeed;
  26957. this.lastNeed = 0;
  26958. } else {
  26959. i = 0;
  26960. }
  26961. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  26962. return r || '';
  26963. };
  26964. StringDecoder.prototype.end = utf8End;
  26965. // Returns only complete characters in a Buffer
  26966. StringDecoder.prototype.text = utf8Text;
  26967. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  26968. StringDecoder.prototype.fillLast = function (buf) {
  26969. if (this.lastNeed <= buf.length) {
  26970. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  26971. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  26972. }
  26973. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  26974. this.lastNeed -= buf.length;
  26975. };
  26976. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  26977. // continuation byte. If an invalid byte is detected, -2 is returned.
  26978. function utf8CheckByte(byte) {
  26979. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  26980. return byte >> 6 === 0x02 ? -1 : -2;
  26981. }
  26982. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  26983. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  26984. // needed to complete the UTF-8 character (if applicable) are returned.
  26985. function utf8CheckIncomplete(self, buf, i) {
  26986. var j = buf.length - 1;
  26987. if (j < i) return 0;
  26988. var nb = utf8CheckByte(buf[j]);
  26989. if (nb >= 0) {
  26990. if (nb > 0) self.lastNeed = nb - 1;
  26991. return nb;
  26992. }
  26993. if (--j < i || nb === -2) return 0;
  26994. nb = utf8CheckByte(buf[j]);
  26995. if (nb >= 0) {
  26996. if (nb > 0) self.lastNeed = nb - 2;
  26997. return nb;
  26998. }
  26999. if (--j < i || nb === -2) return 0;
  27000. nb = utf8CheckByte(buf[j]);
  27001. if (nb >= 0) {
  27002. if (nb > 0) {
  27003. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  27004. }
  27005. return nb;
  27006. }
  27007. return 0;
  27008. }
  27009. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  27010. // needed or are available. If we see a non-continuation byte where we expect
  27011. // one, we "replace" the validated continuation bytes we've seen so far with
  27012. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  27013. // behavior. The continuation byte check is included three times in the case
  27014. // where all of the continuation bytes for a character exist in the same buffer.
  27015. // It is also done this way as a slight performance increase instead of using a
  27016. // loop.
  27017. function utf8CheckExtraBytes(self, buf, p) {
  27018. if ((buf[0] & 0xC0) !== 0x80) {
  27019. self.lastNeed = 0;
  27020. return '\ufffd';
  27021. }
  27022. if (self.lastNeed > 1 && buf.length > 1) {
  27023. if ((buf[1] & 0xC0) !== 0x80) {
  27024. self.lastNeed = 1;
  27025. return '\ufffd';
  27026. }
  27027. if (self.lastNeed > 2 && buf.length > 2) {
  27028. if ((buf[2] & 0xC0) !== 0x80) {
  27029. self.lastNeed = 2;
  27030. return '\ufffd';
  27031. }
  27032. }
  27033. }
  27034. }
  27035. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  27036. function utf8FillLast(buf) {
  27037. var p = this.lastTotal - this.lastNeed;
  27038. var r = utf8CheckExtraBytes(this, buf, p);
  27039. if (r !== undefined) return r;
  27040. if (this.lastNeed <= buf.length) {
  27041. buf.copy(this.lastChar, p, 0, this.lastNeed);
  27042. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  27043. }
  27044. buf.copy(this.lastChar, p, 0, buf.length);
  27045. this.lastNeed -= buf.length;
  27046. }
  27047. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  27048. // partial character, the character's bytes are buffered until the required
  27049. // number of bytes are available.
  27050. function utf8Text(buf, i) {
  27051. var total = utf8CheckIncomplete(this, buf, i);
  27052. if (!this.lastNeed) return buf.toString('utf8', i);
  27053. this.lastTotal = total;
  27054. var end = buf.length - (total - this.lastNeed);
  27055. buf.copy(this.lastChar, 0, end);
  27056. return buf.toString('utf8', i, end);
  27057. }
  27058. // For UTF-8, a replacement character is added when ending on a partial
  27059. // character.
  27060. function utf8End(buf) {
  27061. var r = buf && buf.length ? this.write(buf) : '';
  27062. if (this.lastNeed) return r + '\ufffd';
  27063. return r;
  27064. }
  27065. // UTF-16LE typically needs two bytes per character, but even if we have an even
  27066. // number of bytes available, we need to check if we end on a leading/high
  27067. // surrogate. In that case, we need to wait for the next two bytes in order to
  27068. // decode the last character properly.
  27069. function utf16Text(buf, i) {
  27070. if ((buf.length - i) % 2 === 0) {
  27071. var r = buf.toString('utf16le', i);
  27072. if (r) {
  27073. var c = r.charCodeAt(r.length - 1);
  27074. if (c >= 0xD800 && c <= 0xDBFF) {
  27075. this.lastNeed = 2;
  27076. this.lastTotal = 4;
  27077. this.lastChar[0] = buf[buf.length - 2];
  27078. this.lastChar[1] = buf[buf.length - 1];
  27079. return r.slice(0, -1);
  27080. }
  27081. }
  27082. return r;
  27083. }
  27084. this.lastNeed = 1;
  27085. this.lastTotal = 2;
  27086. this.lastChar[0] = buf[buf.length - 1];
  27087. return buf.toString('utf16le', i, buf.length - 1);
  27088. }
  27089. // For UTF-16LE we do not explicitly append special replacement characters if we
  27090. // end on a partial character, we simply let v8 handle that.
  27091. function utf16End(buf) {
  27092. var r = buf && buf.length ? this.write(buf) : '';
  27093. if (this.lastNeed) {
  27094. var end = this.lastTotal - this.lastNeed;
  27095. return r + this.lastChar.toString('utf16le', 0, end);
  27096. }
  27097. return r;
  27098. }
  27099. function base64Text(buf, i) {
  27100. var n = (buf.length - i) % 3;
  27101. if (n === 0) return buf.toString('base64', i);
  27102. this.lastNeed = 3 - n;
  27103. this.lastTotal = 3;
  27104. if (n === 1) {
  27105. this.lastChar[0] = buf[buf.length - 1];
  27106. } else {
  27107. this.lastChar[0] = buf[buf.length - 2];
  27108. this.lastChar[1] = buf[buf.length - 1];
  27109. }
  27110. return buf.toString('base64', i, buf.length - n);
  27111. }
  27112. function base64End(buf) {
  27113. var r = buf && buf.length ? this.write(buf) : '';
  27114. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  27115. return r;
  27116. }
  27117. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  27118. function simpleWrite(buf) {
  27119. return buf.toString(this.encoding);
  27120. }
  27121. function simpleEnd(buf) {
  27122. return buf && buf.length ? this.write(buf) : '';
  27123. }
  27124. /***/ }),
  27125. /***/ "./node_modules/util-deprecate/browser.js":
  27126. /*!************************************************!*\
  27127. !*** ./node_modules/util-deprecate/browser.js ***!
  27128. \************************************************/
  27129. /*! unknown exports (runtime-defined) */
  27130. /*! runtime requirements: module, __webpack_require__.g, __webpack_require__.* */
  27131. /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
  27132. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  27133. /**
  27134. * Module exports.
  27135. */
  27136. module.exports = deprecate;
  27137. /**
  27138. * Mark that a method should not be used.
  27139. * Returns a modified function which warns once by default.
  27140. *
  27141. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  27142. *
  27143. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  27144. * will throw an Error when invoked.
  27145. *
  27146. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  27147. * will invoke `console.trace()` instead of `console.error()`.
  27148. *
  27149. * @param {Function} fn - the function to deprecate
  27150. * @param {String} msg - the string to print to the console when `fn` is invoked
  27151. * @returns {Function} a new "deprecated" version of `fn`
  27152. * @api public
  27153. */
  27154. function deprecate (fn, msg) {
  27155. if (config('noDeprecation')) {
  27156. return fn;
  27157. }
  27158. var warned = false;
  27159. function deprecated() {
  27160. if (!warned) {
  27161. if (config('throwDeprecation')) {
  27162. throw new Error(msg);
  27163. } else if (config('traceDeprecation')) {
  27164. console.trace(msg);
  27165. } else {
  27166. console.warn(msg);
  27167. }
  27168. warned = true;
  27169. }
  27170. return fn.apply(this, arguments);
  27171. }
  27172. return deprecated;
  27173. }
  27174. /**
  27175. * Checks `localStorage` for boolean values for the given `name`.
  27176. *
  27177. * @param {String} name
  27178. * @returns {Boolean}
  27179. * @api private
  27180. */
  27181. function config (name) {
  27182. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  27183. try {
  27184. if (!__webpack_require__.g.localStorage) return false;
  27185. } catch (_) {
  27186. return false;
  27187. }
  27188. var val = __webpack_require__.g.localStorage[name];
  27189. if (null == val) return false;
  27190. return String(val).toLowerCase() === 'true';
  27191. }
  27192. /***/ }),
  27193. /***/ "?0bed":
  27194. /*!**********************!*\
  27195. !*** util (ignored) ***!
  27196. \**********************/
  27197. /*! unknown exports (runtime-defined) */
  27198. /*! runtime requirements: */
  27199. /***/ (() => {
  27200. /* (ignored) */
  27201. /***/ })
  27202. /******/ });
  27203. /************************************************************************/
  27204. /******/ // The module cache
  27205. /******/ var __webpack_module_cache__ = {};
  27206. /******/
  27207. /******/ // The require function
  27208. /******/ function __webpack_require__(moduleId) {
  27209. /******/ // Check if module is in cache
  27210. /******/ if(__webpack_module_cache__[moduleId]) {
  27211. /******/ return __webpack_module_cache__[moduleId].exports;
  27212. /******/ }
  27213. /******/ // Create a new module (and put it into the cache)
  27214. /******/ var module = __webpack_module_cache__[moduleId] = {
  27215. /******/ // no module.id needed
  27216. /******/ // no module.loaded needed
  27217. /******/ exports: {}
  27218. /******/ };
  27219. /******/
  27220. /******/ // Execute the module function
  27221. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  27222. /******/
  27223. /******/ // Return the exports of the module
  27224. /******/ return module.exports;
  27225. /******/ }
  27226. /******/
  27227. /************************************************************************/
  27228. /******/ /* webpack/runtime/compat get default export */
  27229. /******/ (() => {
  27230. /******/ // getDefaultExport function for compatibility with non-harmony modules
  27231. /******/ __webpack_require__.n = (module) => {
  27232. /******/ var getter = module && module.__esModule ?
  27233. /******/ () => module['default'] :
  27234. /******/ () => module;
  27235. /******/ __webpack_require__.d(getter, { a: getter });
  27236. /******/ return getter;
  27237. /******/ };
  27238. /******/ })();
  27239. /******/
  27240. /******/ /* webpack/runtime/define property getters */
  27241. /******/ (() => {
  27242. /******/ // define getter functions for harmony exports
  27243. /******/ __webpack_require__.d = (exports, definition) => {
  27244. /******/ for(var key in definition) {
  27245. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  27246. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  27247. /******/ }
  27248. /******/ }
  27249. /******/ };
  27250. /******/ })();
  27251. /******/
  27252. /******/ /* webpack/runtime/global */
  27253. /******/ (() => {
  27254. /******/ __webpack_require__.g = (function() {
  27255. /******/ if (typeof globalThis === 'object') return globalThis;
  27256. /******/ try {
  27257. /******/ return this || new Function('return this')();
  27258. /******/ } catch (e) {
  27259. /******/ if (typeof window === 'object') return window;
  27260. /******/ }
  27261. /******/ })();
  27262. /******/ })();
  27263. /******/
  27264. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  27265. /******/ (() => {
  27266. /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
  27267. /******/ })();
  27268. /******/
  27269. /******/ /* webpack/runtime/make namespace object */
  27270. /******/ (() => {
  27271. /******/ // define __esModule on exports
  27272. /******/ __webpack_require__.r = (exports) => {
  27273. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  27274. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  27275. /******/ }
  27276. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  27277. /******/ };
  27278. /******/ })();
  27279. /******/
  27280. /************************************************************************/
  27281. /******/ // module exports must be returned from runtime so entry inlining is disabled
  27282. /******/ // startup
  27283. /******/ // Load entry module and return exports
  27284. /******/ return __webpack_require__("./lib/index.browser.ts");
  27285. /******/ })()
  27286. ;