12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256 |
- var mediaStreamLibrary;mediaStreamLibrary =
- /******/ (() => { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ "./lib/components/aacdepay/index.ts":
- /*!******************************************!*\
- !*** ./lib/components/aacdepay/index.ts ***!
- \******************************************/
- /*! namespace exports */
- /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "AACDepay": () => /* binding */ AACDepay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/aacdepay/parser.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
- 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); }
- 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; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /*
- media: [{ type: 'video',
- port: '0',
- proto: 'RTP/AVP',
- fmt: '96',
- rtpmap: '96 H264/90000',
- fmtp: {
- format: '96',
- parameters: {
- 'packetization-mode': '1',
- 'profile-level-id': '4d0029',
- 'sprop-parameter-sets': 'Z00AKeKQDwBE/LgLcBAQGkHiRFQ=,aO48gA==',
- },
- },
- control: 'rtsp://hostname/media/media.amp/stream=0?audio=1&video=1',
- framerate: '25.000000',
- transform: [[1, 0, 0], [0, 0.75, 0], [0, 0, 1]] },
- { type: 'audio',
- port: '0',
- proto: 'RTP/AVP',
- fmt: '97',
- fmtp: {
- parameters: {
- bitrate: '32000',
- config: '1408',
- indexdeltalength: '3',
- indexlength: '3',
- mode: 'AAC-hbr',
- 'profile-level-id': '2',
- sizelength: '13',
- streamtype: '5'
- },
- format: '97'
- },
- rtpmap: '97 MPEG4-GENERIC/16000/1',
- control: 'rtsp://hostname/media/media.amp/stream=1?audio=1&video=1' }]
- */
- var AACDepay = /*#__PURE__*/function (_Tube) {
- _inherits(AACDepay, _Tube);
- var _super = _createSuper(AACDepay);
- function AACDepay() {
- _classCallCheck(this, AACDepay);
- var AACPayloadType;
- var hasHeader;
- var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_6__.createTransform)(function (msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
- // Check if there is an AAC track in the SDP
- var validMedia;
- var _iterator = _createForOfIteratorHelper(msg.sdp.media),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var media = _step.value;
- if (media.type === 'audio' && media.fmtp && media.fmtp.parameters && media.fmtp.parameters.mode === 'AAC-hbr' &&
- ((media.recvonly !== undefined && media.recvonly == true) || (media.control.indexOf('trackID=') != -1))) { // truen old rtsp
- validMedia = media;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- if (validMedia && validMedia.rtpmap !== undefined) {
- AACPayloadType = Number(validMedia.rtpmap.payloadType);
- var parameters = validMedia.fmtp.parameters; // Required
- var sizeLength = Number(parameters.sizelength) || 0;
- var indexLength = Number(parameters.indexlength) || 0;
- var indexDeltaLength = Number(parameters.indexdeltalength) || 0; // Optionals
- var CTSDeltaLength = Number(parameters.ctsdeltalength) || 0;
- var DTSDeltaLength = Number(parameters.dtsdeltalength) || 0;
- var RandomAccessIndication = Number(parameters.randomaccessindication) || 0;
- var StreamStateIndication = Number(parameters.streamstateindication) || 0;
- var AuxiliaryDataSizeLength = Number(parameters.auxiliarydatasizelength) || 0;
- hasHeader = sizeLength + Math.max(indexLength, indexDeltaLength) + CTSDeltaLength + DTSDeltaLength + RandomAccessIndication + StreamStateIndication + AuxiliaryDataSizeLength > 0;
- }
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_2__.payloadType)(msg.data) === AACPayloadType) {
- (0,_parser__WEBPACK_IMPORTED_MODULE_5__.parse)(msg, hasHeader, this.push.bind(this));
- callback();
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }); // outgoing will be defaulted to a PassThrough stream
- return _super.call(this, incoming);
- }
- return AACDepay;
- }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
- /***/ }),
- /***/ "./lib/components/aacdepay/parser.ts":
- /*!*******************************************!*\
- !*** ./lib/components/aacdepay/parser.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "parse": () => /* binding */ parse
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- ;
- /*
- From RFC 3640 https://tools.ietf.org/html/rfc3640
- 2.11. Global Structure of Payload Format
- The RTP payload following the RTP header, contains three octet-
- aligned data sections, of which the first two MAY be empty, see
- Figure 1.
- +---------+-----------+-----------+---------------+
- | RTP | AU Header | Auxiliary | Access Unit |
- | Header | Section | Section | Data Section |
- +---------+-----------+-----------+---------------+
- <----------RTP Packet Payload----------->
- Figure 1: Data sections within an RTP packet
- Note that auxilary section is empty for AAC-hbr
- 3.2.1. The AU Header Section
- When present, the AU Header Section consists of the AU-headers-length
- field, followed by a number of AU-headers, see Figure 2.
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
- |AU-headers-length|AU-header|AU-header| |AU-header|padding|
- | | (1) | (2) | | (n) | bits |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
- Figure 2: The AU Header Section
- */
- function parse(rtp, hasHeader, callback) {
- var buffer = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.payload)(rtp.data);
- var headerLength = 0;
- if (hasHeader) {
- var auHeaderLengthInBits = buffer.readUInt16BE(0);
- headerLength = 2 + (auHeaderLengthInBits + auHeaderLengthInBits % 8) / 8; // Add padding
- }
- var packet = {
- type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.ELEMENTARY,
- data: buffer.slice(headerLength),
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.payloadType)(rtp.data),
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_1__.timestamp)(rtp.data),
- ntpTimestamp: rtp.ntpTimestamp
- };
- callback(packet);
- }
- /***/ }),
- /***/ "./lib/components/auth/digest.ts":
- /*!***************************************!*\
- !*** ./lib/components/auth/digest.ts ***!
- \***************************************/
- /*! namespace exports */
- /*! export DigestAuth [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "DigestAuth": () => /* binding */ DigestAuth
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var md5_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! md5.js */ "./node_modules/md5.js/index.js");
- /* harmony import */ var md5_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(md5_js__WEBPACK_IMPORTED_MODULE_10__);
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- // https://tools.ietf.org/html/rfc2617#section-3.2.1
- var DigestAuth = function DigestAuth(params, username, password) {
- var _this = this;
- _classCallCheck(this, DigestAuth);
- _defineProperty(this, "realm", void 0);
- _defineProperty(this, "nonce", void 0);
- _defineProperty(this, "opaque", void 0);
- _defineProperty(this, "algorithm", void 0);
- _defineProperty(this, "qop", void 0);
- _defineProperty(this, "username", void 0);
- _defineProperty(this, "ha1Base", void 0);
- _defineProperty(this, "count", void 0);
- _defineProperty(this, "nc", function () {
- ++_this.count;
- return _this.count.toString(16).padStart(8, '0');
- });
- _defineProperty(this, "cnonce", function () {
- return new Array(4).fill(0).map(function () {
- return Math.floor(Math.random() * 256);
- }).map(function (n) {
- return n.toString(16);
- }).join('');
- });
- _defineProperty(this, "ha1", function (cnonce) {
- var ha1 = _this.ha1Base;
- if (_this.algorithm === 'md5-sess') {
- ha1 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(ha1, ":").concat(_this.nonce, ":").concat(cnonce)).digest('hex');
- }
- return ha1;
- });
- _defineProperty(this, "ha2", function (method, uri) {
- var body = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
- var ha2 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(method, ":").concat(uri)).digest('hex');
- if (_this.algorithm === 'md5-sess') {
- var hbody = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update(body).digest('hex');
- ha2 = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(method, ":").concat(uri, ":").concat(hbody)).digest('hex');
- }
- return ha2;
- });
- _defineProperty(this, "authorization", function () {
- var method = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'GET';
- var uri = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var body = arguments.length > 2 ? arguments[2] : undefined;
- // Increase count
- var nc = _this.nc();
- var cnonce = _this.cnonce();
- var ha1 = _this.ha1(cnonce);
- var ha2 = _this.ha2(method, uri, body);
- 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');
- var authorizationParams = [];
- authorizationParams.push("username=\"".concat(_this.username, "\""));
- authorizationParams.push("realm=\"".concat(_this.realm, "\""));
- authorizationParams.push("nonce=\"".concat(_this.nonce, "\""));
- authorizationParams.push("uri=\"".concat(uri, "\""));
- if (_this.qop !== undefined) {
- authorizationParams.push("qop=".concat(_this.qop));
- authorizationParams.push("nc=".concat(nc));
- authorizationParams.push("cnonce=\"".concat(cnonce, "\""));
- }
- authorizationParams.push("response=\"".concat(response, "\""));
- if (_this.opaque !== undefined) {
- authorizationParams.push("opaque=\"".concat(_this.opaque, "\""));
- }
- return "Digest ".concat(authorizationParams.join(', '));
- });
- var realm = params.get('realm');
- if (realm === undefined) {
- throw new Error('no realm in digest challenge');
- }
- this.realm = realm;
- this.ha1Base = new (md5_js__WEBPACK_IMPORTED_MODULE_10___default())().update("".concat(username, ":").concat(realm, ":").concat(password)).digest('hex');
- var nonce = params.get('nonce');
- if (nonce === undefined) {
- throw new Error('no nonce in digest challenge');
- }
- this.nonce = nonce;
- this.opaque = params.get('opaque');
- var algorithm = params.get('algorithm');
- if (algorithm !== undefined) {
- if (algorithm === 'md5') {
- this.algorithm = 'md5';
- } else if (algorithm === 'md5-sess') {
- this.algorithm = 'md5-sess';
- }
- } else {
- this.algorithm = 'md5';
- }
- var qop = params.get('qop');
- if (qop !== undefined) {
- var possibleQops = qop.split(',').map(function (qopType) {
- return qopType.trim();
- });
- if (possibleQops.some(function (qopValue) {
- return qopValue === 'auth';
- })) {
- this.qop = 'auth';
- } else if (possibleQops.some(function (qopValue) {
- return qopValue === 'auth-int';
- })) {
- this.qop = 'auth-int';
- }
- }
- this.count = 0;
- this.username = username;
- };
- /***/ }),
- /***/ "./lib/components/auth/index.ts":
- /*!**************************************!*\
- !*** ./lib/components/auth/index.ts ***!
- \**************************************/
- /*! namespace exports */
- /*! export Auth [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Auth": () => /* binding */ Auth
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
- /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
- /* harmony import */ var _digest__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./digest */ "./lib/components/auth/digest.ts");
- /* harmony import */ var _www_authenticate__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./www-authenticate */ "./lib/components/auth/www-authenticate.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var UNAUTHORIZED = 401;
- var DEFAULT_CONFIG = {
- username: 'root',
- password: 'pass'
- };
- /*
- * This component currently only supports Basic authentication
- * It should be placed between the RTSP parser and the RTSP Session.
- */
- var Auth = /*#__PURE__*/function (_Tube) {
- _inherits(Auth, _Tube);
- var _super = _createSuper(Auth);
- function Auth() {
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- _classCallCheck(this, Auth);
- var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_6__.merge)(DEFAULT_CONFIG, config),
- username = _merge.username,
- password = _merge.password;
- if (username === undefined || password === undefined) {
- throw new Error('need username and password');
- }
- var lastSentMessage;
- var authHeader;
- var outgoing = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_10__.createTransform)(function (msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.RTSP) {
- lastSentMessage = msg;
- if (authHeader && msg.headers) {
- msg.headers.Authorization = authHeader;
- }
- }
- callback(undefined, msg);
- });
- var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_10__.createTransform)(function (msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.RTSP && (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_7__.statusCode)(msg.data) === UNAUTHORIZED) {
- var headers = msg.data.toString().split('\n');
- var wwwAuth = headers.find(function (header) {
- return /WWW-Auth/i.test(header);
- });
- if (wwwAuth === undefined) {
- throw new Error('cannot find WWW-Authenticate header');
- }
- var challenge = (0,_www_authenticate__WEBPACK_IMPORTED_MODULE_12__.parseWWWAuthenticate)(wwwAuth);
- if (challenge.type === 'basic') {
- authHeader = 'Basic ' + Buffer.from(username + ':' + password).toString('base64');
- } else if (challenge.type === 'digest') {
- var digest = new _digest__WEBPACK_IMPORTED_MODULE_11__.DigestAuth(challenge.params, username, password);
- authHeader = digest.authorization(lastSentMessage.method, lastSentMessage.uri);
- } else {
- // unkown authentication type, give up
- return;
- } // Retry last RTSP message
- // Write will fire our outgoing transform function.
- outgoing.write(lastSentMessage, function () {
- return callback();
- });
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- });
- return _super.call(this, incoming, outgoing);
- }
- return Auth;
- }(_component__WEBPACK_IMPORTED_MODULE_8__.Tube);
- /***/ }),
- /***/ "./lib/components/auth/www-authenticate.ts":
- /*!*************************************************!*\
- !*** ./lib/components/auth/www-authenticate.ts ***!
- \*************************************************/
- /*! namespace exports */
- /*! export parseWWWAuthenticate [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "parseWWWAuthenticate": () => /* binding */ parseWWWAuthenticate
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
- 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; }
- function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
- var parseWWWAuthenticate = function parseWWWAuthenticate(header) {
- var _header$split = header.split(' '),
- _header$split2 = _toArray(_header$split),
- type = _header$split2[1],
- challenge = _header$split2.slice(2);
- var pairs = [];
- var re = /\s*([^=]+)=\"([^\"]*)\",?/gm;
- var match;
- do {
- match = re.exec(challenge.join(' '));
- if (match !== null) {
- var _match = match,
- _match2 = _slicedToArray(_match, 3),
- key = _match2[1],
- value = _match2[2];
- pairs.push([key, value]);
- }
- } while (match !== null);
- var params = new Map(pairs);
- return {
- type: type.toLowerCase(),
- params: params
- };
- };
- /***/ }),
- /***/ "./lib/components/basicdepay/index.ts":
- /*!********************************************!*\
- !*** ./lib/components/basicdepay/index.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BasicDepay": () => /* binding */ BasicDepay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var BasicDepay = /*#__PURE__*/function (_Tube) {
- _inherits(BasicDepay, _Tube);
- var _super = _createSuper(BasicDepay);
- function BasicDepay(rtpPayloadType) {
- _classCallCheck(this, BasicDepay);
- if (rtpPayloadType === undefined) {
- throw new Error('you must supply a payload type to BasicDepayComponent');
- }
- var buffer = Buffer.alloc(0);
- var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_5__.createTransform)(function (msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data) === rtpPayloadType) {
- var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payload)(msg.data);
- buffer = Buffer.concat([buffer, rtpPayload]);
- if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.marker)(msg.data)) {
- if (buffer.length > 0) {
- this.push({
- data: buffer,
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.timestamp)(msg.data),
- ntpTimestamp: msg.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data),
- type: _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.ELEMENTARY
- });
- }
- buffer = Buffer.alloc(0);
- }
- callback();
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }); // outgoing will be defaulted to a PassThrough stream
- return _super.call(this, incoming);
- }
- return BasicDepay;
- }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
- /***/ }),
- /***/ "./lib/components/canvas/index.ts":
- /*!****************************************!*\
- !*** ./lib/components/canvas/index.ts ***!
- \****************************************/
- /*! namespace exports */
- /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "CanvasSink": () => /* binding */ CanvasSink
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _utils_clock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/clock */ "./lib/utils/clock.ts");
- /* harmony import */ var _utils_scheduler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/scheduler */ "./lib/utils/scheduler.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_10__);
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var resetInfo = function resetInfo(info) {
- info.bitrate = 0;
- info.framerate = 0;
- info.renderedFrames = 0;
- };
- var generateUpdateInfo = function generateUpdateInfo(clockrate) {
- var cumulativeByteLength = 0;
- var cumulativeDuration = 0;
- var cumulativeFrames = 0;
- return function (info, _ref) {
- var byteLength = _ref.byteLength,
- duration = _ref.duration;
- cumulativeByteLength += byteLength;
- cumulativeDuration += duration;
- cumulativeFrames++; // Update the cumulative number size (bytes) and duration (ticks), and if
- // the duration exceeds the clockrate (meaning longer than 1 second of info),
- // then compute a new bitrate and reset cumulative size and duration.
- if (cumulativeDuration >= clockrate) {
- var bits = 8 * cumulativeByteLength;
- var frames = cumulativeFrames;
- var seconds = cumulativeDuration / clockrate;
- info.bitrate = bits / seconds;
- info.framerate = frames / seconds;
- cumulativeByteLength = 0;
- cumulativeDuration = 0;
- cumulativeFrames = 0;
- }
- };
- };
- /**
- * Canvas component
- *
- * Draws an incoming stream of JPEG images onto a <canvas> element.
- * The RTP timestamps are used to schedule the drawing of the images.
- * An instance can be used as a 'clock' itself, e.g. with a scheduler.
- *
- * The following handlers can be set on a component instance:
- * - onCanplay: will be called when the first frame is ready and
- * the correct frame size has been set on the canvas.
- * At this point, the clock can be started by calling
- * `.play()` method on the component.
- * - onSync: will be called when the presentation time offset is
- * known, with the latter as argument (in UNIX milliseconds)
- *
- * @class CanvasComponent
- * @extends {Component}
- */
- var CanvasSink = /*#__PURE__*/function (_Sink) {
- _inherits(CanvasSink, _Sink);
- var _super = _createSuper(CanvasSink);
- /**
- * Creates an instance of CanvasComponent.
- * @param { HTMLCanvasElement } el - An HTML < canvas > element
- * @memberof CanvasComponent
- */
- function CanvasSink(el) {
- var _this;
- _classCallCheck(this, CanvasSink);
- if (el === undefined) {
- throw new Error('canvas element argument missing');
- }
- var firstTimestamp = 0;
- var lastTimestamp = 0;
- var clockrate = 0;
- var info = {
- bitrate: 0,
- framerate: 0,
- renderedFrames: 0
- };
- var updateInfo; // The createImageBitmap function is supported in Chrome and Firefox
- // (https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap)
- // Note: drawImage can also be used instead of transferFromImageBitmap, but it caused
- // very large memory use in Chrome (goes up to ~2-3GB, then drops again).
- // Do do not call el.getContext twice, safari returns null for second call
- var ctx = null;
- if (window.createImageBitmap !== undefined) {
- ctx = el.getContext('bitmaprenderer');
- }
- if (ctx === null) {
- ctx = el.getContext('2d');
- } // Set up the drawing callback to be used by the scheduler,
- // it receives a blob of a JPEG image.
- var drawImageBlob;
- if (ctx === null) {
- drawImageBlob = function drawImageBlob() {
- /** NOOP */
- };
- } else if ('transferFromImageBitmap' in ctx) {
- var ctxBitmaprenderer = ctx;
- drawImageBlob = function drawImageBlob(_ref2) {
- var blob = _ref2.blob;
- info.renderedFrames++;
- window.createImageBitmap(blob).then(function (imageBitmap) {
- ctxBitmaprenderer.transferFromImageBitmap(imageBitmap);
- }).catch(function () {
- /** ignore */
- });
- };
- } else {
- var ctx2d = ctx;
- var img = new Image();
- img.onload = function () {
- ctx2d.drawImage(img, 0, 0);
- };
- drawImageBlob = function drawImageBlob(_ref3) {
- var blob = _ref3.blob;
- info.renderedFrames++;
- var url = window.URL.createObjectURL(blob);
- img.src = url;
- };
- } // Because we don't have an element that plays video for us,
- // we have to use our own clock. The clock can be started/stopped
- // with the `play` and `pause` methods, and has a `currentTime`
- // property that keeps track of the presentation time.
- // The scheduler will use the clock (instead of e.g. a video element)
- // to determine when to display the JPEG images.
- var clock = new _utils_clock__WEBPACK_IMPORTED_MODULE_7__.Clock();
- var scheduler = new _utils_scheduler__WEBPACK_IMPORTED_MODULE_8__.Scheduler(clock, drawImageBlob);
- var ntpPresentationTime = 0;
- var onCanplay = function onCanplay() {
- _this.onCanplay && _this.onCanplay();
- };
- var onSync = function onSync(ntpPresentationTime) {
- _this.onSync && _this.onSync(ntpPresentationTime);
- }; // Set up an incoming stream and attach it to the image drawing function.
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_10__.Writable({
- objectMode: true,
- write: function write(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.SDP) {
- // start of a new movie, reset timers
- clock.reset();
- scheduler.reset(); // Initialize first timestamp and clockrate
- firstTimestamp = 0;
- var jpegMedia = msg.sdp.media.find(function (media) {
- return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'JPEG';
- });
- if (jpegMedia !== undefined && jpegMedia.rtpmap !== undefined) {
- clockrate = jpegMedia.rtpmap.clockrate; // Initialize the framerate/bitrate data
- resetInfo(info);
- updateInfo = generateUpdateInfo(clockrate);
- }
- callback();
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_9__.MessageType.JPEG) {
- var timestamp = msg.timestamp,
- ntpTimestamp = msg.ntpTimestamp; // If first frame, store its timestamp, initialize
- // the scheduler with 0 and start the clock.
- // Also set the proper size on the canvas.
- if (!firstTimestamp) {
- // Initialize timing
- firstTimestamp = timestamp;
- lastTimestamp = timestamp; // Initialize frame size
- var _msg$framesize = msg.framesize,
- width = _msg$framesize.width,
- height = _msg$framesize.height;
- el.width = width;
- el.height = height; // Notify that we can play at this point
- scheduler.init(0);
- } // Compute millisecond presentation time (with offset 0
- // as we initialized the scheduler with 0).
- var presentationTime = 1000 * (timestamp - firstTimestamp) / clockrate;
- var blob = new window.Blob([msg.data], {
- type: 'image/jpeg'
- }); // If the actual UTC time of the start of presentation isn't known yet,
- // and we do have an ntpTimestamp, then compute it here and notify.
- if (!ntpPresentationTime && ntpTimestamp) {
- ntpPresentationTime = ntpTimestamp - presentationTime;
- onSync(ntpPresentationTime);
- }
- scheduler.run({
- ntpTimestamp: presentationTime,
- blob: blob
- }); // Notify that we can now start the clock.
- if (timestamp === firstTimestamp) {
- onCanplay();
- } // Update bitrate/framerate
- updateInfo(info, {
- byteLength: msg.data.length,
- duration: timestamp - lastTimestamp
- });
- lastTimestamp = timestamp;
- callback();
- } else {
- callback();
- }
- }
- }); // Set up an outgoing stream.
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_10__.Readable({
- objectMode: true,
- read: function read() {//
- }
- }); // When an error is sent on the outgoing stream, whine about it.
- outgoing.on('error', function () {
- console.warn('outgoing stream broke somewhere');
- });
- _this = _super.call(this, incoming, outgoing);
- _defineProperty(_assertThisInitialized(_this), "onCanplay", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
- _defineProperty(_assertThisInitialized(_this), "_clock", void 0);
- _defineProperty(_assertThisInitialized(_this), "_scheduler", void 0);
- _defineProperty(_assertThisInitialized(_this), "_info", void 0);
- _this._clock = clock;
- _this._scheduler = scheduler;
- _this._info = info;
- _this.onCanplay = undefined;
- _this.onSync = undefined;
- return _this;
- }
- /**
- * Retrieve the current presentation time (seconds)
- *
- * @readonly
- * @memberof CanvasComponent
- */
- _createClass(CanvasSink, [{
- key: "currentTime",
- get: function get() {
- return this._clock.currentTime;
- }
- /**
- * Pause the presentation.
- *
- * @memberof CanvasComponent
- */
- }, {
- key: "pause",
- value: function pause() {
- this._scheduler.suspend();
- this._clock.pause();
- }
- /**
- * Start the presentation.
- *
- * @memberof CanvasComponent
- */
- }, {
- key: "play",
- value: function play() {
- this._clock.play();
- this._scheduler.resume();
- }
- }, {
- key: "bitrate",
- get: function get() {
- return this._info.bitrate;
- }
- }, {
- key: "framerate",
- get: function get() {
- return this._info.framerate;
- }
- }]);
- return CanvasSink;
- }(_component__WEBPACK_IMPORTED_MODULE_6__.Sink);
- /***/ }),
- /***/ "./lib/components/component.ts":
- /*!*************************************!*\
- !*** ./lib/components/component.ts ***!
- \*************************************/
- /*! namespace exports */
- /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export Source [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Source": () => /* binding */ Source,
- /* harmony export */ "Tube": () => /* binding */ Tube,
- /* harmony export */ "Sink": () => /* binding */ Sink
- /* harmony export */ });
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/stream-factory */ "./lib/components/helpers/stream-factory.ts");
- 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); }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- var AbstractComponent = function AbstractComponent() {
- _classCallCheck(this, AbstractComponent);
- _defineProperty(this, "incoming", void 0);
- _defineProperty(this, "outgoing", void 0);
- _defineProperty(this, "next", void 0);
- _defineProperty(this, "prev", void 0);
- _defineProperty(this, "_incomingErrorHandler", void 0);
- _defineProperty(this, "_outgoingErrorHandler", void 0);
- };
- var Source = /*#__PURE__*/function (_AbstractComponent) {
- _inherits(Source, _AbstractComponent);
- var _super = _createSuper(Source);
- function Source() {
- var _this;
- var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.Readable({
- objectMode: true
- });
- var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.Writable({
- objectMode: true
- });
- _classCallCheck(this, Source);
- _this = _super.call(this);
- _defineProperty(_assertThisInitialized(_this), "incoming", void 0);
- _defineProperty(_assertThisInitialized(_this), "outgoing", void 0);
- _defineProperty(_assertThisInitialized(_this), "next", void 0);
- _defineProperty(_assertThisInitialized(_this), "prev", void 0);
- _this.incoming = incoming;
- _this.outgoing = outgoing;
- _this.next = null;
- _this.prev = null;
- return _this;
- }
- /**
- * Attach another component so the the 'down' stream flows into the
- * next component 'down' stream and the 'up' stream of the other component
- * flows into the 'up' stream of this component. This is what establishes the
- * meaning of 'up' and 'down'.
- * @param {Component} next - The component to connect.
- * @return {Component} - A reference to the connected component.
- *
- * -------------- pipe --------------
- * <- | outgoing | <- | outgoing | <-
- * | this | | next |
- * -> | incoming | -> | incoming | ->
- * -------------- pipe --------------
- */
- _createClass(Source, [{
- key: "connect",
- value: function connect(next) {
- var _this2 = this;
- // If the next component is not there, we want to return this component
- // so that it is possible to continue to chain. If there is a next component,
- // but this component already has a next one, or the next one already has a
- // previous component, throw an error.
- if (next === null) {
- return this;
- } else if (this.next !== null || next.prev !== null) {
- throw new Error('connection failed: component(s) already connected');
- }
- if (!this.incoming.readable || !this.outgoing.writable) {
- throw new Error('connection failed: this component not compatible');
- }
- if (!next.incoming.writable || !next.outgoing.readable) {
- throw new Error('connection failed: next component not compatible');
- }
- try {
- this.incoming.pipe(next.incoming);
- next.outgoing.pipe(this.outgoing);
- } catch (e) {
- throw new Error("connection failed: ".concat(e.message));
- }
- /**
- * Propagate errors back upstream, this assures an error will be propagated
- * to all previous streams (but not further than any endpoints). What happens
- * when an error is emitted on a stream is up to the stream's implementation.
- */
- var incomingErrorHandler = function incomingErrorHandler(err) {
- _this2.incoming.emit('error', err);
- };
- next.incoming.on('error', incomingErrorHandler);
- var outgoingErrorHandler = function outgoingErrorHandler(err) {
- next.outgoing.emit('error', err);
- };
- this.outgoing.on('error', outgoingErrorHandler); // Keep a bidirectional linked list of components by storing
- // a reference to the next component and the listeners that we set up.
- this.next = next;
- next.prev = this;
- this._incomingErrorHandler = incomingErrorHandler;
- this._outgoingErrorHandler = outgoingErrorHandler;
- return next;
- }
- /**
- * Disconnect the next connected component. When there is no next component
- * the function will just do nothing.
- * @return {Component} - A reference to this component.
- */
- }, {
- key: "disconnect",
- value: function disconnect() {
- var next = this.next;
- if (next !== null) {
- this.incoming.unpipe(next.incoming);
- next.outgoing.unpipe(this.outgoing);
- if (typeof this._incomingErrorHandler !== 'undefined') {
- next.incoming.removeListener('error', this._incomingErrorHandler);
- }
- if (typeof this._outgoingErrorHandler !== 'undefined') {
- this.outgoing.removeListener('error', this._outgoingErrorHandler);
- }
- this.next = null;
- next.prev = null;
- delete this._incomingErrorHandler;
- delete this._outgoingErrorHandler;
- }
- return this;
- }
- }], [{
- key: "fromMessages",
- value:
- /**
- * Set up a component that emits incoming messages.
- * @param {Array} messages List of objects (with data property) to emit.
- * @return {Component}
- */
- function fromMessages(messages) {
- var component = new Source(_helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.producer(messages), _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.consumer());
- return component;
- }
- }]);
- return Source;
- }(AbstractComponent);
- var Tube = /*#__PURE__*/function (_Source) {
- _inherits(Tube, _Source);
- var _super2 = _createSuper(Tube);
- function Tube() {
- var _this3;
- var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough({
- objectMode: true
- });
- var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough({
- objectMode: true
- });
- _classCallCheck(this, Tube);
- _this3 = _super2.call(this, incoming, outgoing);
- _defineProperty(_assertThisInitialized(_this3), "incoming", void 0);
- _defineProperty(_assertThisInitialized(_this3), "outgoing", void 0);
- _this3.incoming = incoming;
- _this3.outgoing = outgoing;
- return _this3;
- }
- _createClass(Tube, null, [{
- key: "fromHandlers",
- value: function fromHandlers(fnIncoming, fnOutgoing) {
- var incomingStream = fnIncoming ? _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.peeker(fnIncoming) : undefined;
- var outgoingStream = fnOutgoing ? _helpers_stream_factory__WEBPACK_IMPORTED_MODULE_1__.default.peeker(fnOutgoing) : undefined;
- return new Tube(incomingStream, outgoingStream);
- }
- }]);
- return Tube;
- }(Source);
- var Sink = /*#__PURE__*/function (_AbstractComponent2) {
- _inherits(Sink, _AbstractComponent2);
- var _super3 = _createSuper(Sink);
- function Sink() {
- var _this4;
- var incoming = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new stream__WEBPACK_IMPORTED_MODULE_0__.Writable({
- objectMode: true
- });
- var outgoing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new stream__WEBPACK_IMPORTED_MODULE_0__.Readable({
- objectMode: true
- });
- _classCallCheck(this, Sink);
- _this4 = _super3.call(this);
- _defineProperty(_assertThisInitialized(_this4), "incoming", void 0);
- _defineProperty(_assertThisInitialized(_this4), "outgoing", void 0);
- _defineProperty(_assertThisInitialized(_this4), "next", void 0);
- _defineProperty(_assertThisInitialized(_this4), "prev", void 0);
- _this4.incoming = incoming;
- _this4.outgoing = outgoing;
- _this4.next = null;
- _this4.prev = null;
- return _this4;
- }
- _createClass(Sink, [{
- key: "connect",
- value: function connect() {
- throw new Error('connection failed: attempting to connect after a sink');
- }
- }, {
- key: "disconnect",
- value: function disconnect() {
- return this;
- }
- }], [{
- key: "fromHandler",
- value:
- /**
- * Set up a component that swallows incoming data (calling fn on it).
- * To print data, you would use fn = console.log.
- * @param {Function} fn The callback to use for the incoming data.
- * @return {Component}
- */
- function fromHandler(fn) {
- 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.
- component.incoming.on('finish', function () {
- component.outgoing.push(null);
- });
- return component;
- }
- }]);
- return Sink;
- }(AbstractComponent);
- /***/ }),
- /***/ "./lib/components/dataCatcherDepay/index.ts":
- /*!**************************************************!*\
- !*** ./lib/components/dataCatcherDepay/index.ts ***!
- \**************************************************/
- /*! namespace exports */
- /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "dataCatcherDepay": () => /* binding */ dataCatcherDepay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var dataCatcherDepay = /*#__PURE__*/function (_Tube) {
- _inherits(dataCatcherDepay, _Tube);
- var _super = _createSuper(dataCatcherDepay);
- function dataCatcherDepay(rtpPayloadType) {
- var _this;
- _classCallCheck(this, dataCatcherDepay);
- if (rtpPayloadType === undefined) {
- throw new Error('you must supply a payload type to BasicDepayComponent');
- }
- var onDataCallback = function onDataCallback(msg) {
- _this.onDataCallback && _this.onDataCallback(msg);
- };
- var buffer = Buffer.alloc(0);
- var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_4__.createTransform)(function (msg, encoding, callback) {
- var ptype = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(msg.data);
- if ( // msg.type === MessageType.RTP &&
- ptype === rtpPayloadType || rtpPayloadType == -1) {
- var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(msg.data);
- buffer = Buffer.concat([buffer, rtpPayload]);
- /* var mrkr = marker(msg.data);
- if (mrkr) {
- */
- if (buffer.length > 0) {
- var catchmsg = {
- data: buffer,
- rawdata: msg.data,
- header: msg.header,
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(msg.data),
- ntpTimestamp: msg.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(msg.data),
- type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.UNKNOWN
- };
- onDataCallback && onDataCallback(catchmsg);
- }
- buffer = Buffer.alloc(0);
- /* }
- */
- callback(undefined, msg);
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }); // outgoing will be defaulted to a PassThrough stream
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- return _this;
- }
- return dataCatcherDepay;
- }(_component__WEBPACK_IMPORTED_MODULE_1__.Tube);
- /***/ }),
- /***/ "./lib/components/g711toPCM/index.ts":
- /*!*******************************************!*\
- !*** ./lib/components/g711toPCM/index.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "g711toPCM": () => /* binding */ g711toPCM
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../messageStreams */ "./lib/components/messageStreams.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var g711toPCM = /*#__PURE__*/function (_Tube) {
- _inherits(g711toPCM, _Tube);
- var _super = _createSuper(g711toPCM);
- function g711toPCM() {
- var _this;
- _classCallCheck(this, g711toPCM);
- var rtpPayloadType = 0; //pcmu aka ulaw aka g711
- var onDataCallback = function onDataCallback(msg) {
- _this.onDataCallback && _this.onDataCallback(msg);
- };
- function mulaw_decode(num) {
- var MULAW_BIAS = 33;
- var sign = 0;
- var position = 0;
- var decoded = 0;
- num = ~num;
- if (num & 0x80) {
- num &= ~(1 << 7);
- sign = -1;
- }
- position = ((num & 0xf0) >> 4) + 5;
- decoded = (1 << position | (num & 0x0F) << position - 4 | 1 << position - 5) - MULAW_BIAS;
- return sign == 0 ? decoded : -decoded;
- }
- var buffer = Buffer.alloc(0);
- var incoming = (0,_messageStreams__WEBPACK_IMPORTED_MODULE_31__.createTransform)(function (msg, encoding, callback) {
- var ptype = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payloadType)(msg.data);
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.SDP) {
- var pcmu = msg.sdp.media.find(function (media) {
- return media.type === 'audio' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'PCMU';
- });
- if (pcmu !== undefined && pcmu.rtpmap !== undefined) {
- rtpPayloadType = pcmu.rtpmap.payloadType;
- pcmu.rtpmap.encodingName = 'PCM';
- }
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.RTP && ptype === rtpPayloadType) {
- var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payload)(msg.data);
- buffer = Buffer.concat([buffer, rtpPayload]);
- if (buffer.length > 0) {
- var decodedBuffer = new Int16Array(buffer.length);
- for (var i = 0; i < buffer.length; i++) {
- decodedBuffer[i] = mulaw_decode(buffer[i]);
- }
- var catchmsg = {
- data: decodedBuffer,
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.timestamp)(msg.data),
- ntpTimestamp: msg.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_30__.payloadType)(msg.data),
- type: _message__WEBPACK_IMPORTED_MODULE_29__.MessageType.PCM
- };
- onDataCallback && onDataCallback(catchmsg); //send decoded data
- callback(undefined, catchmsg);
- decodedBuffer = new Int16Array(0);
- } else {
- //send as is
- callback(undefined, msg);
- }
- buffer = Buffer.alloc(0);
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }); // outgoing will be defaulted to a PassThrough stream
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- return _this;
- }
- return g711toPCM;
- }(_component__WEBPACK_IMPORTED_MODULE_28__.Tube);
- /***/ }),
- /***/ "./lib/components/h264depay/index.ts":
- /*!*******************************************!*\
- !*** ./lib/components/h264depay/index.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "H264Depay": () => /* binding */ H264Depay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/h264depay/parser.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var H264Depay = /*#__PURE__*/function (_Tube) {
- _inherits(H264Depay, _Tube);
- var _super = _createSuper(H264Depay);
- function H264Depay() {
- var _this;
- _classCallCheck(this, H264Depay);
- var h264PayloadType;
- var idrFound = false;
- var h264DepayParser = new _parser__WEBPACK_IMPORTED_MODULE_5__.H264DepayParser();
- var onDataCallback = function onDataCallback(msg) {
- _this.onDataCallback && _this.onDataCallback(msg);
- }; // Incoming
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_2__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- // Get correct payload types from sdp to identify video and audio
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.SDP) {
- var h264Media = msg.sdp.media.find(function (media) {
- return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'H264';
- });
- if (h264Media !== undefined && h264Media.rtpmap !== undefined) {
- h264PayloadType = h264Media.rtpmap.payloadType;
- }
- callback(undefined, msg); // Pass on the original SDP message
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_4__.payloadType)(msg.data) === h264PayloadType) {
- var h264Message = h264DepayParser.parse(msg); // Skip if not a full H264 frame, or when there hasn't been an I-frame yet
- if (h264Message === null || !idrFound && h264Message.nalType !== _parser__WEBPACK_IMPORTED_MODULE_5__.NAL_TYPES.IDR_PICTURE) {
- callback();
- return;
- }
- idrFound = true;
- onDataCallback && onDataCallback(h264Message);
- callback(undefined, h264Message);
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- }); // outgoing will be defaulted to a PassThrough stream
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- return _this;
- }
- return H264Depay;
- }(_component__WEBPACK_IMPORTED_MODULE_1__.Tube);
- /***/ }),
- /***/ "./lib/components/h264depay/parser.ts":
- /*!********************************************!*\
- !*** ./lib/components/h264depay/parser.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export H264DepayParser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export NAL_TYPES [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "NAL_TYPES": () => /* binding */ NAL_TYPES,
- /* harmony export */ "H264DepayParser": () => /* binding */ H264DepayParser
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_4__);
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- var NAL_TYPES;
- /*
- First byte in payload (rtp payload header):
- +---------------+
- |0|1|2|3|4|5|6|7|
- +-+-+-+-+-+-+-+-+
- |F|NRI| Type |
- +---------------+
- 2nd byte in payload: FU header (if type in first byte is 28)
- +---------------+
- |0|1|2|3|4|5|6|7|
- +-+-+-+-+-+-+-+-+
- |S|E|R| Type | S = start, E = end
- +---------------+
- */
- (function (NAL_TYPES) {
- NAL_TYPES[NAL_TYPES["UNSPECIFIED"] = 0] = "UNSPECIFIED";
- NAL_TYPES[NAL_TYPES["NON_IDR_PICTURE"] = 1] = "NON_IDR_PICTURE";
- NAL_TYPES[NAL_TYPES["IDR_PICTURE"] = 5] = "IDR_PICTURE";
- NAL_TYPES[NAL_TYPES["SPS"] = 7] = "SPS";
- NAL_TYPES[NAL_TYPES["PPS"] = 8] = "PPS";
- })(NAL_TYPES || (NAL_TYPES = {}));
- var h264Debug = debug__WEBPACK_IMPORTED_MODULE_4___default()('msl:h264depay');
- var H264DepayParser = /*#__PURE__*/function () {
- function H264DepayParser() {
- _classCallCheck(this, H264DepayParser);
- _defineProperty(this, "_buffer", void 0);
- this._buffer = Buffer.alloc(0);
- }
- _createClass(H264DepayParser, [{
- key: "parse",
- value: function parse(rtp) {
- var rtpPayload = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(rtp.data);
- var type = rtpPayload[0] & 0x1f;
- if (type === 28) {
- /* FU-A NALU */
- var fuIndicator = rtpPayload[0];
- var fuHeader = rtpPayload[1];
- var startBit = !!(fuHeader >> 7);
- var nalType = fuHeader & 0x1f;
- var nal = fuIndicator & 0xe0 | nalType;
- var stopBit = fuHeader & 64;
- if (startBit) {
- this._buffer = Buffer.concat([Buffer.from([0, 0, 0, 0, nal]), rtpPayload.slice(2)]);
- return null;
- } else if (stopBit) {
- /* receieved end bit */
- var h264frame = Buffer.concat([this._buffer, rtpPayload.slice(2)]);
- h264frame.writeUInt32BE(h264frame.length - 4, 0);
- var msg = {
- data: h264frame,
- type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.H264,
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(rtp.data),
- ntpTimestamp: rtp.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(rtp.data),
- nalType: nalType
- };
- this._buffer = Buffer.alloc(0);
- return msg;
- } else {
- // Put the received data on the buffer and cut the header bytes
- this._buffer = Buffer.concat([this._buffer, rtpPayload.slice(2)]);
- return null;
- }
- } else if ((type === NAL_TYPES.NON_IDR_PICTURE || type === NAL_TYPES.IDR_PICTURE) && this._buffer.length === 0) {
- /* Single NALU */
- var _h264frame = Buffer.concat([Buffer.from([0, 0, 0, 0]), rtpPayload]);
- _h264frame.writeUInt32BE(_h264frame.length - 4, 0);
- var _msg = {
- data: _h264frame,
- type: _message__WEBPACK_IMPORTED_MODULE_2__.MessageType.H264,
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.timestamp)(rtp.data),
- ntpTimestamp: rtp.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payloadType)(rtp.data),
- nalType: type
- };
- this._buffer = Buffer.alloc(0);
- return _msg;
- } else {
- h264Debug("H264depayComponent can only extract types 1,5 and 28, got ".concat(type));
- this._buffer = Buffer.alloc(0);
- return null;
- }
- }
- }]);
- return H264DepayParser;
- }();
- /***/ }),
- /***/ "./lib/components/helpers/stream-factory.ts":
- /*!**************************************************!*\
- !*** ./lib/components/helpers/stream-factory.ts ***!
- \**************************************************/
- /*! namespace exports */
- /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => /* binding */ StreamFactory
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var StreamFactory = /*#__PURE__*/function () {
- function StreamFactory() {
- _classCallCheck(this, StreamFactory);
- }
- _createClass(StreamFactory, null, [{
- key: "consumer",
- value:
- /**
- * Creates a writable stream that sends all messages written to the stream
- * to a callback function and then considers it written.
- * @param {Function} fn The callback to be invoked on the message
- */
- function consumer() {
- var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
- /* */
- };
- return new stream__WEBPACK_IMPORTED_MODULE_3__.Writable({
- objectMode: true,
- write: function write(msg, encoding, callback) {
- fn(msg);
- callback();
- }
- });
- }
- }, {
- key: "peeker",
- value: function peeker(fn) {
- if (typeof fn !== 'function') {
- throw new Error('you must supply a function');
- }
- return new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- fn(msg);
- callback(undefined, msg);
- }
- });
- }
- /**
- * Creates a readable stream that sends a message for each element of an array.
- * @param {Array} arr The array with elements to be turned into a stream.
- */
- }, {
- key: "producer",
- value: function producer(messages) {
- var counter = 0;
- return new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({
- objectMode: true,
- read: function read() {
- if (messages !== undefined) {
- if (counter < messages.length) {
- this.push(messages[counter++]);
- } else {
- // End the stream
- this.push(null);
- }
- }
- }
- });
- }
- }, {
- key: "recorder",
- value: function recorder(type, fileStream) {
- return new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- var timestamp = Date.now(); // Replace binary data with base64 string
- var message = Object.assign({}, msg, {
- data: msg.data.toString('base64')
- });
- fileStream.write(JSON.stringify({
- type: type,
- timestamp: timestamp,
- message: message
- }, null, 2));
- fileStream.write(',\n');
- callback(undefined, msg);
- }
- });
- }
- /**
- * Yield binary messages from JSON packet array until depleted.
- * @return {Generator} Returns a JSON packet iterator.
- */
- }, {
- key: "replayer",
- value: function replayer(packets) {
- var packetCounter = 0;
- var lastTimestamp = packets[0].timestamp;
- return new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({
- objectMode: true,
- read: function read() {
- var packet = packets[packetCounter++];
- if (packet) {
- var type = packet.type,
- timestamp = packet.timestamp,
- message = packet.message;
- var delay = timestamp - lastTimestamp;
- lastTimestamp = timestamp;
- if (message) {
- var data = message.data ? Buffer.from(message.data, 'base64') : Buffer.alloc(0);
- var _msg = Object.assign({}, message, {
- data: data
- });
- this.push({
- type: type,
- delay: delay,
- msg: _msg
- });
- } else {
- this.push({
- type: type,
- delay: delay,
- msg: null
- });
- }
- } else {
- this.push(null);
- }
- }
- });
- }
- }]);
- return StreamFactory;
- }();
- /***/ }),
- /***/ "./lib/components/http-source/index.ts":
- /*!*********************************************!*\
- !*** ./lib/components/http-source/index.ts ***!
- \*********************************************/
- /*! namespace exports */
- /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "HttpSource": () => /* binding */ HttpSource
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var debug = debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:http-source');
- var HttpSource = /*#__PURE__*/function (_Source) {
- _inherits(HttpSource, _Source);
- var _super = _createSuper(HttpSource);
- /**
- * Create an HTTP component.
- *
- * The constructor sets a single readable stream from a fetch.
- */
- function HttpSource(config) {
- var _this;
- _classCallCheck(this, HttpSource);
- var uri = config.uri,
- headers = config.headers;
- /**
- * Set up an incoming stream and attach it to the socket.
- */
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_4__.Readable({
- objectMode: true,
- read: function read() {//
- }
- }); // When an error is sent on the incoming stream, close the socket.
- incoming.on('error', function (e) {
- console.warn('closing socket due to incoming error', e);
- _this._reader && _this._reader.cancel();
- });
- /**
- * initialize the component.
- */
- _this = _super.call(this, incoming); // When a read is requested, continue to pull data
- _defineProperty(_assertThisInitialized(_this), "uri", void 0);
- _defineProperty(_assertThisInitialized(_this), "headers", void 0);
- _defineProperty(_assertThisInitialized(_this), "length", void 0);
- _defineProperty(_assertThisInitialized(_this), "_reader", void 0);
- incoming._read = function () {
- _this._pull();
- };
- _this.uri = uri;
- _this.headers = headers;
- return _this;
- }
- _createClass(HttpSource, [{
- key: "play",
- value: function play() {
- var _this2 = this;
- if (this.uri === undefined) {
- throw new Error('cannot start playing when there is no URI');
- }
- this.length = 0;
- fetch(this.uri, {
- headers: this.headers
- }).then(function (rsp) {
- if (rsp.body === null) {
- throw new Error('empty response body');
- }
- _this2._reader = rsp.body.getReader();
- _this2._pull();
- }).catch(function (err) {
- throw new Error(err);
- });
- }
- }, {
- key: "_pull",
- value: function _pull() {
- var _this3 = this;
- if (this._reader === undefined) {
- return;
- }
- this._reader.read().then(function (_ref) {
- var done = _ref.done,
- value = _ref.value;
- if (done) {
- debug('fetch completed, total downloaded: ', _this3.length, ' bytes');
- _this3.incoming.push(null);
- return;
- }
- if (value === undefined) {
- throw new Error('expected value to be defined');
- }
- if (_this3.length === undefined) {
- throw new Error('expected length to be defined');
- }
- _this3.length += value.length;
- var buffer = Buffer.from(value);
- if (!_this3.incoming.push({
- data: buffer,
- type: _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.RAW
- })) {
- // Something happened down stream that it is no longer processing the
- // incoming data, and the stream buffer got full.
- // This could be because we are downloading too much data at once,
- // or because the downstream is frozen. The latter is most likely
- // when dealing with a live stream (as in that case we would expect
- // downstream to be able to handle the data).
- debug('downstream back pressure: pausing read');
- } else {
- // It's ok to read more data
- _this3._pull();
- }
- });
- }
- }]);
- return HttpSource;
- }(_component__WEBPACK_IMPORTED_MODULE_3__.Source);
- /***/ }),
- /***/ "./lib/components/http-tunnel-source/index.ts":
- /*!****************************************************!*\
- !*** ./lib/components/http-tunnel-source/index.ts ***!
- \****************************************************/
- /*! namespace exports */
- /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "base64ArrayBuffer": () => /* binding */ base64ArrayBuffer,
- /* harmony export */ "init_connection": () => /* binding */ init_connection,
- /* harmony export */ "send_command": () => /* binding */ send_command,
- /* harmony export */ "HTTPTunnelSource": () => /* binding */ HTTPTunnelSource
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_28__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_30__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _openhttptunnel__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./openhttptunnel */ "./lib/components/http-tunnel-source/openhttptunnel.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- // Named status codes for CloseEvent, see:
- // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
- var CLOSE_GOING_AWAY = 1001; // Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
- // use window.btoa' step. According to my tests, this appears to be a faster approach:
- // http://jsperf.com/encoding-xhr-image-data/5
- /*
- MIT LICENSE
- Copyright 2011 Jon Leighton
- 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:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- 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.
- */
- function base64ArrayBuffer(arrayBuffer) {
- var base64 = '';
- var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- var bytes = new Uint8Array(arrayBuffer);
- var byteLength = bytes.byteLength;
- var byteRemainder = byteLength % 3;
- var mainLength = byteLength - byteRemainder;
- var a, b, c, d;
- var chunk; // Main loop deals with bytes in chunks of 3
- for (var i = 0; i < mainLength; i = i + 3) {
- // Combine the three bytes into a single integer
- chunk = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; // Use bitmasks to extract 6-bit segments from the triplet
- a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
- b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
- c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
- d = chunk & 63; // 63 = 2^6 - 1
- // Convert the raw binary segments to the appropriate ASCII encoding
- base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
- } // Deal with the remaining bytes and padding
- if (byteRemainder == 1) {
- chunk = bytes[mainLength];
- a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
- // Set the 4 least significant bits to zero
- b = (chunk & 3) << 4; // 3 = 2^2 - 1
- base64 += encodings[a] + encodings[b] + '==';
- } else if (byteRemainder == 2) {
- chunk = bytes[mainLength] << 8 | bytes[mainLength + 1];
- a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
- b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
- // Set the 2 least significant bits to zero
- c = (chunk & 15) << 2; // 15 = 2^4 - 1
- base64 += encodings[a] + encodings[b] + encodings[c] + '=';
- }
- return base64;
- }
- function init_connection(uri, signal, sessioncookie) {
- var response = fetch(uri, {
- method: 'GET',
- signal: signal,
- mode: 'same-origin',
- // no-cors, *cors, same-origin
- cache: 'no-cache',
- // *default, no-cache, reload, force-cache, only-if-cached
- credentials: 'include',
- headers: {
- 'x-sessioncookie': sessioncookie,
- 'Accept': 'application/x-rtsp-tunnelled',
- 'Pragma': 'no-cache',
- 'Cache-Control': 'no-cache',
- 'Accept-Encoding': '' // 'Require': 'www.onvif.org/ver20/backchannel'
- }
- }).catch(function (error) {
- return console.error('Connection error:', error);
- });
- return response;
- }
- function send_command(command, uri, sessioncookie) {
- var xhr = new XMLHttpRequest();
- xhr.open('POST', uri);
- xhr.setRequestHeader('x-sessioncookie', sessioncookie);
- xhr.setRequestHeader('Content-Type', 'application/x-rtsp-tunnelled');
- xhr.setRequestHeader('Pragma', 'no-cache'); //xhr.setRequestHeader('Content-Length', '32767');
- xhr.setRequestHeader('Expires', 'Sun, 9 Jan 1972 00:00:00 GMT'); // xhr.setRequestHeader('Require', 'www.onvif.org/ver20/backchannel');
- xhr.send(command);
- xhr.send(command);
- xhr.onload = function () {
- if (xhr.status != 200) {// alert(`Error ${xhr.status}: ${xhr.statusText}`); // 404: Not Found
- } else {//alert(`OnLoad, receive ${xhr.response.length} bytes`);
- }
- };
- xhr.onprogress = function (event) {
- if (event.lengthComputable) {//alert(`onprogress ${event.loaded} ?? ${event.total} onprogress`);
- } else {//alert(`onprogress ${event.loaded} bytes`); // 1111 ? 111 Content-Length
- }
- };
- xhr.onerror = function () {};
- }
- var HTTPTunnelSource = /*#__PURE__*/function (_Source) {
- _inherits(HTTPTunnelSource, _Source);
- var _super = _createSuper(HTTPTunnelSource);
- /**
- * Create a HTTPTunnelSource component.
- *
- * The constructor sets up GET request .
- *
- */
- function HTTPTunnelSource(config) {
- var _this;
- _classCallCheck(this, HTTPTunnelSource);
- /**
- * Set up an incoming stream and attach it to the socket.
- * @type {Readable}
- */
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_30__.Readable({
- objectMode: true,
- read: function read() {//
- }
- });
- /*
- (HTTP GET)
- |----<<<< data <<<<< ----|
- /client -----| |---- server
- |-- >>>> data >>>>-------|
- / (HTTP POST)
- */
- // Make GET request
- // all command responses and media data come to this socket
- var consume = function consume(responseReader) {
- return responseReader.read().then(function (result) {
- if (result.done) {
- return;
- }
- var chunk = result.value;
- var buffer = Buffer.from(chunk.buffer);
- incoming.push({
- data: buffer,
- type: _message__WEBPACK_IMPORTED_MODULE_31__.MessageType.RAW
- });
- return consume(responseReader);
- });
- };
- var controller = new AbortController();
- var signal = controller.signal;
- var sessioncookie = Math.floor(Math.random() * 99999);
- init_connection(config.uri, signal, sessioncookie.toString()).then(function (response) {
- return consume(response.body.getReader());
- }).then(function (data) {
- console.log(data);
- });
- /**
- * Set up outgoing stream using POST command.
- * @type {Writable}
- */
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_30__.Writable({
- objectMode: true,
- write: function write(msg, encoding, callback) {
- try {
- var t = null;
- if (msg.constructor === Uint8Array) {
- var a = base64ArrayBuffer(msg.subarray(0, 3));
- var b = base64ArrayBuffer(msg.subarray(4));
- t = a + b;
- } else {
- t = btoa(msg.data);
- }
- send_command(t, config.uri, sessioncookie.toString());
- } catch (e) {
- console.warn('message lost during send:', msg);
- }
- callback();
- }
- }); // When an error happens on the outgoing stream, just warn.
- outgoing.on('error', function (e) {
- console.warn('error during send, ignoring:', e);
- }); // When there is no more data going to be written, close!
- outgoing.on('finish', function () {
- controller.abort();
- debug__WEBPACK_IMPORTED_MODULE_28___default()('msl:http_tunnel:outgoing')('finish');
- });
- /**
- * initialize the component.
- */
- _this = _super.call(this, incoming, outgoing);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- return _this;
- }
- /**
- * Expose http_tunnel opener as a class method that returns a promise which
- * resolves with a new HTTPTunnelSource.
- */
- _createClass(HTTPTunnelSource, null, [{
- key: "open",
- value: function open(config) {
- return (0,_openhttptunnel__WEBPACK_IMPORTED_MODULE_32__.openHTTPTunnnel)(config).then(function (http_socket) {
- return new HTTPTunnelSource(config);
- });
- }
- }]);
- return HTTPTunnelSource;
- }(_component__WEBPACK_IMPORTED_MODULE_29__.Source);
- /***/ }),
- /***/ "./lib/components/http-tunnel-source/openhttptunnel.ts":
- /*!*************************************************************!*\
- !*** ./lib/components/http-tunnel-source/openhttptunnel.ts ***!
- \*************************************************************/
- /*! namespace exports */
- /*! export openHTTPTunnnel [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "openHTTPTunnnel": () => /* binding */ openHTTPTunnnel
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
- ;
- // Time in milliseconds we want to wait for a HTTP request to open
- var HTTP_TUNNEL_TIMEOUT = 10007;
- // Default configuration
- var defaultConfig = function defaultConfig() {
- var host = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.host;
- var scheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.protocol;
- var Scheme = scheme === 'https:' ? 'https:' : 'http:';
- return {
- uri: "".concat(Scheme, "//").concat(host, "/rtsp_tunnnel"),
- protocol: 'binary',
- timeout: HTTP_TUNNEL_TIMEOUT
- };
- };
- /**
- * Open a new WebSocket, fallback to token-auth on failure and retry.
- * @param {Object} [config={}] WebSocket configuration.
- * @param {String} [config.host] Specify different host
- * @param {String} [config.sheme] Specify different scheme.
- * @param {String} [config.uri] Full uri for websocket connection
- * @param {String} [config.protocol] protocol
- * @param {Number} [config.timeout] HTTP connection timeout for GET request
- * @return {Promise} Resolves with WebSocket, rejects with error.
- */
- var openHTTPTunnnel = function openHTTPTunnnel() {
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_3__.merge)(defaultConfig(config.host, config.scheme), config),
- uri = _merge.uri,
- protocol = _merge.protocol,
- timeout = _merge.timeout;
- if (uri === undefined) {
- throw new Error('http_tunnel: internal error');
- }
- return new Promise(function (resolve, reject) {
- try {
- // We will need to have
- /*
- let response = fetch( uri,
- {
- method: 'GET',
- mode: 'same-origin', // no-cors, *cors, same-origin
- cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
- credentials: 'include',
- headers:{
- 'x-sessioncookie': '10095',
- 'Accept': 'application/x-rtsp-tunnelled',
- 'Pragma': 'no-cache',
- 'Cache-Control': 'no-cache',
- 'Accept-Encoding': '',
- 'Require': 'www.onvif.org/ver20/backchannel'
- }
- }).catch(error =>
- reject(error.message)
- );
- return response;
- */
- //clearTimeout(countdown)
- resolve(null);
- } catch (e) {
- reject(e);
- }
- });
- };
- /***/ }),
- /***/ "./lib/components/index.browser.ts":
- /*!*****************************************!*\
- !*** ./lib/components/index.browser.ts ***!
- \*****************************************/
- /*! namespace exports */
- /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
- /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
- /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
- /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
- /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
- /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
- /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
- /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
- /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/message.ts .MessageType */
- /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
- /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
- /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
- /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
- /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
- /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
- /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
- /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Sink */
- /*! export Source [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Source */
- /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Tube */
- /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
- /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
- /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
- /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
- /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
- /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
- /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Sink": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Sink,
- /* harmony export */ "Source": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Source,
- /* harmony export */ "Tube": () => /* reexport safe */ _component__WEBPACK_IMPORTED_MODULE_0__.Tube,
- /* harmony export */ "AACDepay": () => /* reexport safe */ _aacdepay__WEBPACK_IMPORTED_MODULE_1__.AACDepay,
- /* harmony export */ "BasicDepay": () => /* reexport safe */ _basicdepay__WEBPACK_IMPORTED_MODULE_2__.BasicDepay,
- /* harmony export */ "CanvasSink": () => /* reexport safe */ _canvas__WEBPACK_IMPORTED_MODULE_3__.CanvasSink,
- /* harmony export */ "H264Depay": () => /* reexport safe */ _h264depay__WEBPACK_IMPORTED_MODULE_4__.H264Depay,
- /* harmony export */ "HttpSource": () => /* reexport safe */ _http_source__WEBPACK_IMPORTED_MODULE_5__.HttpSource,
- /* harmony export */ "Inspector": () => /* reexport safe */ _inspector__WEBPACK_IMPORTED_MODULE_6__.Inspector,
- /* harmony export */ "JPEGDepay": () => /* reexport safe */ _jpegdepay__WEBPACK_IMPORTED_MODULE_7__.JPEGDepay,
- /* harmony export */ "MessageType": () => /* reexport safe */ _message__WEBPACK_IMPORTED_MODULE_8__.MessageType,
- /* harmony export */ "createTransform": () => /* reexport safe */ _messageStreams__WEBPACK_IMPORTED_MODULE_9__.createTransform,
- /* harmony export */ "Mp4Capture": () => /* reexport safe */ _mp4capture__WEBPACK_IMPORTED_MODULE_10__.Mp4Capture,
- /* harmony export */ "Mp4Muxer": () => /* reexport safe */ _mp4muxer__WEBPACK_IMPORTED_MODULE_11__.Mp4Muxer,
- /* harmony export */ "MseSink": () => /* reexport safe */ _mse__WEBPACK_IMPORTED_MODULE_12__.MseSink,
- /* harmony export */ "ONVIFDepay": () => /* reexport safe */ _onvifdepay__WEBPACK_IMPORTED_MODULE_13__.ONVIFDepay,
- /* harmony export */ "RtspParser": () => /* reexport safe */ _rtsp_parser__WEBPACK_IMPORTED_MODULE_14__.RtspParser,
- /* harmony export */ "RTSP_METHOD": () => /* reexport safe */ _rtsp_session__WEBPACK_IMPORTED_MODULE_15__.RTSP_METHOD,
- /* harmony export */ "RtspSession": () => /* reexport safe */ _rtsp_session__WEBPACK_IMPORTED_MODULE_15__.RtspSession,
- /* harmony export */ "WSSource": () => /* reexport safe */ _ws_source__WEBPACK_IMPORTED_MODULE_16__.WSSource,
- /* harmony export */ "dataCatcherDepay": () => /* reexport safe */ _dataCatcherDepay__WEBPACK_IMPORTED_MODULE_17__.dataCatcherDepay,
- /* harmony export */ "g711toPCM": () => /* reexport safe */ _g711toPCM__WEBPACK_IMPORTED_MODULE_18__.g711toPCM,
- /* harmony export */ "HTTPTunnelSource": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.HTTPTunnelSource,
- /* harmony export */ "base64ArrayBuffer": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.base64ArrayBuffer,
- /* harmony export */ "init_connection": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.init_connection,
- /* harmony export */ "send_command": () => /* reexport safe */ _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__.send_command
- /* harmony export */ });
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component */ "./lib/components/component.ts");
- /* harmony import */ var _aacdepay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./aacdepay */ "./lib/components/aacdepay/index.ts");
- /* harmony import */ var _basicdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basicdepay */ "./lib/components/basicdepay/index.ts");
- /* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./canvas */ "./lib/components/canvas/index.ts");
- /* harmony import */ var _h264depay__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./h264depay */ "./lib/components/h264depay/index.ts");
- /* harmony import */ var _http_source__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./http-source */ "./lib/components/http-source/index.ts");
- /* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inspector */ "./lib/components/inspector/index.ts");
- /* harmony import */ var _jpegdepay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jpegdepay */ "./lib/components/jpegdepay/index.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./message */ "./lib/components/message.ts");
- /* harmony import */ var _messageStreams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./messageStreams */ "./lib/components/messageStreams.ts");
- /* harmony import */ var _mp4capture__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mp4capture */ "./lib/components/mp4capture/index.ts");
- /* harmony import */ var _mp4muxer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./mp4muxer */ "./lib/components/mp4muxer/index.ts");
- /* harmony import */ var _mse__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./mse */ "./lib/components/mse/index.ts");
- /* harmony import */ var _onvifdepay__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./onvifdepay */ "./lib/components/onvifdepay/index.ts");
- /* harmony import */ var _rtsp_parser__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rtsp-parser */ "./lib/components/rtsp-parser/index.ts");
- /* harmony import */ var _rtsp_session__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./rtsp-session */ "./lib/components/rtsp-session/index.ts");
- /* harmony import */ var _ws_source__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ws-source */ "./lib/components/ws-source/index.ts");
- /* harmony import */ var _dataCatcherDepay__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./dataCatcherDepay */ "./lib/components/dataCatcherDepay/index.ts");
- /* harmony import */ var _g711toPCM__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./g711toPCM */ "./lib/components/g711toPCM/index.ts");
- /* harmony import */ var _http_tunnel_source__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./http-tunnel-source */ "./lib/components/http-tunnel-source/index.ts");
- /***/ }),
- /***/ "./lib/components/inspector/index.ts":
- /*!*******************************************!*\
- !*** ./lib/components/inspector/index.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Inspector": () => /* binding */ Inspector
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var generateLogger = function generateLogger(prefix, type) {
- var lastTimestamp = Date.now();
- var log = function log(msg) {
- var timestamp = Date.now();
- console.log("".concat(prefix, ": +").concat(timestamp - lastTimestamp, "ms"), msg);
- lastTimestamp = timestamp;
- };
- if (type === undefined) {
- return log;
- } else {
- return function (msg) {
- return msg.type === type && log(msg);
- };
- }
- };
- /**
- * Component that logs whatever is passing through.
- */
- var Inspector = /*#__PURE__*/function (_Tube) {
- _inherits(Inspector, _Tube);
- var _super = _createSuper(Inspector);
- /**
- * Create a new inspector component.
- * @argument {String} type The type of message to log (default is to log all).
- * @return {undefined}
- */
- function Inspector(type) {
- _classCallCheck(this, Inspector);
- var incomingLogger = generateLogger('incoming', type);
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- incomingLogger(msg);
- callback(undefined, msg);
- }
- });
- var outgoingLogger = generateLogger('outgoing', type);
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- outgoingLogger(msg);
- callback(undefined, msg);
- }
- });
- return _super.call(this, incoming, outgoing);
- }
- return Inspector;
- }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
- /***/ }),
- /***/ "./lib/components/jpegdepay/headers.ts":
- /*!*********************************************!*\
- !*** ./lib/components/jpegdepay/headers.ts ***!
- \*********************************************/
- /*! namespace exports */
- /*! export makeFrameHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export makeHuffmanHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export makeImageHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export makeQuantHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export makeScanHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "makeImageHeader": () => /* binding */ makeImageHeader,
- /* harmony export */ "makeQuantHeader": () => /* binding */ makeQuantHeader,
- /* harmony export */ "makeFrameHeader": () => /* binding */ makeFrameHeader,
- /* harmony export */ "makeHuffmanHeader": () => /* binding */ makeHuffmanHeader,
- /* harmony export */ "makeScanHeader": () => /* binding */ makeScanHeader
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- /**
- * Generate frame and scan headers that can be prepended to the
- * RTP/JPEG data payload to produce a JPEG compressed image in
- * interchange format.
- *
- * For detailed information, check Appendix A of:
- * https://tools.ietf.org/html/rfc2435
- */
- function makeImageHeader() {
- return Buffer.from([0xff, 0xd8]);
- }
- function makeQuantHeader(precision, qTable) {
- var lumSize = precision & 1 ? 128 : 64;
- var chmSize = precision & 2 ? 128 : 64;
- if (qTable.length !== lumSize + chmSize) {
- throw new Error('invalid quantization table');
- }
- var lumaPrefix = Buffer.from([0xff, 0xdb, 0, lumSize + 3, 0]);
- var chromaPrefix = Buffer.from([0xff, 0xdb, 0, chmSize + 3, 1]);
- return Buffer.concat([lumaPrefix, qTable.slice(0, lumSize), chromaPrefix, qTable.slice(lumSize)]);
- }
- function makeFrameHeader(width, height, type) {
- return Buffer.from([0xff, 0xc0, // SOF_0 (Start Of Frame)
- 0, 17, 8, height >> 8, height, width >> 8, width, 3, 0, type === 0 ? 0x21 : 0x22, 0, 1, 0x11, 1, 2, 0x11, 1]);
- } // prettier-ignore
- var LUM_DC_CODELENS = [0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]; // prettier-ignore
- var LUM_DC_SYMBOLS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // prettier-ignore
- var LUM_AC_CODELENS = [0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d]; // prettier-ignore
- 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
- var CHM_DC_CODELENS = [0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; // prettier-ignore
- var CHM_DC_SYMBOLS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // prettier-ignore
- var CHM_AC_CODELENS = [0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77]; // prettier-ignore
- 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];
- function makeHuffmanHeader() {
- 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];
- 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];
- 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];
- 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];
- 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))));
- }
- function makeScanHeader() {
- return Buffer.from([0xff, 0xda, // SOS (Start Of Scan)
- 0, 12, 3, 0, 0, 1, 0x11, 2, 0x11, 0, 63, 0]);
- }
- /***/ }),
- /***/ "./lib/components/jpegdepay/index.ts":
- /*!*******************************************!*\
- !*** ./lib/components/jpegdepay/index.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "JPEGDepay": () => /* binding */ JPEGDepay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/jpegdepay/parser.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- 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); }
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- 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; }
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var JPEGDepay = /*#__PURE__*/function (_Tube) {
- _inherits(JPEGDepay, _Tube);
- var _super = _createSuper(JPEGDepay);
- function JPEGDepay() {
- _classCallCheck(this, JPEGDepay);
- var jpegPayloadType;
- var packets = [];
- var jpegDepay;
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_6__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
- var jpegMedia = msg.sdp.media.find(function (media) {
- return media.type === 'video' && media.rtpmap !== undefined && media.rtpmap.encodingName === 'JPEG';
- });
- if (jpegMedia !== undefined && jpegMedia.rtpmap !== undefined) {
- jpegPayloadType = Number(jpegMedia.rtpmap.payloadType);
- var framesize = jpegMedia.framesize; // `framesize` is an SDP field that is present in e.g. Camera's
- // and is used because the width and height that can be sent inside
- // the JPEG header are both limited to 2040.
- // If present, we use this width and height as the default values
- // to be used by the jpeg depay function, otherwise we ignore this
- // and let the JPEG header inside the RTP packets determine this.
- if (framesize !== undefined) {
- var _framesize = _slicedToArray(framesize, 2),
- width = _framesize[0],
- height = _framesize[1]; // msg.framesize = { width, height }
- jpegDepay = (0,_parser__WEBPACK_IMPORTED_MODULE_5__.jpegDepayFactory)(width, height);
- } else {
- jpegDepay = (0,_parser__WEBPACK_IMPORTED_MODULE_5__.jpegDepayFactory)();
- }
- }
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.payloadType)(msg.data) === jpegPayloadType) {
- packets.push(msg.data); // JPEG over RTP uses the RTP marker bit to indicate end
- // of fragmentation. At this point, the packets can be used
- // to reconstruct a JPEG frame.
- if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.marker)(msg.data) && packets.length > 0) {
- var jpegFrame = jpegDepay(packets);
- this.push({
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.timestamp)(msg.data),
- ntpTimestamp: msg.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_7__.payloadType)(msg.data),
- data: jpegFrame.data,
- framesize: jpegFrame.size,
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.JPEG
- });
- packets = [];
- }
- callback();
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- }); // outgoing will be defaulted to a PassThrough stream
- return _super.call(this, incoming);
- }
- return JPEGDepay;
- }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
- /***/ }),
- /***/ "./lib/components/jpegdepay/make-qtable.ts":
- /*!*************************************************!*\
- !*** ./lib/components/jpegdepay/make-qtable.ts ***!
- \*************************************************/
- /*! namespace exports */
- /*! export makeQtable [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "makeQtable": () => /* binding */ makeQtable
- /* harmony export */ });
- /* harmony import */ var _utils_clamp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/clamp */ "./lib/utils/clamp.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- /**
- * @function makeQtable
- * Creating a quantization table from a Q factor
- * Example Code from RFC 2435 Appendix A ported to TypeScript
- *
- * Default luminance/chrominance quantization tables in RFC example are not in zig-zag order.
- * The RFC does not mention that default tables should be in zig-zag ordering,
- * but they say that about the included tables. RFC sample code appears to have a mistake.
- * All the tested cameras and LGPL projects use zig-zag default tables.
- * So we use zig-zaged tables from ISO/IEC 10918-1 Annex K Section K.1
- * @see https://tools.ietf.org/html/rfc2435
- * @see https://www.iso.org/standard/18902.html
- */
- // prettier-ignore
- 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
- 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];
- function makeQtable(Q) {
- var factor = (0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(Q, 1, 99);
- var buffer = Buffer.alloc(128);
- var S = Q < 50 ? Math.floor(5000 / factor) : 200 - factor * 2;
- for (var i = 0; i < 64; i++) {
- var lq = Math.floor((jpegLumaQuantizer[i] * S + 50) / 100);
- var cq = Math.floor((jpeChromaQuantizer[i] * S + 50) / 100);
- buffer.writeUInt8((0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(lq, 1, 255), i);
- buffer.writeUInt8((0,_utils_clamp__WEBPACK_IMPORTED_MODULE_0__.clamp)(cq, 1, 255), i + 64);
- }
- return buffer;
- }
- /***/ }),
- /***/ "./lib/components/jpegdepay/parser.ts":
- /*!********************************************!*\
- !*** ./lib/components/jpegdepay/parser.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export jpegDepayFactory [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "jpegDepayFactory": () => /* binding */ jpegDepayFactory
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headers */ "./lib/components/jpegdepay/headers.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _make_qtable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./make-qtable */ "./lib/components/jpegdepay/make-qtable.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- 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; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- /**
- * Each packet contains a special JPEG header which immediately follows
- * the RTP header. The first 8 bytes of this header, called the "main
- * JPEG header", are as follows:*
- * 0 1 2 3
- * 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
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Type-specific | Fragment Offset |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Type | Q | Width | Height |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /**
- * Restart Marker header: when using types 64-127
- * 0 1 2 3
- * 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
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Restart Interval |F|L| Restart Count |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- /**
- * Quantization Table header: when using Q values 128-255
- * 0 1 2 3
- * 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
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | MBZ | Precision | Length |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Quantization Table Data |
- * | ... |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- function jpegDepayFactory() {
- var defaultWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var IMAGE_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeImageHeader)();
- var HUFFMAN_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeHuffmanHeader)();
- var SCAN_HEADER = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeScanHeader)();
- return function jpegDepay(packets) {
- var metadata;
- var fragments = [];
- var _iterator = _createForOfIteratorHelper(packets),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var packet = _step.value;
- var fragment = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_3__.payload)(packet); // Parse and extract JPEG header.
- var typeSpecific = fragment.readUInt8(0);
- var fragmentOffset = fragment.readUInt8(1) << 16 | fragment.readUInt8(2) << 8 | fragment.readUInt8(3);
- var _type = fragment.readUInt8(4);
- var Q = fragment.readUInt8(5);
- var _width = fragment.readUInt8(6) * 8 || defaultWidth;
- var _height = fragment.readUInt8(7) * 8 || defaultHeight;
- fragment = fragment.slice(8); // Parse and extract Restart Marker header if present.
- var DRI = 0;
- if (_type >= 64 && _type <= 127) {
- DRI = fragment.readUInt16BE(0);
- fragment = fragment.slice(4);
- } // Parse and extract Quantization Table header if present.
- if (Q >= 128 && fragmentOffset === 0) {
- // const MBZ = fragment.readUInt8()
- var _precision = fragment.readUInt8(1);
- var length = fragment.readUInt16BE(2);
- var _qTable = fragment.slice(4, 4 + length);
- metadata = {
- typeSpecific: typeSpecific,
- type: _type,
- width: _width,
- height: _height,
- DRI: DRI,
- precision: _precision,
- qTable: _qTable
- };
- fragment = fragment.slice(4 + length);
- } // Compute Quantization Table
- else if (Q < 128 && fragmentOffset === 0) {
- var _precision2 = 0;
- var _qTable2 = (0,_make_qtable__WEBPACK_IMPORTED_MODULE_4__.makeQtable)(Q);
- metadata = {
- typeSpecific: typeSpecific,
- type: _type,
- width: _width,
- height: _height,
- DRI: DRI,
- precision: _precision2,
- qTable: _qTable2
- };
- }
- fragments.push(fragment);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- if (metadata === undefined) {
- throw new Error('no quantization header present');
- }
- var _metadata = metadata,
- precision = _metadata.precision,
- qTable = _metadata.qTable,
- type = _metadata.type,
- width = _metadata.width,
- height = _metadata.height;
- var quantHeader = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeQuantHeader)(precision, qTable);
- if (metadata.DRI !== 0) {
- throw new Error('not implemented: DRI');
- }
- var frameHeader = (0,_headers__WEBPACK_IMPORTED_MODULE_2__.makeFrameHeader)(width, height, type);
- return {
- size: {
- width: width,
- height: height
- },
- data: Buffer.concat([IMAGE_HEADER, quantHeader, frameHeader, HUFFMAN_HEADER, SCAN_HEADER].concat(fragments))
- };
- };
- }
- /***/ }),
- /***/ "./lib/components/message.ts":
- /*!***********************************!*\
- !*** ./lib/components/message.ts ***!
- \***********************************/
- /*! namespace exports */
- /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "MessageType": () => /* binding */ MessageType
- /* harmony export */ });
- var MessageType;
- (function (MessageType) {
- MessageType[MessageType["UNKNOWN"] = 0] = "UNKNOWN";
- MessageType[MessageType["RAW"] = 1] = "RAW";
- MessageType[MessageType["RTP"] = 2] = "RTP";
- MessageType[MessageType["RTCP"] = 3] = "RTCP";
- MessageType[MessageType["RTSP"] = 4] = "RTSP";
- MessageType[MessageType["SDP"] = 5] = "SDP";
- MessageType[MessageType["ELEMENTARY"] = 6] = "ELEMENTARY";
- MessageType[MessageType["H264"] = 7] = "H264";
- MessageType[MessageType["ISOM"] = 8] = "ISOM";
- MessageType[MessageType["XML"] = 9] = "XML";
- MessageType[MessageType["JPEG"] = 10] = "JPEG";
- MessageType[MessageType["PCM"] = 11] = "PCM";
- })(MessageType || (MessageType = {}));
- /***/ }),
- /***/ "./lib/components/messageStreams.ts":
- /*!******************************************!*\
- !*** ./lib/components/messageStreams.ts ***!
- \******************************************/
- /*! namespace exports */
- /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "createTransform": () => /* binding */ createTransform
- /* harmony export */ });
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__);
- ;
- var createTransform = function createTransform(transform) {
- return new stream__WEBPACK_IMPORTED_MODULE_0__.Transform({
- objectMode: true,
- transform: transform
- });
- };
- /***/ }),
- /***/ "./lib/components/mp4-parser/index.ts":
- /*!********************************************!*\
- !*** ./lib/components/mp4-parser/index.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export Mp4Parser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Mp4Parser": () => /* binding */ Mp4Parser
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser */ "./lib/components/mp4-parser/parser.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /**
- * A component that converts raw binary MP4 data into ISOM boxes.
- * @extends {Component}
- */
- var Mp4Parser = /*#__PURE__*/function (_Tube) {
- _inherits(Mp4Parser, _Tube);
- var _super = _createSuper(Mp4Parser);
- /**
- * Create a new RTSP parser component.
- */
- function Mp4Parser() {
- _classCallCheck(this, Mp4Parser);
- var parser = new _parser__WEBPACK_IMPORTED_MODULE_5__.Parser(); // Incoming stream
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, _, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW) {
- parser.parse(msg.data).forEach(function (message) {
- return incoming.push(message);
- });
- callback();
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- });
- return _super.call(this, incoming);
- }
- return Mp4Parser;
- }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
- /***/ }),
- /***/ "./lib/components/mp4-parser/parser.ts":
- /*!*********************************************!*\
- !*** ./lib/components/mp4-parser/parser.ts ***!
- \*********************************************/
- /*! namespace exports */
- /*! export Parser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Parser": () => /* binding */ Parser
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/protocols/isom */ "./lib/utils/protocols/isom.ts");
- /* harmony import */ var _mp4muxer_helpers_isom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../mp4muxer/helpers/isom */ "./lib/components/mp4muxer/helpers/isom.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- var debug = debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:mp4-parser'); // Identify boxes that conforms to an ISO BMFF byte stream:
- // - header boxes: ftyp + moov
- // - segment boxes: [stype] + moof + mdat + [[mdat]...]
- var ISO_BMFF_BOX_TYPES = new Set(['ftyp', 'moov', 'styp', 'moof', 'mdat']);
- /**
- * Extract type and size information from the box header
- * (8-byte section at beginning of the box).
- */
- var mp4BoxInfo = function mp4BoxInfo(chunks) {
- var header = Buffer.alloc(_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.BOX_HEADER_BYTES);
- var i = 0;
- var bytesRead = 0;
- while (bytesRead < header.length) {
- var chunk = chunks[i++];
- var bytesToRead = Math.min(chunk.length, header.length - bytesRead);
- chunk.copy(header, bytesRead, 0, bytesToRead);
- bytesRead += bytesToRead;
- }
- var size = header.readUInt32BE(0);
- var type = (0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(header);
- return {
- type: type,
- size: size
- };
- };
- /**
- * Parser class with a public method that takes a data chunk and returns the
- * next box, or null of there is no complete box. The parser keeps track of the
- * added chunks internally in an array and only concatenates chunks when data is
- * needed to construct a message.
- * @type {[type]}
- */
- var Parser = /*#__PURE__*/function () {
- /**
- * Create a new Parser object.
- */
- function Parser() {
- _classCallCheck(this, Parser);
- _defineProperty(this, "_chunks", []);
- _defineProperty(this, "_length", 0);
- _defineProperty(this, "_box", void 0);
- _defineProperty(this, "_ftyp", void 0);
- this._init();
- }
- /**
- * Initialize the internal properties to their default starting
- * values.
- */
- _createClass(Parser, [{
- key: "_init",
- value: function _init() {
- this._chunks = [];
- this._length = 0;
- }
- }, {
- key: "_push",
- value: function _push(chunk) {
- this._chunks.push(chunk);
- this._length += chunk.length;
- }
- /**
- * Extract MP4 boxes.
- * @return {Array} An array of messages, possibly empty.
- */
- }, {
- key: "_parseBox",
- value: function _parseBox() {
- // Skip as long as we don't have the first 8 bytes
- if (this._length < _utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.BOX_HEADER_BYTES) {
- return null;
- } // Enough bytes to construct the header and extract packet info.
- if (!this._box) {
- this._box = mp4BoxInfo(this._chunks);
- } // As long as we don't have enough chunks, skip.
- if (this._length < this._box.size) {
- return null;
- } // We have enough data to extract a box.
- // The buffer package has a problem that it doesn't optimize concatenation
- // of an array with only one buffer, check for that (prevents performance issue)
- var buffer = this._chunks.length === 1 ? this._chunks[0] : Buffer.concat(this._chunks);
- var box = buffer.slice(0, this._box.size);
- var trailing = buffer.slice(this._box.size); // Prepare next bit.
- this._init();
- this._push(trailing); // Ignore invalid boxes
- if (!ISO_BMFF_BOX_TYPES.has(this._box.type)) {
- console.warn("ignored non-ISO BMFF Byte Stream box type: ".concat(this._box.type, " (").concat(this._box.size, " bytes)"));
- return Buffer.alloc(0);
- }
- delete this._box;
- return box;
- }
- /**
- * Add the next chunk of data to the parser and extract messages.
- * If no message can be extracted, an empty array is returned, otherwise
- * an array of messages is returned.
- * @param {Buffer} chunk The next piece of data.
- * @return {Array} An array of messages, possibly empty.
- */
- }, {
- key: "parse",
- value: function parse(chunk) {
- this._push(chunk);
- var messages = [];
- var done = false;
- while (!done) {
- var data = this._parseBox();
- if (data !== null) {
- if ((0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(data) === 'ftyp') {
- this._ftyp = data;
- } else if ((0,_utils_protocols_isom__WEBPACK_IMPORTED_MODULE_9__.boxType)(data) === 'moov') {
- var _this$_ftyp;
- var moov = new _mp4muxer_helpers_isom__WEBPACK_IMPORTED_MODULE_10__.Container('moov');
- var tracks = moov.parse(data);
- debug('MP4 tracks: ', tracks);
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_8__.MessageType.ISOM,
- data: Buffer.concat([(_this$_ftyp = this._ftyp) !== null && _this$_ftyp !== void 0 ? _this$_ftyp : Buffer.alloc(0), data]),
- tracks: tracks
- });
- } else {
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_8__.MessageType.ISOM,
- data: data
- });
- }
- } else {
- done = true;
- }
- }
- return messages;
- }
- }]);
- return Parser;
- }();
- /***/ }),
- /***/ "./lib/components/mp4capture/index.ts":
- /*!********************************************!*\
- !*** ./lib/components/mp4capture/index.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Mp4Capture": () => /* binding */ Mp4Capture
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var MAX_CAPTURE_BYTES = 225000000; // 5 min at a rate of 6 Mbit/s
- /**
- * Component that records MP4 data.
- *
- * @extends Component
- */
- var Mp4Capture = /*#__PURE__*/function (_Tube) {
- _inherits(Mp4Capture, _Tube);
- var _super = _createSuper(Mp4Capture);
- /**
- * Create a new mp4muxer component.
- * @return {undefined}
- */
- function Mp4Capture() {
- var _this;
- var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MAX_CAPTURE_BYTES;
- _classCallCheck(this, Mp4Capture);
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.SDP) {
- // Arrival of SDP indicates new movie, start recording if active.
- if (_this._active) {
- _this._capture = true;
- }
- } else if (_this._capture && msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.ISOM) {
- // MP4 box has arrived, record if appropriate
- if (_this._bufferOffset < _this._buffer.byteLength - msg.data.byteLength) {
- msg.data.copy(_this._buffer, _this._bufferOffset);
- _this._bufferOffset += msg.data.byteLength;
- } else {
- _this.stop();
- }
- } // Always pass on all messages
- callback(undefined, msg);
- }
- }); // Stop any recording when the stream is closed.
- incoming.on('finish', function () {
- _this.stop();
- });
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "_active", void 0);
- _defineProperty(_assertThisInitialized(_this), "_capture", void 0);
- _defineProperty(_assertThisInitialized(_this), "_captureCallback", void 0);
- _defineProperty(_assertThisInitialized(_this), "_bufferOffset", void 0);
- _defineProperty(_assertThisInitialized(_this), "_bufferSize", void 0);
- _defineProperty(_assertThisInitialized(_this), "_buffer", void 0);
- _this._buffer = Buffer.allocUnsafe(0);
- _this._bufferSize = maxSize;
- _this._bufferOffset = 0;
- _this._active = false;
- _this._capture = false;
- _this._captureCallback = function () {
- /** noop */
- };
- return _this;
- }
- /**
- * Activate video capture. The capture will begin when a new movie starts,
- * and will terminate when the movie ends or when the buffer is full. On
- * termination, the callback you passed will be called with the captured
- * data as argument.
- * @public
- * @param {Function} callback Will be called when data is captured.
- * @return {undefined}
- */
- _createClass(Mp4Capture, [{
- key: "start",
- value: function start(callback) {
- if (!this._active) {
- debug__WEBPACK_IMPORTED_MODULE_1___default()('msl:capture:start')(callback);
- this._captureCallback = callback;
- this._buffer = Buffer.allocUnsafe(this._bufferSize);
- this._bufferOffset = 0;
- this._active = true;
- }
- }
- /**
- * Deactivate video capture. This ends an ongoing capture and prevents
- * any further capturing.
- * @public
- * @return {undefined}
- */
- }, {
- key: "stop",
- value: function stop() {
- if (this._active) {
- debug__WEBPACK_IMPORTED_MODULE_1___default()('msl:capture:stop')("captured bytes: ".concat(this._bufferOffset));
- try {
- this._captureCallback(this._buffer.slice(0, this._bufferOffset));
- } catch (e) {
- console.error(e);
- }
- this._buffer = Buffer.allocUnsafe(0);
- this._bufferOffset = 0;
- this._active = false;
- this._capture = false;
- }
- }
- }]);
- return Mp4Capture;
- }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/aacSettings.ts":
- /*!********************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/aacSettings.ts ***!
- \********************************************************/
- /*! namespace exports */
- /*! export aacSettings [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "aacSettings": () => /* binding */ aacSettings
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
- ;
- // All audio object types defined in ISO/IEC 14496-3 pp. 40
- var AUDIO_OBJECT_TYPE_NAMES = {
- 1: 'AAC Main',
- 2: 'AAC LC'
- }; // All frequencies defined in ISO/IEC 14496-3 pp. 42
- var FREQUENCY_VALUES = {
- 0: '96 kHz',
- 1: '88.2 kHz',
- 2: '64 kHz',
- 3: '48 kHz',
- 4: '44.1 kHz',
- 5: '32 kHz',
- 6: '24 kHz',
- 7: '22.05 kHz',
- 8: '16 kHz',
- 9: '12 kHz',
- 10: '11.025 kHz',
- 11: '8 kHz',
- 12: '7.35 kHz'
- }; // All channels defined in ISO/IEC 14496-3 pp. 42
- var CHANNEL_CONFIG_NAMES = {
- 1: 'Mono',
- 2: 'Stereo'
- };
- var aacEncodingName = function aacEncodingName(audioConfigBytes) {
- var audioObjectType = audioConfigBytes >>> 11 & 0x001f;
- var frequencyIndex = audioConfigBytes >>> 7 & 0x000f;
- var channelConfig = audioConfigBytes >>> 3 & 0x000f;
- var audioType = AUDIO_OBJECT_TYPE_NAMES[audioObjectType] || "AAC (".concat(audioObjectType, ")");
- var samplingRate = FREQUENCY_VALUES[frequencyIndex] || 'unknown';
- var channels = CHANNEL_CONFIG_NAMES[channelConfig] || channelConfig.toString();
- return {
- coding: audioType,
- samplingRate: samplingRate,
- channels: channels
- };
- };
- var aacSettings = function aacSettings(media, date, trackId) {
- /*
- * Example SDP media segment for MPEG4-GENERIC audio:
- *
- {
- "type": "audio",
- "port": "0",
- "proto": "RTP/AVP",
- "fmt": "97",
- "connectionData": {
- "netType": "IN",
- "addrType": "IP4",
- "connectionAddress": "0.0.0.0"
- },
- "bwtype": "AS",
- "bandwidth": "32",
- "rtpmap": {
- "payloadType": "97",
- "encodingName": "MPEG4-GENERIC",
- "clockrate": "16000",
- "encodingParameters": "1"
- },
- "fmtp": {
- "format": "97",
- "parameters": {
- "streamtype": "5",
- "profile-level-id": "2",
- "mode": "AAC-hbr",
- "config": "1408",
- "sizelength": "13",
- "indexlength": "3",
- "indexdeltalength": "3",
- "bitrate": "32000"
- }
- },
- "control": "rtsp://hostname/media/media.amp/stream=1?audio=1"
- }
- */
- var bitrate = Number(media.fmtp.parameters.bitrate) || 320000;
- var audioConfigBytes = parseInt(media.fmtp.parameters.config, 16);
- var audioObjectType = audioConfigBytes >>> 11 & 0x001f;
- return {
- tkhd: {
- track_ID: trackId,
- creation_time: date,
- modification_time: date,
- width: 0,
- height: 0,
- volume: 1
- },
- mdhd: {
- timescale: Number(media.rtpmap.clockrate),
- creation_time: date,
- modification_time: date,
- duration: 0
- },
- hdlr: {
- handler_type: 'soun',
- name: 'SoundHandler\0' // 00 soundhandler, add 00 if things screws up
- },
- mediaHeaderBox: new _isom__WEBPACK_IMPORTED_MODULE_3__.Box('smhd'),
- sampleEntryBox: new _isom__WEBPACK_IMPORTED_MODULE_3__.Container('mp4a', {
- samplerate: media.rtpmap.clockrate << 16 >>> 0 // FIXME: Is this correct?
- }, new _isom__WEBPACK_IMPORTED_MODULE_3__.Box('esds', {
- audioConfigBytes: audioConfigBytes,
- // Converting from hex string to int
- maxBitRate: bitrate,
- avgBitRate: bitrate
- })),
- /*
- https://wiki.multimedia.cx/index.php/Understanding_AAC
- AAC is a variable bitrate (VBR) block-based codec where each block decodes
- to 1024 time-domain samples, which means that a single block (or frame?) is
- 1024 ticks long, which we take as default here.
- */
- defaultFrameDuration: 1024,
- // MIME type
- mime: "mp4a.40.".concat(audioObjectType),
- codec: aacEncodingName(audioConfigBytes)
- };
- };
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/boxbuilder.ts":
- /*!*******************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/boxbuilder.ts ***!
- \*******************************************************/
- /*! namespace exports */
- /*! export BoxBuilder [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BoxBuilder": () => /* binding */ BoxBuilder
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
- /* harmony import */ var _aacSettings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./aacSettings */ "./lib/components/mp4muxer/helpers/aacSettings.ts");
- /* harmony import */ var _h264Settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./h264Settings */ "./lib/components/mp4muxer/helpers/h264Settings.ts");
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- var formatDefaults = {
- 'MPEG4-GENERIC': _aacSettings__WEBPACK_IMPORTED_MODULE_2__.aacSettings,
- H264: _h264Settings__WEBPACK_IMPORTED_MODULE_3__.h264Settings
- };
- var createTrackData = function createTrackData() {
- return {
- lastTimestamp: 0,
- baseMediaDecodeTime: 0,
- defaultFrameDuration: 0,
- clockrate: 0,
- bitrate: 0,
- framerate: 0,
- cumulativeByteLength: 0,
- cumulativeDuration: 0,
- cumulativeFrames: 0
- };
- };
- var updateRateInfo = function updateRateInfo(trackData, _ref) {
- var byteLength = _ref.byteLength,
- duration = _ref.duration;
- trackData.cumulativeByteLength += byteLength;
- trackData.cumulativeDuration += duration;
- trackData.cumulativeFrames++; // Update the cumulative number size (bytes) and duration (ticks), and if
- // the duration exceeds the clockrate (meaning longer than 1 second of data),
- // then compute a new bitrate and reset cumulative size and duration.
- if (trackData.cumulativeDuration >= trackData.clockrate) {
- var bits = 8 * trackData.cumulativeByteLength;
- var frames = trackData.cumulativeFrames;
- var seconds = trackData.cumulativeDuration / trackData.clockrate;
- trackData.bitrate = bits / seconds;
- trackData.framerate = frames / seconds;
- trackData.cumulativeByteLength = 0;
- trackData.cumulativeDuration = 0;
- trackData.cumulativeFrames = 0;
- }
- };
- /**
- * Create boxes for a stream initiated by an sdp object
- *
- * @class BoxBuilder
- */
- var BoxBuilder = /*#__PURE__*/function () {
- function BoxBuilder() {
- _classCallCheck(this, BoxBuilder);
- _defineProperty(this, "trackIdMap", void 0);
- _defineProperty(this, "sequenceNumber", void 0);
- _defineProperty(this, "ntpPresentationTime", void 0);
- _defineProperty(this, "trackData", void 0);
- _defineProperty(this, "videoTrackId", void 0);
- this.trackIdMap = {};
- this.sequenceNumber = 0;
- this.ntpPresentationTime = 0;
- this.trackData = [];
- }
- _createClass(BoxBuilder, [{
- key: "trak",
- value: function trak(settings) {
- var trak = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('trak');
- var mdia = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('mdia');
- var minf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('minf');
- var dinf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('dinf');
- var dref = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('dref');
- var stbl = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('stbl');
- dref.set('entry_count', 1);
- 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)
- 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')))));
- return trak;
- }
- /**
- * Creates a Moov box from the provided options.
- * @method moov
- * @param {Object} mvhdSettings settings for the movie header box
- * @param {Object[]} tracks track specific settings
- * @return {Moov} Moov object
- */
- }, {
- key: "moov",
- value: function moov(sdp, date) {
- var _this = this;
- var moov = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('moov');
- moov.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mvhd', {
- creation_time: date,
- modification_time: date,
- duration: 0
- }));
- var mvex = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('mvex'); // For each of the media segments in the SDP structure, we will set up
- // a track in the MP4 file. For each track, a 'trak' box is added to the
- // 'moov' box and a 'trex' box is added to the 'mvex' box.
- this.trackIdMap = {};
- this.sequenceNumber = 0;
- this.ntpPresentationTime = 0;
- var trackId = 0;
- this.trackData = [];
- sdp.media.forEach(function (media) {
- if (media.rtpmap === undefined) {
- return;
- }
- var payloadType = media.rtpmap.payloadType;
- var encoding = media.rtpmap.encodingName;
- if (formatDefaults[encoding] !== undefined) {
- // We know how to handle this encoding, add a new track for it, and
- // register the track for this payloadType.
- _this.trackIdMap[payloadType] = ++trackId; // Mark the video track
- if (media.type.toLowerCase() === 'video') {
- _this.videoTrackId = trackId;
- } // Extract the settings from the SDP media information based on
- // the encoding name (H264, MPEG4-GENERIC, ...).
- var settings = formatDefaults[encoding](media, date, trackId);
- media.mime = settings.mime; // add MIME type to the SDP media
- media.codec = settings.codec; // add human readable codec string to the SDP media
- var trackData = createTrackData();
- trackData.clockrate = media.rtpmap.clockrate; // Set default frame duration (in ticks) for later use
- trackData.defaultFrameDuration = settings.defaultFrameDuration;
- _this.trackData.push(trackData);
- var trak = _this.trak(settings);
- moov.append(trak);
- mvex.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('trex', {
- track_ID: trackId
- }));
- }
- });
- moov.append(mvex);
- return moov;
- }
- /**
- * Boxes that carry actual elementary stream fragment metadata + data.
- */
- /**
- * Creates a moof box from the provided fragment metadata.
- * @method moof
- * @param {Object} options options containing, sequencenumber, base time, trun settings, samples
- * @return {Moof} Moof object
- */
- }, {
- key: "moof",
- value: function moof(metadata) {
- var trackId = metadata.trackId,
- timestamp = metadata.timestamp,
- byteLength = metadata.byteLength;
- var trackOffset = trackId - 1;
- var trackData = this.trackData[trackOffset]; // The RTP timestamps are unsigned 32 bit and will overflow
- // at some point. We can guard against the overflow by ORing with 0,
- // which will bring any difference back into signed 32-bit domain.
- var duration = trackData.lastTimestamp !== 0 ? timestamp - trackData.lastTimestamp | 0 : trackData.defaultFrameDuration;
- trackData.lastTimestamp = timestamp;
- if (duration < 0) duration = trackData.defaultFrameDuration;
- var moof = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('moof');
- var traf = new _isom__WEBPACK_IMPORTED_MODULE_1__.Container('traf');
- var trun = new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('trun', {
- sample_duration: duration,
- sample_size: byteLength,
- first_sample_flags: 0x40
- });
- moof.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mfhd', {
- sequence_number: this.sequenceNumber++
- }), traf.append(new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('tfhd', {
- track_ID: trackId
- }), new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('tfdt', {
- baseMediaDecodeTime: trackData.baseMediaDecodeTime
- }), trun));
- trackData.baseMediaDecodeTime += duration; // Correct the trun data offset
- trun.set('data_offset', moof.byteLength + 8);
- updateRateInfo(trackData, {
- byteLength: byteLength,
- duration: duration
- });
- return moof;
- }
- /**
- * Creates an mdat box containing the elementary stream data.
- * @param {[type]} data [description]
- * @return [type] [description]
- */
- }, {
- key: "mdat",
- value: function mdat(data) {
- var box = new _isom__WEBPACK_IMPORTED_MODULE_1__.Box('mdat');
- box.add('data', data);
- return box;
- }
- }, {
- key: "setPresentationTime",
- value: function setPresentationTime(trackId, ntpTimestamp) {
- // Before updating the baseMediaDecodeTime, we check if
- // there is already a base NTP time to use as a reference
- // for computing presentation times.
- if (!this.ntpPresentationTime && ntpTimestamp && trackId === this.videoTrackId) {
- var trackOffset = trackId - 1;
- var trackData = this.trackData[trackOffset];
- this.ntpPresentationTime = ntpTimestamp - 1000 * (trackData.baseMediaDecodeTime / trackData.clockrate);
- }
- }
- }]);
- return BoxBuilder;
- }();
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/bufferreader.ts":
- /*!*********************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/bufferreader.ts ***!
- \*********************************************************/
- /*! namespace exports */
- /*! export BufferReader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BufferReader": () => /* binding */ BufferReader
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- /**
- * Defines functions for reading from a binary buffer. Works similair to the
- * DataView object, but uses bitshifts instead for performance.
- * @class BufferReader
- * @constructor
- * @param {ArrayBuffer} buffer An ArrayBuffer to be read from.
- */
- var BufferReader = /*#__PURE__*/function () {
- function BufferReader(buffer) {
- _classCallCheck(this, BufferReader);
- _defineProperty(this, "_buffer", void 0);
- _defineProperty(this, "_dataView", void 0);
- _defineProperty(this, "_offset", void 0);
- _defineProperty(this, "_bitpos", void 0);
- _defineProperty(this, "_byte", void 0);
- this._buffer = buffer;
- this._dataView = new DataView(this._buffer);
- this._offset = 0;
- this._bitpos = 0;
- this._byte = 0;
- }
- /**
- * Reads 8-bit of data from the buffer.
- * @method readUint8
- * @param {Number} offset Index in the buffer.
- * @return {Number} An unsigned 8-bit integer.
- */
- _createClass(BufferReader, [{
- key: "readUint8",
- value: function readUint8(offset) {
- return this._dataView.getUint8(offset);
- }
- /**
- * Reads 16-bit of data from the buffer.
- * @method readUint16
- * @param {Number} offset Index in the buffer.
- * @return {Number} An unsigned 16-bit integer.
- */
- }, {
- key: "readUint16",
- value: function readUint16(offset) {
- return this._dataView.getUint16(offset);
- }
- /**
- * Reads 32-bit of data from the buffer.
- * @method readUint32
- * @param {Number} offset Index in the buffer.
- * @return {Number} An unsigned 32-bit integer.
- */
- }, {
- key: "readUint32",
- value: function readUint32(offset) {
- return this._dataView.getUint32(offset);
- }
- /**
- * Reads the next byte of data from the buffer and increaments the offset.
- * @method readNext
- * @return {Number} An unsigned 8-bit integer.
- */
- }, {
- key: "readNext",
- value: function readNext() {
- var value = this.readUint8(this._offset);
- this._offset += 1;
- return value;
- }
- }, {
- key: "readBits",
- value: function readBits(length) {
- if (length > 32 || length === 0) {
- throw new Error('length has to be between 0 - 31 bits');
- }
- var result = 0;
- for (var i = 1; i <= length; ++i) {
- if (this._bitpos === 0) {
- /* Previous byte all read out. Get a new one. */
- this._byte = this.readNext();
- }
- /* Shift result one left to make room for another bit,
- then add the next bit on the stream. */
- result = result << 1 | this._byte >> 8 - ++this._bitpos & 0x01;
- this._bitpos %= 8;
- }
- return result;
- }
- }, {
- key: "readUnsignedExpGolomb",
- value: function readUnsignedExpGolomb() {
- var bitsToRead = 0;
- while (this.readBits(1) !== 1) {
- bitsToRead++;
- }
- if (bitsToRead === 0) {
- return 0;
- /* Easy peasy, just a single 1. This is 0 in exp golomb */
- }
- if (bitsToRead >= 31) {
- throw new Error('read unsigned exponential Golomb: internal error');
- }
- /* Read all bits part of this number */
- var n = this.readBits(bitsToRead);
- /* Move in the 1 read by while-statement above */
- n |= 0x1 << bitsToRead;
- return n - 1;
- /* Because result in exp golomb is one larger */
- }
- }, {
- key: "readSignedExpGolomb",
- value: function readSignedExpGolomb() {
- var r = this.readUnsignedExpGolomb();
- if (r & 0x01) {
- r = r + 1 >> 1;
- } else {
- r = -(r >> 1);
- }
- return r;
- }
- /**
- * Returns the size of the buffer
- * @method readSize
- * @return {Number} The buffer size.
- */
- }, {
- key: "size",
- value: function size() {
- return this._buffer.byteLength;
- }
- /**
- * Returns an instance of the buffer as an unsigned 8-bit integer array.
- * @method getUint8Array
- * @return {Uint8Array} Unsigned 8-bit integer representation of the buffer
- */
- }, {
- key: "getUint8Array",
- value: function getUint8Array() {
- return new Uint8Array(this._buffer);
- }
- /**
- * Returns the buffer object
- * @method getArrayBuffer
- * @return {ArrayBuffer} The buffer used the BufferReader
- */
- }, {
- key: "getArrayBuffer",
- value: function getArrayBuffer() {
- return this._buffer;
- }
- }]);
- return BufferReader;
- }();
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/h264Settings.ts":
- /*!*********************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/h264Settings.ts ***!
- \*********************************************************/
- /*! namespace exports */
- /*! export h264Settings [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "h264Settings": () => /* binding */ h264Settings
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./lib/components/mp4muxer/helpers/utils.ts");
- /* harmony import */ var _isom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isom */ "./lib/components/mp4muxer/helpers/isom.ts");
- /* harmony import */ var _spsparser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./spsparser */ "./lib/components/mp4muxer/helpers/spsparser.ts");
- ;
- var PROFILE_NAMES = {
- 66: 'Baseline',
- 77: 'Main',
- 100: 'High'
- };
- var h264EncodingName = function h264EncodingName(profileLevelId) {
- var profileCode = parseInt(profileLevelId.substr(0, 2), 16);
- var levelCode = parseInt(profileLevelId.substr(4, 2), 16);
- var profile = PROFILE_NAMES[profileCode] || profileCode.toString();
- var level = (levelCode / 10).toFixed(1);
- return {
- coding: 'H.264',
- profile: profile,
- level: level
- };
- };
- var h264Settings = function h264Settings(media, date, trackId) {
- /*
- * Example SDP media segment for H264 audio:
- *
- {
- "type": "video",
- "port": "0",
- "proto": "RTP/AVP",
- "fmt": "96",
- "connectionData": {
- "netType": "IN",
- "addrType": "IP4",
- "connectionAddress": "0.0.0.0"
- },
- "bwtype": "AS",
- "bandwidth": "50000",
- "rtpmap": {
- "payloadType": "96",
- "encodingName": "H264",
- "clockrate": "90000"
- },
- "fmtp": {
- "format": "96",
- "parameters": {
- "packetization-mode": "1",
- "profile-level-id": "4d0029",
- "sprop-parameter-sets": "Z00AKeKQDwBE/LgLcBAQGkHiRFQ=,aO48gA=="
- }
- },
- "control": "rtsp://hostname/media/media.amp/stream=0?audio=1",
- "framerate": "25.000000",
- "transform": [[1,0,0],[0,1,0],[0,0,1]]
- },
- */
- var profileLevelId = media.fmtp.parameters['profile-level-id'];
- 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).
- var sps = parameterSets.slice(0, 1); // The remaining sets are all PPS to support more than one.
- var pps = parameterSets.slice(1);
- 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
- // the frame duration. Use a fallback value (90000 Hz / 25 fps)
- var FALLBACK_FRAME_DURATION = 3600;
- return {
- mediaHeaderBox: new _isom__WEBPACK_IMPORTED_MODULE_9__.Box('vmhd'),
- sampleEntryBox: new _isom__WEBPACK_IMPORTED_MODULE_9__.Container('avc1', {
- width: parsedSps.width,
- height: parsedSps.height
- }, new _isom__WEBPACK_IMPORTED_MODULE_9__.Box('avcC', {
- AVCProfileIndication: sps[0][1],
- profile_compatibility: sps[0][2],
- AVCLevelIndication: sps[0][3],
- sequenceParameterSets: sps,
- pictureParameterSets: pps
- })),
- tkhd: {
- track_ID: trackId,
- creation_time: date,
- modification_time: date,
- width: parsedSps.width << 16,
- height: parsedSps.height << 16,
- volume: 0
- },
- hdlr: {},
- mdhd: {
- timescale: media.rtpmap.clockrate,
- creation_time: date,
- modification_time: date,
- duration: 0
- },
- // (ticks / s) / (frames / s) = ticks / frame, e.g. frame duration in ticks
- defaultFrameDuration: media.framerate !== undefined && media.framerate > 0 ? Number(media.rtpmap.clockrate) / Number(media.framerate) || FALLBACK_FRAME_DURATION : FALLBACK_FRAME_DURATION,
- // MIME type
- mime: "avc1.".concat(profileLevelId),
- codec: h264EncodingName(profileLevelId)
- };
- };
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/isom.ts":
- /*!*************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/isom.ts ***!
- \*************************************************/
- /*! namespace exports */
- /*! export Box [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export Container [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Box": () => /* binding */ Box,
- /* harmony export */ "Container": () => /* binding */ Container
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _iterableToArrayLimit(arr, i) { 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; }
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
- 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; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- // Elements: parts of a box that hold values.
- // They should have a:
- // - byteLength
- // - value (can be accessed from outside to set/retrieve)
- // - store(buffer, offset) -> write the value to a buffer
- // - load(buffer, offset) -> read data and store in value
- var CONTAINER_TYPES = new Set(['moov']); // Constants
- var UINT32_RANGE = Math.pow(2, 32);
- var BoxElement = function BoxElement(size) {
- _classCallCheck(this, BoxElement);
- _defineProperty(this, "byteLength", void 0);
- _defineProperty(this, "value", void 0);
- this.byteLength = size;
- };
- var Empty = /*#__PURE__*/function (_BoxElement) {
- _inherits(Empty, _BoxElement);
- var _super = _createSuper(Empty);
- function Empty() {
- var _this;
- var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, Empty);
- _this = _super.call(this, size);
- _defineProperty(_assertThisInitialized(_this), "copy", function (buffer, offset) {
- buffer.fill(0, offset, offset + _this.byteLength);
- });
- return _this;
- }
- _createClass(Empty, [{
- key: "load",
- value: function load() {
- /** noop */
- }
- }]);
- return Empty;
- }(BoxElement);
- var CharArray = /*#__PURE__*/function (_BoxElement2) {
- _inherits(CharArray, _BoxElement2);
- var _super2 = _createSuper(CharArray);
- function CharArray(s) {
- var _this2;
- _classCallCheck(this, CharArray);
- _this2 = _super2.call(this, s.length);
- _defineProperty(_assertThisInitialized(_this2), "value", void 0);
- _defineProperty(_assertThisInitialized(_this2), "copy", function (buffer, offset) {
- for (var i = 0; i < _this2.byteLength; i += 1) {
- buffer[offset + i] = _this2.value.charCodeAt(i);
- }
- });
- _defineProperty(_assertThisInitialized(_this2), "load", function (buffer, offset) {
- _this2.value = buffer.slice(offset, offset + _this2.byteLength).toString('ascii');
- });
- _this2.value = s;
- return _this2;
- }
- return CharArray;
- }(BoxElement);
- var UInt8 = /*#__PURE__*/function (_BoxElement3) {
- _inherits(UInt8, _BoxElement3);
- var _super3 = _createSuper(UInt8);
- function UInt8() {
- var _this3;
- var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, UInt8);
- _this3 = _super3.call(this, 1);
- _defineProperty(_assertThisInitialized(_this3), "value", void 0);
- _defineProperty(_assertThisInitialized(_this3), "copy", function (buffer, offset) {
- buffer.writeUInt8(_this3.value, offset);
- });
- _defineProperty(_assertThisInitialized(_this3), "load", function (buffer, offset) {
- _this3.value = buffer.readUInt8(offset);
- });
- _this3.value = scalar;
- return _this3;
- }
- return UInt8;
- }(BoxElement);
- var UInt8Array = /*#__PURE__*/function (_BoxElement4) {
- _inherits(UInt8Array, _BoxElement4);
- var _super4 = _createSuper(UInt8Array);
- function UInt8Array(array) {
- var _this4;
- _classCallCheck(this, UInt8Array);
- _this4 = _super4.call(this, array.length);
- _defineProperty(_assertThisInitialized(_this4), "value", void 0);
- _defineProperty(_assertThisInitialized(_this4), "copy", function (buffer, offset) {
- for (var i = 0; i < _this4.value.length; ++i) {
- buffer.writeUInt8(_this4.value[i], offset + i);
- }
- });
- _defineProperty(_assertThisInitialized(_this4), "load", function (buffer, offset) {
- for (var i = 0; i < _this4.value.length; ++i) {
- _this4.value[i] = buffer.readUInt8(offset + i);
- }
- });
- _this4.value = array;
- return _this4;
- }
- return UInt8Array;
- }(BoxElement);
- var UInt16BE = /*#__PURE__*/function (_BoxElement5) {
- _inherits(UInt16BE, _BoxElement5);
- var _super5 = _createSuper(UInt16BE);
- function UInt16BE() {
- var _this5;
- var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, UInt16BE);
- _this5 = _super5.call(this, 2);
- _defineProperty(_assertThisInitialized(_this5), "value", void 0);
- _defineProperty(_assertThisInitialized(_this5), "copy", function (buffer, offset) {
- buffer.writeUInt16BE(_this5.value, offset);
- });
- _defineProperty(_assertThisInitialized(_this5), "load", function (buffer, offset) {
- _this5.value = buffer.readUInt16BE(offset);
- });
- _this5.value = scalar;
- return _this5;
- }
- return UInt16BE;
- }(BoxElement);
- var UInt24BE = /*#__PURE__*/function (_BoxElement6) {
- _inherits(UInt24BE, _BoxElement6);
- var _super6 = _createSuper(UInt24BE);
- function UInt24BE() {
- var _this6;
- var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, UInt24BE);
- _this6 = _super6.call(this, 3);
- _defineProperty(_assertThisInitialized(_this6), "value", void 0);
- _defineProperty(_assertThisInitialized(_this6), "copy", function (buffer, offset) {
- buffer.writeUInt8(_this6.value >> 16 & 0xff, offset);
- buffer.writeUInt8(_this6.value >> 8 & 0xff, offset + 1);
- buffer.writeUInt8(_this6.value & 0xff, offset + 2);
- });
- _defineProperty(_assertThisInitialized(_this6), "load", function (buffer, offset) {
- _this6.value = buffer.readUInt8(offset) << 16 + buffer.readUInt8(offset + 1) << 8 + buffer.readUInt8(offset + 2);
- });
- _this6.value = scalar;
- return _this6;
- }
- return UInt24BE;
- }(BoxElement);
- var UInt16BEArray = /*#__PURE__*/function (_BoxElement7) {
- _inherits(UInt16BEArray, _BoxElement7);
- var _super7 = _createSuper(UInt16BEArray);
- function UInt16BEArray(array) {
- var _this7;
- _classCallCheck(this, UInt16BEArray);
- _this7 = _super7.call(this, array.length * 2);
- _defineProperty(_assertThisInitialized(_this7), "value", void 0);
- _defineProperty(_assertThisInitialized(_this7), "copy", function (buffer, offset) {
- for (var i = 0; i < _this7.value.length; ++i) {
- buffer.writeUInt16BE(_this7.value[i], offset + 2 * i);
- }
- });
- _defineProperty(_assertThisInitialized(_this7), "load", function (buffer, offset) {
- for (var i = 0; i < _this7.value.length; ++i) {
- _this7.value[i] = buffer.readUInt16BE(offset + 2 * i);
- }
- });
- _this7.value = array;
- return _this7;
- }
- return UInt16BEArray;
- }(BoxElement);
- var UInt32BE = /*#__PURE__*/function (_BoxElement8) {
- _inherits(UInt32BE, _BoxElement8);
- var _super8 = _createSuper(UInt32BE);
- function UInt32BE() {
- var _this8;
- var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, UInt32BE);
- _this8 = _super8.call(this, 4);
- _defineProperty(_assertThisInitialized(_this8), "value", void 0);
- _defineProperty(_assertThisInitialized(_this8), "copy", function (buffer, offset) {
- buffer.writeUInt32BE(_this8.value, offset);
- });
- _defineProperty(_assertThisInitialized(_this8), "load", function (buffer, offset) {
- _this8.value = buffer.readUInt32BE(offset);
- });
- _this8.value = scalar;
- return _this8;
- }
- return UInt32BE;
- }(BoxElement);
- var UInt32BEArray = /*#__PURE__*/function (_BoxElement9) {
- _inherits(UInt32BEArray, _BoxElement9);
- var _super9 = _createSuper(UInt32BEArray);
- function UInt32BEArray(array) {
- var _this9;
- _classCallCheck(this, UInt32BEArray);
- _this9 = _super9.call(this, array.length * 4);
- _defineProperty(_assertThisInitialized(_this9), "value", void 0);
- _defineProperty(_assertThisInitialized(_this9), "copy", function (buffer, offset) {
- for (var i = 0; i < _this9.value.length; ++i) {
- buffer.writeUInt32BE(_this9.value[i], offset + 4 * i);
- }
- });
- _defineProperty(_assertThisInitialized(_this9), "load", function (buffer, offset) {
- for (var i = 0; i < _this9.value.length; ++i) {
- _this9.value[i] = buffer.readUInt32BE(offset + 4 * i);
- }
- });
- _this9.value = array;
- return _this9;
- }
- return UInt32BEArray;
- }(BoxElement);
- var UInt64BE = /*#__PURE__*/function (_BoxElement10) {
- _inherits(UInt64BE, _BoxElement10);
- var _super10 = _createSuper(UInt64BE);
- function UInt64BE() {
- var _this10;
- var scalar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- _classCallCheck(this, UInt64BE);
- _this10 = _super10.call(this, 8);
- _defineProperty(_assertThisInitialized(_this10), "value", void 0);
- _defineProperty(_assertThisInitialized(_this10), "copy", function (buffer, offset) {
- var high = _this10.value / UINT32_RANGE | 0;
- var low = _this10.value - high * UINT32_RANGE;
- buffer.writeUInt32BE(high, offset);
- buffer.writeUInt32BE(low, offset + 4);
- });
- _defineProperty(_assertThisInitialized(_this10), "load", function (buffer, offset) {
- var high = buffer.readUInt32BE(offset);
- var low = buffer.readUInt32BE(offset + 4);
- _this10.value = high * UINT32_RANGE + low;
- });
- _this10.value = scalar;
- return _this10;
- }
- return UInt64BE;
- }(BoxElement);
- /**
- * Class factory for a parameter set element. A parameter set groups a size,
- * and an array of parameter sets consisting each of a size and a byte array.
- * These elements are used by the avcC box.
- * @param {Number} [sizeMask=0x00] A bit mask to use for the size.
- * @return {Class} An element type that groups parameter sets.
- */
- var createParameterSetArrayClass = function createParameterSetArrayClass() {
- var sizeMask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x00;
- return /*#__PURE__*/function (_BoxElement11) {
- _inherits(ParameterSetArray, _BoxElement11);
- var _super11 = _createSuper(ParameterSetArray);
- /**
- * Takes an array of byte-arrays
- * @param {array} array The array of byte arrays
- * @return {[type]} [description]
- */
- function ParameterSetArray(array) {
- var _this11;
- _classCallCheck(this, ParameterSetArray);
- _this11 = _super11.call(this, 0); // this.setLengths = array.map((byteArray) => byteArray.length);
- _defineProperty(_assertThisInitialized(_this11), "value", void 0);
- _defineProperty(_assertThisInitialized(_this11), "copy", function (buffer, offset) {
- var i = 0;
- var _iterator = _createForOfIteratorHelper(_this11.value),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var element = _step.value;
- element.copy(buffer, offset + i);
- i += element.byteLength;
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- });
- _defineProperty(_assertThisInitialized(_this11), "load", function () {
- /** noop */
- });
- _this11.value = array.reduce(function (flatArray, byteArray) {
- return flatArray.concat(new UInt16BE(byteArray.length), new UInt8Array(byteArray));
- }, [new UInt8(sizeMask | array.length)]);
- _this11.byteLength = _this11.value.reduce(function (total, element) {
- return total + element.byteLength;
- }, 0);
- return _this11;
- }
- return ParameterSetArray;
- }(BoxElement);
- };
- /**
- * Specifications for a selection of ISO BMFF box types.
- *
- * Most of these are defined in ISO/IEC 14496-12,
- * For specific boxes like avc1/avcC/mp4a/esds the exact document is specified
- * with the appropriate box/descriptor.
- *
- * To add a new box, follow the same pattern: you need an object with at least
- * the property 'box' (which is 'Box' or 'FullBox') and for non-container boxes
- * you need also a 'body' property specifying the elements that the box contains.
- * The values assigned to each element in the spec are used as default.
- */
- var BOXSPEC = {
- // File Type Box
- ftyp: {
- container: 'file',
- mandatory: true,
- quantity: 'one',
- box: 'Box',
- is_container: true,
- body: [['major_brand', CharArray, 'isom'], ['minor_version', UInt32BE, 0], ['compatible_brands', CharArray, 'mp41'] // ['compatible_brands1', CharArray, 'iso2'],
- // ['compatible_brands2', CharArray, 'dash'],
- ]
- },
- // Movie Container
- moov: {
- container: 'file',
- mandatory: true,
- quantity: 'one',
- box: 'Box',
- is_container: true
- },
- // Movie Data Box
- mdat: {
- container: 'file',
- mandatory: false,
- quantity: 'any',
- box: 'Box',
- is_container: false,
- body: []
- },
- // Movie Header Box
- mvhd: {
- container: 'moov',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['timescale', UInt32BE, 1000], // time-scale for entire presentation, default = milliseconds
- ['duration', UInt32BE, 0xffffffff], // length of entire presentation, default = undetermined
- ['rate', UInt32BE, 0x00010000], // fixed point 16.16, preferred playback rate, default = 1.0
- ['volume', UInt16BE, 0x0100], // fixed point 8.8, preferred playback volume, default = 1.0
- ['reserved', Empty, 10], // transformation matrix, default = unity
- ['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
- ]
- },
- // Track Container
- trak: {
- container: 'moov',
- mandatory: true,
- quantity: 'one+',
- box: 'Box',
- is_container: true
- },
- // Track Header Box
- tkhd: {
- container: 'trak',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- // Flag values for the track header:
- // 0x000001 Track_enabled: track enabled (otherwise ignored)
- // 0x000002 Track_in_movie: track used in presentation
- // 0x000004 Track_in_preview: used when previewing presentation
- config: {
- flags: 0x000003 // track enabled and used in presentation
- },
- body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['track_ID', UInt32BE, 1], // Track identifier, cannot be 0
- ['reserved', Empty, 4], ['duration', UInt32BE, 0], // Duration of track using timescale of mvhd box
- ['reserved2', Empty, 8], ['layer', UInt16BE, 0], // Front-to-back ordering, lower is closer to viewer
- ['alternate_group', UInt16BE, 0], // Possible grouping of tracks
- ['volume', UInt16BE, 0x0100], // Track's relative audio volume 8.8 fixed point
- ['reserved3', Empty, 2], ['matrix', UInt32BEArray, [0x00010000, 0, 0, 0, 0x00010000, 0, 0, 0, 0x40000000]], ['width', UInt32BE, 0], // Visual presentation width, 16.16 fixed point
- ['height', UInt32BE, 0] // Visual presentation height, 16.16 fixed point
- ]
- },
- // Track Reference Box
- tref: {
- container: 'trak',
- mandatory: false,
- quantity: 'one-',
- box: 'Box',
- is_container: false
- },
- // Media Container
- mdia: {
- container: 'trak',
- mandatory: false,
- quantity: 'one',
- box: 'Box',
- is_container: true
- },
- // Media Header Box
- mdhd: {
- container: 'mdia',
- mandatory: false,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['creation_time', UInt32BE, 0], ['modification_time', UInt32BE, 0], ['timescale', UInt32BE, 1000], // time-scale for entire presentation, default = milliseconds
- ['duration', UInt32BE, 0xffffffff], // length of entire presentation, default = undetermined
- ['language', UInt16BE, 0], // ISO 639-2 lanugage code, three lower-case letters, stored as
- ['pre_defined', UInt16BE, 0]]
- },
- // Handler Reference Box
- hdlr: {
- container: 'mdia',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['predefined', UInt32BE, 0], ['handler_type', CharArray, 'vide'], // 'vide', 'soun', or 'hint'
- ['reserved', Empty, 12], ['name', CharArray, 'VideoHandler\0']]
- },
- // Media Information Container
- minf: {
- container: 'mdia',
- mandatory: true,
- quantity: 'one',
- box: 'Box',
- is_container: true
- },
- // Video Media Header Box
- vmhd: {
- container: 'minf',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- config: {
- flags: 0x000001
- },
- body: [['graphicsmode', UInt16BE, 0], // Composition mode of the video track, 0 = overwrite
- ['opcolor', UInt16BEArray, [0, 0, 0]] // Red green blue, for use by graphics modes
- ]
- },
- // Sound Media Header Box
- smhd: {
- container: 'minf',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [// Place mono track in stereo space:
- // 8.8 fixed point, 0 = center, -1.0 = left, 1.0 = right
- ['balance', UInt16BE, 0x0000], ['reserved', UInt16BE]]
- },
- // Data Information Container
- dinf: {
- container: 'minf',
- mandatory: true,
- quantity: 'one',
- box: 'Box',
- is_container: true
- },
- // Data Reference Box
- dref: {
- // When adding elements to this box, update the entry_count value!
- container: 'dinf',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: true,
- body: [['entry_count', UInt32BE, 0] // Number of entries.
- ]
- },
- 'url ': {
- container: 'dref',
- mandatory: true,
- quantity: 'one+',
- box: 'FullBox',
- is_container: false,
- // Flag values:
- // 0x000001 Local reference, which means empty URL
- config: {
- flags: 0x000001
- },
- body: [// ['location', CharArray, ''],
- ]
- },
- // Sample Table Container
- stbl: {
- container: 'minf',
- mandatory: true,
- quantity: 'one',
- box: 'Box',
- is_container: true
- },
- // Decoding Time to Sample Box
- stts: {
- container: 'stbl',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['entry_count', UInt32BE, 0] // For each entry these two elements:
- // ['sample_count', UInt32BE, 0], // Number of consecutive samples with same delta
- // ['sample_delta', UInt32BE, 0], // Delta of each sample
- ]
- },
- stsd: {
- container: 'stbl',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: true,
- body: [['entry_count', UInt32BE, 1] // For each entry, one of these three boxes depending on the handler:
- // VisualSampleEntry, AudioSampleEntry, HintSampleEntry
- ]
- },
- /*
- ISO/IEC 14496-12:2005(E) 8.16.2 (pp. 28)
- aligned(8) abstract class SampleEntry (unsigned int(32) format)
- extends Box(format){
- const unsigned int(8)[6] reserved = 0;
- unsigned int(16) data_reference_index;
- }
- class VisualSampleEntry(codingname) extends SampleEntry (codingname){
- unsigned int(16) pre_defined = 0;
- const unsigned int(16) reserved = 0;
- unsigned int(32)[3] pre_defined = 0;
- unsigned int(16) width;
- unsigned int(16) height;
- template unsigned int(32) horizresolution = 0x00480000; // 72 dpi
- template unsigned int(32) vertresolution = 0x00480000; // 72 dpi
- const unsigned int(32) reserved = 0;
- template unsigned int(16) frame_count = 1;
- string[32] compressorname;
- template unsigned int(16) depth = 0x0018;
- int(16) pre_defined = -1;
- }
- ISO/IEC 14496-15:2004(E) 5.3.4.1 (pp. 14)
- class AVCSampleEntry() extends VisualSampleEntry (‘avc1’){
- AVCConfigurationBox config;
- MPEG4BitRateBox (); // optional
- MPEG4ExtensionDescriptorsBox (); // optional
- }
- */
- avc1: {
- container: 'stsd',
- mandatory: false,
- quantity: 'one',
- box: 'Box',
- is_container: true,
- 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]]
- },
- /*
- class AVCConfigurationBox extends Box(‘avcC’) {
- AVCDecoderConfigurationRecord() AVCConfig;
- }
- ISO/IEC 14496-15:2004(E) 5.2.4.1.1 (pp. 12)
- aligned(8) class AVCDecoderConfigurationRecord {
- unsigned int(8) configurationVersion = 1;
- unsigned int(8) AVCProfileIndication;
- unsigned int(8) profile_compatibility;
- unsigned int(8) AVCLevelIndication;
- bit(6) reserved = ‘111111’b;
- unsigned int(2) lengthSizeMinusOne;
- bit(3) reserved = ‘111’b;
- unsigned int(5) numOfSequenceParameterSets;
- for (i=0; i< numOfSequenceParameterSets; i++) {
- unsigned int(16) sequenceParameterSetLength ;
- bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;
- }
- unsigned int(8) numOfPictureParameterSets;
- for (i=0; i< numOfPictureParameterSets; i++) {
- unsigned int(16) pictureParameterSetLength;
- bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;
- }
- }
- */
- avcC: {
- container: 'avc1',
- mandatory: false,
- quantity: 'one',
- box: 'Box',
- is_container: false,
- body: [['configurationVersion', UInt8, 1], ['AVCProfileIndication', UInt8, 0x4d], ['profile_compatibility', UInt8, 0x00], ['AVCLevelIndication', UInt8, 0x29], // size = reserved 0b111111 + 0b11 NALUnitLength (0b11 = 4-byte)
- ['lengthSizeMinusOne', UInt8, 255], // Example SPS (length 20):
- // [0x67, 0x4d, 0x00, 0x29, 0xe2, 0x90, 0x0f, 0x00,
- // 0x44, 0xfc, 0xb8, 0x0b, 0x70, 0x10, 0x10, 0x1a,
- // 0x41, 0xe2, 0x44, 0x54]
- // number of sets = reserved 0b111 + number of SPS (0b00001 = 1)
- // ['numOfSequenceParameterSets', UInt8, 0b11100001],
- // ['sequenceParameterSetLength', UInt16BE, 0], // Lenght in bytes of the SPS that follows
- // ['sequenceParameterSetNALUnit', UInt8Array, []],
- // These are packed in a single custom element:
- ['sequenceParameterSets', createParameterSetArrayClass(0xe0), []], // Example PPS (length 4):
- // [0x68, 0xee, 0x3c, 0x80]
- // ['numOfPictureParameterSets', UInt8, 1], // number of PPS
- // ['pictureParameterSetLength', UInt16BE, 0], // Length in bytes of the PPS that follows
- // ['pictureParameterSetNALUnit', UInt8Array, []]
- // These are packed in a single custom element:
- ['pictureParameterSets', createParameterSetArrayClass(), []]]
- },
- /*
- ISO/IEC 14496-12:2005(E) 8.16.2 (pp. 28)
- aligned(8) abstract class SampleEntry (unsigned int(32) format)
- extends Box(format){
- const unsigned int(8)[6] reserved = 0;
- unsigned int(16) data_reference_index;
- }
- class AudioSampleEntry(codingname) extends SampleEntry (codingname){
- const unsigned int(32)[2] reserved = 0;
- template unsigned int(16) channelcount = 2;
- template unsigned int(16) samplesize = 16;
- unsigned int(16) pre_defined = 0;
- const unsigned int(16) reserved = 0 ;
- template unsigned int(32) samplerate = {timescale of media}<<16;
- }
- */
- mp4a: {
- container: 'stsd',
- mandatory: false,
- quantity: 'one',
- box: 'Box',
- is_container: true,
- 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
- ]
- },
- /* Elementary stream descriptor
- basic box that holds only an ESDescriptor
- reference: 'https://developer.apple.com/library/content/documentation/QuickTime/
- QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-124774'
- Descriptors have a tag that identifies them, specified in ISO/IEC 14496-1 8.3.12
- ISO/IEC 14496-1 8.3.3 (pp. 24) ES_Descriptor
- aligned(8) class ES_Descriptor : bit(8) tag=ES_DescrTag {
- bit(8) length;
- bit(16) ES_ID;
- bit(1) streamDependenceFlag;
- bit(1) URL_Flag;
- const bit(1) reserved=1;
- bit(5) streamPriority;
- if (streamDependenceFlag)
- bit(16) dependsOn_ES_ID;
- if (URL_Flag)
- bit(8) URLstring[length-3-(streamDependencFlag*2)];
- ExtensionDescriptor extDescr[0 .. 255];
- LanguageDescriptor langDescr[0 .. 1];
- DecoderConfigDescriptor decConfigDescr;
- SLConfigDescriptor slConfigDescr;
- IPI_DescPointer ipiPtr[0 .. 1];
- IP_IdentificationDataSet ipIDS[0 .. 1];
- QoS_Descriptor qosDescr[0 .. 1];
- }
- aligned(8) class DecoderConfigDescriptor
- : bit(8) tag=DecoderConfigDescrTag {
- bit(8) length;
- bit(8) objectProfileIndication;
- bit(6) streamType;
- bit(1) upStream;
- const bit(1) reserved=1;
- bit(24) bufferSizeDB;
- bit(32) maxBitrate;
- bit(32) avgBitrate;
- DecoderSpecificInfo decSpecificInfo[];
- }
- aligned(8) class DecoderSpecificInfoShort extends DecoderSpecificInfo
- : bit(8) tag=DecSpecificInfoShortTag
- {
- bit(8) length;
- bit(8) specificInfo[length];
- }
- aligned(8) class SLConfigDescriptor : bit(8) tag=SLConfigDescrTag {
- bit(8) length;
- bit(8) predefined;
- if (predefined==0) {
- bit(1) useAccessUnitStartFlag;
- bit(1) useAccessUnitEndFlag;
- bit(1) useRandomAccessPointFlag;
- bit(1) usePaddingFlag;
- bit(1) useTimeStampsFlag;
- bit(1) useWallClockTimeStampFlag;
- bit(1) useIdleFlag;
- bit(1) durationFlag;
- bit(32) timeStampResolution;
- bit(32) OCRResolution;
- bit(8) timeStampLength; // must be less than 64
- bit(8) OCRLength;
- // must be less than 64
- bit(8) AU_Length;
- // must be less than 32
- bit(8) instantBitrateLength;
- bit(4) degradationPriorityLength;
- bit(4) seqNumLength;
- if (durationFlag) {
- bit(32) timeScale;
- bit(16) accessUnitDuration;
- bit(16) compositionUnitDuration;
- }
- if (!useTimeStampsFlag) {
- if (useWallClockTimeStampFlag)
- double(64) wallClockTimeStamp;
- bit(timeStampLength) startDecodingTimeStamp;
- bit(timeStampLength) startCompositionTimeStamp;
- }
- }
- aligned(8) bit(1) OCRstreamFlag;
- const bit(7) reserved=0b1111.111;
- if (OCRstreamFlag)
- bit(16) OCR_ES_Id;
- }
- */
- esds: {
- container: 'mp4a',
- mandatory: false,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['ES_DescrTag', UInt8, 3], // length of the remainder of this descriptor in byte,
- // excluding trailing embedded descriptors.
- ['ES_DescrLength', UInt8, 25], ['ES_ID', UInt16BE, 1], ['flagsAndStreamPriority', UInt8, 0], ['DecoderConfigDescrTag', UInt8, 4], // length of the remainder of this descriptor in bytes,
- // excluding trailing embedded descriptors.
- ['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
- ]
- },
- // Sample Size Box
- stsz: {
- container: 'stbl',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['sample_size', UInt32BE, 0], ['sample_count', UInt32BE, 0] // For each sample up to sample_count, append an entry_size:
- // ['entry_size', UInt32BE, ],
- ]
- },
- // Sample To Chunk Box
- stsc: {
- container: 'stbl',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append these elements:
- // ['first_chunk', UInt32BE, ],
- // ['samples_per_chunk', UInt32BE, ],
- // ['samples_description_index', UInt32BE, ],
- ]
- },
- // Chunk Offset Box
- stco: {
- container: 'stbl',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append an element:
- // ['chunk_offset', UInt32BE, ],
- ]
- },
- // Sync Sample Box
- stss: {
- container: 'stbl',
- mandatory: false,
- quantity: 'one-',
- box: 'FullBox',
- is_container: false,
- body: [['entry_count', UInt32BE, 0] // For each entry up to entry_count, append an element:
- // ['sample_number', UInt32BE, ],
- ]
- },
- // Edit Box
- edts: {
- container: 'trak',
- mandatory: false,
- quantity: 'one-',
- box: 'Box',
- is_container: true
- },
- // Edit List Box
- elst: {
- container: 'edts',
- mandatory: false,
- quantity: 'one-',
- box: 'FullBox',
- is_container: false,
- body: [['entry_count', UInt32BE, 1], ['segment_duration', UInt32BE, 0], ['media_time', UInt32BE, 0xffffffff], ['media_rate_integer', UInt16BE, 1], ['media_rate_fraction', UInt16BE, 0]]
- },
- mvex: {
- container: 'moov',
- mandatory: false,
- quantity: 'one-',
- box: 'Box',
- is_container: true
- },
- mehd: {
- container: 'mvex',
- mandatory: false,
- quantity: 'one-',
- box: 'FullBox',
- is_container: false,
- body: [['fragment_duration', UInt32BE, 0] // Total duration of movie
- ]
- },
- trex: {
- container: 'mvex',
- mandatory: true,
- quantity: 'one+',
- box: 'FullBox',
- is_container: false,
- body: [['track_ID', UInt32BE, 1], // The track to which this data is applicable
- ['default_sample_description_index', UInt32BE, 1], ['default_sample_duration', UInt32BE, 0], ['default_sample_size', UInt32BE, 0], ['default_sample_flags', UInt32BE, 0]]
- },
- moof: {
- container: 'file',
- mandatory: false,
- quantity: 'zero+',
- box: 'Box',
- is_container: false
- },
- mfhd: {
- container: 'moof',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- body: [['sequence_number', UInt32BE, 0] // A number associated with this fragment
- ]
- },
- traf: {
- container: 'moof',
- mandatory: false,
- quantity: 'zero+',
- box: 'Box',
- is_container: true
- },
- tfhd: {
- container: 'traf',
- mandatory: true,
- quantity: 'one',
- box: 'FullBox',
- is_container: false,
- // Flag values for the track fragment header:
- // 0x000001 base-data-offset-present
- // 0x000002 sample-description-index-present
- // 0x000008 default-sample-duration-present
- // 0x000010 default-sample-size-present
- // 0x000020 default-sample-flags-present
- // 0x010000 duration-is-empty
- // 0x020000 default-base-is-moof
- config: {
- flags: 0x000020 // default sample flags present
- },
- body: [['track_ID', UInt32BE, 1], // The track to which this data is applicable
- // ['base_data_offset', UInt64BE, 0],
- // ['default_sample_description_index', UInt32BE, 0],
- // ['default_sample_duration', UInt32BE, 0],
- // ['default_sample_size', UInt32BE, 0],
- ['default_sample_flags', UInt32BE, 0]]
- },
- tfdt: {
- container: 'traf',
- mandatory: false,
- quantity: 'one-',
- box: 'FullBox',
- is_container: false,
- config: {
- version: 1 // Version 1 uses 64-bit value for baseMediaDecodeTime
- },
- body: [['baseMediaDecodeTime', UInt64BE, 0]]
- },
- trun: {
- container: 'traf',
- mandatory: false,
- quantity: 'zero+',
- box: 'FullBox',
- is_container: false,
- // Flag values for the track fragment header:
- // 0x000001 data-offset-present
- // 0x000004 first-sample-flags-present
- // 0x000100 sample-duration-present
- // 0x000200 sample-size-present
- // 0x000400 sample-flags-present
- // 0x000800 sample-composition-time-offsets-present
- config: {
- flags: 0x000305 // default sample flags present
- },
- body: [['sample_count', UInt32BE, 1], // How many samples there are
- ['data_offset', UInt32BE, 0], ['first_sample_flags', UInt32BE, 0], ['sample_duration', UInt32BE, 0], ['sample_size', UInt32BE, 0] // ['sample_flags', UInt32BE, 0],
- // ['sample_composition_time_offset', UInt32BE, 0],
- ]
- },
- // Unknown Box, used for parsing
- '....': {
- box: 'Box',
- is_container: false,
- body: []
- },
- // File Box, special box without any headers
- file: {
- box: 'None',
- is_container: true,
- mandatory: true,
- quantity: 'one'
- }
- };
- /**
- * Helper functions to generate some standard elements that are needed by
- * all types of boxes.
- * All boxes have a length and type, where so-called full boxes have an
- * additional 4-bytes (1-byte version and 3-byte flags fields).
- */
- var Header = /*#__PURE__*/function () {
- function Header() {
- _classCallCheck(this, Header);
- }
- _createClass(Header, null, [{
- key: "None",
- value: function None() {
- return [];
- }
- }, {
- key: "Box",
- value: function Box(type) {
- return [['size', UInt32BE, 0], ['type', CharArray, type]];
- }
- }, {
- key: "FullBox",
- value: function FullBox(type) {
- return [].concat(this.Box(type), [['version', UInt8, 0x00], ['flags', UInt24BE, 0x000000]]);
- }
- }]);
- return Header;
- }();
- /**
- * Box class.
- *
- * Defines a box as an entity similar to a C struct, where the struct is
- * represented by a Map of elements.
- * Each element is an object with at least:
- * - a 'byteLength' property (size of element in bytes)
- * - a 'copy' method (BufferMutation signature)
- */
- var Box = /*#__PURE__*/function (_BoxElement12) {
- _inherits(Box, _BoxElement12);
- var _super12 = _createSuper(Box);
- /**
- * Create a new Box.
- * @param {String} type 4-character ASCII string
- * @param {Object} config Configuration holding (key: value) fields
- */
- function Box(type, config) {
- var _this12;
- _classCallCheck(this, Box);
- _this12 = _super12.call(this, 0);
- _defineProperty(_assertThisInitialized(_this12), "type", void 0);
- _defineProperty(_assertThisInitialized(_this12), "config", void 0);
- _defineProperty(_assertThisInitialized(_this12), "struct", void 0);
- _this12.type = type;
- var spec = BOXSPEC[_this12.type];
- if (spec === undefined) {
- throw new Error("unknown box type: ".concat(type));
- }
- _this12.config = Object.assign({}, spec.config, config);
- var header = Header[spec.box](_this12.type);
- var body = spec.body || []; // Uglify changes the name of the original class, so this doesn't work.
- // TODO: find a better way to check for this.
- // if (spec.body === undefined && this.constructor.name !== 'Container') {
- // throw new Error(`Body missing but '${type}' is not a container box`);
- // }
- // Initialize all elements, an element is something with a byteLength
- _this12.struct = new Map();
- var offset = 0;
- var _iterator2 = _createForOfIteratorHelper([].concat(header, body)),
- _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- var _step2$value = _slicedToArray(_step2.value, 3),
- _key = _step2$value[0],
- Type = _step2$value[1],
- defaultValue = _step2$value[2];
- if (_this12.has(_key)) {
- throw new Error('Trying to add existing key');
- }
- var value = defaultValue;
- if (_this12.config[_key]) {
- value = _this12.config[_key];
- }
- var element = new Type(value);
- _this12.struct.set(_key, {
- offset: offset,
- element: element
- });
- offset += element.byteLength;
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- _this12.byteLength = offset;
- return _this12;
- }
- /**
- * Get access to an element based on it's name.
- * @param {String} key The element's name
- * @return {Element} Object with 'byteLength' property and 'copy' method
- */
- _createClass(Box, [{
- key: "element",
- value: function element(key) {
- var value = this.struct.get(key);
- if (value === undefined) {
- throw new Error('invalid key');
- }
- return value.element;
- }
- /**
- * Set an element's value.
- * @param {String} key The element's name
- * @param {Number|Array} value The element's (new) value
- * @return {undefined}
- */
- }, {
- key: "set",
- value: function set(key, value) {
- this.element(key).value = value;
- }
- /**
- * Get an element's value.
- * @param {String} key The element's name
- * @return {Number|Array} The element's value
- */
- }, {
- key: "get",
- value: function get(key) {
- return this.element(key).value;
- }
- /**
- * Get an element's offset.
- * @param {String} key The element's name
- * @return {Number} The element's offset
- */
- }, {
- key: "offset",
- value: function offset(key) {
- var value = this.struct.get(key);
- if (value === undefined) {
- throw new Error('invalid key');
- }
- return value.offset;
- }
- /**
- * Check if a certain element exists
- * @param {String} key The element's name
- * @return {Boolean} true if the element is known, false if not
- */
- }, {
- key: "has",
- value: function has(key) {
- return this.struct.has(key);
- }
- /**
- * Add a new element to the box.
- * @param {String} key A _new_ non-existing element name.
- * @param {Object} element Something with a 'byteLength' property and 'copy' method.
- * @return {Box} this box, so that 'add' can be used in a chain
- */
- }, {
- key: "add",
- value: function add(key, element) {
- if (this.has(key)) {
- throw new Error('Trying to add existing key');
- }
- this.struct.set(key, {
- offset: this.byteLength,
- element: element
- });
- this.byteLength += element.byteLength;
- return this;
- }
- /**
- * Create a buffer and copy all element values to it.
- * @return {Buffer} Data representing the box.
- */
- }, {
- key: "buffer",
- value: function buffer() {
- var buffer = Buffer.allocUnsafe(this.byteLength);
- this.copy(buffer);
- return buffer;
- }
- /**
- * Copy all values of the box into an existing buffer.
- * @param {Buffer} buffer The target buffer to accept the box data
- * @param {Number} [offset=0] The number of bytes into the target to start at.
- * @return {undefined}
- */
- }, {
- key: "copy",
- value: function copy(buffer) {
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- // Before writing, make sure the size property is set correctly.
- this.set('size', this.byteLength);
- var _iterator3 = _createForOfIteratorHelper(this.struct.values()),
- _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- var entry = _step3.value;
- entry.element.copy(buffer, offset + entry.offset);
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- }
- /**
- * Read element values from a box's data representation.
- * @param {buffer} buffer The source buffer with box data
- * @param {Number} [offset=0] The number of bytes into the source to start at.
- * @return {undefined}
- */
- }, {
- key: "load",
- value: function load(buffer) {
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var _iterator4 = _createForOfIteratorHelper(this.struct.values()),
- _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
- var entry = _step4.value;
- if (entry.element.load !== undefined) {
- entry.element.load(buffer, offset + entry.offset);
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- }
- /**
- * Pretty-format an entire box as an element/box hierarchy.
- * @param {Number} [indent=0] How large an indentation to use for the hierarchy
- * @return {undefined}
- */
- }, {
- key: "format",
- value: function format() {
- var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var lines = [' '.repeat(indent) + "[".concat(this.type, "] (").concat(this.byteLength, ")")];
- var _iterator5 = _createForOfIteratorHelper(this.struct),
- _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
- var _step5$value = _slicedToArray(_step5.value, 2),
- _key2 = _step5$value[0],
- entry = _step5$value[1];
- var element = entry.element;
- if (element.format !== undefined) {
- lines.push(element.format(indent + 2));
- } else {
- lines.push(' '.repeat(indent + 2) + "".concat(_key2, " = ").concat(element.value, " (").concat(element.byteLength, ")"));
- }
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- return lines.join('\n');
- }
- /**
- * Pretty-print an entire box as an element/box hierarchy.
- * @param {Number} [indent=0] How large an indentation to use for the hierarchy
- * @return {undefined}
- */
- }, {
- key: "print",
- value: function print(indent) {
- console.warn(this.format(indent));
- }
- }]);
- return Box;
- }(BoxElement);
- /**
- * Container class
- *
- * special box with an 'add' method which allows appending of other boxes,
- * and a 'parse' method to extract contained boxes.
- */
- var Container = /*#__PURE__*/function (_Box) {
- _inherits(Container, _Box);
- var _super13 = _createSuper(Container);
- /**
- * Create a new container box
- * @param {String} type 4-character ASCII string
- * @param {Object} config Configuration holding (key: value) fields
- * @param {Box} boxes One or more boxes to append.
- */
- function Container(type, config) {
- var _this14;
- var _this13;
- _classCallCheck(this, Container);
- _this13 = _super13.call(this, type, config);
- _defineProperty(_assertThisInitialized(_this13), "boxSize", void 0);
- _this13.boxSize = 0;
- for (var _len = arguments.length, boxes = new Array(_len > 2 ? _len - 2 : 0), _key3 = 2; _key3 < _len; _key3++) {
- boxes[_key3 - 2] = arguments[_key3];
- }
- (_this14 = _this13).append.apply(_this14, boxes);
- return _this13;
- }
- /**
- * Add one or more boxes to the container.
- * @param {Box} boxes The box(es) to append
- * @return {Box} this container, so that add can be used in a chain
- */
- _createClass(Container, [{
- key: "append",
- value: function append() {
- for (var _len2 = arguments.length, boxes = new Array(_len2), _key4 = 0; _key4 < _len2; _key4++) {
- boxes[_key4] = arguments[_key4];
- }
- for (var _i2 = 0, _boxes = boxes; _i2 < _boxes.length; _i2++) {
- var box = _boxes[_i2];
- this.add("box_".concat(this.boxSize++), box);
- }
- return this;
- }
- /**
- * Parse a container box by looking for boxes that it contains, and
- * recursively proceed when it is another container.
- *
- * FIXME: this cannot properly handle different versions of the FullBox,
- * currenlty the loader is hardcoded to the version used in this file.
- * Also, appearance of an esds box is assumed to be AAC audio information,
- * while the avcC box signals H.264 video information.
- *
- * @param {Buffer} data The data to parse.
- * @return {undefined}
- */
- }, {
- key: "parse",
- value: function parse(data) {
- var tracks = [];
- while (data.byteLength > 0) {
- var type = new CharArray('....');
- type.load(data, 4);
- var boxType = type.value;
- var spec = BOXSPEC[boxType];
- var box = void 0;
- if (spec !== undefined) {
- if (spec.is_container) {
- box = new Container(boxType);
- box.load(data);
- var boxTracks = box.parse(data.slice(box.byteLength, box.get('size')));
- tracks.push.apply(tracks, _toConsumableArray(boxTracks));
- } else {
- box = new Box(boxType);
- box.load(data); // Handle 2 kinds of tracks with streaming MP4: video or audio
- if (boxType === 'avcC') {
- var profile = box.element('AVCProfileIndication').value.toString(16).padStart(2, 0);
- var compat = box.element('profile_compatibility').value.toString(16).padStart(2, 0);
- var level = box.element('AVCLevelIndication').value.toString(16).padStart(2, 0);
- tracks.push({
- type: 'video',
- mime: "avc1.".concat(profile).concat(compat).concat(level)
- });
- } else if (boxType === 'esds') {
- var audioConfigBytes = box.element('audioConfigBytes').value;
- var objectTypeIndication = audioConfigBytes >>> 11 & 0x001f;
- tracks.push({
- type: 'audio',
- mime: "mp4a.40.".concat(objectTypeIndication)
- });
- }
- }
- } else {
- box = new Box('....');
- box.load(data);
- box.type = box.get('type');
- }
- this.append(box);
- data = data.slice(box.get('size'));
- }
- return tracks;
- }
- }]);
- return Container;
- }(Box);
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/spsparser.ts":
- /*!******************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/spsparser.ts ***!
- \******************************************************/
- /*! namespace exports */
- /*! export SPSParser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "SPSParser": () => /* binding */ SPSParser
- /* harmony export */ });
- /* harmony import */ var _bufferreader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bufferreader */ "./lib/components/mp4muxer/helpers/bufferreader.ts");
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- /**
- * Defines functions for writing to a binary buffer.
- * @class BufferWriter
- * @constructor
- * @param {Number} size The size of the buffer.
- */
- var SPSParser = /*#__PURE__*/function () {
- function SPSParser(buffer) {
- _classCallCheck(this, SPSParser);
- _defineProperty(this, "reader", void 0);
- this.reader = new _bufferreader__WEBPACK_IMPORTED_MODULE_0__.BufferReader(buffer);
- }
- _createClass(SPSParser, [{
- key: "parse",
- value: function parse() {
- // nalhdr
- this.reader.readNext();
- var profile = this.reader.readNext(); // constraints
- this.reader.readNext();
- var level = this.reader.readNext(); // seqParameterSetId
- this.reader.readUnsignedExpGolomb();
- if ([100, 110, 122, 244, 44, 83, 86, 118].indexOf(profile) >= 0) {
- var chromaFormat = this.reader.readUnsignedExpGolomb();
- if (chromaFormat === 3) {
- // Separate color plane flag
- this.reader.readBits(1);
- } // bitDepthLumaMinus8
- this.reader.readUnsignedExpGolomb(); // bitDepthChromaMinus8
- this.reader.readUnsignedExpGolomb(); // qpPrimeYZeroTransformBypassFlag
- this.reader.readBits(1);
- var seqScalingMatrix = this.reader.readBits(1);
- if (seqScalingMatrix) {
- for (var k = 0; k < (chromaFormat !== 3 ? 8 : 12); k++) {
- // seqScalingListPresentFlag
- this.reader.readBits(1); // TODO: More logic goes here..
- }
- }
- } // log2MaxFrameNumMinus4
- this.reader.readUnsignedExpGolomb();
- var picOrderCntType = this.reader.readUnsignedExpGolomb();
- if (picOrderCntType === 0) {
- // log2MaxPicOrderCntLsbMinus4
- this.reader.readUnsignedExpGolomb();
- } else if (picOrderCntType === 1) {
- var numRefFramesInPic = 0;
- this.reader.readBits(1);
- this.reader.readSignedExpGolomb();
- this.reader.readSignedExpGolomb();
- numRefFramesInPic = this.reader.readUnsignedExpGolomb();
- for (var i = 0; i < numRefFramesInPic; i++) {
- this.reader.readSignedExpGolomb();
- }
- } // maxNumRefFrames
- this.reader.readUnsignedExpGolomb(); // gapsInFrameNumValueAllowedFlag
- this.reader.readBits(1);
- var picWidthInMbsMinus1 = this.reader.readUnsignedExpGolomb();
- var picHeightInMapUnitsMinus1 = this.reader.readUnsignedExpGolomb();
- var picFrameMbsOnlyFlag = this.reader.readBits(1); // direct8x8InferenceFlag
- this.reader.readBits(1);
- var frameCroppingFlag = this.reader.readBits(1);
- var frameCropLeftOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
- var frameCropRightOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
- var frameCropTopOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
- var frameCropBottomOffset = frameCroppingFlag ? this.reader.readUnsignedExpGolomb() : 0;
- var w = (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2;
- var h = (2 - picFrameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2;
- return {
- profile: profile,
- level: level / 10.0,
- width: w,
- height: h
- };
- }
- }]);
- return SPSParser;
- }();
- /***/ }),
- /***/ "./lib/components/mp4muxer/helpers/utils.ts":
- /*!**************************************************!*\
- !*** ./lib/components/mp4muxer/helpers/utils.ts ***!
- \**************************************************/
- /*! namespace exports */
- /*! export b64ToUint6 [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export base64DecToArr [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "b64ToUint6": () => /* binding */ b64ToUint6,
- /* harmony export */ "base64DecToArr": () => /* binding */ base64DecToArr
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- function b64ToUint6(nChr) {
- 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;
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
- function base64DecToArr(sBase64, nBlocksSize) {
- var sB64Enc = sBase64.replace(/[^A-Za-z0-9+/]/g, '');
- var nInLen = sB64Enc.length;
- var nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2;
- var taBytes = new Uint8Array(nOutLen);
- var nMod3;
- var nMod4;
- var nUint24 = 0;
- var nOutIdx = 0;
- for (var nInIdx = 0; nInIdx < nInLen; nInIdx++) {
- nMod4 = nInIdx & 3;
- nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;
- if (nMod4 === 3 || nInLen - nInIdx === 1) {
- for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
- taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
- }
- nUint24 = 0;
- }
- }
- return taBytes;
- }
- /***/ }),
- /***/ "./lib/components/mp4muxer/index.ts":
- /*!******************************************!*\
- !*** ./lib/components/mp4muxer/index.ts ***!
- \******************************************/
- /*! namespace exports */
- /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Mp4Muxer": () => /* binding */ Mp4Muxer
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _helpers_isom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/isom */ "./lib/components/mp4muxer/helpers/isom.ts");
- /* harmony import */ var _helpers_boxbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/boxbuilder */ "./lib/components/mp4muxer/helpers/boxbuilder.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _h264depay_parser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../h264depay/parser */ "./lib/components/h264depay/parser.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * Component that converts elementary stream data into MP4 boxes honouring
- * the ISO BMFF Byte Stream (Some extra restrictions are involved).
- */
- var Mp4Muxer = /*#__PURE__*/function (_Tube) {
- _inherits(Mp4Muxer, _Tube);
- var _super = _createSuper(Mp4Muxer);
- /**
- * Create a new mp4muxer component.
- * @return {undefined}
- */
- function Mp4Muxer() {
- var _this;
- _classCallCheck(this, Mp4Muxer);
- var boxBuilder = new _helpers_boxbuilder__WEBPACK_IMPORTED_MODULE_4__.BoxBuilder();
- var onSync = function onSync(ntpPresentationTime) {
- _this.onSync && _this.onSync(ntpPresentationTime);
- };
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_5__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.SDP) {
- /**
- * Arrival of SDP signals the beginning of a new movie.
- * Set up the ftyp and moov boxes.
- */
- // Why is this here? These should be default inside the mvhd box?
- var now = Math.floor(new Date().getTime() / 1000 + 2082852000);
- var ftyp = new _helpers_isom__WEBPACK_IMPORTED_MODULE_3__.Box('ftyp');
- var moov = boxBuilder.moov(msg.sdp, now);
- var data = Buffer.allocUnsafe(ftyp.byteLength + moov.byteLength);
- ftyp.copy(data, 0);
- moov.copy(data, ftyp.byteLength);
- debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:mp4:isom')("ftyp: ".concat(ftyp.format()));
- debug__WEBPACK_IMPORTED_MODULE_2___default()('msl:mp4:isom')("moov: ".concat(moov.format())); // Set up a list of tracks that contain info about
- // the type of media, encoding, and codec are present.
- var tracks = msg.sdp.media.map(function (media) {
- var isrecv = media.sendonly !== undefined ? false : true;
- return {
- type: media.type,
- encoding: media.rtpmap && media.rtpmap.encodingName,
- mime: media.mime,
- codec: media.codec,
- isrecv: isrecv
- };
- });
- this.push({
- type: _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ISOM,
- data: data,
- tracks: tracks,
- ftyp: ftyp,
- moov: moov
- });
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ELEMENTARY || msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.H264) {
- /**
- * Otherwise we are getting some elementary stream data.
- * Set up the moof and mdat boxes.
- */
- var payloadType = msg.payloadType,
- timestamp = msg.timestamp,
- ntpTimestamp = msg.ntpTimestamp;
- var trackId = boxBuilder.trackIdMap[payloadType];
- if (trackId) {
- if (!boxBuilder.ntpPresentationTime) {
- boxBuilder.setPresentationTime(trackId, ntpTimestamp);
- if (boxBuilder.ntpPresentationTime) {
- onSync(boxBuilder.ntpPresentationTime);
- }
- }
- var checkpointTime = undefined;
- var idrPicture = msg.type === _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.H264 ? msg.nalType === _h264depay_parser__WEBPACK_IMPORTED_MODULE_7__.NAL_TYPES.IDR_PICTURE : undefined;
- if (boxBuilder.ntpPresentationTime && idrPicture && msg.ntpTimestamp !== undefined) {
- checkpointTime = (msg.ntpTimestamp - boxBuilder.ntpPresentationTime) / 1000;
- }
- var byteLength = msg.data.byteLength;
- var moof = boxBuilder.moof({
- trackId: trackId,
- timestamp: timestamp,
- byteLength: byteLength
- });
- var mdat = boxBuilder.mdat(msg.data);
- var _data = Buffer.allocUnsafe(moof.byteLength + mdat.byteLength);
- moof.copy(_data, 0);
- mdat.copy(_data, moof.byteLength);
- this.push({
- type: _message__WEBPACK_IMPORTED_MODULE_1__.MessageType.ISOM,
- data: _data,
- moof: moof,
- mdat: mdat,
- ntpTimestamp: ntpTimestamp,
- checkpointTime: checkpointTime,
- idrPicture: idrPicture
- });
- }
- } else {
- // No message type we recognize, pass it on.
- this.push(msg);
- }
- callback();
- }
- });
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "boxBuilder", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
- _this.boxBuilder = boxBuilder;
- return _this;
- }
- _createClass(Mp4Muxer, [{
- key: "bitrate",
- get: function get() {
- return this.boxBuilder.trackData && this.boxBuilder.trackData.map(function (data) {
- return data.bitrate;
- });
- }
- }, {
- key: "framerate",
- get: function get() {
- return this.boxBuilder.trackData && this.boxBuilder.trackData.map(function (data) {
- return data.framerate;
- });
- }
- }, {
- key: "ntpPresentationTime",
- get: function get() {
- return this.boxBuilder.ntpPresentationTime;
- }
- }]);
- return Mp4Muxer;
- }(_component__WEBPACK_IMPORTED_MODULE_6__.Tube);
- /***/ }),
- /***/ "./lib/components/mse/index.ts":
- /*!*************************************!*\
- !*** ./lib/components/mse/index.ts ***!
- \*************************************/
- /*! namespace exports */
- /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "MseSink": () => /* binding */ MseSink
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/protocols/rtcp */ "./lib/utils/protocols/rtcp.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var TRIGGER_THRESHOLD = 100;
- var debug = debug__WEBPACK_IMPORTED_MODULE_8___default()('msl:mse');
- var MseSink = /*#__PURE__*/function (_Sink) {
- _inherits(MseSink, _Sink);
- var _super = _createSuper(MseSink);
- /**
- * Create a Media component.
- *
- * The constructor sets up two streams and connects them to the MediaSource.
- *
- * @param {MediaSource} mse - A media source.
- */
- function MseSink(el) {
- var _this;
- _classCallCheck(this, MseSink);
- if (el === undefined) {
- throw new Error('video element argument missing');
- }
- var mse;
- var sourceBuffer;
- /**
- * Set up an incoming stream and attach it to the sourceBuffer.
- */
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_10__.Writable({
- objectMode: true,
- write: function write(msg, _, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_11__.MessageType.ISOM) {
- // ISO BMFF Byte Stream data to be added to the source buffer
- _this._done = callback;
- if (msg.tracks !== undefined) {
- var _tracks = msg.tracks; // Start a new movie (new SDP info available)
- _this._lastCheckpointTime = 0; // Start a new mediaSource and prepare it with a sourceBuffer.
- // When ready, this component's .onSourceOpen callback will be called
- // with the mediaSource, and a list of valid/ignored media.
- mse = new MediaSource();
- el.src = window.URL.createObjectURL(mse);
- var handler = function handler() {
- window.URL.revokeObjectURL(el.src);
- mse.removeEventListener('sourceopen', handler);
- _this.onSourceOpen && _this.onSourceOpen(mse, _tracks); // MIME codecs: https://tools.ietf.org/html/rfc6381
- var mimeCodecs = _tracks.map(function (track) {
- return track.mime;
- }).filter(function (mime) {
- return mime;
- });
- var codecs = mimeCodecs.length !== 0 ? mimeCodecs.join(', ') : 'avc1.640029, mp4a.40.2';
- sourceBuffer = _this.addSourceBuffer(el, mse, "video/mp4; codecs=\"".concat(codecs, "\""));
- sourceBuffer.onerror = function (e) {
- console.error('error on SourceBuffer: ', e);
- incoming.emit('error');
- };
- try {
- sourceBuffer.appendBuffer(msg.data);
- _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
- } catch (err) {
- console.error('failed to append to SourceBuffer: ', err, msg);
- }
- };
- mse.addEventListener('sourceopen', handler);
- } else {
- // Continue current movie
- _this._lastCheckpointTime = msg.checkpointTime !== undefined ? msg.checkpointTime : _this._lastCheckpointTime;
- try {
- sourceBuffer.appendBuffer(msg.data);
- _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
- } catch (e) {
- console.error('failed to append to SourceBuffer: ', e, msg);
- }
- }
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_11__.MessageType.RTCP) {
- if ((0,_utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__.packetType)(msg.data) === _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_12__.BYE.packetType) {
- mse.readyState === 'open' && mse.endOfStream();
- }
- callback();
- } else {
- callback();
- }
- }
- });
- incoming.on('finish', function () {
- console.warn('incoming stream finished: end stream');
- mse && mse.readyState === 'open' && mse.endOfStream();
- }); // When an error is sent on the incoming stream, close it.
- incoming.on('error', function () {
- console.error('error on incoming stream: end stream');
- if (sourceBuffer.updating) {
- sourceBuffer.addEventListener('updateend', function () {
- mse.readyState === 'open' && mse.endOfStream();
- });
- } else {
- mse.readyState === 'open' && mse.endOfStream();
- }
- });
- /**
- * Set up outgoing stream.
- */
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_10__.Readable({
- objectMode: true,
- read: function read() {//
- }
- }); // When an error is sent on the outgoing stream, whine about it.
- outgoing.on('error', function () {
- console.warn('outgoing stream broke somewhere');
- });
- /**
- * initialize the component.
- */
- _this = _super.call(this, incoming, outgoing);
- _defineProperty(_assertThisInitialized(_this), "_videoEl", void 0);
- _defineProperty(_assertThisInitialized(_this), "_done", void 0);
- _defineProperty(_assertThisInitialized(_this), "_lastCheckpointTime", void 0);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
- _this._videoEl = el;
- _this._lastCheckpointTime = 0;
- return _this;
- }
- /**
- * Add a new sourceBuffer to the mediaSource and remove old ones.
- * @param {HTMLMediaElement} el The media element holding the media source.
- * @param {MediaSource} mse The media source the buffer should be attached to.
- * @param {String} [mimeType='video/mp4; codecs="avc1.4D0029, mp4a.40.2"'] [description]
- */
- _createClass(MseSink, [{
- key: "addSourceBuffer",
- value: function addSourceBuffer(el, mse, mimeType) {
- var _this2 = this;
- var sourceBuffer = mse.addSourceBuffer(mimeType);
- var trigger = 0;
- var onUpdateEndHandler = function onUpdateEndHandler() {
- ++trigger;
- if (trigger > TRIGGER_THRESHOLD && sourceBuffer.buffered.length) {
- trigger = 0;
- var index = sourceBuffer.buffered.length - 1;
- var start = sourceBuffer.buffered.start(index);
- var end = Math.min(el.currentTime, _this2._lastCheckpointTime) - 10;
- try {
- // remove all material up to 10 seconds before current time
- if (end > start) {
- sourceBuffer.remove(start, end);
- return; // this._done() will be called on the next updateend event!
- }
- } catch (e) {
- console.warn(e);
- }
- }
- _this2._done && _this2._done();
- };
- sourceBuffer.addEventListener('updateend', onUpdateEndHandler);
- return sourceBuffer;
- }
- }, {
- key: "currentTime",
- get: function get() {
- return this._videoEl.currentTime;
- }
- }, {
- key: "play",
- value: function play() {
- return this._videoEl.play();
- }
- }, {
- key: "pause",
- value: function pause() {
- return this._videoEl.pause();
- }
- }]);
- return MseSink;
- }(_component__WEBPACK_IMPORTED_MODULE_9__.Sink);
- /***/ }),
- /***/ "./lib/components/onvifdepay/index.ts":
- /*!********************************************!*\
- !*** ./lib/components/onvifdepay/index.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "ONVIFDepay": () => /* binding */ ONVIFDepay
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- 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; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var ONVIFDepay = /*#__PURE__*/function (_Tube) {
- _inherits(ONVIFDepay, _Tube);
- var _super = _createSuper(ONVIFDepay);
- function ONVIFDepay() {
- _classCallCheck(this, ONVIFDepay);
- var XMLPayloadType;
- var packets = [];
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_4__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.SDP) {
- var validMedia;
- var _iterator = _createForOfIteratorHelper(msg.sdp.media),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var media = _step.value;
- if (media.type === 'application' && media.rtpmap && media.rtpmap.encodingName === 'VND.ONVIF.METADATA') {
- validMedia = media;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- if (validMedia && validMedia.rtpmap) {
- XMLPayloadType = Number(validMedia.rtpmap.payloadType);
- }
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.RTP && (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payloadType)(msg.data) === XMLPayloadType) {
- // Add payload to packet stack
- packets.push((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payload)(msg.data)); // XML over RTP uses the RTP marker bit to indicate end
- // of fragmentation. At this point, the packets can be used
- // to reconstruct an XML packet.
- if ((0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.marker)(msg.data) && packets.length > 0) {
- var xmlMsg = {
- timestamp: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.timestamp)(msg.data),
- ntpTimestamp: msg.ntpTimestamp,
- payloadType: (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_6__.payloadType)(msg.data),
- data: Buffer.concat(packets),
- type: _message__WEBPACK_IMPORTED_MODULE_5__.MessageType.XML
- };
- callback(undefined, xmlMsg);
- packets = [];
- return;
- }
- callback();
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- }); // outgoing will be defaulted to a PassThrough stream
- return _super.call(this, incoming);
- }
- return ONVIFDepay;
- }(_component__WEBPACK_IMPORTED_MODULE_3__.Tube);
- /***/ }),
- /***/ "./lib/components/rtsp-parser/builder.ts":
- /*!***********************************************!*\
- !*** ./lib/components/rtsp-parser/builder.ts ***!
- \***********************************************/
- /*! namespace exports */
- /*! export builder [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "builder": () => /* binding */ builder
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_4__);
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- 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; }
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
- var DEFAULT_PROTOCOL = 'RTSP/1.0';
- var builder = function builder(msg) {
- if (!msg.method || !msg.uri) {
- throw new Error('message needs to contain a method and a uri');
- }
- var protocol = msg.protocol || DEFAULT_PROTOCOL;
- var headers = msg.headers || {};
- var messageString = ["".concat(msg.method, " ").concat(msg.uri, " ").concat(protocol), Object.entries(headers).map(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
- return key + ': ' + value;
- }).join('\r\n'), '\r\n'].join('\r\n');
- debug__WEBPACK_IMPORTED_MODULE_4___default()('msl:rtsp:outgoing')(messageString);
- return Buffer.from(messageString);
- };
- /***/ }),
- /***/ "./lib/components/rtsp-parser/index.ts":
- /*!*********************************************!*\
- !*** ./lib/components/rtsp-parser/index.ts ***!
- \*********************************************/
- /*! namespace exports */
- /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "RtspParser": () => /* binding */ RtspParser
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _builder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./builder */ "./lib/components/rtsp-parser/builder.ts");
- /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser */ "./lib/components/rtsp-parser/parser.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /**
- * A component that converts raw binary data into RTP/RTSP/RTCP packets on the
- * incoming stream, and converts RTSP commands to raw binary data on the outgoing
- * stream. The component is agnostic of any RTSP session details (you need an
- * RTSP session component in the pipeline).
- * @extends {Component}
- */
- var RtspParser = /*#__PURE__*/function (_Tube) {
- _inherits(RtspParser, _Tube);
- var _super = _createSuper(RtspParser);
- /**
- * Create a new RTSP parser component.
- * @return {undefined}
- */
- function RtspParser() {
- _classCallCheck(this, RtspParser);
- var parser = new _parser__WEBPACK_IMPORTED_MODULE_6__.Parser(); // Incoming stream
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW) {
- try {
- parser.parse(msg.data).forEach(function (message) {
- return incoming.push(message);
- });
- callback();
- } catch (e) {
- callback(e);
- }
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- }); // Outgoing stream
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_3__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP) {
- var data = (0,_builder__WEBPACK_IMPORTED_MODULE_5__.builder)(msg);
- callback(undefined, {
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RAW,
- data: data
- });
- } else {
- // don't touch other types
- callback(undefined, msg);
- }
- }
- });
- return _super.call(this, incoming, outgoing);
- }
- return RtspParser;
- }(_component__WEBPACK_IMPORTED_MODULE_2__.Tube);
- /***/ }),
- /***/ "./lib/components/rtsp-parser/parser.ts":
- /*!**********************************************!*\
- !*** ./lib/components/rtsp-parser/parser.ts ***!
- \**********************************************/
- /*! namespace exports */
- /*! export Parser [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Parser": () => /* binding */ Parser
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _utils_protocols_sdp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/protocols/sdp */ "./lib/utils/protocols/sdp.ts");
- /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- /**
- * The different possible internal parser states.
- */
- var STATE;
- (function (STATE) {
- STATE[STATE["IDLE"] = 0] = "IDLE";
- STATE[STATE["INTERLEAVED"] = 1] = "INTERLEAVED";
- STATE[STATE["RTSP"] = 2] = "RTSP";
- })(STATE || (STATE = {}));
- var INTERLEAVED_HEADER_BYTES = 4;
- var ASCII_DOLLAR = 0x24;
- /**
- * Extract packet information from the interleaved header
- * (4-byte section before the RTP packet).
- * @param {Array} chunks Buffers constituting the data.
- * @return {Object} Packet information (channel, begin, end).
- */
- var rtpPacketInfo = function rtpPacketInfo(chunks) {
- var header = Buffer.alloc(INTERLEAVED_HEADER_BYTES);
- var i = 0;
- var bytesRead = 0;
- while (bytesRead < header.length) {
- var chunk = chunks[i++];
- var bytesToRead = Math.min(chunk.length, header.length - bytesRead);
- chunk.copy(header, bytesRead, 0, bytesToRead);
- bytesRead += bytesToRead;
- }
- var channel = header[1];
- var begin = header.length;
- var length = header.readUInt16BE(2);
- var end = begin + length;
- return {
- channel: channel,
- begin: begin,
- end: end
- };
- };
- /**
- * Parser class with a public method that takes a data chunk and
- * returns an array of RTP/RTSP/RTCP message objects. The parser
- * keeps track of the added chunks internally in an array and only
- * concatenates chunks when data is needed to construct a message.
- * @type {[type]}
- */
- var Parser = /*#__PURE__*/function () {
- /**
- * Create a new Parser object.
- * @return {undefined}
- */
- function Parser() {
- _classCallCheck(this, Parser);
- _defineProperty(this, "_chunks", []);
- _defineProperty(this, "_length", 0);
- _defineProperty(this, "_state", STATE.IDLE);
- _defineProperty(this, "_packet", void 0);
- this._init();
- }
- /**
- * Initialize the internal properties to their default starting
- * values.
- * @return {undefined}
- */
- _createClass(Parser, [{
- key: "_init",
- value: function _init() {
- this._chunks = [];
- this._length = 0;
- this._state = STATE.IDLE;
- }
- }, {
- key: "_push",
- value: function _push(chunk) {
- this._chunks.push(chunk);
- this._length += chunk.length;
- }
- /**
- * Extract RTSP messages.
- * @return {Array} An array of messages, possibly empty.
- */
- }, {
- key: "_parseRtsp",
- value: function _parseRtsp() {
- var messages = [];
- var buffer = Buffer.concat(this._chunks);
- 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.
- if (chunkBodyOffset === -1) {
- return messages;
- }
- var rtspHeaderLength = chunkBodyOffset;
- var contentLength = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_6__.extractHeaderValue)(buffer, 'Content-Length');
- if (contentLength && parseInt(contentLength) > buffer.length - rtspHeaderLength) {
- // we do not have the whole body
- return messages;
- }
- this._init(); // resets this._chunks and this._length
- if (rtspHeaderLength === buffer.length || buffer[rtspHeaderLength] === ASCII_DOLLAR) {
- // No body in this chunk, assume there is no body?
- var packet = buffer.slice(0, rtspHeaderLength);
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP,
- data: packet
- }); // Add the remaining data to the chunk stack.
- var trailing = buffer.slice(rtspHeaderLength);
- this._push(trailing);
- } else {
- // Body is assumed to be the remaining data of the last chunk.
- var _packet = buffer;
- var body = buffer.slice(rtspHeaderLength);
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTSP,
- data: _packet
- });
- messages.push((0,_utils_protocols_sdp__WEBPACK_IMPORTED_MODULE_5__.messageFromBuffer)(body));
- }
- return messages;
- }
- /**
- * Extract RTP/RTCP messages.
- * @return {Array} An array of messages, possibly empty.
- */
- }, {
- key: "_parseInterleaved",
- value: function _parseInterleaved() {
- var messages = []; // Skip as long as we don't have the first 4 bytes
- if (this._length < INTERLEAVED_HEADER_BYTES) {
- return messages;
- } // Enough bytes to construct the header and extract packet info.
- if (!this._packet) {
- this._packet = rtpPacketInfo(this._chunks);
- } // As long as we don't have enough chunks, skip.
- if (this._length < this._packet.end) {
- return messages;
- } // We have enough data to extract the packet.
- var buffer = Buffer.concat(this._chunks);
- var packet = buffer.slice(this._packet.begin, this._packet.end);
- var header = buffer.slice(0, this._packet.begin);
- var trailing = buffer.slice(this._packet.end);
- var channel = this._packet.channel;
- delete this._packet; // Prepare next bit.
- this._init();
- this._push(trailing); // Extract messages
- if (channel % 2 === 0) {
- // Even channels 0, 2, ...
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTP,
- data: packet,
- header: header,
- channel: channel
- });
- } else {
- // Odd channels 1, 3, ...
- var rtcpPackets = packet;
- do {
- // RTCP packets can be packed together, unbundle them:
- var rtcpByteSize = rtcpPackets.readUInt16BE(2) * 4 + 4;
- var data = rtcpPackets.slice(0, rtcpByteSize);
- messages.push({
- type: _message__WEBPACK_IMPORTED_MODULE_4__.MessageType.RTCP,
- data: data,
- header: header,
- channel: channel
- });
- rtcpPackets = rtcpPackets.slice(rtcpByteSize);
- } while (rtcpPackets.length > 0);
- }
- return messages;
- }
- /**
- * Set the internal state based on the type of the first chunk
- * @param {[type]} chunk [description]
- */
- }, {
- key: "_setState",
- value: function _setState() {
- // Remove leading 0-sized chunks.
- while (this._chunks.length > 0 && this._chunks[0].length === 0) {
- this._chunks.shift();
- }
- var firstChunk = this._chunks[0];
- if (this._chunks.length === 0) {
- this._state = STATE.IDLE;
- } else if (firstChunk[0] === ASCII_DOLLAR) {
- this._state = STATE.INTERLEAVED;
- } else if (firstChunk.toString('ascii', 0, 4) === 'RTSP') {
- this._state = STATE.RTSP;
- } else {
- throw new Error("Unknown chunk of length ".concat(firstChunk.length));
- }
- }
- /**
- * Add the next chunk of data to the parser and extract messages.
- * If no message can be extracted, an empty array is returned, otherwise
- * an array of messages is returned.
- * @param {Buffer} chunk The next piece of data.
- * @return {Array} An array of messages, possibly empty.
- */
- }, {
- key: "parse",
- value: function parse(chunk) {
- this._push(chunk);
- if (this._state === STATE.IDLE) {
- this._setState();
- }
- var messages = [];
- var done = false;
- while (!done) {
- var extracted = [];
- switch (this._state) {
- case STATE.IDLE:
- break;
- case STATE.INTERLEAVED:
- extracted = this._parseInterleaved();
- break;
- case STATE.RTSP:
- extracted = this._parseRtsp();
- break;
- default:
- throw new Error('internal error: unknown state');
- }
- if (extracted.length > 0) {
- messages = messages.concat(extracted);
- } else {
- done = true;
- }
- this._setState();
- }
- return messages;
- }
- }]);
- return Parser;
- }();
- /***/ }),
- /***/ "./lib/components/rtsp-session/index.ts":
- /*!**********************************************!*\
- !*** ./lib/components/rtsp-session/index.ts ***!
- \**********************************************/
- /*! namespace exports */
- /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "RTSP_METHOD": () => /* binding */ RTSP_METHOD,
- /* harmony export */ "RtspSession": () => /* binding */ RtspSession
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_11__);
- /* harmony import */ var _utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/protocols/rtsp */ "./lib/utils/protocols/rtsp.ts");
- /* harmony import */ var _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/protocols/rtcp */ "./lib/utils/protocols/rtcp.ts");
- /* harmony import */ var _utils_protocols_ntp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/protocols/ntp */ "./lib/utils/protocols/ntp.ts");
- /* harmony import */ var _utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/protocols/rtp */ "./lib/utils/protocols/rtp.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- function isAbsolute(url) {
- return /^[^:]+:\/\//.test(url);
- }
- var STATE;
- (function (STATE) {
- STATE["IDLE"] = "idle";
- STATE["PLAYING"] = "playing";
- STATE["PAUSED"] = "paused";
- })(STATE || (STATE = {}));
- var RTSP_METHOD;
- (function (RTSP_METHOD) {
- RTSP_METHOD["OPTIONS"] = "OPTIONS";
- RTSP_METHOD["DESCRIBE"] = "DESCRIBE";
- RTSP_METHOD["SETUP"] = "SETUP";
- RTSP_METHOD["PLAY"] = "PLAY";
- RTSP_METHOD["PAUSE"] = "PAUSE";
- RTSP_METHOD["TEARDOWN"] = "TEARDOWN";
- })(RTSP_METHOD || (RTSP_METHOD = {}));
- var MIN_SESSION_TIMEOUT = 5; // minimum timeout for a rtsp session in seconds
- // Default RTSP configuration
- var defaultConfig = function defaultConfig() {
- var hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof window === 'undefined' ? '' : window.location.hostname;
- var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var uri = parameters.length > 0 ? "rtsp://".concat(hostname, "/media/media.amp?").concat(parameters.join('&')) : "rtsp://".concat(hostname, "/media/media.amp");
- return {
- uri: uri
- };
- };
- /**
- * A component that sets up a command queue in order to interact with the RTSP
- * server. Allows control over the RTSP session by listening to incoming messages
- * and sending request on the outgoing stream.
- *
- * The following handlers can be set on the component:
- * - onSdp: will be called when an SDP object is sent with the object as argument
- * - onPlay: will be called when an RTSP PLAY response is sent with the media range
- * as argument. The latter is an array [start, stop], where start is "now"
- * (for live) or a time in seconds, and stop is undefined (for live or
- * ongoing streams) or a time in seconds.
- * @extends {Component}
- */
- var RtspSession = /*#__PURE__*/function (_Tube) {
- _inherits(RtspSession, _Tube);
- var _super = _createSuper(RtspSession);
- /**
- * Create a new RTSP session controller component.
- * @param {Object} [config={}] Details about the session.
- * @param {String} [config.hostname] The RTSP server hostname
- * @param {String[]} [config.parameters] The RTSP URI parameters
- * @param {String} [config.uri] The full RTSP URI (overrides any hostname/parameters)
- * @param {Object} [config.defaultHeaders] Default headers to use (for all methods).
- * @param {Object} [config.headers] Headers to use (mapped to each method).
- * @return {undefined}
- */
- function RtspSession() {
- var _this;
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- _classCallCheck(this, RtspSession);
- var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_9__.merge)(defaultConfig(config.hostname, config.parameters), config),
- uri = _merge.uri,
- headers = _merge.headers,
- defaultHeaders = _merge.defaultHeaders;
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_11__.Transform({
- objectMode: true,
- transform: function transform(msg, encoding, callback) {
- if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTSP) {
- _this._onRtsp(msg);
- callback(); // Consumes the RTSP packages
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTCP) {
- _this._onRtcp(msg);
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTP) {
- _this._onRtp(msg);
- callback(undefined, msg);
- } else if (msg.type === _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.SDP) {
- var sdpmedia = [];
- for (var i = 0; i < msg.sdp.media.length; i++) {
- if ((msg.sdp.media[i].recvonly && msg.sdp.media[i].recvonly === true) ||
- (msg.sdp.media[i].control.indexOf('trackID=') != -1)) { // truen old rtsp
- sdpmedia.push(msg.sdp.media[i]);
- } else {
- if (msg.sdp.media[i].control.indexOf("audioback") != -1 || msg.sdp.media[i].control.indexOf("backchannel") != -1) {
- _this.audioback_chnl = i * 2;
- _this.audioback_control = msg.sdp.media[i].control;
- }
- }
- }
- delete msg.sdp.media;
- msg.sdp.media = sdpmedia;
- _this._onSdp(msg); // Execute externally registered SDP handler
- msg.sdp.rawdata = msg.data;
- _this.onSdp && _this.onSdp(msg.sdp); // Pass SDP forward
- callback(undefined, msg);
- } else {
- // Not a message we should handle
- callback(undefined, msg);
- }
- }
- });
- incoming.on('end', function () {
- // Incoming was ended, assume that outgoing is closed as well
- _this._outgoingClosed = true;
- });
- _this = _super.call(this, incoming);
- _defineProperty(_assertThisInitialized(_this), "uri", void 0);
- _defineProperty(_assertThisInitialized(_this), "headers", void 0);
- _defineProperty(_assertThisInitialized(_this), "defaultHeaders", void 0);
- _defineProperty(_assertThisInitialized(_this), "t0", void 0);
- _defineProperty(_assertThisInitialized(_this), "n0", void 0);
- _defineProperty(_assertThisInitialized(_this), "clockrates", void 0);
- _defineProperty(_assertThisInitialized(_this), "startTime", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSdp", void 0);
- _defineProperty(_assertThisInitialized(_this), "onError", void 0);
- _defineProperty(_assertThisInitialized(_this), "onPlay", void 0);
- _defineProperty(_assertThisInitialized(_this), "_outgoingClosed", void 0);
- _defineProperty(_assertThisInitialized(_this), "_sequence", void 0);
- _defineProperty(_assertThisInitialized(_this), "_retry", void 0);
- _defineProperty(_assertThisInitialized(_this), "_callStack", void 0);
- _defineProperty(_assertThisInitialized(_this), "_callHistory", void 0);
- _defineProperty(_assertThisInitialized(_this), "_state", void 0);
- _defineProperty(_assertThisInitialized(_this), "_waiting", void 0);
- _defineProperty(_assertThisInitialized(_this), "_contentBase", void 0);
- _defineProperty(_assertThisInitialized(_this), "_sessionId", void 0);
- _defineProperty(_assertThisInitialized(_this), "_renewSessionInterval", void 0);
- _this._outgoingClosed = false;
- _this._reset();
- _this.update(uri, headers, defaultHeaders);
- return _this;
- }
- /**
- * Update the cached RTSP uri and headers.
- * @param {String} uri The RTSP URI.
- * @param {Object} headers Maps commands to headers.
- * @param {Object} [defaultHeaders={}] Default headers.
- * @return {[type]} [description]
- */
- _createClass(RtspSession, [{
- key: "update",
- value: function update(uri) {
- var _Object$assign;
- var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var defaultHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- if (uri === undefined) {
- throw new Error('You must supply an uri when creating a RtspSessionComponent');
- }
- this.uri = uri;
- this.defaultHeaders = defaultHeaders;
- this.headers = Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, RTSP_METHOD.OPTIONS, {}), _defineProperty(_Object$assign, RTSP_METHOD.PLAY, {
- Require: 'www.onvif.org/ver20/backchannel'
- }), _defineProperty(_Object$assign, RTSP_METHOD.SETUP, {
- Blocksize: '64000',
- Require: 'www.onvif.org/ver20/backchannel'
- }), _defineProperty(_Object$assign, RTSP_METHOD.DESCRIBE, {
- Accept: 'application/sdp',
- Require: 'www.onvif.org/ver20/backchannel'
- }), _defineProperty(_Object$assign, RTSP_METHOD.PAUSE, {}), _Object$assign), headers);
- }
- /**
- * Restore the initial values to the state they were in before any RTSP
- * connection was made.
- */
- }, {
- key: "_reset",
- value: function _reset() {
- this._sequence = 1;
- this._retry = function () {
- return console.error("No request sent, can't retry");
- };
- this._callStack = [];
- this._callHistory = [];
- this._state = STATE.IDLE;
- this._waiting = false;
- this._contentBase = null;
- this._sessionId = null;
- if (this._renewSessionInterval !== null) {
- clearInterval(this._renewSessionInterval);
- }
- this._renewSessionInterval = null;
- this.t0 = undefined;
- this.n0 = undefined;
- this.clockrates = undefined;
- }
- /**
- * Handles incoming RTSP messages and send the next command in the queue.
- * @param {Object} msg An incoming RTSP message.
- * @return {undefined}
- */
- }, {
- key: "_onRtsp",
- value: function _onRtsp(msg) {
- var _this2 = this;
- this._waiting = false;
- var status = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.statusCode)(msg.data);
- var ended = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.connectionEnded)(msg.data);
- var seq = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sequence)(msg.data);
- if (seq === null) {
- throw new Error('rtsp: expected sequence number');
- }
- if (this._callHistory === undefined) {
- throw new Error('rtsp: internal error');
- }
- var method = this._callHistory[seq - 1];
- debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:incoming')("".concat(msg.data));
- if (!this._sessionId && !ended) {
- // Response on first SETUP
- this._sessionId = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sessionId)(msg.data);
- var _sessionTimeout = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.sessionTimeout)(msg.data);
- if (_sessionTimeout !== null) {
- // The server specified that sessions will timeout if not renewed.
- // In order to keep it alive we need periodically send a RTSP_OPTIONS message
- if (this._renewSessionInterval !== null) {
- clearInterval(this._renewSessionInterval);
- }
- this._renewSessionInterval = setInterval(function () {
- _this2._enqueue({
- method: RTSP_METHOD.OPTIONS
- });
- _this2._dequeue();
- }, Math.max(MIN_SESSION_TIMEOUT, _sessionTimeout - 5) * 1000);
- }
- }
- if (!this._contentBase) {
- this._contentBase = (0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.contentBase)(msg.data);
- }
- if (status >= 400) {
- // TODO: Retry in certain cases?
- this.onError && this.onError(new Error(msg.data.toString('ascii')));
- }
- if (method === RTSP_METHOD.PLAY) {
- // When starting to play, send the actual range to an external handler.
- this.onPlay && this.onPlay((0,_utils_protocols_rtsp__WEBPACK_IMPORTED_MODULE_12__.range)(msg.data));
- }
- if (ended) {
- debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:incoming')("RTSP Session ".concat(this._sessionId, " ended with statusCode: ").concat(status));
- this._sessionId = null;
- }
- this._dequeue();
- }
- }, {
- key: "_onRtcp",
- value: function _onRtcp(msg) {
- if (this.t0 === undefined || this.n0 === undefined) {
- throw new Error('rtsp: internal error');
- }
- if ((0,_utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.packetType)(msg.data) === _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.packetType) {
- var rtpChannel = msg.channel - 1;
- this.t0[rtpChannel] = _utils_protocols_rtcp__WEBPACK_IMPORTED_MODULE_13__.SR.rtpTimestamp(msg.data);
- 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));
- }
- }
- }, {
- key: "_onRtp",
- value: function _onRtp(msg) {
- if (this.t0 === undefined || this.n0 === undefined || this.clockrates === undefined) {
- throw new Error('rtsp: internal error');
- }
- var rtpChannel = msg.channel;
- var t0 = this.t0[rtpChannel];
- var n0 = this.n0[rtpChannel];
- if (typeof t0 !== 'undefined' && typeof n0 !== 'undefined') {
- var clockrate = this.clockrates[rtpChannel];
- var t = (0,_utils_protocols_rtp__WEBPACK_IMPORTED_MODULE_15__.timestamp)(msg.data); // The RTP timestamps are unsigned 32 bit and will overflow
- // at some point. We can guard against the overflow by ORing with 0,
- // which will bring any difference back into signed 32-bit domain.
- var dt = t - t0 | 0;
- msg.ntpTimestamp = dt / clockrate * 1000 + n0;
- }
- }
- /**
- * Handles incoming SDP messages, reply with SETUP and optionally PLAY.
- * @param {Object} msg An incoming SDP message.
- * @return {undefined}
- */
- }, {
- key: "_onSdp",
- value: function _onSdp(msg) {
- var _this3 = this;
- this.n0 = {};
- this.t0 = {};
- this.clockrates = {};
- msg.sdp.media.forEach(function (media, index) {
- var uri = media.control; // We should actually be able to handle
- // non-dynamic payload types, but ignored for now.
- if (media.rtpmap === undefined) {
- //return
- if (media.fmt == 0) {
- //PCMU
- media.rtpmap = {
- clockrate: 8000,
- encodingName: "PCMU",
- payloadType: 0
- };
- }
- }
- var clockrate = media.rtpmap.clockrate;
- var rtp = index * 2;
- var rtcp = rtp + 1; // TODO: investigate if we can make sure this is defined
- if (uri === undefined) {
- return;
- }
- if (!isAbsolute(uri)) {
- uri = _this3._contentBase + uri;
- }
- if (uri.indexOf("audioback") != -1) {
- _this3.audioback_chnl = rtp;
- }
- _this3._enqueue({
- method: RTSP_METHOD.SETUP,
- headers: {
- Transport: 'RTP/AVP/TCP;unicast;interleaved=' + rtp + '-' + rtcp
- },
- uri: uri
- }); // TODO: see if we can get rid of this check somehow
- if (_this3.clockrates === undefined) {
- return;
- }
- _this3.clockrates[rtp] = clockrate;
- });
- if (this.audioback_chnl) {
- var uri = this.audioback_control;
- console.log("audioback_chnl = ", this.audioback_chnl);
- if (!isAbsolute(uri)) {
- uri = this._contentBase + uri;
- }
- this._enqueue({
- method: RTSP_METHOD.SETUP,
- headers: {
- Transport: 'RTP/AVP/TCP;unicast;interleaved=' + this.audioback_chnl + '-' + (this.audioback_chnl + 1)
- },
- uri: uri
- });
- }
- if (this._state === STATE.PLAYING) {
- this._enqueue({
- method: RTSP_METHOD.PLAY,
- headers: {
- Range: "npt=".concat(this.startTime || 0, "-")
- }
- });
- }
- this._dequeue();
- }
- /**
- * Set up command queue in order to start playing, i.e. PLAY optionally
- * preceeded by OPTIONS/DESCRIBE commands. If not waiting, immediately
- * start sending.
- * @param {Number} startTime Time (seconds) at which to start playing
- * @return {undefined}
- */
- }, {
- key: "play",
- value: function play() {
- var startTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- if (this._state === STATE.IDLE) {
- this.startTime = Number(startTime) || 0;
- this._enqueue({
- method: RTSP_METHOD.OPTIONS
- });
- this._enqueue({
- method: RTSP_METHOD.DESCRIBE
- });
- } else if (this._state === STATE.PAUSED) {
- if (this._sessionId === null || this._sessionId === undefined) {
- throw new Error('rtsp: internal error');
- }
- this._enqueue({
- method: RTSP_METHOD.PLAY,
- headers: {
- Session: this._sessionId
- }
- });
- }
- this._state = STATE.PLAYING;
- this._dequeue();
- }
- /**
- * Queue a pause command, and send if not waiting.
- * @return {undefined}
- */
- }, {
- key: "pause",
- value: function pause() {
- this._enqueue({
- method: RTSP_METHOD.PAUSE
- });
- this._state = STATE.PAUSED;
- this._dequeue();
- }
- /**
- * End the session if there is one, otherwise just cancel
- * any outstanding calls on the stack.
- * @return {undefined}
- */
- }, {
- key: "stop",
- value: function stop() {
- if (this._sessionId) {
- this._enqueue({
- method: RTSP_METHOD.TEARDOWN
- });
- } else {
- this._callStack = [];
- }
- this._state = STATE.IDLE;
- if (this._renewSessionInterval !== null) {
- clearInterval(this._renewSessionInterval);
- this._renewSessionInterval = null;
- }
- this._dequeue();
- }
- /**
- * Pushes an RTSP request onto the outgoing stream.
- * @param {Object} options The details about the command to send.
- * @return {undefined}
- */
- }, {
- key: "send",
- value: function send(cmd) {
- var method = cmd.method,
- headers = cmd.headers,
- uri = cmd.uri;
- if (method === undefined) {
- throw new Error('missing method when send request');
- }
- this._waiting = true;
- this._retry = this.send.bind(this, cmd);
- if (this._sequence === undefined || this.headers === undefined || this._callHistory === undefined) {
- throw new Error('rtsp: internal error');
- }
- var message = Object.assign({
- type: _message__WEBPACK_IMPORTED_MODULE_10__.MessageType.RTSP,
- uri: uri || this.uri,
- data: Buffer.alloc(0) // data is a mandatory field. Not used by session -> parser messages.
- }, {
- method: method,
- headers: headers
- }, {
- headers: Object.assign({
- CSeq: this._sequence++
- }, this.defaultHeaders, // default headers (for all methods)
- this.headers[method], // preset headers for this method
- headers // headers that came with the invokation
- )
- });
- this._sessionId && (message.headers.Session = this._sessionId);
- this._callHistory.push(method);
- if (!this._outgoingClosed) {
- this.outgoing.push(message);
- } else {
- // If the socket is closed, dont attempt to send any data
- debug__WEBPACK_IMPORTED_MODULE_7___default()('msl:rtsp:outgoing')("Unable to send ".concat(method, ", connection closed"));
- }
- }
- /**
- * Push one or more commands onto the call stack.
- * @param {...Object} commands One or more commands.
- * @return {undefined}
- */
- }, {
- key: "_enqueue",
- value: function _enqueue(cmd) {
- if (this._callStack === undefined) {
- throw new Error('rtsp: internal error');
- }
- this._callStack.push(cmd);
- }
- /**
- * If possible, send the next command on the call stack.
- * @return {undefined}
- */
- }, {
- key: "_dequeue",
- value: function _dequeue() {
- if (this._callStack === undefined) {
- throw new Error('rtsp: internal error');
- }
- if (!this._waiting && this._callStack.length > 0) {
- var cmd = this._callStack.shift();
- if (cmd !== undefined) {
- this.send(cmd);
- }
- }
- }
- }]);
- return RtspSession;
- }(_component__WEBPACK_IMPORTED_MODULE_8__.Tube);
- /***/ }),
- /***/ "./lib/components/ws-source/index.ts":
- /*!*******************************************!*\
- !*** ./lib/components/ws-source/index.ts ***!
- \*******************************************/
- /*! namespace exports */
- /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "WSSource": () => /* binding */ WSSource
- /* harmony export */ });
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
- /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component */ "./lib/components/component.ts");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message */ "./lib/components/message.ts");
- /* harmony import */ var _openwebsocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./openwebsocket */ "./lib/components/ws-source/openwebsocket.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- // Named status codes for CloseEvent, see:
- // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
- var CLOSE_GOING_AWAY = 1001;
- var WSSource = /*#__PURE__*/function (_Source) {
- _inherits(WSSource, _Source);
- var _super = _createSuper(WSSource);
- /**
- * Create a WebSocket component.
- *
- * The constructor sets up two streams and connects them to the socket as
- * soon as the socket is available (and open).
- *
- * @param {Object} socket - an open WebSocket.
- */
- function WSSource(socket) {
- var _this;
- _classCallCheck(this, WSSource);
- if (socket === undefined) {
- throw new Error('socket argument missing');
- }
- /**
- * Set up an incoming stream and attach it to the socket.
- * @type {Readable}
- */
- var incoming = new stream__WEBPACK_IMPORTED_MODULE_2__.Readable({
- objectMode: true,
- read: function read() {//
- }
- });
- socket.onmessage = function (msg) {
- var buffer = Buffer.from(msg.data);
- if (!incoming.push({
- data: buffer,
- type: _message__WEBPACK_IMPORTED_MODULE_3__.MessageType.RAW
- })) {
- // Something happened down stream that it is no longer processing the
- // incoming data, and the stream buffer got full. In this case it is
- // best to just close the socket instead of throwing away data in the
- // hope that the situation will get resolved.
- if (socket.readyState === WebSocket.OPEN) {
- debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:incoming')('downstream frozen');
- socket.close();
- }
- }
- }; // When an error is sent on the incoming stream, close the socket.
- incoming.on('error', function (e) {
- console.warn('closing socket due to incoming error', e);
- socket.close();
- });
- /**
- * Set up outgoing stream and attach it to the socket.
- * @type {Writable}
- */
- var outgoing = new stream__WEBPACK_IMPORTED_MODULE_2__.Writable({
- objectMode: true,
- write: function write(msg, encoding, callback) {
- try {
- socket.send(msg.data);
- } catch (e) {
- console.warn('message lost during send:', msg);
- }
- callback();
- }
- }); // When an error happens on the outgoing stream, just warn.
- outgoing.on('error', function (e) {
- console.warn('error during websocket send, ignoring:', e);
- }); // When there is no more data going to be written, close!
- outgoing.on('finish', function () {
- debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:outgoing')('finish');
- if (socket.readyState !== WebSocket.CLOSED) {
- socket.close();
- }
- });
- /**
- * Handler for when WebSocket is CLOSED
- * @param {CloseEvent} e The event associated with a close
- * @param {Number} e.code The status code sent by the server
- * Possible codes are documented here:
- * https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
- * @return {undefined}
- */
- socket.onclose = function (e) {
- debug__WEBPACK_IMPORTED_MODULE_0___default()('msl:websocket:close')("".concat(e.code));
- if (e.code === CLOSE_GOING_AWAY) {
- _this.onServerClose && _this.onServerClose();
- } // Terminate the streams.
- incoming.push(null);
- outgoing.end();
- };
- /**
- * initialize the component.
- */
- _this = _super.call(this, incoming, outgoing);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- return _this;
- }
- /**
- * Expose websocket opener as a class method that returns a promise which
- * resolves with a new WebSocketComponent.
- */
- _createClass(WSSource, null, [{
- key: "open",
- value: function open(config) {
- return (0,_openwebsocket__WEBPACK_IMPORTED_MODULE_4__.openWebSocket)(config).then(function (socket) {
- return new WSSource(socket);
- });
- }
- }]);
- return WSSource;
- }(_component__WEBPACK_IMPORTED_MODULE_1__.Source);
- /***/ }),
- /***/ "./lib/components/ws-source/openwebsocket.ts":
- /*!***************************************************!*\
- !*** ./lib/components/ws-source/openwebsocket.ts ***!
- \***************************************************/
- /*! namespace exports */
- /*! export openWebSocket [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "openWebSocket": () => /* binding */ openWebSocket
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _utils_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/config */ "./lib/utils/config.ts");
- ;
- // Time in milliseconds we want to wait for a websocket to open
- var WEBSOCKET_TIMEOUT = 10007;
- // Default configuration
- var defaultConfig = function defaultConfig() {
- var host = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.host;
- var scheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.protocol;
- var wsScheme = scheme === 'https:' ? 'wss:' : 'ws:';
- return {
- uri: "".concat(wsScheme, "//").concat(host, "/rtsp-over-websocket"),
- tokenUri: "".concat(scheme, "//").concat(host, "/cgi/rtspwssession.cgi"),
- protocol: 'binary',
- timeout: WEBSOCKET_TIMEOUT
- };
- };
- /**
- * Open a new WebSocket, fallback to token-auth on failure and retry.
- * @param {Object} [config={}] WebSocket configuration.
- * @param {String} [config.host] Specify different host
- * @param {String} [config.sheme] Specify different scheme.
- * @param {String} [config.uri] Full uri for websocket connection
- * @param {String} [config.tokenUri] Full uri for token API
- * @param {String} [config.protocol] Websocket protocol
- * @param {Number} [config.timeout] Websocket connection timeout
- * @return {Promise} Resolves with WebSocket, rejects with error.
- */
- var openWebSocket = function openWebSocket() {
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _merge = (0,_utils_config__WEBPACK_IMPORTED_MODULE_3__.merge)(defaultConfig(config.host, config.scheme), config),
- uri = _merge.uri,
- tokenUri = _merge.tokenUri,
- protocol = _merge.protocol,
- timeout = _merge.timeout;
- if (uri === undefined) {
- throw new Error('ws: internal error');
- }
- return new Promise(function (resolve, reject) {
- try {
- var ws = new WebSocket(uri, protocol);
- var countdown = setTimeout(function () {
- clearTimeout(countdown);
- if (ws.readyState === WebSocket.CONNECTING) {
- ws.onerror = null;
- reject(new Error('websocket connection timed out'));
- }
- }, timeout);
- ws.binaryType = 'arraybuffer';
- ws.onerror = function (originalError) {
- console.error(originalError);
- /*
- clearTimeout(countdown)
- // try fetching an authentication token
- function onLoadToken(this: XMLHttpRequest) {
- if (this.status >= 400) {
- console.warn('failed to load token', this.status, this.responseText)
- reject(originalError)
- return
- }
- const token = this.responseText.trim()
- // We have a token! attempt to open a WebSocket again.
- const newUri = `${uri}?rtspwssession=${token}`
- const ws2 = new WebSocket(newUri, protocol)
- ws2.binaryType = 'arraybuffer'
- ws2.onerror = (err) => {
- reject(err)
- }
- ws2.onopen = () => resolve(ws2)
- }
- const request = new XMLHttpRequest()
- request.addEventListener('load', onLoadToken)
- request.addEventListener('error', (err) => {
- console.warn('failed to get token')
- reject(err)
- })
- request.addEventListener('abort', () => reject(originalError))
- request.open('GET', `${tokenUri}?${Date.now()}`)
- try {
- request.send()
- } catch (error) {
- reject(originalError)
- }
- */
- };
- ws.onopen = function () {
- clearTimeout(countdown);
- resolve(ws);
- };
- } catch (e) {
- reject(e);
- }
- });
- };
- /***/ }),
- /***/ "./lib/index.browser.ts":
- /*!******************************!*\
- !*** ./lib/index.browser.ts ***!
- \******************************/
- /*! namespace exports */
- /*! export AACDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
- /*! export BasicDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
- /*! export CanvasSink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
- /*! export H264Depay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
- /*! export HTTPTunnelSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
- /*! export Html5CanvasPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
- /*! export Html5VideoMetadataPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
- /*! export Html5VideoPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
- /*! export Html5VideoPipeline_HTTP [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
- /*! export HttpMsePipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
- /*! export HttpSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
- /*! export Inspector [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
- /*! export JPEGDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
- /*! export MessageType [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/message.ts .MessageType */
- /*! export MetadataPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
- /*! export Mp4Capture [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
- /*! export Mp4Muxer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
- /*! export MseSink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
- /*! export ONVIFDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
- /*! export Pipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
- /*! export RTSP_METHOD [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
- /*! export RtspMjpegPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
- /*! export RtspMp4Pipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
- /*! export RtspParser [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
- /*! export RtspPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
- /*! export RtspSession [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
- /*! export Scheduler [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
- /*! export Sink [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Sink */
- /*! export Source [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Source */
- /*! export Tube [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/component.ts .Tube */
- /*! export WSSource [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
- /*! export WsSdpPipeline [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
- /*! export base64ArrayBuffer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
- /*! export bodyOffset [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
- /*! export cSrc [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
- /*! export cSrcCount [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
- /*! export components [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/index.browser.ts */
- /*! export AACDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/aacdepay/index.ts .AACDepay */
- /*! export BasicDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/basicdepay/index.ts .BasicDepay */
- /*! export CanvasSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/canvas/index.ts .CanvasSink */
- /*! export H264Depay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/h264depay/index.ts .H264Depay */
- /*! export HTTPTunnelSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .HTTPTunnelSource */
- /*! export HttpSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-source/index.ts .HttpSource */
- /*! export Inspector [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/inspector/index.ts .Inspector */
- /*! export JPEGDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/jpegdepay/index.ts .JPEGDepay */
- /*! export MessageType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/message.ts .MessageType */
- /*! export Mp4Capture [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4capture/index.ts .Mp4Capture */
- /*! export Mp4Muxer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mp4muxer/index.ts .Mp4Muxer */
- /*! export MseSink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/mse/index.ts .MseSink */
- /*! export ONVIFDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/onvifdepay/index.ts .ONVIFDepay */
- /*! export RTSP_METHOD [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RTSP_METHOD */
- /*! export RtspParser [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-parser/index.ts .RtspParser */
- /*! export RtspSession [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/rtsp-session/index.ts .RtspSession */
- /*! export Sink [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Sink */
- /*! export Source [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Source */
- /*! export Tube [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/component.ts .Tube */
- /*! export WSSource [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/ws-source/index.ts .WSSource */
- /*! export base64ArrayBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .base64ArrayBuffer */
- /*! export createTransform [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
- /*! export dataCatcherDepay [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
- /*! export g711toPCM [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
- /*! export init_connection [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
- /*! export send_command [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
- /*! other exports [not provided] [no usage info] */
- /*! export connectionEnded [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
- /*! export contentBase [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
- /*! export createTransform [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/messageStreams.ts .createTransform */
- /*! export dataCatcherDepay [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/dataCatcherDepay/index.ts .dataCatcherDepay */
- /*! export extHeader [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
- /*! export extHeaderLength [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
- /*! export extension [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
- /*! export extractHeaderValue [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
- /*! export extractURIs [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
- /*! export g711toPCM [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/g711toPCM/index.ts .g711toPCM */
- /*! export getTime [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
- /*! export init_connection [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .init_connection */
- /*! export marker [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
- /*! export messageFromBuffer [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
- /*! export padding [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
- /*! export parse [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
- /*! export payload [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
- /*! export payloadType [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
- /*! export pipelines [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/pipelines/index.browser.ts */
- /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
- /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
- /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
- /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
- /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
- /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
- /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
- /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
- /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
- /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
- /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
- /*! other exports [not provided] [no usage info] */
- /*! export range [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
- /*! export sSrc [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
- /*! export send_command [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/components/http-tunnel-source/index.ts .send_command */
- /*! export sequence [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
- /*! export sequenceNumber [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
- /*! export sessionId [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
- /*! export sessionTimeout [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
- /*! export statusCode [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
- /*! export timestamp [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
- /*! export utils [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/index.browser.ts */
- /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
- /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
- /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
- /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
- /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
- /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
- /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
- /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
- /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
- /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
- /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
- /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
- /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
- /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
- /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
- /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
- /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
- /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
- /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
- /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
- /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
- /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
- /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
- /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
- /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
- /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
- /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
- /*! other exports [not provided] [no usage info] */
- /*! export version [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
- /*! other exports [not provided] [maybe used in main (runtime-defined)] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "components": () => /* reexport module object */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__,
- /* harmony export */ "pipelines": () => /* reexport module object */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__,
- /* harmony export */ "utils": () => /* reexport module object */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__,
- /* harmony export */ "AACDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.AACDepay,
- /* harmony export */ "BasicDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.BasicDepay,
- /* harmony export */ "CanvasSink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.CanvasSink,
- /* harmony export */ "H264Depay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.H264Depay,
- /* harmony export */ "HTTPTunnelSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.HTTPTunnelSource,
- /* harmony export */ "HttpSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.HttpSource,
- /* harmony export */ "Inspector": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Inspector,
- /* harmony export */ "JPEGDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.JPEGDepay,
- /* harmony export */ "MessageType": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.MessageType,
- /* harmony export */ "Mp4Capture": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Mp4Capture,
- /* harmony export */ "Mp4Muxer": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Mp4Muxer,
- /* harmony export */ "MseSink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.MseSink,
- /* harmony export */ "ONVIFDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.ONVIFDepay,
- /* harmony export */ "RTSP_METHOD": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RTSP_METHOD,
- /* harmony export */ "RtspParser": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RtspParser,
- /* harmony export */ "RtspSession": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.RtspSession,
- /* harmony export */ "Sink": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Sink,
- /* harmony export */ "Source": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Source,
- /* harmony export */ "Tube": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.Tube,
- /* harmony export */ "WSSource": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.WSSource,
- /* harmony export */ "base64ArrayBuffer": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.base64ArrayBuffer,
- /* harmony export */ "createTransform": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.createTransform,
- /* harmony export */ "dataCatcherDepay": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.dataCatcherDepay,
- /* harmony export */ "g711toPCM": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.g711toPCM,
- /* harmony export */ "init_connection": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.init_connection,
- /* harmony export */ "send_command": () => /* reexport safe */ _components_index_browser__WEBPACK_IMPORTED_MODULE_0__.send_command,
- /* harmony export */ "Html5CanvasPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5CanvasPipeline,
- /* harmony export */ "Html5VideoMetadataPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoMetadataPipeline,
- /* harmony export */ "Html5VideoPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline,
- /* harmony export */ "Html5VideoPipeline_HTTP": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline_HTTP,
- /* harmony export */ "HttpMsePipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.HttpMsePipeline,
- /* harmony export */ "MetadataPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.MetadataPipeline,
- /* harmony export */ "Pipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.Pipeline,
- /* harmony export */ "RtspMjpegPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspMjpegPipeline,
- /* harmony export */ "RtspMp4Pipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspMp4Pipeline,
- /* harmony export */ "RtspPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline,
- /* harmony export */ "WsSdpPipeline": () => /* reexport safe */ _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__.WsSdpPipeline,
- /* harmony export */ "Scheduler": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.Scheduler,
- /* harmony export */ "bodyOffset": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.bodyOffset,
- /* harmony export */ "cSrc": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.cSrc,
- /* harmony export */ "cSrcCount": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.cSrcCount,
- /* harmony export */ "connectionEnded": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.connectionEnded,
- /* harmony export */ "contentBase": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.contentBase,
- /* harmony export */ "extHeader": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extHeader,
- /* harmony export */ "extHeaderLength": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extHeaderLength,
- /* harmony export */ "extension": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extension,
- /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extractHeaderValue,
- /* harmony export */ "extractURIs": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.extractURIs,
- /* harmony export */ "getTime": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.getTime,
- /* harmony export */ "marker": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.marker,
- /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.messageFromBuffer,
- /* harmony export */ "padding": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.padding,
- /* harmony export */ "parse": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.parse,
- /* harmony export */ "payload": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.payload,
- /* harmony export */ "payloadType": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.payloadType,
- /* harmony export */ "range": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.range,
- /* harmony export */ "sSrc": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sSrc,
- /* harmony export */ "sequence": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sequence,
- /* harmony export */ "sequenceNumber": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sequenceNumber,
- /* harmony export */ "sessionId": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sessionId,
- /* harmony export */ "sessionTimeout": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.sessionTimeout,
- /* harmony export */ "statusCode": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.statusCode,
- /* harmony export */ "timestamp": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.timestamp,
- /* harmony export */ "version": () => /* reexport safe */ _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__.version
- /* harmony export */ });
- /* harmony import */ var _components_index_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/index.browser */ "./lib/components/index.browser.ts");
- /* harmony import */ var _pipelines_index_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pipelines/index.browser */ "./lib/pipelines/index.browser.ts");
- /* harmony import */ var _utils_index_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/index.browser */ "./lib/utils/index.browser.ts");
- ;
- /***/ }),
- /***/ "./lib/pipelines/html5-canvas-pipeline.ts":
- /*!************************************************!*\
- !*** ./lib/pipelines/html5-canvas-pipeline.ts ***!
- \************************************************/
- /*! namespace exports */
- /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Html5CanvasPipeline": () => /* binding */ Html5CanvasPipeline
- /* harmony export */ });
- /* harmony import */ var _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mjpeg-pipeline */ "./lib/pipelines/rtsp-mjpeg-pipeline.ts");
- /* harmony import */ var _components_canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/canvas */ "./lib/components/canvas/index.ts");
- /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
- /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * Pipeline that can receive Motion JPEG over RTP over WebSocket
- * and display it on a canvas.
- *
- * Handlers that can be set on the pipeline:
- * - onCanplay: called when the first frame is ready, at this point
- * you can call the play method to start playback.
- * Note: the default is to autoplay, so call .pause() inside
- * your onCanplay function if you want to prevent this.
- * - onSync: called when UNIX time (milliseconds) is available
- * for the start of the presentation.
- *
- * @class Html5CanvasPipeline
- * @extends {RtspMjpegPipeline}
- */
- var Html5CanvasPipeline = /*#__PURE__*/function (_RtspMjpegPipeline) {
- _inherits(Html5CanvasPipeline, _RtspMjpegPipeline);
- var _super = _createSuper(Html5CanvasPipeline);
- /**
- * Creates an instance of Html5CanvasPipeline.
- * @param {any} [config={}] Component options
- * @memberof Html5CanvasPipeline
- */
- function Html5CanvasPipeline(config) {
- var _this;
- _classCallCheck(this, Html5CanvasPipeline);
- var wsConfig = config.ws,
- rtspConfig = config.rtsp,
- mediaElement = config.mediaElement,
- authConfig = config.auth;
- _this = _super.call(this, rtspConfig);
- _defineProperty(_assertThisInitialized(_this), "onCanplay", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- _defineProperty(_assertThisInitialized(_this), "ready", void 0);
- _defineProperty(_assertThisInitialized(_this), "_src", void 0);
- _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
- if (authConfig) {
- var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
- _this.insertBefore(_this.rtsp, auth);
- }
- var canvasSink = new _components_canvas__WEBPACK_IMPORTED_MODULE_1__.CanvasSink(mediaElement);
- canvasSink.onCanplay = function () {
- canvasSink.play();
- _this.onCanplay && _this.onCanplay();
- };
- canvasSink.onSync = function (ntpPresentationTime) {
- _this.onSync && _this.onSync(ntpPresentationTime);
- };
- _this.append(canvasSink);
- _this._sink = canvasSink;
- var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_2__.WSSource.open(wsConfig);
- _this.ready = waitForWs.then(function (wsSource) {
- wsSource.onServerClose = function () {
- _this.onServerClose && _this.onServerClose();
- };
- _this.prepend(wsSource);
- _this._src = wsSource;
- });
- return _this;
- }
- _createClass(Html5CanvasPipeline, [{
- key: "close",
- value: function close() {
- this._src && this._src.outgoing.end();
- }
- }, {
- key: "currentTime",
- get: function get() {
- return this._sink.currentTime;
- }
- }, {
- key: "play",
- value: function play() {
- return this._sink.play();
- }
- }, {
- key: "pause",
- value: function pause() {
- return this._sink.pause();
- }
- }, {
- key: "bitrate",
- get: function get() {
- return this._sink.bitrate;
- }
- }, {
- key: "framerate",
- get: function get() {
- return this._sink.framerate;
- }
- }]);
- return Html5CanvasPipeline;
- }(_rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMjpegPipeline);
- /***/ }),
- /***/ "./lib/pipelines/html5-video-metadata-pipeline.ts":
- /*!********************************************************!*\
- !*** ./lib/pipelines/html5-video-metadata-pipeline.ts ***!
- \********************************************************/
- /*! namespace exports */
- /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Html5VideoMetadataPipeline": () => /* binding */ Html5VideoMetadataPipeline
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./html5-video-pipeline */ "./lib/pipelines/html5-video-pipeline.ts");
- /* harmony import */ var _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/onvifdepay */ "./lib/components/onvifdepay/index.ts");
- /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/message */ "./lib/components/message.ts");
- /* harmony import */ var _components_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/component */ "./lib/components/component.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /**
- * Pipeline that can receive H264/AAC video over RTP
- * over WebSocket and pass it to a video element.
- * Additionally, this pipeline passes XML metadata sent
- * in the same stream to a handler.
- */
- var Html5VideoMetadataPipeline = /*#__PURE__*/function (_Html5VideoPipeline) {
- _inherits(Html5VideoMetadataPipeline, _Html5VideoPipeline);
- var _super = _createSuper(Html5VideoMetadataPipeline);
- function Html5VideoMetadataPipeline(config) {
- var _this;
- _classCallCheck(this, Html5VideoMetadataPipeline);
- var metadataHandler = config.metadataHandler;
- _this = _super.call(this, config);
- var onvifDepay = new _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__.ONVIFDepay();
- _this.insertAfter(_this.rtsp, onvifDepay);
- var onvifHandlerPipe = _components_component__WEBPACK_IMPORTED_MODULE_4__.Tube.fromHandlers(function (msg) {
- if (msg.type === _components_message__WEBPACK_IMPORTED_MODULE_3__.MessageType.XML) {
- metadataHandler(msg);
- }
- }, undefined);
- _this.insertAfter(onvifDepay, onvifHandlerPipe);
- return _this;
- }
- return Html5VideoMetadataPipeline;
- }(_html5_video_pipeline__WEBPACK_IMPORTED_MODULE_1__.Html5VideoPipeline);
- /***/ }),
- /***/ "./lib/pipelines/html5-video-pipeline-http.ts":
- /*!****************************************************!*\
- !*** ./lib/pipelines/html5-video-pipeline-http.ts ***!
- \****************************************************/
- /*! namespace exports */
- /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Html5VideoPipeline_HTTP": () => /* binding */ Html5VideoPipeline_HTTP
- /* harmony export */ });
- /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
- /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
- /* harmony import */ var _components_http_tunnel_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/http-tunnel-source */ "./lib/components/http-tunnel-source/index.ts");
- /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * Pipeline that can receive H264/AAC video over RTP
- * over WebSocket and pass it to a video element.
- *
- * @class Html5VideoPipeline
- * @extends {RtspMp4Pipeline}
- */
- var Html5VideoPipeline_HTTP = /*#__PURE__*/function (_RtspMp4Pipeline) {
- _inherits(Html5VideoPipeline_HTTP, _RtspMp4Pipeline);
- var _super = _createSuper(Html5VideoPipeline_HTTP);
- /**
- * Creates an instance of Html5VideoPipeline.
- * @param {any} [config={}] Component options
- * @memberof Html5VideoPipeline
- */
- function Html5VideoPipeline_HTTP(config) {
- var _this;
- _classCallCheck(this, Html5VideoPipeline_HTTP);
- var http_Tunnel_Config = config.ws,
- rtspConfig = config.rtsp,
- mediaElement = config.mediaElement,
- authConfig = config.auth;
- _this = _super.call(this, rtspConfig);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- _defineProperty(_assertThisInitialized(_this), "ready", void 0);
- _defineProperty(_assertThisInitialized(_this), "tracks", void 0);
- _defineProperty(_assertThisInitialized(_this), "_src", void 0);
- _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
- if (authConfig) {
- var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
- _this.insertBefore(_this.rtsp, auth);
- }
- var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_1__.MseSink(mediaElement);
- mseSink.onSourceOpen = function (mse, tracks) {
- _this.tracks = tracks;
- _this.onSourceOpen && _this.onSourceOpen(mse, tracks);
- };
- mseSink.onDataCallback = function (sourceBuffer, msg) {
- _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
- };
- _this.append(mseSink);
- _this._sink = mseSink;
- var waitForWs = _components_http_tunnel_source__WEBPACK_IMPORTED_MODULE_2__.HTTPTunnelSource.open(http_Tunnel_Config);
- _this.ready = waitForWs.then(function (httpTunnnelSource) {
- httpTunnnelSource.onServerClose = function () {
- _this.onServerClose && _this.onServerClose();
- };
- _this.prepend(httpTunnnelSource);
- _this._src = httpTunnnelSource;
- });
- return _this;
- }
- _createClass(Html5VideoPipeline_HTTP, [{
- key: "close",
- value: function close() {
- this._src && this._src.outgoing.end();
- }
- }, {
- key: "currentTime",
- get: function get() {
- return this._sink.currentTime;
- }
- }, {
- key: "play",
- value: function play() {
- return this._sink.play();
- }
- }, {
- key: "pause",
- value: function pause() {
- return this._sink.pause();
- }
- }]);
- return Html5VideoPipeline_HTTP;
- }(_rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMp4Pipeline);
- /***/ }),
- /***/ "./lib/pipelines/html5-video-pipeline.ts":
- /*!***********************************************!*\
- !*** ./lib/pipelines/html5-video-pipeline.ts ***!
- \***********************************************/
- /*! namespace exports */
- /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Html5VideoPipeline": () => /* binding */ Html5VideoPipeline
- /* harmony export */ });
- /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
- /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
- /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
- /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * Pipeline that can receive H264/AAC video over RTP
- * over WebSocket and pass it to a video element.
- *
- * @class Html5VideoPipeline
- * @extends {RtspMp4Pipeline}
- */
- var Html5VideoPipeline = /*#__PURE__*/function (_RtspMp4Pipeline) {
- _inherits(Html5VideoPipeline, _RtspMp4Pipeline);
- var _super = _createSuper(Html5VideoPipeline);
- /**
- * Creates an instance of Html5VideoPipeline.
- * @param {any} [config={}] Component options
- * @memberof Html5VideoPipeline
- */
- function Html5VideoPipeline(config) {
- var _this;
- _classCallCheck(this, Html5VideoPipeline);
- var wsConfig = config.ws,
- rtspConfig = config.rtsp,
- mediaElement = config.mediaElement,
- authConfig = config.auth;
- _this = _super.call(this, rtspConfig);
- _defineProperty(_assertThisInitialized(_this), "onDataCallback", void 0);
- _defineProperty(_assertThisInitialized(_this), "onSourceOpen", void 0);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- _defineProperty(_assertThisInitialized(_this), "ready", void 0);
- _defineProperty(_assertThisInitialized(_this), "tracks", void 0);
- _defineProperty(_assertThisInitialized(_this), "_src", void 0);
- _defineProperty(_assertThisInitialized(_this), "_sink", void 0);
- if (authConfig) {
- var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_3__.Auth(authConfig);
- _this.insertBefore(_this.rtsp, auth);
- }
- var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_1__.MseSink(mediaElement);
- mseSink.onSourceOpen = function (mse, tracks) {
- _this.tracks = tracks;
- _this.onSourceOpen && _this.onSourceOpen(mse, tracks);
- };
- mseSink.onDataCallback = function (sourceBuffer, msg) {
- _this.onDataCallback && _this.onDataCallback(sourceBuffer, msg);
- };
- _this.append(mseSink);
- _this._sink = mseSink;
- var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_2__.WSSource.open(wsConfig);
- _this.ready = waitForWs.then(function (wsSource) {
- wsSource.onServerClose = function () {
- _this.onServerClose && _this.onServerClose();
- };
- _this.prepend(wsSource);
- _this._src = wsSource;
- });
- return _this;
- }
- _createClass(Html5VideoPipeline, [{
- key: "close",
- value: function close() {
- this._src && this._src.outgoing.end();
- }
- }, {
- key: "currentTime",
- get: function get() {
- return this._sink.currentTime;
- }
- }, {
- key: "play",
- value: function play() {
- return this._sink.play();
- }
- }, {
- key: "pause",
- value: function pause() {
- return this._sink.pause();
- }
- }]);
- return Html5VideoPipeline;
- }(_rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspMp4Pipeline);
- /***/ }),
- /***/ "./lib/pipelines/http-mse-pipeline.ts":
- /*!********************************************!*\
- !*** ./lib/pipelines/http-mse-pipeline.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "HttpMsePipeline": () => /* binding */ HttpMsePipeline
- /* harmony export */ });
- /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
- /* harmony import */ var _components_http_source__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/http-source */ "./lib/components/http-source/index.ts");
- /* harmony import */ var _components_mse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/mse */ "./lib/components/mse/index.ts");
- /* harmony import */ var _components_mp4_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/mp4-parser */ "./lib/components/mp4-parser/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- var HttpMsePipeline = /*#__PURE__*/function (_Pipeline) {
- _inherits(HttpMsePipeline, _Pipeline);
- var _super = _createSuper(HttpMsePipeline);
- function HttpMsePipeline(config) {
- var _this;
- _classCallCheck(this, HttpMsePipeline);
- var httpConfig = config.http,
- mediaElement = config.mediaElement;
- var httpSource = new _components_http_source__WEBPACK_IMPORTED_MODULE_1__.HttpSource(httpConfig);
- var mp4Parser = new _components_mp4_parser__WEBPACK_IMPORTED_MODULE_3__.Mp4Parser();
- var mseSink = new _components_mse__WEBPACK_IMPORTED_MODULE_2__.MseSink(mediaElement);
- _this = _super.call(this, httpSource, mp4Parser, mseSink); // Expose session for external use
- _defineProperty(_assertThisInitialized(_this), "http", void 0);
- _this.http = httpSource;
- return _this;
- }
- return HttpMsePipeline;
- }(_pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline);
- /***/ }),
- /***/ "./lib/pipelines/index.browser.ts":
- /*!****************************************!*\
- !*** ./lib/pipelines/index.browser.ts ***!
- \****************************************/
- /*! namespace exports */
- /*! export Html5CanvasPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-canvas-pipeline.ts .Html5CanvasPipeline */
- /*! export Html5VideoMetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-metadata-pipeline.ts .Html5VideoMetadataPipeline */
- /*! export Html5VideoPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline.ts .Html5VideoPipeline */
- /*! export Html5VideoPipeline_HTTP [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/html5-video-pipeline-http.ts .Html5VideoPipeline_HTTP */
- /*! export HttpMsePipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/http-mse-pipeline.ts .HttpMsePipeline */
- /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/metadata-pipeline.ts .MetadataPipeline */
- /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/pipeline.ts .Pipeline */
- /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mjpeg-pipeline.ts .RtspMjpegPipeline */
- /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-mp4-pipeline.ts .RtspMp4Pipeline */
- /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/rtsp-pipeline.ts .RtspPipeline */
- /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/pipelines/ws-sdp-pipeline.ts .WsSdpPipeline */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Pipeline": () => /* reexport safe */ _pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline,
- /* harmony export */ "RtspPipeline": () => /* reexport safe */ _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline,
- /* harmony export */ "RtspMp4Pipeline": () => /* reexport safe */ _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_2__.RtspMp4Pipeline,
- /* harmony export */ "RtspMjpegPipeline": () => /* reexport safe */ _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_3__.RtspMjpegPipeline,
- /* harmony export */ "Html5CanvasPipeline": () => /* reexport safe */ _html5_canvas_pipeline__WEBPACK_IMPORTED_MODULE_4__.Html5CanvasPipeline,
- /* harmony export */ "Html5VideoPipeline": () => /* reexport safe */ _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_5__.Html5VideoPipeline,
- /* harmony export */ "Html5VideoPipeline_HTTP": () => /* reexport safe */ _html5_video_pipeline_http__WEBPACK_IMPORTED_MODULE_6__.Html5VideoPipeline_HTTP,
- /* harmony export */ "Html5VideoMetadataPipeline": () => /* reexport safe */ _html5_video_metadata_pipeline__WEBPACK_IMPORTED_MODULE_7__.Html5VideoMetadataPipeline,
- /* harmony export */ "MetadataPipeline": () => /* reexport safe */ _metadata_pipeline__WEBPACK_IMPORTED_MODULE_8__.MetadataPipeline,
- /* harmony export */ "WsSdpPipeline": () => /* reexport safe */ _ws_sdp_pipeline__WEBPACK_IMPORTED_MODULE_9__.WsSdpPipeline,
- /* harmony export */ "HttpMsePipeline": () => /* reexport safe */ _http_mse_pipeline__WEBPACK_IMPORTED_MODULE_10__.HttpMsePipeline
- /* harmony export */ });
- /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
- /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
- /* harmony import */ var _rtsp_mp4_pipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rtsp-mp4-pipeline */ "./lib/pipelines/rtsp-mp4-pipeline.ts");
- /* harmony import */ var _rtsp_mjpeg_pipeline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rtsp-mjpeg-pipeline */ "./lib/pipelines/rtsp-mjpeg-pipeline.ts");
- /* harmony import */ var _html5_canvas_pipeline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./html5-canvas-pipeline */ "./lib/pipelines/html5-canvas-pipeline.ts");
- /* harmony import */ var _html5_video_pipeline__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./html5-video-pipeline */ "./lib/pipelines/html5-video-pipeline.ts");
- /* harmony import */ var _html5_video_pipeline_http__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./html5-video-pipeline-http */ "./lib/pipelines/html5-video-pipeline-http.ts");
- /* harmony import */ var _html5_video_metadata_pipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./html5-video-metadata-pipeline */ "./lib/pipelines/html5-video-metadata-pipeline.ts");
- /* harmony import */ var _metadata_pipeline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./metadata-pipeline */ "./lib/pipelines/metadata-pipeline.ts");
- /* harmony import */ var _ws_sdp_pipeline__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ws-sdp-pipeline */ "./lib/pipelines/ws-sdp-pipeline.ts");
- /* harmony import */ var _http_mse_pipeline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./http-mse-pipeline */ "./lib/pipelines/http-mse-pipeline.ts");
- /***/ }),
- /***/ "./lib/pipelines/metadata-pipeline.ts":
- /*!********************************************!*\
- !*** ./lib/pipelines/metadata-pipeline.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export MetadataPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "MetadataPipeline": () => /* binding */ MetadataPipeline
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
- /* harmony import */ var _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/onvifdepay */ "./lib/components/onvifdepay/index.ts");
- /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
- /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/message */ "./lib/components/message.ts");
- /* harmony import */ var _components_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/component */ "./lib/components/component.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- // Default configuration for XML event stream
- var DEFAULT_RTSP_PARAMETERS = {
- parameters: ['audio=0', 'video=0', 'event=on', 'ptz=all']
- };
- /**
- * Pipeline that can receive XML metadata over RTP
- * over WebSocket and pass it to a handler.
- */
- var MetadataPipeline = /*#__PURE__*/function (_RtspPipeline) {
- _inherits(MetadataPipeline, _RtspPipeline);
- var _super = _createSuper(MetadataPipeline);
- function MetadataPipeline(config) {
- var _this;
- _classCallCheck(this, MetadataPipeline);
- var wsConfig = config.ws,
- rtspConfig = config.rtsp,
- metadataHandler = config.metadataHandler;
- _this = _super.call(this, Object.assign({}, DEFAULT_RTSP_PARAMETERS, rtspConfig));
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- _defineProperty(_assertThisInitialized(_this), "ready", void 0);
- _defineProperty(_assertThisInitialized(_this), "_src", void 0);
- var onvifDepay = new _components_onvifdepay__WEBPACK_IMPORTED_MODULE_2__.ONVIFDepay();
- _this.append(onvifDepay);
- var handlerSink = _components_component__WEBPACK_IMPORTED_MODULE_5__.Sink.fromHandler(function (msg) {
- if (msg.type === _components_message__WEBPACK_IMPORTED_MODULE_4__.MessageType.XML) {
- metadataHandler(msg);
- }
- });
- _this.append(handlerSink);
- var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_3__.WSSource.open(wsConfig);
- _this.ready = waitForWs.then(function (wsSource) {
- wsSource.onServerClose = function () {
- _this.onServerClose && _this.onServerClose();
- };
- _this.prepend(wsSource);
- _this._src = wsSource;
- });
- return _this;
- }
- _createClass(MetadataPipeline, [{
- key: "close",
- value: function close() {
- this._src && this._src.outgoing.end();
- }
- }]);
- return MetadataPipeline;
- }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline);
- /***/ }),
- /***/ "./lib/pipelines/pipeline.ts":
- /*!***********************************!*\
- !*** ./lib/pipelines/pipeline.ts ***!
- \***********************************/
- /*! namespace exports */
- /*! export Pipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Pipeline": () => /* binding */ Pipeline
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- var Pipeline = /*#__PURE__*/function () {
- /**
- * Create a pipeline which is a linked list of components.
- * Works naturally with only a single component.
- * A set keeps track of which components the pipeline contains,
- * while any order is completely determined by the component's
- * connectedness.
- * @param {Array} components The components of the pipeline in order.
- */
- function Pipeline() {
- _classCallCheck(this, Pipeline);
- _defineProperty(this, "firstComponent", void 0);
- _defineProperty(this, "lastComponent", void 0);
- _defineProperty(this, "_set", void 0);
- for (var _len = arguments.length, components = new Array(_len), _key = 0; _key < _len; _key++) {
- components[_key] = arguments[_key];
- }
- var car = components[0],
- cdr = components.slice(1);
- this._set = new Set(components);
- this.firstComponent = car;
- this.lastComponent = cdr.reduce(function (last, component) {
- return last.connect(component);
- }, car);
- }
- _createClass(Pipeline, [{
- key: "init",
- value: function init() {
- for (var _len2 = arguments.length, components = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- components[_key2] = arguments[_key2];
- }
- var car = components[0],
- cdr = components.slice(1);
- this._set = new Set(components);
- this.firstComponent = car;
- this.lastComponent = cdr.reduce(function (last, component) {
- return last.connect(component);
- }, car);
- }
- }, {
- key: "insertAfter",
- value: function insertAfter(component, newComponent) {
- if (!this._set.has(component)) {
- throw new Error('insertion point not part of pipeline');
- }
- if (this._set.has(newComponent)) {
- throw new Error('new component already in the pipeline');
- }
- var cdr = component.next;
- if (cdr === null) {
- component.connect(newComponent);
- this.lastComponent = newComponent;
- } else {
- component.disconnect();
- component.connect(newComponent).connect(cdr);
- }
- this._set.add(newComponent);
- return this;
- }
- }, {
- key: "insertBefore",
- value: function insertBefore(component, newComponent) {
- if (!this._set.has(component)) {
- throw new Error('insertion point not part of pipeline');
- }
- if (this._set.has(newComponent)) {
- throw new Error('new component already in the pipeline');
- }
- var car = component.prev;
- if (car === null) {
- newComponent.connect(component);
- this.firstComponent = newComponent;
- } else {
- car.disconnect();
- car.connect(newComponent).connect(component);
- }
- this._set.add(newComponent);
- return this;
- }
- }, {
- key: "remove",
- value: function remove(component) {
- if (!this._set.has(component)) {
- throw new Error('component not part of pipeline');
- }
- var car = component.prev;
- var cdr = component.next;
- if (car === null && cdr === null) {
- throw new Error('cannot remove last component');
- } else if (car === null && cdr !== null) {
- component.disconnect();
- this.firstComponent = cdr;
- } else if (car !== null && cdr === null) {
- car.disconnect();
- this.lastComponent = car;
- } else if (car !== null && cdr !== null) {
- car.disconnect();
- component.disconnect();
- car.connect(cdr);
- }
- this._set.delete(component);
- return this;
- }
- }, {
- key: "append",
- value: function append() {
- var _this = this;
- for (var _len3 = arguments.length, components = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- components[_key3] = arguments[_key3];
- }
- components.forEach(function (component) {
- _this.insertAfter(_this.lastComponent, component);
- });
- return this;
- }
- }, {
- key: "prepend",
- value: function prepend() {
- var _this2 = this;
- for (var _len4 = arguments.length, components = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- components[_key4] = arguments[_key4];
- }
- components.forEach(function (component) {
- _this2.insertBefore(_this2.firstComponent, component);
- });
- return this;
- }
- }]);
- return Pipeline;
- }();
- /***/ }),
- /***/ "./lib/pipelines/rtsp-mjpeg-pipeline.ts":
- /*!**********************************************!*\
- !*** ./lib/pipelines/rtsp-mjpeg-pipeline.ts ***!
- \**********************************************/
- /*! namespace exports */
- /*! export RtspMjpegPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "RtspMjpegPipeline": () => /* binding */ RtspMjpegPipeline
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
- /* harmony import */ var _components_jpegdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/jpegdepay */ "./lib/components/jpegdepay/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- /**
- * A pipeline that deals with JPEG encoded video
- * sent over RTP, and converts it to motion JPEG
- * format.
- */
- var RtspMjpegPipeline = /*#__PURE__*/function (_RtspPipeline) {
- _inherits(RtspMjpegPipeline, _RtspPipeline);
- var _super = _createSuper(RtspMjpegPipeline);
- function RtspMjpegPipeline(rtspConfig) {
- var _this;
- _classCallCheck(this, RtspMjpegPipeline);
- _this = _super.call(this, rtspConfig);
- var jpegDepay = new _components_jpegdepay__WEBPACK_IMPORTED_MODULE_2__.JPEGDepay();
- _this.append(jpegDepay);
- return _this;
- }
- return RtspMjpegPipeline;
- }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_1__.RtspPipeline);
- /***/ }),
- /***/ "./lib/pipelines/rtsp-mp4-pipeline.ts":
- /*!********************************************!*\
- !*** ./lib/pipelines/rtsp-mp4-pipeline.ts ***!
- \********************************************/
- /*! namespace exports */
- /*! export RtspMp4Pipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "RtspMp4Pipeline": () => /* binding */ RtspMp4Pipeline
- /* harmony export */ });
- /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
- /* harmony import */ var _components_h264depay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/h264depay */ "./lib/components/h264depay/index.ts");
- /* harmony import */ var _components_aacdepay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/aacdepay */ "./lib/components/aacdepay/index.ts");
- /* harmony import */ var _components_mp4muxer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/mp4muxer */ "./lib/components/mp4muxer/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * A pipeline that deals with H264/AAC encoded video
- * sent over RTP, and converts it to streaming MP4
- * format.
- *
- * The following handlers can be defined:
- * - onSync: called when the NTP time of the first frame
- * is known, with the timestamp as argument
- * (the timestamp is UNIX milliseconds)
- */
- var RtspMp4Pipeline = /*#__PURE__*/function (_RtspPipeline) {
- _inherits(RtspMp4Pipeline, _RtspPipeline);
- var _super = _createSuper(RtspMp4Pipeline);
- function RtspMp4Pipeline(rtspConfig) {
- var _this;
- _classCallCheck(this, RtspMp4Pipeline);
- _this = _super.call(this, rtspConfig);
- _defineProperty(_assertThisInitialized(_this), "onSync", void 0);
- _defineProperty(_assertThisInitialized(_this), "_mp4Muxer", void 0);
- var h264Depay = new _components_h264depay__WEBPACK_IMPORTED_MODULE_1__.H264Depay();
- var aacDepay = new _components_aacdepay__WEBPACK_IMPORTED_MODULE_2__.AACDepay();
- var mp4Muxer = new _components_mp4muxer__WEBPACK_IMPORTED_MODULE_3__.Mp4Muxer();
- mp4Muxer.onSync = function (ntpPresentationTime) {
- _this.onSync && _this.onSync(ntpPresentationTime);
- };
- _this.append(h264Depay, aacDepay, mp4Muxer);
- _this._mp4Muxer = mp4Muxer;
- return _this;
- }
- _createClass(RtspMp4Pipeline, [{
- key: "bitrate",
- get: function get() {
- return this._mp4Muxer.bitrate;
- }
- }, {
- key: "framerate",
- get: function get() {
- return this._mp4Muxer.framerate;
- }
- }]);
- return RtspMp4Pipeline;
- }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_0__.RtspPipeline);
- /***/ }),
- /***/ "./lib/pipelines/rtsp-pipeline.ts":
- /*!****************************************!*\
- !*** ./lib/pipelines/rtsp-pipeline.ts ***!
- \****************************************/
- /*! namespace exports */
- /*! export RtspPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "RtspPipeline": () => /* binding */ RtspPipeline
- /* harmony export */ });
- /* harmony import */ var _pipeline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pipeline */ "./lib/pipelines/pipeline.ts");
- /* harmony import */ var _components_rtsp_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/rtsp-parser */ "./lib/components/rtsp-parser/index.ts");
- /* harmony import */ var _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/rtsp-session */ "./lib/components/rtsp-session/index.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * A pipeline that converts interleaved RTSP/RTP
- * into a series of RTP, RTCP, and RTSP packets.
- * The pipeline exposes the RTSP session component
- * as `this.session`, and wraps its play, pause
- * and stop methods.
- *
- * The following handlers can be defined:
- * - onSdp: called when the session descript protocol
- * is available, with the SDP object as argument
- * - onPlay: called when a response from the PLAY command
- * arrives, with the play range as argument
- */
- var RtspPipeline = /*#__PURE__*/function (_Pipeline) {
- _inherits(RtspPipeline, _Pipeline);
- var _super = _createSuper(RtspPipeline);
- function RtspPipeline(rtspConfig) {
- var _this;
- _classCallCheck(this, RtspPipeline);
- var rtspParser = new _components_rtsp_parser__WEBPACK_IMPORTED_MODULE_1__.RtspParser();
- var rtspSession = new _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RtspSession(rtspConfig);
- rtspSession.onSdp = function (sdp) {
- _this.onSdp && _this.onSdp(sdp);
- };
- rtspSession.onPlay = function (range) {
- _this.onPlay && _this.onPlay(range);
- };
- _this = _super.call(this, rtspParser, rtspSession); // Expose session for external use
- _defineProperty(_assertThisInitialized(_this), "onSdp", void 0);
- _defineProperty(_assertThisInitialized(_this), "onPlay", void 0);
- _defineProperty(_assertThisInitialized(_this), "rtsp", void 0);
- _this.rtsp = rtspSession;
- return _this;
- }
- return RtspPipeline;
- }(_pipeline__WEBPACK_IMPORTED_MODULE_0__.Pipeline);
- /***/ }),
- /***/ "./lib/pipelines/ws-sdp-pipeline.ts":
- /*!******************************************!*\
- !*** ./lib/pipelines/ws-sdp-pipeline.ts ***!
- \******************************************/
- /*! namespace exports */
- /*! export WsSdpPipeline [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "WsSdpPipeline": () => /* binding */ WsSdpPipeline
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/rtsp-session */ "./lib/components/rtsp-session/index.ts");
- /* harmony import */ var _components_ws_source__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ws-source */ "./lib/components/ws-source/index.ts");
- /* harmony import */ var _components_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/auth */ "./lib/components/auth/index.ts");
- /* harmony import */ var _rtsp_pipeline__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rtsp-pipeline */ "./lib/pipelines/rtsp-pipeline.ts");
- 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); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- 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); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- 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; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- 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; }
- /**
- * Pipeline that can receive the SDP object for an RTS stream.
- *
- * @class WsSdpPipeline
- * @extends {RtspPipeline}
- */
- var WsSdpPipeline = /*#__PURE__*/function (_RtspPipeline) {
- _inherits(WsSdpPipeline, _RtspPipeline);
- var _super = _createSuper(WsSdpPipeline);
- /**
- * Creates an instance of Html5VideoPipeline.
- * @param {any} [config={}] Component options
- * @memberof Html5VideoPipeline
- */
- function WsSdpPipeline(config) {
- var _this;
- _classCallCheck(this, WsSdpPipeline);
- var wsConfig = config.ws,
- rtspConfig = config.rtsp,
- authConfig = config.auth;
- _this = _super.call(this, rtspConfig);
- _defineProperty(_assertThisInitialized(_this), "onServerClose", void 0);
- _defineProperty(_assertThisInitialized(_this), "ready", void 0);
- _defineProperty(_assertThisInitialized(_this), "_src", void 0);
- if (authConfig) {
- var auth = new _components_auth__WEBPACK_IMPORTED_MODULE_4__.Auth(authConfig);
- _this.insertBefore(_this.rtsp, auth);
- }
- var waitForWs = _components_ws_source__WEBPACK_IMPORTED_MODULE_3__.WSSource.open(wsConfig);
- _this.ready = waitForWs.then(function (wsSource) {
- wsSource.onServerClose = function () {
- _this.onServerClose && _this.onServerClose();
- };
- _this.prepend(wsSource);
- _this._src = wsSource;
- });
- return _this;
- }
- _createClass(WsSdpPipeline, [{
- key: "close",
- value: function close() {
- this._src && this._src.outgoing.end();
- }
- }, {
- key: "sdp",
- get: function get() {
- var _this2 = this;
- return this.ready.then(function () {
- var sdpPromise = new Promise(function (resolve) {
- _this2.rtsp.onSdp = resolve;
- });
- _this2.rtsp.send({
- method: _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RTSP_METHOD.DESCRIBE
- });
- _this2.rtsp.send({
- method: _components_rtsp_session__WEBPACK_IMPORTED_MODULE_2__.RTSP_METHOD.TEARDOWN
- });
- return sdpPromise;
- });
- }
- }]);
- return WsSdpPipeline;
- }(_rtsp_pipeline__WEBPACK_IMPORTED_MODULE_5__.RtspPipeline);
- /***/ }),
- /***/ "./lib/utils/bits.ts":
- /*!***************************!*\
- !*** ./lib/utils/bits.ts ***!
- \***************************/
- /*! namespace exports */
- /*! export POS [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "POS": () => /* binding */ POS
- /* harmony export */ });
- var POS = [0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01];
- /***/ }),
- /***/ "./lib/utils/clamp.ts":
- /*!****************************!*\
- !*** ./lib/utils/clamp.ts ***!
- \****************************/
- /*! namespace exports */
- /*! export clamp [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "clamp": () => /* binding */ clamp
- /* harmony export */ });
- function clamp(val, min, max) {
- return val > max ? max : val < min ? min : val;
- }
- /***/ }),
- /***/ "./lib/utils/clock.ts":
- /*!****************************!*\
- !*** ./lib/utils/clock.ts ***!
- \****************************/
- /*! namespace exports */
- /*! export Clock [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Clock": () => /* binding */ Clock
- /* harmony export */ });
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- /**
- * Clock
- *
- * A simple timer to keep track of elapsed time,
- * which can be retrieved with the `now` method.
- * The clock is initially in a stopped state, during
- * which the elapsed time does not increase. When
- * started, the clock will return the total elapsed
- * time since the first start / last reset.
- *
- * As a convenience, start/stop are aliased as
- * play/pause, to mimic a media element (for use
- * as a playback clock). The `currentTime` getter
- * returns the elapsed time in seconds (floating
- * point), also as a convenienve to closely match
- * the behaviour of a video element.
- */
- var Clock = /*#__PURE__*/function () {
- function Clock() {
- _classCallCheck(this, Clock);
- _defineProperty(this, "started", void 0);
- _defineProperty(this, "stopped", void 0);
- _defineProperty(this, "elapsed", void 0);
- this.elapsed = 0;
- this.started = 0;
- this.stopped = true;
- }
- _createClass(Clock, [{
- key: "start",
- value: function start() {
- if (this.stopped) {
- this.started = window.performance.now();
- this.stopped = false;
- }
- }
- }, {
- key: "stop",
- value: function stop() {
- if (!this.stopped) {
- this.elapsed = this.now();
- this.stopped = true;
- }
- }
- }, {
- key: "reset",
- value: function reset() {
- this.elapsed = 0;
- this.started = 0;
- this.stopped = true;
- } // Gives the elapsed time in milliseconds since the
- // clock was first started (after last reset).
- }, {
- key: "now",
- value: function now() {
- if (this.stopped) {
- return this.elapsed;
- } else {
- return this.elapsed + (window.performance.now() - this.started);
- }
- }
- }, {
- key: "play",
- value: function play() {
- this.start();
- }
- }, {
- key: "pause",
- value: function pause() {
- this.stop();
- } // Gives the elapsed time in seconds since last reset.
- }, {
- key: "currentTime",
- get: function get() {
- return this.now() / 1000;
- }
- }]);
- return Clock;
- }();
- /***/ }),
- /***/ "./lib/utils/config.ts":
- /*!*****************************!*\
- !*** ./lib/utils/config.ts ***!
- \*****************************/
- /*! namespace exports */
- /*! export merge [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "merge": () => /* binding */ merge
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- 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); }
- /**
- * Flat merge of objects, ignoring undefined override values.
- * @param {Object} template The object with default values
- * @param {Object} override The object with override values.
- * @return {Object} The template object with override merged in.
- */
- var merge = function merge(template, override) {
- var cleanOverride;
- if (override !== undefined) {
- if (_typeof(override) !== 'object') {
- throw new Error('merge expects override to be an object!');
- } else {
- cleanOverride = Object.keys(override).reduce(function (acc, key) {
- if (override[key] !== undefined) {
- acc[key] = override[key];
- }
- return acc;
- }, {});
- }
- }
- return Object.assign({}, template, cleanOverride);
- };
- /***/ }),
- /***/ "./lib/utils/index.browser.ts":
- /*!************************************!*\
- !*** ./lib/utils/index.browser.ts ***!
- \************************************/
- /*! namespace exports */
- /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/scheduler.ts .Scheduler */
- /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
- /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
- /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
- /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
- /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
- /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
- /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
- /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
- /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
- /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
- /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
- /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
- /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
- /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
- /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
- /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
- /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
- /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
- /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
- /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
- /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
- /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
- /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
- /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
- /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
- /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Scheduler": () => /* reexport safe */ _scheduler__WEBPACK_IMPORTED_MODULE_0__.Scheduler,
- /* harmony export */ "bodyOffset": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.bodyOffset,
- /* harmony export */ "cSrc": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.cSrc,
- /* harmony export */ "cSrcCount": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.cSrcCount,
- /* harmony export */ "connectionEnded": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.connectionEnded,
- /* harmony export */ "contentBase": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.contentBase,
- /* harmony export */ "extHeader": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extHeader,
- /* harmony export */ "extHeaderLength": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extHeaderLength,
- /* harmony export */ "extension": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extension,
- /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extractHeaderValue,
- /* harmony export */ "extractURIs": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.extractURIs,
- /* harmony export */ "getTime": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.getTime,
- /* harmony export */ "marker": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.marker,
- /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.messageFromBuffer,
- /* harmony export */ "padding": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.padding,
- /* harmony export */ "parse": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.parse,
- /* harmony export */ "payload": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.payload,
- /* harmony export */ "payloadType": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.payloadType,
- /* harmony export */ "range": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.range,
- /* harmony export */ "sSrc": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sSrc,
- /* harmony export */ "sequence": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sequence,
- /* harmony export */ "sequenceNumber": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sequenceNumber,
- /* harmony export */ "sessionId": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sessionId,
- /* harmony export */ "sessionTimeout": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.sessionTimeout,
- /* harmony export */ "statusCode": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.statusCode,
- /* harmony export */ "timestamp": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.timestamp,
- /* harmony export */ "version": () => /* reexport safe */ _protocols__WEBPACK_IMPORTED_MODULE_1__.version
- /* harmony export */ });
- /* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduler */ "./lib/utils/scheduler.ts");
- /* harmony import */ var _protocols__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./protocols */ "./lib/utils/protocols/index.ts");
- /***/ }),
- /***/ "./lib/utils/protocols/index.ts":
- /*!**************************************!*\
- !*** ./lib/utils/protocols/index.ts ***!
- \**************************************/
- /*! namespace exports */
- /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .bodyOffset */
- /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrc */
- /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .cSrcCount */
- /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .connectionEnded */
- /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .contentBase */
- /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeader */
- /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extHeaderLength */
- /*! export extension [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .extension */
- /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .extractHeaderValue */
- /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .extractURIs */
- /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/ntp.ts .getTime */
- /*! export marker [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .marker */
- /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .messageFromBuffer */
- /*! export padding [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .padding */
- /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/sdp.ts .parse */
- /*! export payload [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payload */
- /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .payloadType */
- /*! export range [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .range */
- /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sSrc */
- /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sequence */
- /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .sequenceNumber */
- /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionId */
- /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .sessionTimeout */
- /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtsp.ts .statusCode */
- /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .timestamp */
- /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./lib/utils/protocols/rtp.ts .version */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "extractURIs": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.extractURIs,
- /* harmony export */ "messageFromBuffer": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.messageFromBuffer,
- /* harmony export */ "parse": () => /* reexport safe */ _sdp__WEBPACK_IMPORTED_MODULE_0__.parse,
- /* harmony export */ "cSrc": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.cSrc,
- /* harmony export */ "cSrcCount": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.cSrcCount,
- /* harmony export */ "extHeader": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extHeader,
- /* harmony export */ "extHeaderLength": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extHeaderLength,
- /* harmony export */ "extension": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.extension,
- /* harmony export */ "marker": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.marker,
- /* harmony export */ "padding": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.padding,
- /* harmony export */ "payload": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.payload,
- /* harmony export */ "payloadType": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.payloadType,
- /* harmony export */ "sSrc": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.sSrc,
- /* harmony export */ "sequenceNumber": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.sequenceNumber,
- /* harmony export */ "timestamp": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.timestamp,
- /* harmony export */ "version": () => /* reexport safe */ _rtp__WEBPACK_IMPORTED_MODULE_1__.version,
- /* harmony export */ "bodyOffset": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.bodyOffset,
- /* harmony export */ "connectionEnded": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.connectionEnded,
- /* harmony export */ "contentBase": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.contentBase,
- /* harmony export */ "extractHeaderValue": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.extractHeaderValue,
- /* harmony export */ "range": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.range,
- /* harmony export */ "sequence": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sequence,
- /* harmony export */ "sessionId": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sessionId,
- /* harmony export */ "sessionTimeout": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.sessionTimeout,
- /* harmony export */ "statusCode": () => /* reexport safe */ _rtsp__WEBPACK_IMPORTED_MODULE_2__.statusCode,
- /* harmony export */ "getTime": () => /* reexport safe */ _ntp__WEBPACK_IMPORTED_MODULE_3__.getTime
- /* harmony export */ });
- /* harmony import */ var _sdp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sdp */ "./lib/utils/protocols/sdp.ts");
- /* harmony import */ var _rtp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rtp */ "./lib/utils/protocols/rtp.ts");
- /* harmony import */ var _rtsp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rtsp */ "./lib/utils/protocols/rtsp.ts");
- /* harmony import */ var _ntp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ntp */ "./lib/utils/protocols/ntp.ts");
- /***/ }),
- /***/ "./lib/utils/protocols/isom.ts":
- /*!*************************************!*\
- !*** ./lib/utils/protocols/isom.ts ***!
- \*************************************/
- /*! namespace exports */
- /*! export BOX_HEADER_BYTES [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export boxType [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BOX_HEADER_BYTES": () => /* binding */ BOX_HEADER_BYTES,
- /* harmony export */ "boxType": () => /* binding */ boxType
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- /*
- * Track data which can be attached to an ISOM message.
- * It indicates the start of a new movie.
- */
- var BOX_HEADER_BYTES = 8;
- var boxType = function boxType(buffer) {
- return buffer.toString('ascii', 4, 8).toLowerCase();
- };
- /***/ }),
- /***/ "./lib/utils/protocols/ntp.ts":
- /*!************************************!*\
- !*** ./lib/utils/protocols/ntp.ts ***!
- \************************************/
- /*! namespace exports */
- /*! export getTime [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "getTime": () => /* binding */ getTime
- /* harmony export */ });
- // NTP is offset from 01.01.1900
- var NTP_UNIX_EPOCH_OFFSET = Date.UTC(1900, 0, 1); // Convenience types
- /**
- * Convert NTP time to milliseconds since January 1, 1970, 00:00:00 UTC (Unix Epoch)
- * @param {Number} ntpMost Seconds since 01.01.1900
- * @param {Number} ntpLeast Fractions since 01.01.1900
- */
- function getTime(ntpMost, ntpLeast) {
- var ntpMilliSeconds = (ntpMost + ntpLeast / 0x100000000) * 1000;
- return NTP_UNIX_EPOCH_OFFSET + ntpMilliSeconds;
- }
- /***/ }),
- /***/ "./lib/utils/protocols/rtcp.ts":
- /*!*************************************!*\
- !*** ./lib/utils/protocols/rtcp.ts ***!
- \*************************************/
- /*! namespace exports */
- /*! export APP [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export BYE [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export RR [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export SDES [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export SR [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export count [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export length [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export packetType [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export padding [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export version [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "version": () => /* binding */ version,
- /* harmony export */ "padding": () => /* binding */ padding,
- /* harmony export */ "count": () => /* binding */ count,
- /* harmony export */ "packetType": () => /* binding */ packetType,
- /* harmony export */ "length": () => /* binding */ length,
- /* harmony export */ "SR": () => /* binding */ SR,
- /* harmony export */ "RR": () => /* binding */ RR,
- /* harmony export */ "SDES": () => /* binding */ SDES,
- /* harmony export */ "BYE": () => /* binding */ BYE,
- /* harmony export */ "APP": () => /* binding */ APP
- /* harmony export */ });
- /* harmony import */ var _bits__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bits */ "./lib/utils/bits.ts");
- ; // Real Time Control Protocol (RTCP)
- // https://tools.ietf.org/html/rfc3550#section-6
- /*
- Common RTCP packed header:
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- header |V=2|P| RC | PT=SR=200 | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var version = function version(buffer) {
- return buffer[0] >>> 6;
- };
- var padding = function padding(buffer) {
- return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_0__.POS[2]);
- };
- var count = function count(buffer) {
- return buffer[0] & 0x1f;
- };
- var packetType = function packetType(buffer) {
- return buffer[1];
- };
- var length = function length(buffer) {
- return buffer.readUInt16BE(2);
- };
- /*
- SR: Sender Report RTCP Packet
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- header |V=2|P| RC | PT=SR=200 | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SSRC of sender |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- sender | NTP timestamp, most significant word |
- info +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | NTP timestamp, least significant word |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | RTP timestamp |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | sender's packet count |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | sender's octet count |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- report | SSRC_1 (SSRC of first source) |
- block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- 1 | fraction lost | cumulative number of packets lost |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | extended highest sequence number received |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | interarrival jitter |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | last SR (LSR) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | delay since last SR (DLSR) |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- report | SSRC_2 (SSRC of second source) |
- block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- 2 : ... :
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | profile-specific extensions |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var SR = {
- packetType: 200,
- syncSource: function syncSource(buffer) {
- return buffer.readUInt32BE(4);
- },
- ntpMost: function ntpMost(buffer) {
- return buffer.readUInt32BE(8);
- },
- ntpLeast: function ntpLeast(buffer) {
- return buffer.readUInt32BE(12);
- },
- rtpTimestamp: function rtpTimestamp(buffer) {
- return buffer.readUInt32BE(16);
- },
- sendersPacketCount: function sendersPacketCount(buffer) {
- return buffer.readUInt32BE(20);
- },
- sendersOctetCount: function sendersOctetCount(buffer) {
- return buffer.readUInt32BE(24);
- }
- };
- /*
- RR: Receiver Report RTCP Packet
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- header |V=2|P| RC | PT=RR=201 | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SSRC of packet sender |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- report | SSRC_1 (SSRC of first source) |
- block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- 1 | fraction lost | cumulative number of packets lost |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | extended highest sequence number received |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | interarrival jitter |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | last SR (LSR) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | delay since last SR (DLSR) |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- report | SSRC_2 (SSRC of second source) |
- block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- 2 : ... :
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | profile-specific extensions |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var RR = {
- packetType: 201
- };
- /*
- SDES: Source Description RTCP Packet
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- header |V=2|P| SC | PT=SDES=202 | length |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- chunk | SSRC/CSRC_1 |
- 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SDES items |
- | ... |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- chunk | SSRC/CSRC_2 |
- 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SDES items |
- | ... |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- */
- var SDES = {
- packetType: 202
- };
- /*
- BYE: Goodbye RTCP Packet
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P| SC | PT=BYE=203 | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SSRC/CSRC |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- : ... :
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- (opt) | length | reason for leaving ...
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var BYE = {
- packetType: 203
- };
- /*
- APP: Application-Defined RTCP Packet
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P| subtype | PT=APP=204 | length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | SSRC/CSRC |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | name (ASCII) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | application-dependent data ...
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var APP = {
- packetType: 204
- };
- /***/ }),
- /***/ "./lib/utils/protocols/rtp.ts":
- /*!************************************!*\
- !*** ./lib/utils/protocols/rtp.ts ***!
- \************************************/
- /*! namespace exports */
- /*! export cSrc [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export cSrcCount [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export extHeader [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export extHeaderLength [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export extension [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export marker [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export padding [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export payload [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export payloadType [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export sSrc [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export sequenceNumber [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export timestamp [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export version [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "version": () => /* binding */ version,
- /* harmony export */ "padding": () => /* binding */ padding,
- /* harmony export */ "extension": () => /* binding */ extension,
- /* harmony export */ "cSrcCount": () => /* binding */ cSrcCount,
- /* harmony export */ "marker": () => /* binding */ marker,
- /* harmony export */ "payloadType": () => /* binding */ payloadType,
- /* harmony export */ "sequenceNumber": () => /* binding */ sequenceNumber,
- /* harmony export */ "timestamp": () => /* binding */ timestamp,
- /* harmony export */ "sSrc": () => /* binding */ sSrc,
- /* harmony export */ "cSrc": () => /* binding */ cSrc,
- /* harmony export */ "extHeaderLength": () => /* binding */ extHeaderLength,
- /* harmony export */ "extHeader": () => /* binding */ extHeader,
- /* harmony export */ "payload": () => /* binding */ payload
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* harmony import */ var _bits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bits */ "./lib/utils/bits.ts");
- /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"];
- ;
- // Real Time Protocol (RTP)
- // https://tools.ietf.org/html/rfc3550#section-5.1
- /*
- RTP Fixed Header Fields
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P|X| CC |M| PT | sequence number |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | timestamp |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | synchronization source (SSRC) identifier |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | contributing source (CSRC) identifiers |
- | .... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | profile-specific ext. id | profile-specific ext. length |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | profile-specific extension |
- | .... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- var version = function version(buffer) {
- return buffer[0] >>> 6;
- };
- var padding = function padding(buffer) {
- return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[2]);
- };
- var extension = function extension(buffer) {
- return !!(buffer[0] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[3]);
- };
- var cSrcCount = function cSrcCount(buffer) {
- return buffer[0] & 0x0f;
- };
- var marker = function marker(buffer) {
- return !!(buffer[1] & _bits__WEBPACK_IMPORTED_MODULE_1__.POS[0]);
- };
- var payloadType = function payloadType(buffer) {
- return buffer[1] & 0x7f;
- };
- var sequenceNumber = function sequenceNumber(buffer) {
- return buffer.readUInt16BE(2);
- };
- var timestamp = function timestamp(buffer) {
- return buffer.readUInt32BE(4);
- };
- var sSrc = function sSrc(buffer) {
- return buffer.readUInt32BE(8);
- };
- var cSrc = function cSrc(buffer) {
- var rank = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- return cSrcCount(buffer) > rank ? buffer.readUInt32BE(12 + rank * 4) : 0;
- };
- var extHeaderLength = function extHeaderLength(buffer) {
- return extension(buffer) === false ? 0 : buffer.readUInt16BE(12 + cSrcCount(buffer) * 4 + 2);
- };
- var extHeader = function extHeader(buffer) {
- return extHeaderLength(buffer) === 0 ? Buffer.from([]) : buffer.slice(12 + cSrcCount(buffer) * 4, 12 + cSrcCount(buffer) * 4 + 4 + extHeaderLength(buffer) * 4);
- };
- var payload = function payload(buffer) {
- return extension(buffer) === false ? buffer.slice(12 + cSrcCount(buffer) * 4) : buffer.slice(12 + cSrcCount(buffer) * 4 + 4 + extHeaderLength(buffer) * 4);
- };
- /***/ }),
- /***/ "./lib/utils/protocols/rtsp.ts":
- /*!*************************************!*\
- !*** ./lib/utils/protocols/rtsp.ts ***!
- \*************************************/
- /*! namespace exports */
- /*! export bodyOffset [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export connectionEnded [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export contentBase [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export extractHeaderValue [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export range [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export sequence [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export sessionId [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export sessionTimeout [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export statusCode [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "extractHeaderValue": () => /* binding */ extractHeaderValue,
- /* harmony export */ "sequence": () => /* binding */ sequence,
- /* harmony export */ "sessionId": () => /* binding */ sessionId,
- /* harmony export */ "sessionTimeout": () => /* binding */ sessionTimeout,
- /* harmony export */ "statusCode": () => /* binding */ statusCode,
- /* harmony export */ "contentBase": () => /* binding */ contentBase,
- /* harmony export */ "connectionEnded": () => /* binding */ connectionEnded,
- /* harmony export */ "range": () => /* binding */ range,
- /* harmony export */ "bodyOffset": () => /* binding */ bodyOffset
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- ;
- /*
- * The RTSP response format is defined in RFC 7826,
- * using ABNF notation specified in RFC 5234.
- * Strings in ABNF rules ("...") are always case insensitive!
- *
- * Basic rules to help with the headers below:
- * ====
- * CR = %x0D ; US-ASCII CR, carriage return (13)
- * LF = %x0A ; US-ASCII LF, linefeed (10)
- * SP = %x20 ; US-ASCII SP, space (32)
- * HT = %x09 ; US-ASCII HT, horizontal-tab (9)
- * CRLF = CR LF
- * LWS = [CRLF] 1*( SP / HT ) ; Line-breaking whitespace
- * SWS = [LWS] ; Separating whitespace
- * HCOLON = *( SP / HT ) ":" SWS
- *
- * RTSP response rules (a `*` means zero or more):
- * ====
- * Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF
- * Response = Status-Line
- * *((general-header
- * / response-header
- * / message-body-header) CRLF)
- * CRLF
- * [ message-body-data ]
- *
- * Example response:
- * ====
- * RTSP/1.0 200 OK
- * CSeq: 3
- * Content-Type: application/sdp
- * Content-Base: rtsp://192.168.0.3/media/media.amp/
- * Server: GStreamer RTSP server
- * Date: Wed, 03 Jun 2015 14:23:42 GMT
- * Content-Length: 623
- *
- * v=0
- * ....
- */
- /**
- * Extract the value of a header.
- *
- * @param buffer The response bytes
- * @param header The header to search for
- */
- var extractHeaderValue = function extractHeaderValue(buffer, header) {
- var anchor = "\n".concat(header.toLowerCase(), ": ");
- var start = buffer.toString().toLowerCase().indexOf(anchor);
- if (start >= 0) {
- var end = buffer.indexOf('\n', start + anchor.length);
- var headerValue = buffer.toString('ascii', start + anchor.length, end).trim();
- return headerValue;
- }
- return null;
- };
- var sequence = function sequence(buffer) {
- /**
- * CSeq = "CSeq" HCOLON cseq-nr
- * cseq-nr = 1*9DIGIT
- */
- var val = extractHeaderValue(buffer, 'CSeq');
- if (val !== null) {
- return Number(val);
- }
- return null;
- };
- var sessionId = function sessionId(buffer) {
- /**
- * Session = "Session" HCOLON session-id
- * [ SEMI "timeout" EQUAL delta-seconds ]
- * session-id = 1*256( ALPHA / DIGIT / safe )
- * delta-seconds = 1*19DIGIT
- */
- var val = extractHeaderValue(buffer, 'Session');
- return val ? val.split(';')[0] : null;
- };
- var sessionTimeout = function sessionTimeout(buffer) {
- /**
- * Session = "Session" HCOLON session-id
- * [ SEMI "timeout" EQUAL delta-seconds ]
- * session-id = 1*256( ALPHA / DIGIT / safe )
- * delta-seconds = 1*19DIGIT
- */
- var val = extractHeaderValue(buffer, 'Session');
- if (val === null) {
- return null;
- }
- var timeoutToken = 'timeout=';
- var timeoutPosition = val.toLowerCase().indexOf(timeoutToken);
- if (timeoutPosition !== -1) {
- var timeoutVal = val.substring(timeoutPosition + timeoutToken.length);
- timeoutVal = timeoutVal.split(';')[0];
- var parsedTimeout = parseInt(timeoutVal);
- return isNaN(parsedTimeout) ? null : parsedTimeout;
- }
- return null;
- };
- var statusCode = function statusCode(buffer) {
- return Number(buffer.toString('ascii', 9, 12));
- };
- var contentBase = function contentBase(buffer) {
- /**
- * Content-Base = "Content-Base" HCOLON RTSP-URI
- */
- return extractHeaderValue(buffer, 'Content-Base');
- };
- var connectionEnded = function connectionEnded(buffer) {
- /**
- * Connection = "Connection" HCOLON connection-token
- * *(COMMA connection-token)
- * connection-token = "close" / token
- */
- var connectionToken = extractHeaderValue(buffer, 'Connection');
- return connectionToken !== null && connectionToken.toLowerCase() === 'close';
- };
- var range = function range(buffer) {
- /**
- * Range = "Range" HCOLON ranges-spec
- * ranges-spec = npt-range / utc-range / smpte-range
- * / range-ext
- * npt-range = "npt" [EQUAL npt-range-spec]
- * npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time )
- * npt-time = "now" / npt-sec / npt-hhmmss / npt-hhmmss-comp
- * npt-sec = 1*19DIGIT [ "." 1*9DIGIT ]
- * npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ]
- * npt-hh = 2*19DIGIT ; any positive number
- * npt-mm = 2*2DIGIT ; 0-59
- * npt-ss = 2*2DIGIT ; 0-59
- * npt-hhmmss-comp = npt-hh-comp ":" npt-mm-comp ":" npt-ss-comp
- * [ "." 1*9DIGIT ] ; Compatibility format
- * npt-hh-comp = 1*19DIGIT ; any positive number
- * npt-mm-comp = 1*2DIGIT ; 0-59
- * npt-ss-comp = 1*2DIGIT ; 0-59
- */
- // Example range headers:
- // Range: npt=now-
- // Range: npt=1154.598701-3610.259146
- var npt = extractHeaderValue(buffer, 'Range');
- if (npt !== null) {
- return npt.split('=')[1].split('-');
- }
- return undefined;
- };
- /**
- * Determine the offset of the RTSP body, where the header ends.
- * If there is no header ending, -1 is returned
- * @param {Buffer} chunk A piece of data
- * @return {Number} The body offset, or -1 if no header end found
- */
- var bodyOffset = function bodyOffset(chunk) {
- /**
- * Strictly speaking, it seems RTSP MUST have CRLF and doesn't allow CR or LF on its own.
- * That means that the end of the header part should be a pair of CRLF, but we're being
- * flexible here and also allow LF LF or CR CR instead of CRLF CRLF.
- */
- var bodyOffsets = ['\n\n', '\r\r', '\r\n\r\n'].map(function (s) {
- var offset = chunk.indexOf(s);
- if (offset !== -1) {
- return offset + s.length;
- }
- return offset;
- }).filter(function (offset) {
- return offset !== -1;
- });
- if (bodyOffsets.length > 0) {
- return bodyOffsets.reduce(function (acc, offset) {
- return Math.min(acc, offset);
- });
- } else {
- return -1;
- }
- };
- /***/ }),
- /***/ "./lib/utils/protocols/sdp.ts":
- /*!************************************!*\
- !*** ./lib/utils/protocols/sdp.ts ***!
- \************************************/
- /*! namespace exports */
- /*! export extractURIs [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export messageFromBuffer [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "extractURIs": () => /* binding */ extractURIs,
- /* harmony export */ "parse": () => /* binding */ parse,
- /* harmony export */ "messageFromBuffer": () => /* binding */ messageFromBuffer
- /* harmony export */ });
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* 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");
- /* 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__);
- /* harmony import */ var _components_message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../components/message */ "./lib/components/message.ts");
- ;
- 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; } } }; }
- function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _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; }
- 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; }
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
- var extractLineVals = function extractLineVals(buffer, lineStart) {
- var start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- var anchor = "\n".concat(lineStart);
- start = buffer.indexOf(anchor, start);
- var end = 0;
- var ret = [];
- while (start >= 0) {
- end = buffer.indexOf('\n', start + anchor.length);
- ret.push(buffer.toString('ascii', start + anchor.length, end).trim());
- start = buffer.indexOf(anchor, end);
- }
- return ret;
- }; // SDP parsing
- /**
- * Identify the start of a session-level or media-level section.
- * @param {String} line The line to parse
- * @return {Object} Object with a type + name
- */
- var newMediaLevel = function newMediaLevel(line) {
- return line.match(/^m=/);
- };
- var splitOnFirst = function splitOnFirst(c, text) {
- var p = text.indexOf(c);
- if (p < 0) {
- return [text.slice(0)];
- } else {
- return [text.slice(0, p), text.slice(p + 1)];
- }
- };
- var attributeParsers = {
- fmtp: function fmtp(value) {
- var _splitOnFirst = splitOnFirst(' ', value),
- _splitOnFirst2 = _slicedToArray(_splitOnFirst, 2),
- format = _splitOnFirst2[0],
- stringParameters = _splitOnFirst2[1];
- switch (format) {
- default:
- var pairs = stringParameters.trim().split(';');
- var parameters = {};
- pairs.forEach(function (pair) {
- var _splitOnFirst3 = splitOnFirst('=', pair),
- _splitOnFirst4 = _slicedToArray(_splitOnFirst3, 2),
- key = _splitOnFirst4[0],
- val = _splitOnFirst4[1];
- var normalizedKey = key.trim().toLowerCase();
- if (normalizedKey !== '') {
- parameters[normalizedKey] = val.trim();
- }
- });
- return {
- format: format,
- parameters: parameters
- };
- }
- },
- framerate: Number,
- rtpmap: function rtpmap(value) {
- var _splitOnFirst5 = splitOnFirst(' ', value),
- _splitOnFirst6 = _slicedToArray(_splitOnFirst5, 2),
- payloadType = _splitOnFirst6[0],
- encoding = _splitOnFirst6[1];
- var _encoding$toUpperCase = encoding.toUpperCase().split('/'),
- _encoding$toUpperCase2 = _slicedToArray(_encoding$toUpperCase, 3),
- encodingName = _encoding$toUpperCase2[0],
- clockrate = _encoding$toUpperCase2[1],
- encodingParameters = _encoding$toUpperCase2[2];
- if (encodingParameters === undefined) {
- return {
- payloadType: Number(payloadType),
- encodingName: encodingName,
- clockrate: Number(clockrate)
- };
- } else {
- return {
- payloadType: Number(payloadType),
- encodingName: encodingName,
- clockrate: Number(clockrate),
- encodingParameters: encodingParameters
- };
- }
- },
- transform: function transform(value) {
- return value.split(';').map(function (row) {
- return row.split(',').map(Number);
- });
- },
- framesize: function framesize(value) {
- return value.split(' ')[1].split('-').map(Number);
- }
- };
- var parseAttribute = function parseAttribute(body) {
- var _splitOnFirst7 = splitOnFirst(':', body),
- _splitOnFirst8 = _slicedToArray(_splitOnFirst7, 2),
- attribute = _splitOnFirst8[0],
- value = _splitOnFirst8[1];
- if (value === undefined) {
- return _defineProperty({}, attribute, true);
- } else {
- if (attributeParsers[attribute] !== undefined) {
- return _defineProperty({}, attribute, attributeParsers[attribute](value));
- } else {
- return _defineProperty({}, attribute, value);
- }
- }
- };
- var extractField = function extractField(line) {
- var prefix = line.slice(0, 1);
- var body = line.slice(2);
- switch (prefix) {
- case 'v':
- return {
- version: body
- };
- case 'o':
- var _body$split = body.split(' '),
- _body$split2 = _slicedToArray(_body$split, 6),
- username = _body$split2[0],
- sessionId = _body$split2[1],
- sessionVersion = _body$split2[2],
- netType = _body$split2[3],
- addrType = _body$split2[4],
- unicastAddress = _body$split2[5];
- return {
- origin: {
- addrType: addrType,
- netType: netType,
- sessionId: sessionId,
- sessionVersion: sessionVersion,
- unicastAddress: unicastAddress,
- username: username
- }
- };
- case 's':
- return {
- sessionName: body
- };
- case 'i':
- return {
- sessionInformation: body
- };
- case 'u':
- return {
- uri: body
- };
- case 'e':
- return {
- email: body
- };
- case 'p':
- return {
- phone: body
- };
- // c=<nettype> <addrtype> <connection-address>
- case 'c':
- var _body$split3 = body.split(' '),
- _body$split4 = _slicedToArray(_body$split3, 3),
- connectionNetType = _body$split4[0],
- connectionAddrType = _body$split4[1],
- connectionAddress = _body$split4[2];
- return {
- connectionData: {
- addrType: connectionAddrType,
- connectionAddress: connectionAddress,
- netType: connectionNetType
- }
- };
- // b=<bwtype>:<bandwidth>
- case 'b':
- var _body$split5 = body.split(':'),
- _body$split6 = _slicedToArray(_body$split5, 2),
- bwtype = _body$split6[0],
- bandwidth = _body$split6[1];
- return {
- bwtype: bwtype,
- bandwidth: bandwidth
- };
- // t=<start-time> <stop-time>
- case 't':
- var _body$split$map = body.split(' ').map(Number),
- _body$split$map2 = _slicedToArray(_body$split$map, 2),
- startTime = _body$split$map2[0],
- stopTime = _body$split$map2[1];
- return {
- time: {
- startTime: startTime,
- stopTime: stopTime
- }
- };
- // r=<repeat interval> <active duration> <offsets from start-time>
- case 'r':
- var _body$split$map3 = body.split(' ').map(Number),
- _body$split$map4 = _toArray(_body$split$map3),
- repeatInterval = _body$split$map4[0],
- activeDuration = _body$split$map4[1],
- offsets = _body$split$map4.slice(2);
- return {
- repeatTimes: {
- repeatInterval: repeatInterval,
- activeDuration: activeDuration,
- offsets: offsets
- }
- };
- // z=<adjustment time> <offset> <adjustment time> <offset> ....
- case 'z':
- return;
- // k=<method>
- // k=<method>:<encryption key>
- case 'k':
- return;
- // a=<attribute>
- // a=<attribute>:<value>
- case 'a':
- return parseAttribute(body);
- case 'm':
- // Only the first fmt field is parsed!
- var _body$split7 = body.split(' '),
- _body$split8 = _slicedToArray(_body$split7, 4),
- type = _body$split8[0],
- port = _body$split8[1],
- protocol = _body$split8[2],
- fmt = _body$split8[3];
- return {
- type: type,
- port: Number(port),
- protocol: protocol,
- fmt: Number(fmt)
- };
- default: // console.log('unknown SDP prefix ', prefix);
- }
- };
- var extractURIs = function extractURIs(buffer) {
- // There is a control URI above the m= line, which should not be used
- var seekFrom = buffer.indexOf('\nm=');
- return extractLineVals(buffer, 'a=control:', seekFrom);
- };
- /**
- * Create an array of sprop-parameter-sets elements
- * @param {Buffer} buffer The buffer containing the sdp data
- * @return {Array} The differen parameter strings
- */
- var parse = function parse(buffer) {
- var sdp = buffer.toString('ascii').split('\n').map(function (s) {
- return s.trim();
- });
- var struct = {
- session: {},
- media: []
- };
- var mediaCounter = 0;
- var current = struct.session;
- var _iterator = _createForOfIteratorHelper(sdp),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var line = _step.value;
- if (newMediaLevel(line)) {
- struct.media[mediaCounter] = {};
- current = struct.media[mediaCounter];
- ++mediaCounter;
- }
- current = Object.assign(current, extractField(line));
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return struct;
- };
- var messageFromBuffer = function messageFromBuffer(buffer) {
- return {
- type: _components_message__WEBPACK_IMPORTED_MODULE_11__.MessageType.SDP,
- data: buffer,
- sdp: parse(buffer)
- };
- };
- /***/ }),
- /***/ "./lib/utils/scheduler.ts":
- /*!********************************!*\
- !*** ./lib/utils/scheduler.ts ***!
- \********************************/
- /*! namespace exports */
- /*! export Scheduler [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Scheduler": () => /* binding */ Scheduler
- /* harmony export */ });
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- 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; }
- // The default tolerance for matching the handler
- // invocation to clock presentation time.
- var DEFAULT_TOLERANCE = 10;
- /**
- * A scheduler that can decide when to execute a certain
- * timestamped callback so that it happens in sync with a video
- * element.
- *
- * To use it:
- *
- * (1) Initialize a new Scheduler with a clock (to synchronize
- * against) and a callback (to be called when a message is in
- * sync with the video). The clock can be a HTMLVideoElement,
- * or anything that has a `currentTime` property which gives
- * the current presentation time in seconds, and a `pause` and
- * `play` method to control playback.
- *
- * (2) Call the `run` method every time a new message arrives
- * that you want to schedule (it needs to have an ntpTimestamp).
- * As soon at the presentation time is known, call the `init`
- * method and pass in that time, so that the scheduler can
- * start to schedule the callbacks. From then on, whenever
- * a message in the queue has a timestamp that matches the
- * current presentation time of the video, your callback will
- * fire.
- *
- * @class Scheduler
- */
- var Scheduler = /*#__PURE__*/function () {
- /**
- * Creates an instance of Scheduler.
- * @param {any} clock The clock to use (so we can control playback)
- * @param {any} handler The callback to invoke when a message is in sync
- * @param {number} [tolerance=DEFAULT_TOLERANCE] The milliseconds defining "in sync"
- * @memberof Scheduler
- */
- function Scheduler(clock, handler) {
- var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_TOLERANCE;
- _classCallCheck(this, Scheduler);
- _defineProperty(this, "_clock", void 0);
- _defineProperty(this, "_handler", void 0);
- _defineProperty(this, "_tolerance", void 0);
- _defineProperty(this, "_nextRun", void 0);
- _defineProperty(this, "_nextPlay", void 0);
- _defineProperty(this, "_fifo", void 0);
- _defineProperty(this, "_ntpPresentationTime", void 0);
- _defineProperty(this, "_suspended", void 0);
- this._clock = clock;
- this._handler = handler;
- this._tolerance = tolerance;
- this._nextRun = 0;
- this._nextPlay = 0;
- this._fifo = [];
- this._ntpPresentationTime = 0;
- this._suspended = false;
- }
- /**
- * Bring the scheduler back to it's initial state.
- * @memberof Scheduler
- */
- _createClass(Scheduler, [{
- key: "reset",
- value: function reset() {
- clearTimeout(this._nextRun);
- clearTimeout(this._nextPlay);
- this._fifo = [];
- this._ntpPresentationTime = 0;
- this._suspended = false;
- }
- /**
- * Initialize the scheduler.
- *
- * @param {any} ntpPresentationTime The offset representing the start of the presentation
- * @memberof Scheduler
- */
- }, {
- key: "init",
- value: function init(ntpPresentationTime) {
- this._ntpPresentationTime = ntpPresentationTime;
- }
- /**
- * Suspend the scheduler.
- *
- * This releases control of the clock and stops any scheduling activity.
- * Note that this doesn't mean the clock will be in a particular state
- * (could be started or stopped), just that the scheduler will no longer
- * control it.
- *
- * @memberof Scheduler
- */
- }, {
- key: "suspend",
- value: function suspend() {
- clearTimeout(this._nextPlay);
- this._suspended = true;
- }
- /**
- * Resume the scheduler.
- *
- * This gives back control of the clock and the ability
- * to schedule messages. The scheduler will immediately
- * try to do that on resume.
- *
- * @memberof Scheduler
- */
- }, {
- key: "resume",
- value: function resume() {
- this._suspended = false;
- this.run(undefined);
- }
- /**
- * Run the scheduler.
- *
- * @param {any} [msg] New message to schedule.
- * @memberof Scheduler
- */
- }, {
- key: "run",
- value: function run(newMessage) {
- var _this = this;
- clearTimeout(this._nextRun); // If there is no way to schedule anything, just return.
- // The first schedule will happen for the first .run that
- // is called after the presentation time has been initialized.
- if (typeof this._ntpPresentationTime === 'undefined') {
- return;
- } // If there is a new message, add it to the FIFO queue
- if (typeof newMessage !== 'undefined') {
- this._fifo.push(newMessage);
- } // If the scheduler is suspended, we can only keep the
- // messages and not do anything with them.
- if (this._suspended) {
- return;
- } // If there are no messages, we don't need to bother or
- // even re-schedule, because the new call to .run() will
- // have to come from outside with a new message.
- if (this._fifo.length === 0) {
- return;
- } // There is at least one message in the FIFO queue, either
- // display it, or re-schedule the method for later execution
- var timeToPresent = 0;
- var currentMessage;
- do {
- var _msg = this._fifo.shift();
- if (_msg === undefined) {
- throw new Error('internal error: message should never be undefined');
- }
- currentMessage = _msg;
- var ntpTimestamp = currentMessage.ntpTimestamp;
- if (ntpTimestamp === undefined) {
- continue;
- }
- var presentationTime = ntpTimestamp - this._ntpPresentationTime;
- timeToPresent = presentationTime - this._clock.currentTime * 1000; // If the message is within a tolerance of the presentation time
- // then call the handler.
- if (Math.abs(timeToPresent) < this._tolerance) {
- this._handler && this._handler(currentMessage);
- }
- } while (timeToPresent < this._tolerance && this._fifo.length > 0);
- if (timeToPresent < -this._tolerance) {
- // We ran out of messages, delay the video with the same amount
- // of delay as the last message had on the FIFO queue.
- // Since we don't have any messages in the queue right now,
- // the only way for anything to happen is if scheduler.run
- // is called.
- clearTimeout(this._nextPlay);
- this._clock.pause();
- this._nextPlay = window.setTimeout(function () {
- return _this._clock.play();
- }, -timeToPresent);
- } else if (timeToPresent > this._tolerance) {
- // message is later than video, add it back to the queue and
- // re-run the scheduling at a later point in time
- this._fifo.unshift(currentMessage);
- this._nextRun = window.setTimeout(function () {
- return _this.run(undefined);
- }, timeToPresent);
- }
- }
- }]);
- return Scheduler;
- }();
- /***/ }),
- /***/ "./node_modules/base64-js/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/base64-js/index.js ***!
- \*****************************************/
- /*! default exports */
- /*! export byteLength [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export fromByteArray [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export toByteArray [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__ */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- exports.byteLength = byteLength
- exports.toByteArray = toByteArray
- exports.fromByteArray = fromByteArray
- var lookup = []
- var revLookup = []
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
- }
- // Support decoding URL-safe base64 strings, as Node.js does.
- // See: https://en.wikipedia.org/wiki/Base64#URL_applications
- revLookup['-'.charCodeAt(0)] = 62
- revLookup['_'.charCodeAt(0)] = 63
- function getLens (b64) {
- var len = b64.length
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
- return [validLen, placeHoldersLen]
- }
- // base64 is 4/3 + up to two characters of the original data
- function byteLength (b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
- function _byteLength (b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
- function toByteArray (b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
- var curByte = 0
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
- var i
- for (i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
- return arr
- }
- function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
- }
- function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
- }
- function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
- return parts.join('')
- }
- /***/ }),
- /***/ "./node_modules/buffer/index.js":
- /*!**************************************!*\
- !*** ./node_modules/buffer/index.js ***!
- \**************************************/
- /*! default exports */
- /*! export Buffer [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export INSPECT_MAX_BYTES [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export SlowBuffer [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export kMaxLength [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
- /* eslint-disable no-proto */
- var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
- var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
- var customInspectSymbol =
- (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
- ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
- : null
- exports.Buffer = Buffer
- exports.SlowBuffer = SlowBuffer
- exports.INSPECT_MAX_BYTES = 50
- var K_MAX_LENGTH = 0x7fffffff
- exports.kMaxLength = K_MAX_LENGTH
- /**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Print warning and recommend using `buffer` v4.x which has an Object
- * implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * We report that the browser does not support typed arrays if the are not subclassable
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
- * for __proto__ and has a buggy typed array implementation.
- */
- Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
- if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
- typeof console.error === 'function') {
- console.error(
- 'This browser lacks typed array (Uint8Array) support which is required by ' +
- '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
- )
- }
- function typedArraySupport () {
- // Can typed array instances can be augmented?
- try {
- var arr = new Uint8Array(1)
- var proto = { foo: function () { return 42 } }
- Object.setPrototypeOf(proto, Uint8Array.prototype)
- Object.setPrototypeOf(arr, proto)
- return arr.foo() === 42
- } catch (e) {
- return false
- }
- }
- Object.defineProperty(Buffer.prototype, 'parent', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.buffer
- }
- })
- Object.defineProperty(Buffer.prototype, 'offset', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.byteOffset
- }
- })
- function createBuffer (length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"')
- }
- // Return an augmented `Uint8Array` instance
- var buf = new Uint8Array(length)
- Object.setPrototypeOf(buf, Buffer.prototype)
- return buf
- }
- /**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
- function Buffer (arg, encodingOrOffset, length) {
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- )
- }
- return allocUnsafe(arg)
- }
- return from(arg, encodingOrOffset, length)
- }
- Buffer.poolSize = 8192 // not used by this implementation
- function from (value, encodingOrOffset, length) {
- if (typeof value === 'string') {
- return fromString(value, encodingOrOffset)
- }
- if (ArrayBuffer.isView(value)) {
- return fromArrayView(value)
- }
- if (value == null) {
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
- if (isInstance(value, ArrayBuffer) ||
- (value && isInstance(value.buffer, ArrayBuffer))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
- if (typeof SharedArrayBuffer !== 'undefined' &&
- (isInstance(value, SharedArrayBuffer) ||
- (value && isInstance(value.buffer, SharedArrayBuffer)))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
- if (typeof value === 'number') {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- )
- }
- var valueOf = value.valueOf && value.valueOf()
- if (valueOf != null && valueOf !== value) {
- return Buffer.from(valueOf, encodingOrOffset, length)
- }
- var b = fromObject(value)
- if (b) return b
- if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
- typeof value[Symbol.toPrimitive] === 'function') {
- return Buffer.from(
- value[Symbol.toPrimitive]('string'), encodingOrOffset, length
- )
- }
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
- /**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
- Buffer.from = function (value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length)
- }
- // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
- // https://github.com/feross/buffer/pull/148
- Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
- Object.setPrototypeOf(Buffer, Uint8Array)
- function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be of type number')
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- }
- function alloc (size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpreted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(size).fill(fill, encoding)
- : createBuffer(size).fill(fill)
- }
- return createBuffer(size)
- }
- /**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
- Buffer.alloc = function (size, fill, encoding) {
- return alloc(size, fill, encoding)
- }
- function allocUnsafe (size) {
- assertSize(size)
- return createBuffer(size < 0 ? 0 : checked(size) | 0)
- }
- /**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
- Buffer.allocUnsafe = function (size) {
- return allocUnsafe(size)
- }
- /**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
- Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(size)
- }
- function fromString (string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- var length = byteLength(string, encoding) | 0
- var buf = createBuffer(length)
- var actual = buf.write(string, encoding)
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- buf = buf.slice(0, actual)
- }
- return buf
- }
- function fromArrayLike (array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- var buf = createBuffer(length)
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255
- }
- return buf
- }
- function fromArrayView (arrayView) {
- if (isInstance(arrayView, Uint8Array)) {
- var copy = new Uint8Array(arrayView)
- return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
- }
- return fromArrayLike(arrayView)
- }
- function fromArrayBuffer (array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds')
- }
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds')
- }
- var buf
- if (byteOffset === undefined && length === undefined) {
- buf = new Uint8Array(array)
- } else if (length === undefined) {
- buf = new Uint8Array(array, byteOffset)
- } else {
- buf = new Uint8Array(array, byteOffset, length)
- }
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(buf, Buffer.prototype)
- return buf
- }
- function fromObject (obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- var buf = createBuffer(len)
- if (buf.length === 0) {
- return buf
- }
- obj.copy(buf, 0, 0, len)
- return buf
- }
- if (obj.length !== undefined) {
- if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
- return createBuffer(0)
- }
- return fromArrayLike(obj)
- }
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data)
- }
- }
- function checked (length) {
- // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= K_MAX_LENGTH) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
- }
- return length | 0
- }
- function SlowBuffer (length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
- }
- Buffer.isBuffer = function isBuffer (b) {
- return b != null && b._isBuffer === true &&
- b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
- }
- Buffer.compare = function compare (a, b) {
- if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
- if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- )
- }
- if (a === b) return 0
- var x = a.length
- var y = b.length
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
- Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
- }
- Buffer.concat = function concat (list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (isInstance(buf, Uint8Array)) {
- if (pos + buf.length > buffer.length) {
- Buffer.from(buf).copy(buffer, pos)
- } else {
- Uint8Array.prototype.set.call(
- buffer,
- buf,
- pos
- )
- }
- } else if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- } else {
- buf.copy(buffer, pos)
- }
- pos += buf.length
- }
- return buffer
- }
- function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
- 'Received type ' + typeof string
- )
- }
- var len = string.length
- var mustMatch = (arguments.length > 2 && arguments[2] === true)
- if (!mustMatch && len === 0) return 0
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
- }
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.byteLength = byteLength
- function slowToString (encoding, start, end) {
- var loweredCase = false
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
- if (end === undefined || end > this.length) {
- end = this.length
- }
- if (end <= 0) {
- return ''
- }
- // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
- if (end <= start) {
- return ''
- }
- if (!encoding) encoding = 'utf8'
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
- case 'ascii':
- return asciiSlice(this, start, end)
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
- case 'base64':
- return base64Slice(this, start, end)
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
- }
- // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
- // to detect a Buffer instance. It's not possible to use `instanceof Buffer`
- // reliably in a browserify context because there could be multiple different
- // copies of the 'buffer' package in use. This method works even for Buffer
- // instances that were created from another copy of the `buffer` package.
- // See: https://github.com/feross/buffer/issues/154
- Buffer.prototype._isBuffer = true
- function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
- }
- Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
- }
- Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
- }
- Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
- }
- Buffer.prototype.toString = function toString () {
- var length = this.length
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
- }
- Buffer.prototype.toLocaleString = Buffer.prototype.toString
- Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
- }
- Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
- if (this.length > max) str += ' ... '
- return '<Buffer ' + str + '>'
- }
- if (customInspectSymbol) {
- Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
- }
- Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer.from(target, target.offset, target.byteLength)
- }
- if (!Buffer.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. ' +
- 'Received type ' + (typeof target)
- )
- }
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
- if (this === target) return 0
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
- // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
- // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
- //
- // Arguments:
- // - buffer - a Buffer to search
- // - val - a string, Buffer, or number
- // - byteOffset - an index into `buffer`; will be clamped to an int32
- // - encoding - an optional encoding, relevant is val is a string
- // - dir - true for indexOf, false for lastIndexOf
- function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (numberIsNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
- }
- throw new TypeError('val must be string, number or Buffer')
- }
- function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
- return -1
- }
- Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
- }
- Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
- }
- Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
- }
- function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
- var strLen = string.length
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (numberIsNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
- }
- function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
- }
- function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
- }
- function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
- }
- function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
- }
- Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset >>> 0
- if (isFinite(length)) {
- length = length >>> 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
- if (!encoding) encoding = 'utf8'
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
- case 'ascii':
- case 'latin1':
- case 'binary':
- return asciiWrite(this, string, offset, length)
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
- function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
- }
- function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF)
- ? 4
- : (firstByte > 0xDF)
- ? 3
- : (firstByte > 0xBF)
- ? 2
- : 1
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
- res.push(codePoint)
- i += bytesPerSequence
- }
- return decodeCodePointsArray(res)
- }
- // Based on http://stackoverflow.com/a/22747272/680742, the browser with
- // the lowest limit is Chrome, with 0x10000 args.
- // We go 1 magnitude less, for safety
- var MAX_ARGUMENTS_LENGTH = 0x1000
- function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
- }
- function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
- }
- function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
- }
- function hexSlice (buf, start, end) {
- var len = buf.length
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
- var out = ''
- for (var i = start; i < end; ++i) {
- out += hexSliceLookupTable[buf[i]]
- }
- return out
- }
- function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
- for (var i = 0; i < bytes.length - 1; i += 2) {
- res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
- }
- return res
- }
- Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
- if (end < start) end = start
- var newBuf = this.subarray(start, end)
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(newBuf, Buffer.prototype)
- return newBuf
- }
- /*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
- function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
- }
- Buffer.prototype.readUintLE =
- Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- return val
- }
- Buffer.prototype.readUintBE =
- Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
- return val
- }
- Buffer.prototype.readUint8 =
- Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
- }
- Buffer.prototype.readUint16LE =
- Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
- }
- Buffer.prototype.readUint16BE =
- Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
- }
- Buffer.prototype.readUint32LE =
- Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
- }
- Buffer.prototype.readUint32BE =
- Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
- }
- Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
- return val
- }
- Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
- return val
- }
- Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
- }
- Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
- Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
- Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
- }
- Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
- }
- Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
- }
- Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
- }
- Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
- }
- Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
- }
- function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- }
- Buffer.prototype.writeUintLE =
- Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeUintBE =
- Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeUint8 =
- Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- this[offset] = (value & 0xff)
- return offset + 1
- }
- Buffer.prototype.writeUint16LE =
- Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
- Buffer.prototype.writeUint16BE =
- Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
- Buffer.prototype.writeUint32LE =
- Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- return offset + 4
- }
- Buffer.prototype.writeUint32BE =
- Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
- Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
- return offset + byteLength
- }
- Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
- }
- Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
- Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
- Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- return offset + 4
- }
- Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
- function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
- }
- function writeFloat (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
- }
- Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
- }
- Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
- }
- function writeDouble (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
- }
- Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
- }
- Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
- }
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
- Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
- var len = end - start
- if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
- // Use built-in when available, missing from IE11
- this.copyWithin(targetStart, start, end)
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- )
- }
- return len
- }
- // Usage:
- // buffer.fill(number[, offset[, end]])
- // buffer.fill(buffer[, offset[, end]])
- // buffer.fill(string[, offset[, end]][, encoding])
- Buffer.prototype.fill = function fill (val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if ((encoding === 'utf8' && code < 128) ||
- encoding === 'latin1') {
- // Fast path: If `val` fits into a single byte, use that numeric value.
- val = code
- }
- }
- } else if (typeof val === 'number') {
- val = val & 255
- } else if (typeof val === 'boolean') {
- val = Number(val)
- }
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
- if (end <= start) {
- return this
- }
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
- if (!val) val = 0
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : Buffer.from(val, encoding)
- var len = bytes.length
- if (len === 0) {
- throw new TypeError('The value "' + val +
- '" is invalid for argument "value"')
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
- return this
- }
- // HELPER FUNCTIONS
- // ================
- var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
- function base64clean (str) {
- // Node takes equal signs as end of the Base64 encoding
- str = str.split('=')[0]
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = str.trim().replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
- }
- function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
- // valid lead
- leadSurrogate = codePoint
- continue
- }
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
- leadSurrogate = null
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
- return bytes
- }
- function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
- }
- function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
- return byteArray
- }
- function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
- }
- function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
- }
- // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
- // the `instanceof` check but they should be treated as of that type.
- // See: https://github.com/feross/buffer/issues/166
- function isInstance (obj, type) {
- return obj instanceof type ||
- (obj != null && obj.constructor != null && obj.constructor.name != null &&
- obj.constructor.name === type.name)
- }
- function numberIsNaN (obj) {
- // For IE11 support
- return obj !== obj // eslint-disable-line no-self-compare
- }
- // Create lookup table for `toString('hex')`
- // See: https://github.com/feross/buffer/issues/219
- var hexSliceLookupTable = (function () {
- var alphabet = '0123456789abcdef'
- var table = new Array(256)
- for (var i = 0; i < 16; ++i) {
- var i16 = i * 16
- for (var j = 0; j < 16; ++j) {
- table[i16 + j] = alphabet[i] + alphabet[j]
- }
- }
- return table
- })()
- /***/ }),
- /***/ "./node_modules/core-js/internals/a-function.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/a-function.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (it) {
- if (typeof it != 'function') {
- throw TypeError(String(it) + ' is not a function');
- } return it;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/a-possible-prototype.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/internals/a-possible-prototype.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- module.exports = function (it) {
- if (!isObject(it) && it !== null) {
- throw TypeError("Can't set " + String(it) + ' as a prototype');
- } return it;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/add-to-unscopables.js":
- /*!**************************************************************!*\
- !*** ./node_modules/core-js/internals/add-to-unscopables.js ***!
- \**************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var UNSCOPABLES = wellKnownSymbol('unscopables');
- var ArrayPrototype = Array.prototype;
- // Array.prototype[@@unscopables]
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
- configurable: true,
- value: create(null)
- });
- }
- // add a key to Array.prototype[@@unscopables]
- module.exports = function (key) {
- ArrayPrototype[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/advance-string-index.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/internals/advance-string-index.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").charAt;
- // `AdvanceStringIndex` abstract operation
- // https://tc39.github.io/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? charAt(S, index).length : 1);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/an-instance.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/an-instance.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (it, Constructor, name) {
- if (!(it instanceof Constructor)) {
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
- } return it;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/an-object.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/an-object.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- module.exports = function (it) {
- if (!isObject(it)) {
- throw TypeError(String(it) + ' is not an object');
- } return it;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-buffer-native.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/array-buffer-native.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-buffer-view-core.js":
- /*!******************************************************************!*\
- !*** ./node_modules/core-js/internals/array-buffer-view-core.js ***!
- \******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 145:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var NATIVE_ARRAY_BUFFER = __webpack_require__(/*! ../internals/array-buffer-native */ "./node_modules/core-js/internals/array-buffer-native.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
- var Int8Array = global.Int8Array;
- var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
- var Uint8ClampedArray = global.Uint8ClampedArray;
- var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
- var TypedArray = Int8Array && getPrototypeOf(Int8Array);
- var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
- var ObjectPrototype = Object.prototype;
- var isPrototypeOf = ObjectPrototype.isPrototypeOf;
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
- // Fixing native typed arrays in Opera Presto crashes the browser, see #595
- var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
- var TYPED_ARRAY_TAG_REQIRED = false;
- var NAME;
- var TypedArrayConstructorsList = {
- Int8Array: 1,
- Uint8Array: 1,
- Uint8ClampedArray: 1,
- Int16Array: 2,
- Uint16Array: 2,
- Int32Array: 4,
- Uint32Array: 4,
- Float32Array: 4,
- Float64Array: 8
- };
- var isView = function isView(it) {
- var klass = classof(it);
- return klass === 'DataView' || has(TypedArrayConstructorsList, klass);
- };
- var isTypedArray = function (it) {
- return isObject(it) && has(TypedArrayConstructorsList, classof(it));
- };
- var aTypedArray = function (it) {
- if (isTypedArray(it)) return it;
- throw TypeError('Target is not a typed array');
- };
- var aTypedArrayConstructor = function (C) {
- if (setPrototypeOf) {
- if (isPrototypeOf.call(TypedArray, C)) return C;
- } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) {
- var TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) {
- return C;
- }
- } throw TypeError('Target is not a typed array constructor');
- };
- var exportTypedArrayMethod = function (KEY, property, forced) {
- if (!DESCRIPTORS) return;
- if (forced) for (var ARRAY in TypedArrayConstructorsList) {
- var TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) {
- delete TypedArrayConstructor.prototype[KEY];
- }
- }
- if (!TypedArrayPrototype[KEY] || forced) {
- redefine(TypedArrayPrototype, KEY, forced ? property
- : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
- }
- };
- var exportTypedArrayStaticMethod = function (KEY, property, forced) {
- var ARRAY, TypedArrayConstructor;
- if (!DESCRIPTORS) return;
- if (setPrototypeOf) {
- if (forced) for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {
- delete TypedArrayConstructor[KEY];
- }
- }
- if (!TypedArray[KEY] || forced) {
- // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
- try {
- return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property);
- } catch (error) { /* empty */ }
- } else return;
- }
- for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
- redefine(TypedArrayConstructor, KEY, property);
- }
- }
- };
- for (NAME in TypedArrayConstructorsList) {
- if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;
- }
- // WebKit bug - typed arrays constructors prototype is Object.prototype
- if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {
- // eslint-disable-next-line no-shadow
- TypedArray = function TypedArray() {
- throw TypeError('Incorrect invocation');
- };
- if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
- if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
- }
- }
- if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
- TypedArrayPrototype = TypedArray.prototype;
- if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
- if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
- }
- }
- // WebKit bug - one more object in Uint8ClampedArray prototype chain
- if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
- setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
- }
- if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
- TYPED_ARRAY_TAG_REQIRED = true;
- defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
- return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
- } });
- for (NAME in TypedArrayConstructorsList) if (global[NAME]) {
- createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
- }
- }
- module.exports = {
- NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
- TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
- aTypedArray: aTypedArray,
- aTypedArrayConstructor: aTypedArrayConstructor,
- exportTypedArrayMethod: exportTypedArrayMethod,
- exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
- isView: isView,
- isTypedArray: isTypedArray,
- TypedArray: TypedArray,
- TypedArrayPrototype: TypedArrayPrototype
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-buffer.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/array-buffer.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 223:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var NATIVE_ARRAY_BUFFER = __webpack_require__(/*! ../internals/array-buffer-native */ "./node_modules/core-js/internals/array-buffer-native.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toIndex = __webpack_require__(/*! ../internals/to-index */ "./node_modules/core-js/internals/to-index.js");
- var IEEE754 = __webpack_require__(/*! ../internals/ieee754 */ "./node_modules/core-js/internals/ieee754.js");
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
- var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var arrayFill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var ARRAY_BUFFER = 'ArrayBuffer';
- var DATA_VIEW = 'DataView';
- var PROTOTYPE = 'prototype';
- var WRONG_LENGTH = 'Wrong length';
- var WRONG_INDEX = 'Wrong index';
- var NativeArrayBuffer = global[ARRAY_BUFFER];
- var $ArrayBuffer = NativeArrayBuffer;
- var $DataView = global[DATA_VIEW];
- var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
- var ObjectPrototype = Object.prototype;
- var RangeError = global.RangeError;
- var packIEEE754 = IEEE754.pack;
- var unpackIEEE754 = IEEE754.unpack;
- var packInt8 = function (number) {
- return [number & 0xFF];
- };
- var packInt16 = function (number) {
- return [number & 0xFF, number >> 8 & 0xFF];
- };
- var packInt32 = function (number) {
- return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
- };
- var unpackInt32 = function (buffer) {
- return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
- };
- var packFloat32 = function (number) {
- return packIEEE754(number, 23, 4);
- };
- var packFloat64 = function (number) {
- return packIEEE754(number, 52, 8);
- };
- var addGetter = function (Constructor, key) {
- defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });
- };
- var get = function (view, count, index, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = bytes.slice(start, start + count);
- return isLittleEndian ? pack : pack.reverse();
- };
- var set = function (view, count, index, conversion, value, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = conversion(+value);
- for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
- };
- if (!NATIVE_ARRAY_BUFFER) {
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
- var byteLength = toIndex(length);
- setInternalState(this, {
- bytes: arrayFill.call(new Array(byteLength), 0),
- byteLength: byteLength
- });
- if (!DESCRIPTORS) this.byteLength = byteLength;
- };
- $DataView = function DataView(buffer, byteOffset, byteLength) {
- anInstance(this, $DataView, DATA_VIEW);
- anInstance(buffer, $ArrayBuffer, DATA_VIEW);
- var bufferLength = getInternalState(buffer).byteLength;
- var offset = toInteger(byteOffset);
- if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');
- byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
- if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
- setInternalState(this, {
- buffer: buffer,
- byteLength: byteLength,
- byteOffset: offset
- });
- if (!DESCRIPTORS) {
- this.buffer = buffer;
- this.byteLength = byteLength;
- this.byteOffset = offset;
- }
- };
- if (DESCRIPTORS) {
- addGetter($ArrayBuffer, 'byteLength');
- addGetter($DataView, 'buffer');
- addGetter($DataView, 'byteLength');
- addGetter($DataView, 'byteOffset');
- }
- redefineAll($DataView[PROTOTYPE], {
- getInt8: function getInt8(byteOffset) {
- return get(this, 1, byteOffset)[0] << 24 >> 24;
- },
- getUint8: function getUint8(byteOffset) {
- return get(this, 1, byteOffset)[0];
- },
- getInt16: function getInt16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
- return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
- },
- getUint16: function getUint16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
- return bytes[1] << 8 | bytes[0];
- },
- getInt32: function getInt32(byteOffset /* , littleEndian */) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));
- },
- getUint32: function getUint32(byteOffset /* , littleEndian */) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;
- },
- getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);
- },
- getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);
- },
- setInt8: function setInt8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setUint8: function setUint8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
- set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);
- }
- });
- } else {
- if (!fails(function () {
- NativeArrayBuffer(1);
- }) || !fails(function () {
- new NativeArrayBuffer(-1); // eslint-disable-line no-new
- }) || fails(function () {
- new NativeArrayBuffer(); // eslint-disable-line no-new
- new NativeArrayBuffer(1.5); // eslint-disable-line no-new
- new NativeArrayBuffer(NaN); // eslint-disable-line no-new
- return NativeArrayBuffer.name != ARRAY_BUFFER;
- })) {
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer);
- return new NativeArrayBuffer(toIndex(length));
- };
- var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];
- for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
- if (!((key = keys[j++]) in $ArrayBuffer)) {
- createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
- }
- }
- ArrayBufferPrototype.constructor = $ArrayBuffer;
- }
- // WebKit bug - the same parent prototype for typed arrays and data view
- if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {
- setPrototypeOf($DataViewPrototype, ObjectPrototype);
- }
- // iOS Safari 7.x bug
- var testView = new $DataView(new $ArrayBuffer(2));
- var nativeSetInt8 = $DataViewPrototype.setInt8;
- testView.setInt8(0, 2147483648);
- testView.setInt8(1, 2147483649);
- if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
- setInt8: function setInt8(byteOffset, value) {
- nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
- },
- setUint8: function setUint8(byteOffset, value) {
- nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
- }
- }, { unsafe: true });
- }
- setToStringTag($ArrayBuffer, ARRAY_BUFFER);
- setToStringTag($DataView, DATA_VIEW);
- module.exports = {
- ArrayBuffer: $ArrayBuffer,
- DataView: $DataView
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-copy-within.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/array-copy-within.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var min = Math.min;
- // `Array.prototype.copyWithin` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin
- module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
- var O = toObject(this);
- var len = toLength(O.length);
- var to = toAbsoluteIndex(target, len);
- var from = toAbsoluteIndex(start, len);
- var end = arguments.length > 2 ? arguments[2] : undefined;
- var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
- var inc = 1;
- if (from < to && to < from + count) {
- inc = -1;
- from += count - 1;
- to += count - 1;
- }
- while (count-- > 0) {
- if (from in O) O[to] = O[from];
- else delete O[to];
- to += inc;
- from += inc;
- } return O;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-fill.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/array-fill.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- // `Array.prototype.fill` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
- module.exports = function fill(value /* , start = 0, end = @length */) {
- var O = toObject(this);
- var length = toLength(O.length);
- var argumentsLength = arguments.length;
- var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
- var end = argumentsLength > 2 ? arguments[2] : undefined;
- var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
- while (endPos > index) O[index++] = value;
- return O;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-for-each.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/array-for-each.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 11:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
- var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
- // `Array.prototype.forEach` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
- module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- } : [].forEach;
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-from.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/array-from.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js");
- var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
- // `Array.from` method implementation
- // https://tc39.github.io/ecma262/#sec-array.from
- module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iteratorMethod = getIteratorMethod(O);
- var index = 0;
- var length, result, step, iterator, next, value;
- if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
- // if the target is not iterable or it's an array with the default iterator - use a simple case
- if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
- iterator = iteratorMethod.call(O);
- next = iterator.next;
- result = new C();
- for (;!(step = next.call(iterator)).done; index++) {
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
- createProperty(result, index, value);
- }
- } else {
- length = toLength(O.length);
- result = new C(length);
- for (;length > index; index++) {
- value = mapping ? mapfn(O[index], index) : O[index];
- createProperty(result, index, value);
- }
- }
- result.length = index;
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-includes.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/array-includes.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
- // `Array.prototype.{ indexOf, includes }` methods implementation
- var createMethod = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- module.exports = {
- // `Array.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
- indexOf: createMethod(false)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-iteration.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/array-iteration.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 43:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/core-js/internals/array-species-create.js");
- var push = [].push;
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
- var createMethod = function (TYPE) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- return function ($this, callbackfn, that, specificCreate) {
- var O = toObject($this);
- var self = IndexedObject(O);
- var boundFunction = bind(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var create = specificCreate || arraySpeciesCreate;
- var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var value, result;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- value = self[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP) target[index] = result; // map
- else if (result) switch (TYPE) {
- case 3: return true; // some
- case 5: return value; // find
- case 6: return index; // findIndex
- case 2: push.call(target, value); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
- };
- module.exports = {
- // `Array.prototype.forEach` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-last-index-of.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/array-last-index-of.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var min = Math.min;
- var nativeLastIndexOf = [].lastIndexOf;
- var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
- // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
- // `Array.prototype.lastIndexOf` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
- module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
- // convert -0 to +0
- if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var index = length - 1;
- if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
- if (index < 0) index = length + index;
- for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
- return -1;
- } : nativeLastIndexOf;
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-method-has-species-support.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/core-js/internals/array-method-has-species-support.js ***!
- \****************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (METHOD_NAME) {
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/677
- return V8_VERSION >= 51 || !fails(function () {
- var array = [];
- var constructor = array.constructor = {};
- constructor[SPECIES] = function () {
- return { foo: 1 };
- };
- return array[METHOD_NAME](Boolean).foo !== 1;
- });
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-method-is-strict.js":
- /*!******************************************************************!*\
- !*** ./node_modules/core-js/internals/array-method-is-strict.js ***!
- \******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- module.exports = function (METHOD_NAME, argument) {
- var method = [][METHOD_NAME];
- return !!method && fails(function () {
- // eslint-disable-next-line no-useless-call,no-throw-literal
- method.call(null, argument || function () { throw 1; }, 1);
- });
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-method-uses-to-length.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/core-js/internals/array-method-uses-to-length.js ***!
- \***********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var defineProperty = Object.defineProperty;
- var cache = {};
- var thrower = function (it) { throw it; };
- module.exports = function (METHOD_NAME, options) {
- if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
- if (!options) options = {};
- var method = [][METHOD_NAME];
- var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
- var argument0 = has(options, 0) ? options[0] : thrower;
- var argument1 = has(options, 1) ? options[1] : undefined;
- return cache[METHOD_NAME] = !!method && !fails(function () {
- if (ACCESSORS && !DESCRIPTORS) return true;
- var O = { length: -1 };
- if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
- else O[1] = 1;
- method.call(O, argument0, argument1);
- });
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-reduce.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/array-reduce.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 33:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
- var createMethod = function (IS_RIGHT) {
- return function (that, callbackfn, argumentsLength, memo) {
- aFunction(callbackfn);
- var O = toObject(that);
- var self = IndexedObject(O);
- var length = toLength(O.length);
- var index = IS_RIGHT ? length - 1 : 0;
- var i = IS_RIGHT ? -1 : 1;
- if (argumentsLength < 2) while (true) {
- if (index in self) {
- memo = self[index];
- index += i;
- break;
- }
- index += i;
- if (IS_RIGHT ? index < 0 : length <= index) {
- throw TypeError('Reduce of empty array with no initial value');
- }
- }
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
- memo = callbackfn(memo, self[index], index, O);
- }
- return memo;
- };
- };
- module.exports = {
- // `Array.prototype.reduce` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
- left: createMethod(false),
- // `Array.prototype.reduceRight` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
- right: createMethod(true)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/array-species-create.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/internals/array-species-create.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var SPECIES = wellKnownSymbol('species');
- // `ArraySpeciesCreate` abstract operation
- // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
- module.exports = function (originalArray, length) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/core-js/internals/call-with-safe-iteration-closing.js ***!
- \****************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- // call something on iterator step with safe closing on error
- module.exports = function (iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch (error) {
- var returnMethod = iterator['return'];
- if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
- throw error;
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/check-correctness-of-iteration.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/core-js/internals/check-correctness-of-iteration.js ***!
- \**************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function () {
- return { done: !!called++ };
- },
- 'return': function () {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function () {
- return this;
- };
- // eslint-disable-next-line no-throw-literal
- Array.from(iteratorWithReturn, function () { throw 2; });
- } catch (error) { /* empty */ }
- module.exports = function (exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function () {
- return {
- next: function () {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) { /* empty */ }
- return ITERATION_SUPPORT;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/classof-raw.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/classof-raw.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module) => {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/classof.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/internals/classof.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 17:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
- var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- // ES3 wrong here
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (error) { /* empty */ }
- };
- // getting tag from ES6+ `Object.prototype.toString`
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
- var O, tag, result;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
- // builtinTag case
- : CORRECT_ARGUMENTS ? classofRaw(O)
- // ES3 arguments fallback
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/collection-strong.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/collection-strong.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 17:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
- var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
- var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var fastKey = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/core-js/internals/internal-metadata.js").fastKey;
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var setInternalState = InternalStateModule.set;
- var internalStateGetterFor = InternalStateModule.getterFor;
- module.exports = {
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- anInstance(that, C, CONSTRUCTOR_NAME);
- setInternalState(that, {
- type: CONSTRUCTOR_NAME,
- index: create(null),
- first: undefined,
- last: undefined,
- size: 0
- });
- if (!DESCRIPTORS) that.size = 0;
- if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
- });
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var define = function (that, key, value) {
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- var previous, index;
- // change existing entry
- if (entry) {
- entry.value = value;
- // create new entry
- } else {
- state.last = entry = {
- index: index = fastKey(key, true),
- key: key,
- value: value,
- previous: previous = state.last,
- next: undefined,
- removed: false
- };
- if (!state.first) state.first = entry;
- if (previous) previous.next = entry;
- if (DESCRIPTORS) state.size++;
- else that.size++;
- // add to index
- if (index !== 'F') state.index[index] = entry;
- } return that;
- };
- var getEntry = function (that, key) {
- var state = getInternalState(that);
- // fast case
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return state.index[index];
- // frozen object case
- for (entry = state.first; entry; entry = entry.next) {
- if (entry.key == key) return entry;
- }
- };
- redefineAll(C.prototype, {
- // 23.1.3.1 Map.prototype.clear()
- // 23.2.3.2 Set.prototype.clear()
- clear: function clear() {
- var that = this;
- var state = getInternalState(that);
- var data = state.index;
- var entry = state.first;
- while (entry) {
- entry.removed = true;
- if (entry.previous) entry.previous = entry.previous.next = undefined;
- delete data[entry.index];
- entry = entry.next;
- }
- state.first = state.last = undefined;
- if (DESCRIPTORS) state.size = 0;
- else that.size = 0;
- },
- // 23.1.3.3 Map.prototype.delete(key)
- // 23.2.3.4 Set.prototype.delete(value)
- 'delete': function (key) {
- var that = this;
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.next;
- var prev = entry.previous;
- delete state.index[entry.index];
- entry.removed = true;
- if (prev) prev.next = next;
- if (next) next.previous = prev;
- if (state.first == entry) state.first = next;
- if (state.last == entry) state.last = prev;
- if (DESCRIPTORS) state.size--;
- else that.size--;
- } return !!entry;
- },
- // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
- forEach: function forEach(callbackfn /* , that = undefined */) {
- var state = getInternalState(this);
- var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
- var entry;
- while (entry = entry ? entry.next : state.first) {
- boundFunction(entry.value, entry.key, this);
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- }
- },
- // 23.1.3.7 Map.prototype.has(key)
- // 23.2.3.7 Set.prototype.has(value)
- has: function has(key) {
- return !!getEntry(this, key);
- }
- });
- redefineAll(C.prototype, IS_MAP ? {
- // 23.1.3.6 Map.prototype.get(key)
- get: function get(key) {
- var entry = getEntry(this, key);
- return entry && entry.value;
- },
- // 23.1.3.9 Map.prototype.set(key, value)
- set: function set(key, value) {
- return define(this, key === 0 ? 0 : key, value);
- }
- } : {
- // 23.2.3.1 Set.prototype.add(value)
- add: function add(value) {
- return define(this, value = value === 0 ? 0 : value, value);
- }
- });
- if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
- get: function () {
- return getInternalState(this).size;
- }
- });
- return C;
- },
- setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
- var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
- var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
- // add .keys, .values, .entries, [@@iterator]
- // 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
- defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
- setInternalState(this, {
- type: ITERATOR_NAME,
- target: iterated,
- state: getInternalCollectionState(iterated),
- kind: kind,
- last: undefined
- });
- }, function () {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var entry = state.last;
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- // get next entry
- if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
- // or finish the iteration
- state.target = undefined;
- return { value: undefined, done: true };
- }
- // return step by kind
- if (kind == 'keys') return { value: entry.key, done: false };
- if (kind == 'values') return { value: entry.value, done: false };
- return { value: [entry.key, entry.value], done: false };
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
- // add [@@species], 23.1.2.2, 23.2.2.2
- setSpecies(CONSTRUCTOR_NAME);
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/collection.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/collection.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 15:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var InternalMetadataModule = __webpack_require__(/*! ../internals/internal-metadata */ "./node_modules/core-js/internals/internal-metadata.js");
- var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
- module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
- var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
- var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
- var ADDER = IS_MAP ? 'set' : 'add';
- var NativeConstructor = global[CONSTRUCTOR_NAME];
- var NativePrototype = NativeConstructor && NativeConstructor.prototype;
- var Constructor = NativeConstructor;
- var exported = {};
- var fixMethod = function (KEY) {
- var nativeMethod = NativePrototype[KEY];
- redefine(NativePrototype, KEY,
- KEY == 'add' ? function add(value) {
- nativeMethod.call(this, value === 0 ? 0 : value);
- return this;
- } : KEY == 'delete' ? function (key) {
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
- } : KEY == 'get' ? function get(key) {
- return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
- } : KEY == 'has' ? function has(key) {
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
- } : function set(key, value) {
- nativeMethod.call(this, key === 0 ? 0 : key, value);
- return this;
- }
- );
- };
- // eslint-disable-next-line max-len
- if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
- new NativeConstructor().entries().next();
- })))) {
- // create collection constructor
- Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
- InternalMetadataModule.REQUIRED = true;
- } else if (isForced(CONSTRUCTOR_NAME, true)) {
- var instance = new Constructor();
- // early implementations not supports chaining
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
- var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
- // most early implementations doesn't supports iterables, most modern - not close it correctly
- // eslint-disable-next-line no-new
- var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
- // for early implementations -0 and +0 not the same
- var BUGGY_ZERO = !IS_WEAK && fails(function () {
- // V8 ~ Chromium 42- fails only with 5+ elements
- var $instance = new NativeConstructor();
- var index = 5;
- while (index--) $instance[ADDER](index, index);
- return !$instance.has(-0);
- });
- if (!ACCEPT_ITERABLES) {
- Constructor = wrapper(function (dummy, iterable) {
- anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
- var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
- if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
- return that;
- });
- Constructor.prototype = NativePrototype;
- NativePrototype.constructor = Constructor;
- }
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
- // weak collections should not contains .clear method
- if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
- }
- exported[CONSTRUCTOR_NAME] = Constructor;
- $({ global: true, forced: Constructor != NativeConstructor }, exported);
- setToStringTag(Constructor, CONSTRUCTOR_NAME);
- if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
- return Constructor;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/copy-constructor-properties.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***!
- \***********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/core-js/internals/own-keys.js");
- var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- module.exports = function (target, source) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/correct-prototype-getter.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/correct-prototype-getter.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- module.exports = !fails(function () {
- function F() { /* empty */ }
- F.prototype.constructor = null;
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/create-iterator-constructor.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/core-js/internals/create-iterator-constructor.js ***!
- \***********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
- var returnThis = function () { return this; };
- module.exports = function (IteratorConstructor, NAME, next) {
- var TO_STRING_TAG = NAME + ' Iterator';
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/create-non-enumerable-property.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/core-js/internals/create-non-enumerable-property.js ***!
- \**************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- module.exports = DESCRIPTORS ? function (object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/create-property-descriptor.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/core-js/internals/create-property-descriptor.js ***!
- \**********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/create-property.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/create-property.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- module.exports = function (object, key, value) {
- var propertyKey = toPrimitive(key);
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else object[propertyKey] = value;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/define-iterator.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/define-iterator.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "./node_modules/core-js/internals/create-iterator-constructor.js");
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
- var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js");
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol('iterator');
- var KEYS = 'keys';
- var VALUES = 'values';
- var ENTRIES = 'entries';
- var returnThis = function () { return this; };
- module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function (KIND) {
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
- } return function () { return new IteratorConstructor(this); };
- };
- var TO_STRING_TAG = NAME + ' Iterator';
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR]
- || IterablePrototype['@@iterator']
- || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- // fix native
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
- createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- // Set @@toStringTag to native iterators
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() { return nativeIterator.call(this); };
- }
- // define iterator
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
- }
- Iterators[NAME] = defaultIterator;
- // export additional methods
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED) for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- redefine(IterablePrototype, KEY, methods[KEY]);
- }
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- return methods;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/define-well-known-symbol.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/define-well-known-symbol.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var path = __webpack_require__(/*! ../internals/path */ "./node_modules/core-js/internals/path.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/core-js/internals/well-known-symbol-wrapped.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- module.exports = function (NAME) {
- var Symbol = path.Symbol || (path.Symbol = {});
- if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
- value: wrappedWellKnownSymbolModule.f(NAME)
- });
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/descriptors.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/descriptors.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- // Thank's IE8 for his funny defineProperty
- module.exports = !fails(function () {
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/document-create-element.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/core-js/internals/document-create-element.js ***!
- \*******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var document = global.document;
- // typeof document.createElement is 'object' in old IE
- var EXISTS = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return EXISTS ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/dom-iterables.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/dom-iterables.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module) => {
- // iterable DOM collections
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
- module.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/engine-is-ios.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/engine-is-ios.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
- module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
- /***/ }),
- /***/ "./node_modules/core-js/internals/engine-user-agent.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/engine-user-agent.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- module.exports = getBuiltIn('navigator', 'userAgent') || '';
- /***/ }),
- /***/ "./node_modules/core-js/internals/engine-v8-version.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/engine-v8-version.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 20:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
- var process = global.process;
- var versions = process && process.versions;
- var v8 = versions && versions.v8;
- var match, version;
- if (v8) {
- match = v8.split('.');
- version = match[0] + match[1];
- } else if (userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match) version = match[1];
- }
- }
- module.exports = version && +version;
- /***/ }),
- /***/ "./node_modules/core-js/internals/enum-bug-keys.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/enum-bug-keys.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 2:0-14 */
- /***/ ((module) => {
- // IE8- don't enum bug keys
- module.exports = [
- 'constructor',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'toLocaleString',
- 'toString',
- 'valueOf'
- ];
- /***/ }),
- /***/ "./node_modules/core-js/internals/export.js":
- /*!**************************************************!*\
- !*** ./node_modules/core-js/internals/export.js ***!
- \**************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
- var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
- /*
- options.target - name of the target object
- options.global - target is the global object
- options.stat - export as static methods of target
- options.proto - export as prototype methods of target
- options.real - real prototype method for the `pure` version
- options.forced - export even if the native feature is available
- options.bind - bind methods to the target, required for the `pure` version
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
- options.sham - add a flag to not completely full polyfills
- options.enumerable - export as enumerable property
- options.noTargetGet - prevent calling a getter on target
- */
- module.exports = function (options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global;
- } else if (STATIC) {
- target = global[TARGET] || setGlobal(TARGET, {});
- } else {
- target = (global[TARGET] || {}).prototype;
- }
- if (target) for (key in source) {
- sourceProperty = source[key];
- if (options.noTargetGet) {
- descriptor = getOwnPropertyDescriptor(target, key);
- targetProperty = descriptor && descriptor.value;
- } else targetProperty = target[key];
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
- // contained in target
- if (!FORCED && targetProperty !== undefined) {
- if (typeof sourceProperty === typeof targetProperty) continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- // add a flag to not completely full polyfills
- if (options.sham || (targetProperty && targetProperty.sham)) {
- createNonEnumerableProperty(sourceProperty, 'sham', true);
- }
- // extend global
- redefine(target, key, sourceProperty, options);
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/fails.js":
- /*!*************************************************!*\
- !*** ./node_modules/core-js/internals/fails.js ***!
- \*************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
- \******************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 50:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // TODO: Remove from `core-js@4` since it's moved to entry points
- __webpack_require__(/*! ../modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var SPECIES = wellKnownSymbol('species');
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
- // #replace needs built-in support for named groups.
- // #match works fine because it just return the exec results, even if it has
- // a "grops" property.
- var re = /./;
- re.exec = function () {
- var result = [];
- result.groups = { a: '7' };
- return result;
- };
- return ''.replace(re, '$<a>') !== '7';
- });
- // IE <= 11 replaces $0 with the whole match, as if it was $&
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
- var REPLACE_KEEPS_$0 = (function () {
- return 'a'.replace(/./, '$0') === '$0';
- })();
- var REPLACE = wellKnownSymbol('replace');
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
- if (/./[REPLACE]) {
- return /./[REPLACE]('a', '$0') === '';
- }
- return false;
- })();
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function () { return originalExec.apply(this, arguments); };
- var result = 'ab'.split(re);
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
- });
- module.exports = function (KEY, length, exec, sham) {
- var SYMBOL = wellKnownSymbol(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function () {
- // String methods call symbol-named RegEp methods
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) != 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
- // Symbol-named RegExp methods call .exec
- var execCalled = false;
- var re = /a/;
- if (KEY === 'split') {
- // We can't use real regex here since it causes deoptimization
- // and serious performance degradation in V8
- // https://github.com/zloirock/core-js/issues/306
- re = {};
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
- // a new one. We need to return the patched regex when creating the new one.
- re.constructor = {};
- re.constructor[SPECIES] = function () { return re; };
- re.flags = '';
- re[SYMBOL] = /./[SYMBOL];
- }
- re.exec = function () { execCalled = true; return null; };
- re[SYMBOL]('');
- return !execCalled;
- });
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- (KEY === 'replace' && !(
- REPLACE_SUPPORTS_NAMED_GROUPS &&
- REPLACE_KEEPS_$0 &&
- !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- )) ||
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
- if (regexp.exec === regexpExec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- // The native String method already delegates to @@method (this
- // polyfilled function), leasing to infinite recursion.
- // We avoid it by directly calling the native @@method method.
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
- }
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
- }
- return { done: false };
- }, {
- REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
- REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- });
- var stringMethod = methods[0];
- var regexMethod = methods[1];
- redefine(String.prototype, KEY, stringMethod);
- redefine(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function (string, arg) { return regexMethod.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return regexMethod.call(string, this); }
- );
- }
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/freezing.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/internals/freezing.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- module.exports = !fails(function () {
- return Object.isExtensible(Object.preventExtensions({}));
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/function-bind-context.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/internals/function-bind-context.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
- // optional / simple context binding
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 0: return function () {
- return fn.call(that);
- };
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/get-built-in.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/get-built-in.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var path = __webpack_require__(/*! ../internals/path */ "./node_modules/core-js/internals/path.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var aFunction = function (variable) {
- return typeof variable == 'function' ? variable : undefined;
- };
- module.exports = function (namespace, method) {
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
- : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/get-iterator-method.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/get-iterator-method.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = function (it) {
- if (it != undefined) return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/get-iterator.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/get-iterator.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
- module.exports = function (it) {
- var iteratorMethod = getIteratorMethod(it);
- if (typeof iteratorMethod != 'function') {
- throw TypeError(String(it) + ' is not iterable');
- } return anObject(iteratorMethod.call(it));
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/global.js":
- /*!**************************************************!*\
- !*** ./node_modules/core-js/internals/global.js ***!
- \**************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var check = function (it) {
- return it && it.Math == Math && it;
- };
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- module.exports =
- // eslint-disable-next-line no-undef
- check(typeof globalThis == 'object' && globalThis) ||
- check(typeof window == 'object' && window) ||
- check(typeof self == 'object' && self) ||
- check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||
- // eslint-disable-next-line no-new-func
- Function('return this')();
- /***/ }),
- /***/ "./node_modules/core-js/internals/has.js":
- /*!***********************************************!*\
- !*** ./node_modules/core-js/internals/has.js ***!
- \***********************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module) => {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/hidden-keys.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/hidden-keys.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = {};
- /***/ }),
- /***/ "./node_modules/core-js/internals/host-report-errors.js":
- /*!**************************************************************!*\
- !*** ./node_modules/core-js/internals/host-report-errors.js ***!
- \**************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- module.exports = function (a, b) {
- var console = global.console;
- if (console && console.error) {
- arguments.length === 1 ? console.error(a) : console.error(a, b);
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/html.js":
- /*!************************************************!*\
- !*** ./node_modules/core-js/internals/html.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- module.exports = getBuiltIn('document', 'documentElement');
- /***/ }),
- /***/ "./node_modules/core-js/internals/ie8-dom-define.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/ie8-dom-define.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
- // Thank's IE8 for his funny defineProperty
- module.exports = !DESCRIPTORS && !fails(function () {
- return Object.defineProperty(createElement('div'), 'a', {
- get: function () { return 7; }
- }).a != 7;
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/ieee754.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/internals/ieee754.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 85:0-14 */
- /***/ ((module) => {
- // IEEE754 conversions based on https://github.com/feross/ieee754
- // eslint-disable-next-line no-shadow-restricted-names
- var Infinity = 1 / 0;
- var abs = Math.abs;
- var pow = Math.pow;
- var floor = Math.floor;
- var log = Math.log;
- var LN2 = Math.LN2;
- var pack = function (number, mantissaLength, bytes) {
- var buffer = new Array(bytes);
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
- var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
- var index = 0;
- var exponent, mantissa, c;
- number = abs(number);
- // eslint-disable-next-line no-self-compare
- if (number != number || number === Infinity) {
- // eslint-disable-next-line no-self-compare
- mantissa = number != number ? 1 : 0;
- exponent = eMax;
- } else {
- exponent = floor(log(number) / LN2);
- if (number * (c = pow(2, -exponent)) < 1) {
- exponent--;
- c *= 2;
- }
- if (exponent + eBias >= 1) {
- number += rt / c;
- } else {
- number += rt * pow(2, 1 - eBias);
- }
- if (number * c >= 2) {
- exponent++;
- c /= 2;
- }
- if (exponent + eBias >= eMax) {
- mantissa = 0;
- exponent = eMax;
- } else if (exponent + eBias >= 1) {
- mantissa = (number * c - 1) * pow(2, mantissaLength);
- exponent = exponent + eBias;
- } else {
- mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
- exponent = 0;
- }
- }
- for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);
- exponent = exponent << mantissaLength | mantissa;
- exponentLength += mantissaLength;
- for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);
- buffer[--index] |= sign * 128;
- return buffer;
- };
- var unpack = function (buffer, mantissaLength) {
- var bytes = buffer.length;
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var nBits = exponentLength - 7;
- var index = bytes - 1;
- var sign = buffer[index--];
- var exponent = sign & 127;
- var mantissa;
- sign >>= 7;
- for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);
- mantissa = exponent & (1 << -nBits) - 1;
- exponent >>= -nBits;
- nBits += mantissaLength;
- for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);
- if (exponent === 0) {
- exponent = 1 - eBias;
- } else if (exponent === eMax) {
- return mantissa ? NaN : sign ? -Infinity : Infinity;
- } else {
- mantissa = mantissa + pow(2, mantissaLength);
- exponent = exponent - eBias;
- } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
- };
- module.exports = {
- pack: pack,
- unpack: unpack
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/indexed-object.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/indexed-object.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var split = ''.split;
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- module.exports = fails(function () {
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
- // eslint-disable-next-line no-prototype-builtins
- return !Object('z').propertyIsEnumerable(0);
- }) ? function (it) {
- return classof(it) == 'String' ? split.call(it, '') : Object(it);
- } : Object;
- /***/ }),
- /***/ "./node_modules/core-js/internals/inherit-if-required.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/inherit-if-required.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
- // makes subclassing work correct for wrapped built-ins
- module.exports = function ($this, dummy, Wrapper) {
- var NewTarget, NewTargetPrototype;
- if (
- // it can work only with native `setPrototypeOf`
- setPrototypeOf &&
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
- typeof (NewTarget = dummy.constructor) == 'function' &&
- NewTarget !== Wrapper &&
- isObject(NewTargetPrototype = NewTarget.prototype) &&
- NewTargetPrototype !== Wrapper.prototype
- ) setPrototypeOf($this, NewTargetPrototype);
- return $this;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/inspect-source.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/inspect-source.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
- var functionToString = Function.toString;
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
- if (typeof store.inspectSource != 'function') {
- store.inspectSource = function (it) {
- return functionToString.call(it);
- };
- }
- module.exports = store.inspectSource;
- /***/ }),
- /***/ "./node_modules/core-js/internals/internal-metadata.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/internal-metadata.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 54:11-25 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
- var FREEZING = __webpack_require__(/*! ../internals/freezing */ "./node_modules/core-js/internals/freezing.js");
- var METADATA = uid('meta');
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var setMetadata = function (it) {
- defineProperty(it, METADATA, { value: {
- objectID: 'O' + ++id, // object ID
- weakData: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return a primitive with prefix
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!has(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMetadata(it);
- // return object ID
- } return it[METADATA].objectID;
- };
- var getWeakData = function (it, create) {
- if (!has(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMetadata(it);
- // return the store of weak collections IDs
- } return it[METADATA].weakData;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
- return it;
- };
- var meta = module.exports = {
- REQUIRED: false,
- fastKey: fastKey,
- getWeakData: getWeakData,
- onFreeze: onFreeze
- };
- hiddenKeys[METADATA] = true;
- /***/ }),
- /***/ "./node_modules/core-js/internals/internal-state.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/internal-state.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 55:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "./node_modules/core-js/internals/native-weak-map.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var objectHas = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
- var WeakMap = global.WeakMap;
- var set, get, has;
- var enforce = function (it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function (TYPE) {
- return function (it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
- } return state;
- };
- };
- if (NATIVE_WEAK_MAP) {
- var store = new WeakMap();
- var wmget = store.get;
- var wmhas = store.has;
- var wmset = store.set;
- set = function (it, metadata) {
- wmset.call(store, it, metadata);
- return metadata;
- };
- get = function (it) {
- return wmget.call(store, it) || {};
- };
- has = function (it) {
- return wmhas.call(store, it);
- };
- } else {
- var STATE = sharedKey('state');
- hiddenKeys[STATE] = true;
- set = function (it, metadata) {
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function (it) {
- return objectHas(it, STATE) ? it[STATE] : {};
- };
- has = function (it) {
- return objectHas(it, STATE);
- };
- }
- module.exports = {
- set: set,
- get: get,
- has: has,
- enforce: enforce,
- getterFor: getterFor
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-array-iterator-method.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/is-array-iterator-method.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayPrototype = Array.prototype;
- // check on default Array iterator
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-array.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/internals/is-array.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- // `IsArray` abstract operation
- // https://tc39.github.io/ecma262/#sec-isarray
- module.exports = Array.isArray || function isArray(arg) {
- return classof(arg) == 'Array';
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-forced.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/is-forced.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 21:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var replacement = /#|\.prototype\./;
- var isForced = function (feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true
- : value == NATIVE ? false
- : typeof detection == 'function' ? fails(detection)
- : !!detection;
- };
- var normalize = isForced.normalize = function (string) {
- return String(string).replace(replacement, '.').toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = 'N';
- var POLYFILL = isForced.POLYFILL = 'P';
- module.exports = isForced;
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-object.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/is-object.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-pure.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/internals/is-pure.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = false;
- /***/ }),
- /***/ "./node_modules/core-js/internals/is-regexp.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/is-regexp.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var MATCH = wellKnownSymbol('match');
- // `IsRegExp` abstract operation
- // https://tc39.github.io/ecma262/#sec-isregexp
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/iterate.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/internals/iterate.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 13:14-28 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
- var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "./node_modules/core-js/internals/call-with-safe-iteration-closing.js");
- var Result = function (stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
- var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
- var iterator, iterFn, index, length, result, next, step;
- if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
- // optimisation for array iterators
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = toLength(iterable.length); length > index; index++) {
- result = AS_ENTRIES
- ? boundFunction(anObject(step = iterable[index])[0], step[1])
- : boundFunction(iterable[index]);
- if (result && result instanceof Result) return result;
- } return new Result(false);
- }
- iterator = iterFn.call(iterable);
- }
- next = iterator.next;
- while (!(step = next.call(iterator)).done) {
- result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
- if (typeof result == 'object' && result && result instanceof Result) return result;
- } return new Result(false);
- };
- iterate.stop = function (result) {
- return new Result(true, result);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/iterators-core.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/internals/iterators-core.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 34:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var BUGGY_SAFARI_ITERATORS = false;
- var returnThis = function () { return this; };
- // `%IteratorPrototype%` object
- // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- if ([].keys) {
- arrayIterator = [].keys();
- // Safari 8 has buggy iterators w/o `next`
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- if (IteratorPrototype == undefined) IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
- createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
- }
- module.exports = {
- IteratorPrototype: IteratorPrototype,
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/iterators.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/iterators.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = {};
- /***/ }),
- /***/ "./node_modules/core-js/internals/microtask.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/microtask.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 71:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var macrotask = __webpack_require__(/*! ../internals/task */ "./node_modules/core-js/internals/task.js").set;
- var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/core-js/internals/engine-is-ios.js");
- var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
- var process = global.process;
- var Promise = global.Promise;
- var IS_NODE = classof(process) == 'process';
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
- var flush, head, last, notify, toggle, node, promise, then;
- // modern engines have queueMicrotask method
- if (!queueMicrotask) {
- flush = function () {
- var parent, fn;
- if (IS_NODE && (parent = process.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (error) {
- if (head) notify();
- else last = undefined;
- throw error;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
- // Node.js
- if (IS_NODE) {
- notify = function () {
- process.nextTick(flush);
- };
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
- } else if (MutationObserver && !IS_IOS) {
- toggle = true;
- node = document.createTextNode('');
- new MutationObserver(flush).observe(node, { characterData: true });
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (Promise && Promise.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- promise = Promise.resolve(undefined);
- then = promise.then;
- notify = function () {
- then.call(promise, flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessag
- // - onreadystatechange
- // - setTimeout
- } else {
- notify = function () {
- // strange IE + webpack dev server bug - use .call(global)
- macrotask.call(global, flush);
- };
- }
- }
- module.exports = queueMicrotask || function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/native-promise-constructor.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/core-js/internals/native-promise-constructor.js ***!
- \**********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- module.exports = global.Promise;
- /***/ }),
- /***/ "./node_modules/core-js/internals/native-symbol.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/native-symbol.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
- // Chrome 38 Symbol has incorrect toString conversion
- // eslint-disable-next-line no-undef
- return !String(Symbol());
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/native-url.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/native-url.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = !fails(function () {
- var url = new URL('b?a=1&b=2&c=3', 'http://a');
- var searchParams = url.searchParams;
- var result = '';
- url.pathname = 'c%20d';
- searchParams.forEach(function (value, key) {
- searchParams['delete']('b');
- result += key + value;
- });
- return (IS_PURE && !url.toJSON)
- || !searchParams.sort
- || url.href !== 'http://a/c%20d?a=1&c=3'
- || searchParams.get('c') !== '3'
- || String(new URLSearchParams('?a=1')) !== 'a=1'
- || !searchParams[ITERATOR]
- // throws in Edge
- || new URL('https://a@b').username !== 'a'
- || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
- // not punycoded in Edge
- || new URL('http://тест').host !== 'xn--e1aybc'
- // not escaped in Chrome 62-
- || new URL('http://a#б').hash !== '#%D0%B1'
- // fails in Chrome 66-
- || result !== 'a1c3'
- // throws in Safari
- || new URL('http://x', undefined).host !== 'x';
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/native-weak-map.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/native-weak-map.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
- var WeakMap = global.WeakMap;
- module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
- /***/ }),
- /***/ "./node_modules/core-js/internals/new-promise-capability.js":
- /*!******************************************************************!*\
- !*** ./node_modules/core-js/internals/new-promise-capability.js ***!
- \******************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: module, __webpack_require__ */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
- var PromiseCapability = function (C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aFunction(resolve);
- this.reject = aFunction(reject);
- };
- // 25.4.1.5 NewPromiseCapability(C)
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-assign.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/object-assign.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 15:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
- var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
- var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
- var nativeAssign = Object.assign;
- var defineProperty = Object.defineProperty;
- // `Object.assign` method
- // https://tc39.github.io/ecma262/#sec-object.assign
- module.exports = !nativeAssign || fails(function () {
- // should have correct order of operations (Edge bug)
- if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
- enumerable: true,
- get: function () {
- defineProperty(this, 'b', {
- value: 3,
- enumerable: false
- });
- }
- }), { b: 2 })).b !== 1) return true;
- // should work with symbols and should have deterministic property order (V8 bug)
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var symbol = Symbol();
- var alphabet = 'abcdefghijklmnopqrst';
- A[symbol] = 7;
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
- return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = toObject(target);
- var argumentsLength = arguments.length;
- var index = 1;
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
- while (argumentsLength > index) {
- var S = IndexedObject(arguments[index++]);
- var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
- }
- } return T;
- } : nativeAssign;
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-create.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/object-create.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 68:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js");
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
- var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js");
- var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
- var GT = '>';
- var LT = '<';
- var PROTOTYPE = 'prototype';
- var SCRIPT = 'script';
- var IE_PROTO = sharedKey('IE_PROTO');
- var EmptyConstructor = function () { /* empty */ };
- var scriptTag = function (content) {
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
- };
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
- var NullProtoObjectViaActiveX = function (activeXDocument) {
- activeXDocument.write(scriptTag(''));
- activeXDocument.close();
- var temp = activeXDocument.parentWindow.Object;
- activeXDocument = null; // avoid memory leak
- return temp;
- };
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var NullProtoObjectViaIFrame = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = documentCreateElement('iframe');
- var JS = 'java' + SCRIPT + ':';
- var iframeDocument;
- iframe.style.display = 'none';
- html.appendChild(iframe);
- // https://github.com/zloirock/core-js/issues/475
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag('document.F=Object'));
- iframeDocument.close();
- return iframeDocument.F;
- };
- // Check for document.domain and active x support
- // No need to use active x approach when document.domain is not set
- // see https://github.com/es-shims/es5-shim/issues/150
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
- // avoid IE GC bug
- var activeXDocument;
- var NullProtoObject = function () {
- try {
- /* global ActiveXObject */
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
- } catch (error) { /* ignore */ }
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
- var length = enumBugKeys.length;
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- // `Object.create` method
- // https://tc39.github.io/ecma262/#sec-object.create
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = NullProtoObject();
- return Properties === undefined ? result : defineProperties(result, Properties);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-define-properties.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/object-define-properties.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
- // `Object.defineProperties` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
- module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
- return O;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-define-property.js":
- /*!******************************************************************!*\
- !*** ./node_modules/core-js/internals/object-define-property.js ***!
- \******************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var nativeDefineProperty = Object.defineProperty;
- // `Object.defineProperty` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
- exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return nativeDefineProperty(O, P, Attributes);
- } catch (error) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***!
- \******************************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
- exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE) try {
- return nativeGetOwnPropertyDescriptor(O, P);
- } catch (error) { /* empty */ }
- if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-get-own-property-names-external.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/core-js/internals/object-get-own-property-names-external.js ***!
- \**********************************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, module */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var nativeGetOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
- var toString = {}.toString;
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function (it) {
- try {
- return nativeGetOwnPropertyNames(it);
- } catch (error) {
- return windowNames.slice();
- }
- };
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- module.exports.f = function getOwnPropertyNames(it) {
- return windowNames && toString.call(it) == '[object Window]'
- ? getWindowNames(it)
- : nativeGetOwnPropertyNames(toIndexedObject(it));
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-get-own-property-names.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***!
- \*************************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
- // `Object.getOwnPropertyNames` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***!
- \***************************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__ */
- /***/ ((__unused_webpack_module, exports) => {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-get-prototype-of.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/core-js/internals/object-get-prototype-of.js ***!
- \*******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 11:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/core-js/internals/correct-prototype-getter.js");
- var IE_PROTO = sharedKey('IE_PROTO');
- var ObjectPrototype = Object.prototype;
- // `Object.getPrototypeOf` method
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
- module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
- O = toObject(O);
- if (has(O, IE_PROTO)) return O[IE_PROTO];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectPrototype : null;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-keys-internal.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/internals/object-keys-internal.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
- module.exports = function (object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~indexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-keys.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/object-keys.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
- // `Object.keys` method
- // https://tc39.github.io/ecma262/#sec-object.keys
- module.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-property-is-enumerable.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***!
- \*************************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__ */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // Nashorn ~ JDK8 bug
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
- // `Object.prototype.propertyIsEnumerable` method implementation
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : nativePropertyIsEnumerable;
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-set-prototype-of.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***!
- \*******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ "./node_modules/core-js/internals/a-possible-prototype.js");
- // `Object.setPrototypeOf` method
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- /* eslint-disable no-proto */
- module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
- var CORRECT_SETTER = false;
- var test = {};
- var setter;
- try {
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
- setter.call(test, []);
- CORRECT_SETTER = test instanceof Array;
- } catch (error) { /* empty */ }
- return function setPrototypeOf(O, proto) {
- anObject(O);
- aPossiblePrototype(proto);
- if (CORRECT_SETTER) setter.call(O, proto);
- else O.__proto__ = proto;
- return O;
- };
- }() : undefined);
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-to-array.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/object-to-array.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var propertyIsEnumerable = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js").f;
- // `Object.{ entries, values }` methods implementation
- var createMethod = function (TO_ENTRIES) {
- return function (it) {
- var O = toIndexedObject(it);
- var keys = objectKeys(O);
- var length = keys.length;
- var i = 0;
- var result = [];
- var key;
- while (length > i) {
- key = keys[i++];
- if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
- result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
- }
- }
- return result;
- };
- };
- module.exports = {
- // `Object.entries` method
- // https://tc39.github.io/ecma262/#sec-object.entries
- entries: createMethod(true),
- // `Object.values` method
- // https://tc39.github.io/ecma262/#sec-object.values
- values: createMethod(false)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/object-to-string.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/internals/object-to-string.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
- var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
- // `Object.prototype.toString` method implementation
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
- module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
- return '[object ' + classof(this) + ']';
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/own-keys.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/internals/own-keys.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
- var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- // all object keys, includes non-enumerable and symbols
- module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/path.js":
- /*!************************************************!*\
- !*** ./node_modules/core-js/internals/path.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- module.exports = global;
- /***/ }),
- /***/ "./node_modules/core-js/internals/perform.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/internals/perform.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function (exec) {
- try {
- return { error: false, value: exec() };
- } catch (error) {
- return { error: true, value: error };
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/promise-resolve.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/internals/promise-resolve.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/core-js/internals/new-promise-capability.js");
- module.exports = function (C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C) return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/redefine-all.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/redefine-all.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- module.exports = function (target, src, options) {
- for (var key in src) redefine(target, key, src[key], options);
- return target;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/redefine.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/internals/redefine.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 12:1-15 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var getInternalState = InternalStateModule.get;
- var enforceInternalState = InternalStateModule.enforce;
- var TEMPLATE = String(String).split('String');
- (module.exports = function (O, key, value, options) {
- var unsafe = options ? !!options.unsafe : false;
- var simple = options ? !!options.enumerable : false;
- var noTargetGet = options ? !!options.noTargetGet : false;
- if (typeof value == 'function') {
- if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
- enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
- }
- if (O === global) {
- if (simple) O[key] = value;
- else setGlobal(key, value);
- return;
- } else if (!unsafe) {
- delete O[key];
- } else if (!noTargetGet && O[key]) {
- simple = true;
- }
- if (simple) O[key] = value;
- else createNonEnumerableProperty(O, key, value);
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, 'toString', function toString() {
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/regexp-exec-abstract.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/internals/regexp-exec-abstract.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var classof = __webpack_require__(/*! ./classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var regexpExec = __webpack_require__(/*! ./regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
- // `RegExpExec` abstract operation
- // https://tc39.github.io/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (typeof exec === 'function') {
- var result = exec.call(R, S);
- if (typeof result !== 'object') {
- throw TypeError('RegExp exec method returned something other than an Object or null');
- }
- return result;
- }
- if (classof(R) !== 'RegExp') {
- throw TypeError('RegExp#exec called on incompatible receiver');
- }
- return regexpExec.call(R, S);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/regexp-exec.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/regexp-exec.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 87:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var regexpFlags = __webpack_require__(/*! ./regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");
- var stickyHelpers = __webpack_require__(/*! ./regexp-sticky-helpers */ "./node_modules/core-js/internals/regexp-sticky-helpers.js");
- var nativeExec = RegExp.prototype.exec;
- // This always refers to the native implementation, because the
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
- // which loads this file before patching the method.
- var nativeReplace = String.prototype.replace;
- var patchedExec = nativeExec;
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/;
- var re2 = /b*/g;
- nativeExec.call(re1, 'a');
- nativeExec.call(re2, 'a');
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
- })();
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
- if (PATCH) {
- patchedExec = function exec(str) {
- var re = this;
- var lastIndex, reCopy, match, i;
- var sticky = UNSUPPORTED_Y && re.sticky;
- var flags = regexpFlags.call(re);
- var source = re.source;
- var charsAdded = 0;
- var strCopy = str;
- if (sticky) {
- flags = flags.replace('y', '');
- if (flags.indexOf('g') === -1) {
- flags += 'g';
- }
- strCopy = String(str).slice(re.lastIndex);
- // Support anchored sticky behavior.
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
- source = '(?: ' + source + ')';
- strCopy = ' ' + strCopy;
- charsAdded++;
- }
- // ^(? + rx + ) is needed, in combination with some str slicing, to
- // simulate the 'y' flag.
- reCopy = new RegExp('^(?:' + source + ')', flags);
- }
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
- match = nativeExec.call(sticky ? reCopy : re, strCopy);
- if (sticky) {
- if (match) {
- match.input = match.input.slice(charsAdded);
- match[0] = match[0].slice(charsAdded);
- match.index = re.lastIndex;
- re.lastIndex += match[0].length;
- } else re.lastIndex = 0;
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- // Fix browsers whose `exec` methods don't consistently return `undefined`
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
- nativeReplace.call(match[0], reCopy, function () {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined) match[i] = undefined;
- }
- });
- }
- return match;
- };
- }
- module.exports = patchedExec;
- /***/ }),
- /***/ "./node_modules/core-js/internals/regexp-flags.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/regexp-flags.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- // `RegExp.prototype.flags` getter implementation
- // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
- module.exports = function () {
- var that = anObject(this);
- var result = '';
- if (that.global) result += 'g';
- if (that.ignoreCase) result += 'i';
- if (that.multiline) result += 'm';
- if (that.dotAll) result += 's';
- if (that.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/regexp-sticky-helpers.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/internals/regexp-sticky-helpers.js ***!
- \*****************************************************************/
- /*! default exports */
- /*! export BROKEN_CARET [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export UNSUPPORTED_Y [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- var fails = __webpack_require__(/*! ./fails */ "./node_modules/core-js/internals/fails.js");
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
- // so we use an intermediate function.
- function RE(s, f) {
- return RegExp(s, f);
- }
- exports.UNSUPPORTED_Y = fails(function () {
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
- var re = RE('a', 'y');
- re.lastIndex = 2;
- return re.exec('abcd') != null;
- });
- exports.BROKEN_CARET = fails(function () {
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
- var re = RE('^r', 'gy');
- re.lastIndex = 2;
- return re.exec('str') != null;
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/require-object-coercible.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/require-object-coercible.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module) => {
- // `RequireObjectCoercible` abstract operation
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/set-global.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/set-global.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- module.exports = function (key, value) {
- try {
- createNonEnumerableProperty(global, key, value);
- } catch (error) {
- global[key] = value;
- } return value;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/set-species.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/set-species.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- var defineProperty = definePropertyModule.f;
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineProperty(Constructor, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/set-to-string-tag.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/set-to-string-tag.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- module.exports = function (it, TAG, STATIC) {
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/shared-key.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/shared-key.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
- var keys = shared('keys');
- module.exports = function (key) {
- return keys[key] || (keys[key] = uid(key));
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/shared-store.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/shared-store.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || setGlobal(SHARED, {});
- module.exports = store;
- /***/ }),
- /***/ "./node_modules/core-js/internals/shared.js":
- /*!**************************************************!*\
- !*** ./node_modules/core-js/internals/shared.js ***!
- \**************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 4:1-15 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: '3.6.5',
- mode: IS_PURE ? 'pure' : 'global',
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/species-constructor.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/species-constructor.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var SPECIES = wellKnownSymbol('species');
- // `SpeciesConstructor` abstract operation
- // https://tc39.github.io/ecma262/#sec-speciesconstructor
- module.exports = function (O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-multibyte.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/internals/string-multibyte.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 20:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- // `String.prototype.{ codePointAt, at }` methods implementation
- var createMethod = function (CONVERT_TO_STRING) {
- return function ($this, pos) {
- var S = String(requireObjectCoercible($this));
- var position = toInteger(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = S.charCodeAt(position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING ? S.charAt(position) : first
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
- };
- };
- module.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-pad-webkit-bug.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/internals/string-pad-webkit-bug.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/zloirock/core-js/issues/280
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
- // eslint-disable-next-line unicorn/no-unsafe-regex
- module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-pad.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/string-pad.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 24:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-string-pad-start-end
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- var ceil = Math.ceil;
- // `String.prototype.{ padStart, padEnd }` methods implementation
- var createMethod = function (IS_END) {
- return function ($this, maxLength, fillString) {
- var S = String(requireObjectCoercible($this));
- var stringLength = S.length;
- var fillStr = fillString === undefined ? ' ' : String(fillString);
- var intMaxLength = toLength(maxLength);
- var fillLen, stringFiller;
- if (intMaxLength <= stringLength || fillStr == '') return S;
- fillLen = intMaxLength - stringLength;
- stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
- if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
- return IS_END ? S + stringFiller : stringFiller + S;
- };
- };
- module.exports = {
- // `String.prototype.padStart` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
- start: createMethod(false),
- // `String.prototype.padEnd` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padend
- end: createMethod(true)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-punycode-to-ascii.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/internals/string-punycode-to-ascii.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 159:0-14 */
- /***/ ((module) => {
- "use strict";
- // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
- var base = 36;
- var tMin = 1;
- var tMax = 26;
- var skew = 38;
- var damp = 700;
- var initialBias = 72;
- var initialN = 128; // 0x80
- var delimiter = '-'; // '\x2D'
- var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
- var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
- var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
- var baseMinusTMin = base - tMin;
- var floor = Math.floor;
- var stringFromCharCode = String.fromCharCode;
- /**
- * Creates an array containing the numeric code points of each Unicode
- * character in the string. While JavaScript uses UCS-2 internally,
- * this function will convert a pair of surrogate halves (each of which
- * UCS-2 exposes as separate characters) into a single code point,
- * matching UTF-16.
- */
- var ucs2decode = function (string) {
- var output = [];
- var counter = 0;
- var length = string.length;
- while (counter < length) {
- var value = string.charCodeAt(counter++);
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
- // It's a high surrogate, and there is a next character.
- var extra = string.charCodeAt(counter++);
- if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
- } else {
- // It's an unmatched surrogate; only append this code unit, in case the
- // next code unit is the high surrogate of a surrogate pair.
- output.push(value);
- counter--;
- }
- } else {
- output.push(value);
- }
- }
- return output;
- };
- /**
- * Converts a digit/integer into a basic code point.
- */
- var digitToBasic = function (digit) {
- // 0..25 map to ASCII a..z or A..Z
- // 26..35 map to ASCII 0..9
- return digit + 22 + 75 * (digit < 26);
- };
- /**
- * Bias adaptation function as per section 3.4 of RFC 3492.
- * https://tools.ietf.org/html/rfc3492#section-3.4
- */
- var adapt = function (delta, numPoints, firstTime) {
- var k = 0;
- delta = firstTime ? floor(delta / damp) : delta >> 1;
- delta += floor(delta / numPoints);
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
- delta = floor(delta / baseMinusTMin);
- }
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
- };
- /**
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
- * Punycode string of ASCII-only symbols.
- */
- // eslint-disable-next-line max-statements
- var encode = function (input) {
- var output = [];
- // Convert the input in UCS-2 to an array of Unicode code points.
- input = ucs2decode(input);
- // Cache the length.
- var inputLength = input.length;
- // Initialize the state.
- var n = initialN;
- var delta = 0;
- var bias = initialBias;
- var i, currentValue;
- // Handle the basic code points.
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < 0x80) {
- output.push(stringFromCharCode(currentValue));
- }
- }
- var basicLength = output.length; // number of basic code points.
- var handledCPCount = basicLength; // number of code points that have been handled;
- // Finish the basic string with a delimiter unless it's empty.
- if (basicLength) {
- output.push(delimiter);
- }
- // Main encoding loop:
- while (handledCPCount < inputLength) {
- // All non-basic code points < n have been handled already. Find the next larger one:
- var m = maxInt;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue >= n && currentValue < m) {
- m = currentValue;
- }
- }
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
- var handledCPCountPlusOne = handledCPCount + 1;
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
- throw RangeError(OVERFLOW_ERROR);
- }
- delta += (m - n) * handledCPCountPlusOne;
- n = m;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < n && ++delta > maxInt) {
- throw RangeError(OVERFLOW_ERROR);
- }
- if (currentValue == n) {
- // Represent delta as a generalized variable-length integer.
- var q = delta;
- for (var k = base; /* no condition */; k += base) {
- var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
- if (q < t) break;
- var qMinusT = q - t;
- var baseMinusT = base - t;
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
- q = floor(qMinusT / baseMinusT);
- }
- output.push(stringFromCharCode(digitToBasic(q)));
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
- delta = 0;
- ++handledCPCount;
- }
- }
- ++delta;
- ++n;
- }
- return output.join('');
- };
- module.exports = function (input) {
- var encoded = [];
- var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
- var i, label;
- for (i = 0; i < labels.length; i++) {
- label = labels[i];
- encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
- }
- return encoded.join('.');
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-repeat.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/internals/string-repeat.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- // `String.prototype.repeat` method implementation
- // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
- module.exports = ''.repeat || function repeat(count) {
- var str = String(requireObjectCoercible(this));
- var result = '';
- var n = toInteger(count);
- if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-trim-forced.js":
- /*!**************************************************************!*\
- !*** ./node_modules/core-js/internals/string-trim-forced.js ***!
- \**************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js");
- var non = '\u200B\u0085\u180E';
- // check that a method works with the correct list
- // of whitespaces and has a correct name
- module.exports = function (METHOD_NAME) {
- return fails(function () {
- return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
- });
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/string-trim.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/string-trim.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js");
- var whitespace = '[' + whitespaces + ']';
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
- var rtrim = RegExp(whitespace + whitespace + '*$');
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
- var createMethod = function (TYPE) {
- return function ($this) {
- var string = String(requireObjectCoercible($this));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
- };
- };
- module.exports = {
- // `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
- trim: createMethod(3)
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/task.js":
- /*!************************************************!*\
- !*** ./node_modules/core-js/internals/task.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js");
- var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
- var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "./node_modules/core-js/internals/engine-is-ios.js");
- var location = global.location;
- var set = global.setImmediate;
- var clear = global.clearImmediate;
- var process = global.process;
- var MessageChannel = global.MessageChannel;
- var Dispatch = global.Dispatch;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var defer, channel, port;
- var run = function (id) {
- // eslint-disable-next-line no-prototype-builtins
- if (queue.hasOwnProperty(id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var runner = function (id) {
- return function () {
- run(id);
- };
- };
- var listener = function (event) {
- run(event.data);
- };
- var post = function (id) {
- // old engines have not location.origin
- global.postMessage(id + '', location.protocol + '//' + location.host);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!set || !clear) {
- set = function setImmediate(fn) {
- var args = [];
- var i = 1;
- while (arguments.length > i) args.push(arguments[i++]);
- queue[++counter] = function () {
- // eslint-disable-next-line no-new-func
- (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
- };
- defer(counter);
- return counter;
- };
- clear = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (classof(process) == 'process') {
- defer = function (id) {
- process.nextTick(runner(id));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(runner(id));
- };
- // Browsers with MessageChannel, includes WebWorkers
- // except iOS - https://github.com/zloirock/core-js/issues/624
- } else if (MessageChannel && !IS_IOS) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = bind(port.postMessage, port, 1);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (
- global.addEventListener &&
- typeof postMessage == 'function' &&
- !global.importScripts &&
- !fails(post) &&
- location.protocol !== 'file:'
- ) {
- defer = post;
- global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in createElement('script')) {
- defer = function (id) {
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(runner(id), 0);
- };
- }
- }
- module.exports = {
- set: set,
- clear: clear
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/this-number-value.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/this-number-value.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- // `thisNumberValue` abstract operation
- // https://tc39.github.io/ecma262/#sec-thisnumbervalue
- module.exports = function (value) {
- if (typeof value != 'number' && classof(value) != 'Number') {
- throw TypeError('Incorrect invocation');
- }
- return +value;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-absolute-index.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/to-absolute-index.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var max = Math.max;
- var min = Math.min;
- // Helper for a popular repeating case of the spec:
- // Let integer be ? ToInteger(index).
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
- module.exports = function (index, length) {
- var integer = toInteger(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-index.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/internals/to-index.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- // `ToIndex` abstract operation
- // https://tc39.github.io/ecma262/#sec-toindex
- module.exports = function (it) {
- if (it === undefined) return 0;
- var number = toInteger(it);
- var length = toLength(number);
- if (number !== length) throw RangeError('Wrong length or index');
- return length;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-indexed-object.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/to-indexed-object.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // toObject with fallback for non-array-like ES3 strings
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- module.exports = function (it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-integer.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/internals/to-integer.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module) => {
- var ceil = Math.ceil;
- var floor = Math.floor;
- // `ToInteger` abstract operation
- // https://tc39.github.io/ecma262/#sec-tointeger
- module.exports = function (argument) {
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-length.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/to-length.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var min = Math.min;
- // `ToLength` abstract operation
- // https://tc39.github.io/ecma262/#sec-tolength
- module.exports = function (argument) {
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-object.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/to-object.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 5:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- // `ToObject` abstract operation
- // https://tc39.github.io/ecma262/#sec-toobject
- module.exports = function (argument) {
- return Object(requireObjectCoercible(argument));
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-offset.js":
- /*!*****************************************************!*\
- !*** ./node_modules/core-js/internals/to-offset.js ***!
- \*****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toPositiveInteger = __webpack_require__(/*! ../internals/to-positive-integer */ "./node_modules/core-js/internals/to-positive-integer.js");
- module.exports = function (it, BYTES) {
- var offset = toPositiveInteger(it);
- if (offset % BYTES) throw RangeError('Wrong offset');
- return offset;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-positive-integer.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/internals/to-positive-integer.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- module.exports = function (it) {
- var result = toInteger(it);
- if (result < 0) throw RangeError("The argument can't be less than 0");
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-primitive.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/internals/to-primitive.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- // `ToPrimitive` abstract operation
- // https://tc39.github.io/ecma262/#sec-toprimitive
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function (input, PREFERRED_STRING) {
- if (!isObject(input)) return input;
- var fn, val;
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/to-string-tag-support.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/internals/to-string-tag-support.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var test = {};
- test[TO_STRING_TAG] = 'z';
- module.exports = String(test) === '[object z]';
- /***/ }),
- /***/ "./node_modules/core-js/internals/typed-array-constructor.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/core-js/internals/typed-array-constructor.js ***!
- \*******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 109:2-16 */
- /*! CommonJS bailout: module.exports is used directly at 230:7-21 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- 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");
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var ArrayBufferModule = __webpack_require__(/*! ../internals/array-buffer */ "./node_modules/core-js/internals/array-buffer.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toIndex = __webpack_require__(/*! ../internals/to-index */ "./node_modules/core-js/internals/to-index.js");
- var toOffset = __webpack_require__(/*! ../internals/to-offset */ "./node_modules/core-js/internals/to-offset.js");
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js");
- var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
- var typedArrayFrom = __webpack_require__(/*! ../internals/typed-array-from */ "./node_modules/core-js/internals/typed-array-from.js");
- var forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
- var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var round = Math.round;
- var RangeError = global.RangeError;
- var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
- var DataView = ArrayBufferModule.DataView;
- var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
- var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
- var TypedArray = ArrayBufferViewCore.TypedArray;
- var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var isTypedArray = ArrayBufferViewCore.isTypedArray;
- var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
- var WRONG_LENGTH = 'Wrong length';
- var fromList = function (C, list) {
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- };
- var addGetter = function (it, key) {
- nativeDefineProperty(it, key, { get: function () {
- return getInternalState(this)[key];
- } });
- };
- var isArrayBuffer = function (it) {
- var klass;
- return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
- };
- var isTypedArrayIndex = function (target, key) {
- return isTypedArray(target)
- && typeof key != 'symbol'
- && key in target
- && String(+key) == String(key);
- };
- var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
- return isTypedArrayIndex(target, key = toPrimitive(key, true))
- ? createPropertyDescriptor(2, target[key])
- : nativeGetOwnPropertyDescriptor(target, key);
- };
- var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
- if (isTypedArrayIndex(target, key = toPrimitive(key, true))
- && isObject(descriptor)
- && has(descriptor, 'value')
- && !has(descriptor, 'get')
- && !has(descriptor, 'set')
- // TODO: add validation descriptor w/o calling accessors
- && !descriptor.configurable
- && (!has(descriptor, 'writable') || descriptor.writable)
- && (!has(descriptor, 'enumerable') || descriptor.enumerable)
- ) {
- target[key] = descriptor.value;
- return target;
- } return nativeDefineProperty(target, key, descriptor);
- };
- if (DESCRIPTORS) {
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
- definePropertyModule.f = wrappedDefineProperty;
- addGetter(TypedArrayPrototype, 'buffer');
- addGetter(TypedArrayPrototype, 'byteOffset');
- addGetter(TypedArrayPrototype, 'byteLength');
- addGetter(TypedArrayPrototype, 'length');
- }
- $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
- getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
- defineProperty: wrappedDefineProperty
- });
- module.exports = function (TYPE, wrapper, CLAMPED) {
- var BYTES = TYPE.match(/\d+$/)[0] / 8;
- var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
- var GETTER = 'get' + TYPE;
- var SETTER = 'set' + TYPE;
- var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
- var TypedArrayConstructor = NativeTypedArrayConstructor;
- var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
- var exported = {};
- var getter = function (that, index) {
- var data = getInternalState(that);
- return data.view[GETTER](index * BYTES + data.byteOffset, true);
- };
- var setter = function (that, index, value) {
- var data = getInternalState(that);
- if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
- data.view[SETTER](index * BYTES + data.byteOffset, value, true);
- };
- var addElement = function (that, index) {
- nativeDefineProperty(that, index, {
- get: function () {
- return getter(this, index);
- },
- set: function (value) {
- return setter(this, index, value);
- },
- enumerable: true
- });
- };
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
- anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);
- var index = 0;
- var byteOffset = 0;
- var buffer, byteLength, length;
- if (!isObject(data)) {
- length = toIndex(data);
- byteLength = length * BYTES;
- buffer = new ArrayBuffer(byteLength);
- } else if (isArrayBuffer(data)) {
- buffer = data;
- byteOffset = toOffset(offset, BYTES);
- var $len = data.byteLength;
- if ($length === undefined) {
- if ($len % BYTES) throw RangeError(WRONG_LENGTH);
- byteLength = $len - byteOffset;
- if (byteLength < 0) throw RangeError(WRONG_LENGTH);
- } else {
- byteLength = toLength($length) * BYTES;
- if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
- }
- length = byteLength / BYTES;
- } else if (isTypedArray(data)) {
- return fromList(TypedArrayConstructor, data);
- } else {
- return typedArrayFrom.call(TypedArrayConstructor, data);
- }
- setInternalState(that, {
- buffer: buffer,
- byteOffset: byteOffset,
- byteLength: byteLength,
- length: length,
- view: new DataView(buffer)
- });
- while (index < length) addElement(that, index++);
- });
- if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
- TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
- } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
- TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
- anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);
- return inheritIfRequired(function () {
- if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
- if (isArrayBuffer(data)) return $length !== undefined
- ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
- : typedArrayOffset !== undefined
- ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
- : new NativeTypedArrayConstructor(data);
- if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
- return typedArrayFrom.call(TypedArrayConstructor, data);
- }(), dummy, TypedArrayConstructor);
- });
- if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
- forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
- if (!(key in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
- }
- });
- TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
- }
- if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
- }
- if (TYPED_ARRAY_TAG) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
- }
- exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
- $({
- global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS
- }, exported);
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
- }
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
- }
- setSpecies(CONSTRUCTOR_NAME);
- };
- } else module.exports = function () { /* empty */ };
- /***/ }),
- /***/ "./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js ***!
- \*************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 10:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- /* eslint-disable no-new */
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
- 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;
- var ArrayBuffer = global.ArrayBuffer;
- var Int8Array = global.Int8Array;
- module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
- Int8Array(1);
- }) || !fails(function () {
- new Int8Array(-1);
- }) || !checkCorrectnessOfIteration(function (iterable) {
- new Int8Array();
- new Int8Array(null);
- new Int8Array(1.5);
- new Int8Array(iterable);
- }, true) || fails(function () {
- // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
- return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
- });
- /***/ }),
- /***/ "./node_modules/core-js/internals/typed-array-from.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/internals/typed-array-from.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 8:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
- var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "./node_modules/core-js/internals/is-array-iterator-method.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var aTypedArrayConstructor = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js").aTypedArrayConstructor;
- module.exports = function from(source /* , mapfn, thisArg */) {
- var O = toObject(source);
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iteratorMethod = getIteratorMethod(O);
- var i, length, result, step, iterator, next;
- if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {
- iterator = iteratorMethod.call(O);
- next = iterator.next;
- O = [];
- while (!(step = next.call(iterator)).done) {
- O.push(step.value);
- }
- }
- if (mapping && argumentsLength > 2) {
- mapfn = bind(mapfn, arguments[2], 2);
- }
- length = toLength(O.length);
- result = new (aTypedArrayConstructor(this))(length);
- for (i = 0; length > i; i++) {
- result[i] = mapping ? mapfn(O[i], i) : O[i];
- }
- return result;
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/uid.js":
- /*!***********************************************!*\
- !*** ./node_modules/core-js/internals/uid.js ***!
- \***********************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 4:0-14 */
- /***/ ((module) => {
- var id = 0;
- var postfix = Math.random();
- module.exports = function (key) {
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/use-symbol-as-uid.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/use-symbol-as-uid.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
- module.exports = NATIVE_SYMBOL
- // eslint-disable-next-line no-undef
- && !Symbol.sham
- // eslint-disable-next-line no-undef
- && typeof Symbol.iterator == 'symbol';
- /***/ }),
- /***/ "./node_modules/core-js/internals/well-known-symbol-wrapped.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/core-js/internals/well-known-symbol-wrapped.js ***!
- \*********************************************************************/
- /*! default exports */
- /*! export f [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__, __webpack_require__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- exports.f = wellKnownSymbol;
- /***/ }),
- /***/ "./node_modules/core-js/internals/well-known-symbol.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/internals/well-known-symbol.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 12:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
- var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
- var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
- var WellKnownSymbolsStore = shared('wks');
- var Symbol = global.Symbol;
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
- module.exports = function (name) {
- if (!has(WellKnownSymbolsStore, name)) {
- if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
- } return WellKnownSymbolsStore[name];
- };
- /***/ }),
- /***/ "./node_modules/core-js/internals/whitespaces.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/internals/whitespaces.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:0-14 */
- /***/ ((module) => {
- // a string of all valid unicode whitespaces
- // eslint-disable-next-line max-len
- 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';
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.concat.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.concat.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
- var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "./node_modules/core-js/internals/array-species-create.js");
- var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/679
- var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
- var array = [];
- array[IS_CONCAT_SPREADABLE] = false;
- return array.concat()[0] !== array;
- });
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
- var isConcatSpreadable = function (O) {
- if (!isObject(O)) return false;
- var spreadable = O[IS_CONCAT_SPREADABLE];
- return spreadable !== undefined ? !!spreadable : isArray(O);
- };
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
- // `Array.prototype.concat` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.concat
- // with adding support of @@isConcatSpreadable and @@species
- $({ target: 'Array', proto: true, forced: FORCED }, {
- concat: function concat(arg) { // eslint-disable-line no-unused-vars
- var O = toObject(this);
- var A = arraySpeciesCreate(O, 0);
- var n = 0;
- var i, k, length, len, E;
- for (i = -1, length = arguments.length; i < length; i++) {
- E = i === -1 ? O : arguments[i];
- if (isConcatSpreadable(E)) {
- len = toLength(E.length);
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
- } else {
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- createProperty(A, n++, E);
- }
- }
- A.length = n;
- return A;
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.fill.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.fill.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var fill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
- var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
- // `Array.prototype.fill` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
- $({ target: 'Array', proto: true }, {
- fill: fill
- });
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('fill');
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.filter.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.filter.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").filter;
- var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
- // Edge 14- issue
- var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
- // `Array.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- filter: function filter(callbackfn /* , thisArg */) {
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.find.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.find.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $find = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").find;
- var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var FIND = 'find';
- var SKIPS_HOLES = true;
- var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
- // Shouldn't skip holes
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
- // `Array.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables(FIND);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.iterator.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.iterator.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 22:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
- var ARRAY_ITERATOR = 'Array Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- // `Array.prototype.entries` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.github.io/ecma262/#sec-createarrayiterator
- module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated), // target
- index: 0, // next index
- kind: kind // kind
- });
- // `%ArrayIteratorPrototype%.next` method
- // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
- }, function () {
- var state = getInternalState(this);
- var target = state.target;
- var kind = state.kind;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = undefined;
- return { value: undefined, done: true };
- }
- if (kind == 'keys') return { value: index, done: false };
- if (kind == 'values') return { value: target[index], done: false };
- return { value: [index, target[index]], done: false };
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values%
- // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
- Iterators.Arguments = Iterators.Array;
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.join.js":
- /*!*******************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.join.js ***!
- \*******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");
- var nativeJoin = [].join;
- var ES3_STRINGS = IndexedObject != Object;
- var STRICT_METHOD = arrayMethodIsStrict('join', ',');
- // `Array.prototype.join` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.join
- $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
- join: function join(separator) {
- return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.map.js":
- /*!******************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.map.js ***!
- \******************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $map = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").map;
- var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
- // FF49- issue
- var USES_TO_LENGTH = arrayMethodUsesToLength('map');
- // `Array.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- map: function map(callbackfn /* , thisArg */) {
- return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.array.slice.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/modules/es.array.slice.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "./node_modules/core-js/internals/array-method-has-species-support.js");
- var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
- var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
- var SPECIES = wellKnownSymbol('species');
- var nativeSlice = [].slice;
- var max = Math.max;
- // `Array.prototype.slice` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.slice
- // fallback for not array-like ES3 strings and DOM objects
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- slice: function slice(start, end) {
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
- var Constructor, result, n;
- if (isArray(O)) {
- Constructor = O.constructor;
- // cross-realm fallback
- if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
- Constructor = undefined;
- } else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES];
- if (Constructor === null) Constructor = undefined;
- }
- if (Constructor === Array || Constructor === undefined) {
- return nativeSlice.call(O, k, fin);
- }
- }
- result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
- result.length = n;
- return result;
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.map.js":
- /*!************************************************!*\
- !*** ./node_modules/core-js/modules/es.map.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var collection = __webpack_require__(/*! ../internals/collection */ "./node_modules/core-js/internals/collection.js");
- var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "./node_modules/core-js/internals/collection-strong.js");
- // `Map` constructor
- // https://tc39.github.io/ecma262/#sec-map-objects
- module.exports = collection('Map', function (init) {
- return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
- }, collectionStrong);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.number.constructor.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/modules/es.number.constructor.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js");
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f;
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim;
- var NUMBER = 'Number';
- var NativeNumber = global[NUMBER];
- var NumberPrototype = NativeNumber.prototype;
- // Opera ~12 has broken Object#toString
- var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
- // `ToNumber` abstract operation
- // https://tc39.github.io/ecma262/#sec-tonumber
- var toNumber = function (argument) {
- var it = toPrimitive(argument, false);
- var first, third, radix, maxCode, digits, length, index, code;
- if (typeof it == 'string' && it.length > 2) {
- it = trim(it);
- first = it.charCodeAt(0);
- if (first === 43 || first === 45) {
- third = it.charCodeAt(2);
- if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
- } else if (first === 48) {
- switch (it.charCodeAt(1)) {
- case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
- case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
- default: return +it;
- }
- digits = it.slice(2);
- length = digits.length;
- for (index = 0; index < length; index++) {
- code = digits.charCodeAt(index);
- // parseInt parses a string to a first unavailable symbol
- // but ToNumber should return NaN if a string contains unavailable symbols
- if (code < 48 || code > maxCode) return NaN;
- } return parseInt(digits, radix);
- }
- } return +it;
- };
- // `Number` constructor
- // https://tc39.github.io/ecma262/#sec-number-constructor
- if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
- var NumberWrapper = function Number(value) {
- var it = arguments.length < 1 ? 0 : value;
- var dummy = this;
- return dummy instanceof NumberWrapper
- // check on 1..constructor(foo) case
- && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
- ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
- };
- for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
- // ES3:
- 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
- // ES2015 (in case, if modules with ES2015 Number statics required before):
- 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
- 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
- ).split(','), j = 0, key; keys.length > j; j++) {
- if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
- defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
- }
- }
- NumberWrapper.prototype = NumberPrototype;
- NumberPrototype.constructor = NumberWrapper;
- redefine(global, NUMBER, NumberWrapper);
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.number.to-fixed.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/modules/es.number.to-fixed.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var thisNumberValue = __webpack_require__(/*! ../internals/this-number-value */ "./node_modules/core-js/internals/this-number-value.js");
- var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var nativeToFixed = 1.0.toFixed;
- var floor = Math.floor;
- var pow = function (x, n, acc) {
- return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
- };
- var log = function (x) {
- var n = 0;
- var x2 = x;
- while (x2 >= 4096) {
- n += 12;
- x2 /= 4096;
- }
- while (x2 >= 2) {
- n += 1;
- x2 /= 2;
- } return n;
- };
- var FORCED = nativeToFixed && (
- 0.00008.toFixed(3) !== '0.000' ||
- 0.9.toFixed(0) !== '1' ||
- 1.255.toFixed(2) !== '1.25' ||
- 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
- ) || !fails(function () {
- // V8 ~ Android 4.3-
- nativeToFixed.call({});
- });
- // `Number.prototype.toFixed` method
- // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
- $({ target: 'Number', proto: true, forced: FORCED }, {
- // eslint-disable-next-line max-statements
- toFixed: function toFixed(fractionDigits) {
- var number = thisNumberValue(this);
- var fractDigits = toInteger(fractionDigits);
- var data = [0, 0, 0, 0, 0, 0];
- var sign = '';
- var result = '0';
- var e, z, j, k;
- var multiply = function (n, c) {
- var index = -1;
- var c2 = c;
- while (++index < 6) {
- c2 += n * data[index];
- data[index] = c2 % 1e7;
- c2 = floor(c2 / 1e7);
- }
- };
- var divide = function (n) {
- var index = 6;
- var c = 0;
- while (--index >= 0) {
- c += data[index];
- data[index] = floor(c / n);
- c = (c % n) * 1e7;
- }
- };
- var dataToString = function () {
- var index = 6;
- var s = '';
- while (--index >= 0) {
- if (s !== '' || index === 0 || data[index] !== 0) {
- var t = String(data[index]);
- s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
- }
- } return s;
- };
- if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
- // eslint-disable-next-line no-self-compare
- if (number != number) return 'NaN';
- if (number <= -1e21 || number >= 1e21) return String(number);
- if (number < 0) {
- sign = '-';
- number = -number;
- }
- if (number > 1e-21) {
- e = log(number * pow(2, 69, 1)) - 69;
- z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
- z *= 0x10000000000000;
- e = 52 - e;
- if (e > 0) {
- multiply(0, z);
- j = fractDigits;
- while (j >= 7) {
- multiply(1e7, 0);
- j -= 7;
- }
- multiply(pow(10, j, 1), 0);
- j = e - 1;
- while (j >= 23) {
- divide(1 << 23);
- j -= 23;
- }
- divide(1 << j);
- multiply(1, 1);
- divide(2);
- result = dataToString();
- } else {
- multiply(0, z);
- multiply(1 << -e, 0);
- result = dataToString() + repeat.call('0', fractDigits);
- }
- }
- if (fractDigits > 0) {
- k = result.length;
- result = sign + (k <= fractDigits
- ? '0.' + repeat.call('0', fractDigits - k) + result
- : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
- } else {
- result = sign + result;
- } return result;
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.object.assign.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/modules/es.object.assign.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var assign = __webpack_require__(/*! ../internals/object-assign */ "./node_modules/core-js/internals/object-assign.js");
- // `Object.assign` method
- // https://tc39.github.io/ecma262/#sec-object.assign
- $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
- assign: assign
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.object.entries.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/modules/es.object.entries.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $entries = __webpack_require__(/*! ../internals/object-to-array */ "./node_modules/core-js/internals/object-to-array.js").entries;
- // `Object.entries` method
- // https://tc39.github.io/ecma262/#sec-object.entries
- $({ target: 'Object', stat: true }, {
- entries: function entries(O) {
- return $entries(O);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.object.get-prototype-of.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.object.get-prototype-of.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var nativeGetPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js");
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/core-js/internals/correct-prototype-getter.js");
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
- // `Object.getPrototypeOf` method
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
- getPrototypeOf: function getPrototypeOf(it) {
- return nativeGetPrototypeOf(toObject(it));
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.object.keys.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/modules/es.object.keys.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var nativeKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
- // `Object.keys` method
- // https://tc39.github.io/ecma262/#sec-object.keys
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
- keys: function keys(it) {
- return nativeKeys(toObject(it));
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.object.to-string.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.object.to-string.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var toString = __webpack_require__(/*! ../internals/object-to-string */ "./node_modules/core-js/internals/object-to-string.js");
- // `Object.prototype.toString` method
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
- if (!TO_STRING_TAG_SUPPORT) {
- redefine(Object.prototype, 'toString', toString, { unsafe: true });
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.promise.js":
- /*!****************************************************!*\
- !*** ./node_modules/core-js/modules/es.promise.js ***!
- \****************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- var NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ "./node_modules/core-js/internals/native-promise-constructor.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var aFunction = __webpack_require__(/*! ../internals/a-function */ "./node_modules/core-js/internals/a-function.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
- var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
- var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "./node_modules/core-js/internals/check-correctness-of-iteration.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var task = __webpack_require__(/*! ../internals/task */ "./node_modules/core-js/internals/task.js").set;
- var microtask = __webpack_require__(/*! ../internals/microtask */ "./node_modules/core-js/internals/microtask.js");
- var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "./node_modules/core-js/internals/promise-resolve.js");
- var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "./node_modules/core-js/internals/host-report-errors.js");
- var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "./node_modules/core-js/internals/new-promise-capability.js");
- var perform = __webpack_require__(/*! ../internals/perform */ "./node_modules/core-js/internals/perform.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
- var SPECIES = wellKnownSymbol('species');
- var PROMISE = 'Promise';
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
- var PromiseConstructor = NativePromise;
- var TypeError = global.TypeError;
- var document = global.document;
- var process = global.process;
- var $fetch = getBuiltIn('fetch');
- var newPromiseCapability = newPromiseCapabilityModule.f;
- var newGenericPromiseCapability = newPromiseCapability;
- var IS_NODE = classof(process) == 'process';
- var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
- var UNHANDLED_REJECTION = 'unhandledrejection';
- var REJECTION_HANDLED = 'rejectionhandled';
- var PENDING = 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- var HANDLED = 1;
- var UNHANDLED = 2;
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
- var FORCED = isForced(PROMISE, function () {
- var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
- if (!GLOBAL_CORE_JS_PROMISE) {
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // We can't detect it synchronously, so just check versions
- if (V8_VERSION === 66) return true;
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
- }
- // We need Promise#finally in the pure version for preventing prototype pollution
- if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
- // We can't use @@species feature detection in V8 since it causes
- // deoptimization and performance degradation
- // https://github.com/zloirock/core-js/issues/679
- if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
- // Detect correctness of subclassing with @@species support
- var promise = PromiseConstructor.resolve(1);
- var FakePromise = function (exec) {
- exec(function () { /* empty */ }, function () { /* empty */ });
- };
- var constructor = promise.constructor = {};
- constructor[SPECIES] = FakePromise;
- return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
- });
- var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
- });
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var notify = function (promise, state, isReject) {
- if (state.notified) return;
- state.notified = true;
- var chain = state.reactions;
- microtask(function () {
- var value = state.value;
- var ok = state.state == FULFILLED;
- var index = 0;
- // variable length - can't use forEach
- while (chain.length > index) {
- var reaction = chain[index++];
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
- state.rejection = HANDLED;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // can throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- then.call(result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (error) {
- if (domain && !exited) domain.exit();
- reject(error);
- }
- }
- state.reactions = [];
- state.notified = false;
- if (isReject && !state.rejection) onUnhandled(promise, state);
- });
- };
- var dispatchEvent = function (name, promise, reason) {
- var event, handler;
- if (DISPATCH_EVENT) {
- event = document.createEvent('Event');
- event.promise = promise;
- event.reason = reason;
- event.initEvent(name, false, true);
- global.dispatchEvent(event);
- } else event = { promise: promise, reason: reason };
- if (handler = global['on' + name]) handler(event);
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
- };
- var onUnhandled = function (promise, state) {
- task.call(global, function () {
- var value = state.value;
- var IS_UNHANDLED = isUnhandled(state);
- var result;
- if (IS_UNHANDLED) {
- result = perform(function () {
- if (IS_NODE) {
- process.emit('unhandledRejection', value, promise);
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
- if (result.error) throw result.value;
- }
- });
- };
- var isUnhandled = function (state) {
- return state.rejection !== HANDLED && !state.parent;
- };
- var onHandleUnhandled = function (promise, state) {
- task.call(global, function () {
- if (IS_NODE) {
- process.emit('rejectionHandled', promise);
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
- });
- };
- var bind = function (fn, promise, state, unwrap) {
- return function (value) {
- fn(promise, state, value, unwrap);
- };
- };
- var internalReject = function (promise, state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- state.value = value;
- state.state = REJECTED;
- notify(promise, state, true);
- };
- var internalResolve = function (promise, state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- try {
- if (promise === value) throw TypeError("Promise can't be resolved itself");
- var then = isThenable(value);
- if (then) {
- microtask(function () {
- var wrapper = { done: false };
- try {
- then.call(value,
- bind(internalResolve, promise, wrapper, state),
- bind(internalReject, promise, wrapper, state)
- );
- } catch (error) {
- internalReject(promise, wrapper, error, state);
- }
- });
- } else {
- state.value = value;
- state.state = FULFILLED;
- notify(promise, state, false);
- }
- } catch (error) {
- internalReject(promise, { done: false }, error, state);
- }
- };
- // constructor polyfill
- if (FORCED) {
- // 25.4.3.1 Promise(executor)
- PromiseConstructor = function Promise(executor) {
- anInstance(this, PromiseConstructor, PROMISE);
- aFunction(executor);
- Internal.call(this);
- var state = getInternalState(this);
- try {
- executor(bind(internalResolve, this, state), bind(internalReject, this, state));
- } catch (error) {
- internalReject(this, state, error);
- }
- };
- // eslint-disable-next-line no-unused-vars
- Internal = function Promise(executor) {
- setInternalState(this, {
- type: PROMISE,
- done: false,
- notified: false,
- parent: false,
- reactions: [],
- rejection: false,
- state: PENDING,
- value: undefined
- });
- };
- Internal.prototype = redefineAll(PromiseConstructor.prototype, {
- // `Promise.prototype.then` method
- // https://tc39.github.io/ecma262/#sec-promise.prototype.then
- then: function then(onFulfilled, onRejected) {
- var state = getInternalPromiseState(this);
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = IS_NODE ? process.domain : undefined;
- state.parent = true;
- state.reactions.push(reaction);
- if (state.state != PENDING) notify(this, state, false);
- return reaction.promise;
- },
- // `Promise.prototype.catch` method
- // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- var state = getInternalState(promise);
- this.promise = promise;
- this.resolve = bind(internalResolve, promise, state);
- this.reject = bind(internalReject, promise, state);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === PromiseConstructor || C === PromiseWrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- if (!IS_PURE && typeof NativePromise == 'function') {
- nativeThen = NativePromise.prototype.then;
- // wrap native Promise#then for native async functions
- redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
- var that = this;
- return new PromiseConstructor(function (resolve, reject) {
- nativeThen.call(that, resolve, reject);
- }).then(onFulfilled, onRejected);
- // https://github.com/zloirock/core-js/issues/640
- }, { unsafe: true });
- // wrap fetch result
- if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
- // eslint-disable-next-line no-unused-vars
- fetch: function fetch(input /* , init */) {
- return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
- }
- });
- }
- }
- $({ global: true, wrap: true, forced: FORCED }, {
- Promise: PromiseConstructor
- });
- setToStringTag(PromiseConstructor, PROMISE, false, true);
- setSpecies(PROMISE);
- PromiseWrapper = getBuiltIn(PROMISE);
- // statics
- $({ target: PROMISE, stat: true, forced: FORCED }, {
- // `Promise.reject` method
- // https://tc39.github.io/ecma262/#sec-promise.reject
- reject: function reject(r) {
- var capability = newPromiseCapability(this);
- capability.reject.call(undefined, r);
- return capability.promise;
- }
- });
- $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
- // `Promise.resolve` method
- // https://tc39.github.io/ecma262/#sec-promise.resolve
- resolve: function resolve(x) {
- return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
- }
- });
- $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
- // `Promise.all` method
- // https://tc39.github.io/ecma262/#sec-promise.all
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyCalled = false;
- values.push(undefined);
- remaining++;
- $promiseResolve.call(C, promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.error) reject(result.value);
- return capability.promise;
- },
- // `Promise.race` method
- // https://tc39.github.io/ecma262/#sec-promise.race
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
- iterate(iterable, function (promise) {
- $promiseResolve.call(C, promise).then(capability.resolve, reject);
- });
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.regexp.exec.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/modules/es.regexp.exec.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var exec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
- exec: exec
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.regexp.to-string.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.regexp.to-string.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var flags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");
- var TO_STRING = 'toString';
- var RegExpPrototype = RegExp.prototype;
- var nativeToString = RegExpPrototype[TO_STRING];
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
- // FF44- RegExp#toString has a wrong name
- var INCORRECT_NAME = nativeToString.name != TO_STRING;
- // `RegExp.prototype.toString` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
- if (NOT_GENERIC || INCORRECT_NAME) {
- redefine(RegExp.prototype, TO_STRING, function toString() {
- var R = anObject(this);
- var p = String(R.source);
- var rf = R.flags;
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
- return '/' + p + '/' + f;
- }, { unsafe: true });
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.set.js":
- /*!************************************************!*\
- !*** ./node_modules/core-js/modules/es.set.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 7:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var collection = __webpack_require__(/*! ../internals/collection */ "./node_modules/core-js/internals/collection.js");
- var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "./node_modules/core-js/internals/collection-strong.js");
- // `Set` constructor
- // https://tc39.github.io/ecma262/#sec-set-objects
- module.exports = collection('Set', function (init) {
- return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
- }, collectionStrong);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.iterator.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.iterator.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").charAt;
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "./node_modules/core-js/internals/define-iterator.js");
- var STRING_ITERATOR = 'String Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- // `String.prototype[@@iterator]` method
- // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
- defineIterator(String, 'String', function (iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: String(iterated),
- index: 0
- });
- // `%StringIteratorPrototype%.next` method
- // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length) return { value: undefined, done: true };
- point = charAt(string, index);
- state.index += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.match.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.match.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
- // @@match logic
- fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = requireObjectCoercible(this);
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
- function (regexp) {
- var res = maybeCallNative(nativeMatch, regexp, this);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- if (!rx.global) return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = String(result[0]);
- A[n] = matchStr;
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.pad-start.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.pad-start.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $padStart = __webpack_require__(/*! ../internals/string-pad */ "./node_modules/core-js/internals/string-pad.js").start;
- var WEBKIT_BUG = __webpack_require__(/*! ../internals/string-pad-webkit-bug */ "./node_modules/core-js/internals/string-pad-webkit-bug.js");
- // `String.prototype.padStart` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
- $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
- padStart: function padStart(maxLength /* , fillString = ' ' */) {
- return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.repeat.js":
- /*!**********************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.repeat.js ***!
- \**********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var repeat = __webpack_require__(/*! ../internals/string-repeat */ "./node_modules/core-js/internals/string-repeat.js");
- // `String.prototype.repeat` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
- $({ target: 'String', proto: true }, {
- repeat: repeat
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.replace.js":
- /*!***********************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.replace.js ***!
- \***********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
- var max = Math.max;
- var min = Math.min;
- var floor = Math.floor;
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // @@replace logic
- fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
- var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
- return [
- // `String.prototype.replace` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = requireObjectCoercible(this);
- var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
- return replacer !== undefined
- ? replacer.call(searchValue, O, replaceValue)
- : nativeReplace.call(String(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
- function (regexp, replaceValue) {
- if (
- (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
- (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
- ) {
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
- if (res.done) return res.value;
- }
- var rx = anObject(regexp);
- var S = String(this);
- var functionalReplace = typeof replaceValue === 'function';
- if (!functionalReplace) replaceValue = String(replaceValue);
- var global = rx.global;
- if (global) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null) break;
- results.push(result);
- if (!global) break;
- var matchStr = String(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = String(result[0]);
- var position = max(min(toInteger(result.index), S.length), 0);
- var captures = [];
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = [matched].concat(captures, position, S);
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + S.slice(nextSourcePosition);
- }
- ];
- // https://tc39.github.io/ecma262/#sec-getsubstitution
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return nativeReplace.call(replacement, symbols, function (match, ch) {
- var capture;
- switch (ch.charAt(0)) {
- case '$': return '$';
- case '&': return matched;
- case '`': return str.slice(0, position);
- case "'": return str.slice(tailPos);
- case '<':
- capture = namedCaptures[ch.slice(1, -1)];
- break;
- default: // \d\d?
- var n = +ch;
- if (n === 0) return match;
- if (n > m) {
- var f = floor(n / 10);
- if (f === 0) return match;
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === undefined ? '' : capture;
- });
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.split.js":
- /*!*********************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.split.js ***!
- \*********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/core-js/internals/is-regexp.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var callRegExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
- var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var arrayPush = [].push;
- var min = Math.min;
- var MAX_UINT32 = 0xFFFFFFFF;
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
- // @@split logic
- fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
- var internalSplit;
- if (
- 'abbc'.split(/(b)*/)[1] == 'c' ||
- 'test'.split(/(?:)/, -1).length != 4 ||
- 'ab'.split(/(?:ab)*/).length != 2 ||
- '.'.split(/(.?)(.?)/).length != 4 ||
- '.'.split(/()()/).length > 1 ||
- ''.split(/.?/).length
- ) {
- // based on es5-shim implementation, need to rework it
- internalSplit = function (separator, limit) {
- var string = String(requireObjectCoercible(this));
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (separator === undefined) return [string];
- // If `separator` is not a regex, use native split
- if (!isRegExp(separator)) {
- return nativeSplit.call(string, separator, lim);
- }
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var match, lastIndex, lastLength;
- while (match = regexpExec.call(separatorCopy, string)) {
- lastIndex = separatorCopy.lastIndex;
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
- if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= lim) break;
- }
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !separatorCopy.test('')) output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output.length > lim ? output.slice(0, lim) : output;
- };
- // Chakra, V8
- } else if ('0'.split(undefined, 0).length) {
- internalSplit = function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
- };
- } else internalSplit = nativeSplit;
- return [
- // `String.prototype.split` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = requireObjectCoercible(this);
- var splitter = separator == undefined ? undefined : separator[SPLIT];
- return splitter !== undefined
- ? splitter.call(separator, O, limit)
- : internalSplit.call(String(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function (regexp, limit) {
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? 'i' : '') +
- (rx.multiline ? 'm' : '') +
- (rx.unicode ? 'u' : '') +
- (SUPPORTS_Y ? 'y' : 'g');
- // ^(? + rx + ) is needed, in combination with some S slicing, to
- // simulate the 'y' flag.
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
- var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
- var e;
- if (
- z === null ||
- (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
- ) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- A.push(S.slice(p, q));
- if (A.length === lim) return A;
- for (var i = 1; i <= z.length - 1; i++) {
- A.push(z[i]);
- if (A.length === lim) return A;
- }
- q = p = e;
- }
- }
- A.push(S.slice(p));
- return A;
- }
- ];
- }, !SUPPORTS_Y);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.string.trim.js":
- /*!********************************************************!*\
- !*** ./node_modules/core-js/modules/es.string.trim.js ***!
- \********************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var $trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim;
- var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "./node_modules/core-js/internals/string-trim-forced.js");
- // `String.prototype.trim` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
- $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
- trim: function trim() {
- return $trim(this);
- }
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.symbol.description.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/modules/es.symbol.description.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // `Symbol.prototype.description` getter
- // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f;
- var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
- var NativeSymbol = global.Symbol;
- if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
- // Safari 12 bug
- NativeSymbol().description !== undefined
- )) {
- var EmptyStringDescriptionStore = {};
- // wrap Symbol constructor for correct work with undefined description
- var SymbolWrapper = function Symbol() {
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
- var result = this instanceof SymbolWrapper
- ? new NativeSymbol(description)
- // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
- : description === undefined ? NativeSymbol() : NativeSymbol(description);
- if (description === '') EmptyStringDescriptionStore[result] = true;
- return result;
- };
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
- var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
- symbolPrototype.constructor = SymbolWrapper;
- var symbolToString = symbolPrototype.toString;
- var native = String(NativeSymbol('test')) == 'Symbol(test)';
- var regexp = /^Symbol\((.*)\)[^)]+$/;
- defineProperty(symbolPrototype, 'description', {
- configurable: true,
- get: function description() {
- var symbol = isObject(this) ? this.valueOf() : this;
- var string = symbolToString.call(symbol);
- if (has(EmptyStringDescriptionStore, symbol)) return '';
- var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
- return desc === '' ? undefined : desc;
- }
- });
- $({ global: true, forced: true }, {
- Symbol: SymbolWrapper
- });
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.symbol.iterator.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/modules/es.symbol.iterator.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/core-js/internals/define-well-known-symbol.js");
- // `Symbol.iterator` well-known symbol
- // https://tc39.github.io/ecma262/#sec-symbol.iterator
- defineWellKnownSymbol('iterator');
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.symbol.js":
- /*!***************************************************!*\
- !*** ./node_modules/core-js/modules/es.symbol.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "./node_modules/core-js/internals/native-symbol.js");
- var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var isArray = __webpack_require__(/*! ../internals/is-array */ "./node_modules/core-js/internals/is-array.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- var nativeObjectCreate = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
- var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
- var getOwnPropertyNamesExternal = __webpack_require__(/*! ../internals/object-get-own-property-names-external */ "./node_modules/core-js/internals/object-get-own-property-names-external.js");
- var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
- var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
- var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/well-known-symbol-wrapped */ "./node_modules/core-js/internals/well-known-symbol-wrapped.js");
- var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "./node_modules/core-js/internals/define-well-known-symbol.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
- var HIDDEN = sharedKey('hidden');
- var SYMBOL = 'Symbol';
- var PROTOTYPE = 'prototype';
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(SYMBOL);
- var ObjectPrototype = Object[PROTOTYPE];
- var $Symbol = global.Symbol;
- var $stringify = getBuiltIn('JSON', 'stringify');
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
- var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
- var AllSymbols = shared('symbols');
- var ObjectPrototypeSymbols = shared('op-symbols');
- var StringToSymbolRegistry = shared('string-to-symbol-registry');
- var SymbolToStringRegistry = shared('symbol-to-string-registry');
- var WellKnownSymbolsStore = shared('wks');
- var QObject = global.QObject;
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDescriptor = DESCRIPTORS && fails(function () {
- return nativeObjectCreate(nativeDefineProperty({}, 'a', {
- get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
- })).a != 7;
- }) ? function (O, P, Attributes) {
- var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
- if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
- nativeDefineProperty(O, P, Attributes);
- if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
- nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
- }
- } : nativeDefineProperty;
- var wrap = function (tag, description) {
- var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
- setInternalState(symbol, {
- type: SYMBOL,
- tag: tag,
- description: description
- });
- if (!DESCRIPTORS) symbol.description = description;
- return symbol;
- };
- var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
- return typeof it == 'symbol';
- } : function (it) {
- return Object(it) instanceof $Symbol;
- };
- var $defineProperty = function defineProperty(O, P, Attributes) {
- if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
- anObject(O);
- var key = toPrimitive(P, true);
- anObject(Attributes);
- if (has(AllSymbols, key)) {
- if (!Attributes.enumerable) {
- if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
- O[HIDDEN][key] = true;
- } else {
- if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
- Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
- } return setSymbolDescriptor(O, key, Attributes);
- } return nativeDefineProperty(O, key, Attributes);
- };
- var $defineProperties = function defineProperties(O, Properties) {
- anObject(O);
- var properties = toIndexedObject(Properties);
- var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
- $forEach(keys, function (key) {
- if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
- });
- return O;
- };
- var $create = function create(O, Properties) {
- return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(V) {
- var P = toPrimitive(V, true);
- var enumerable = nativePropertyIsEnumerable.call(this, P);
- if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
- return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
- var it = toIndexedObject(O);
- var key = toPrimitive(P, true);
- if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
- var descriptor = nativeGetOwnPropertyDescriptor(it, key);
- if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
- descriptor.enumerable = true;
- }
- return descriptor;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(O) {
- var names = nativeGetOwnPropertyNames(toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
- });
- return result;
- };
- var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
- var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
- var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
- result.push(AllSymbols[key]);
- }
- });
- return result;
- };
- // `Symbol` constructor
- // https://tc39.github.io/ecma262/#sec-symbol-constructor
- if (!NATIVE_SYMBOL) {
- $Symbol = function Symbol() {
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
- var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
- var tag = uid(description);
- var setter = function (value) {
- if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
- if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
- };
- if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
- return wrap(tag, description);
- };
- redefine($Symbol[PROTOTYPE], 'toString', function toString() {
- return getInternalState(this).tag;
- });
- redefine($Symbol, 'withoutSetter', function (description) {
- return wrap(uid(description), description);
- });
- propertyIsEnumerableModule.f = $propertyIsEnumerable;
- definePropertyModule.f = $defineProperty;
- getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
- getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
- getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
- wrappedWellKnownSymbolModule.f = function (name) {
- return wrap(wellKnownSymbol(name), name);
- };
- if (DESCRIPTORS) {
- // https://github.com/tc39/proposal-Symbol-description
- nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
- configurable: true,
- get: function description() {
- return getInternalState(this).description;
- }
- });
- if (!IS_PURE) {
- redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
- }
- }
- }
- $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
- Symbol: $Symbol
- });
- $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
- defineWellKnownSymbol(name);
- });
- $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
- // `Symbol.for` method
- // https://tc39.github.io/ecma262/#sec-symbol.for
- 'for': function (key) {
- var string = String(key);
- if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
- var symbol = $Symbol(string);
- StringToSymbolRegistry[string] = symbol;
- SymbolToStringRegistry[symbol] = string;
- return symbol;
- },
- // `Symbol.keyFor` method
- // https://tc39.github.io/ecma262/#sec-symbol.keyfor
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
- if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
- },
- useSetter: function () { USE_SETTER = true; },
- useSimple: function () { USE_SETTER = false; }
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
- // `Object.create` method
- // https://tc39.github.io/ecma262/#sec-object.create
- create: $create,
- // `Object.defineProperty` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
- defineProperty: $defineProperty,
- // `Object.defineProperties` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
- defineProperties: $defineProperties,
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
- // `Object.getOwnPropertyNames` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
- getOwnPropertyNames: $getOwnPropertyNames,
- // `Object.getOwnPropertySymbols` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
- getOwnPropertySymbols: $getOwnPropertySymbols
- });
- // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
- // https://bugs.chromium.org/p/v8/issues/detail?id=3443
- $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- return getOwnPropertySymbolsModule.f(toObject(it));
- }
- });
- // `JSON.stringify` method behavior with symbols
- // https://tc39.github.io/ecma262/#sec-json.stringify
- if ($stringify) {
- var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
- var symbol = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- return $stringify([symbol]) != '[null]'
- // WebKit converts symbol values to JSON as null
- || $stringify({ a: symbol }) != '{}'
- // V8 throws on boxed symbols
- || $stringify(Object(symbol)) != '{}';
- });
- $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
- // eslint-disable-next-line no-unused-vars
- stringify: function stringify(it, replacer, space) {
- var args = [it];
- var index = 1;
- var $replacer;
- while (arguments.length > index) args.push(arguments[index++]);
- $replacer = replacer;
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
- if (!isArray(replacer)) replacer = function (key, value) {
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
- if (!isSymbol(value)) return value;
- };
- args[1] = replacer;
- return $stringify.apply(null, args);
- }
- });
- }
- // `Symbol.prototype[@@toPrimitive]` method
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
- createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- }
- // `Symbol.prototype[@@toStringTag]` property
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
- setToStringTag($Symbol, SYMBOL);
- hiddenKeys[HIDDEN] = true;
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.copy-within.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.copy-within.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $copyWithin = __webpack_require__(/*! ../internals/array-copy-within */ "./node_modules/core-js/internals/array-copy-within.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.copyWithin` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin
- exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
- return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.every.js":
- /*!**************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.every.js ***!
- \**************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $every = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").every;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.every` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every
- exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
- return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.fill.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.fill.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $fill = __webpack_require__(/*! ../internals/array-fill */ "./node_modules/core-js/internals/array-fill.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.fill` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill
- // eslint-disable-next-line no-unused-vars
- exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
- return $fill.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.filter.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.filter.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $filter = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").filter;
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter
- exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
- var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- var C = speciesConstructor(this, this.constructor);
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.find-index.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.find-index.js ***!
- \*******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $findIndex = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").findIndex;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.findIndex` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex
- exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
- return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.find.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.find.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $find = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").find;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find
- exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
- return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.for-each.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.for-each.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.forEach` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach
- exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
- $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.includes.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.includes.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $includes = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").includes;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes
- exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {
- return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.index-of.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.index-of.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.indexOf` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof
- exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {
- return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.int16-array.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.int16-array.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var createTypedArrayConstructor = __webpack_require__(/*! ../internals/typed-array-constructor */ "./node_modules/core-js/internals/typed-array-constructor.js");
- // `Int16Array` constructor
- // https://tc39.github.io/ecma262/#sec-typedarray-objects
- createTypedArrayConstructor('Int16', function (init) {
- return function Int16Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.iterator.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.iterator.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var ArrayIterators = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var Uint8Array = global.Uint8Array;
- var arrayValues = ArrayIterators.values;
- var arrayKeys = ArrayIterators.keys;
- var arrayEntries = ArrayIterators.entries;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
- var CORRECT_ITER_NAME = !!nativeTypedArrayIterator
- && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);
- var typedArrayValues = function values() {
- return arrayValues.call(aTypedArray(this));
- };
- // `%TypedArray%.prototype.entries` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries
- exportTypedArrayMethod('entries', function entries() {
- return arrayEntries.call(aTypedArray(this));
- });
- // `%TypedArray%.prototype.keys` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys
- exportTypedArrayMethod('keys', function keys() {
- return arrayKeys.call(aTypedArray(this));
- });
- // `%TypedArray%.prototype.values` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values
- exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);
- // `%TypedArray%.prototype[@@iterator]` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator
- exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.join.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.join.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $join = [].join;
- // `%TypedArray%.prototype.join` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join
- // eslint-disable-next-line no-unused-vars
- exportTypedArrayMethod('join', function join(separator) {
- return $join.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.last-index-of.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.last-index-of.js ***!
- \**********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $lastIndexOf = __webpack_require__(/*! ../internals/array-last-index-of */ "./node_modules/core-js/internals/array-last-index-of.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.lastIndexOf` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof
- // eslint-disable-next-line no-unused-vars
- exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
- return $lastIndexOf.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.map.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.map.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $map = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").map;
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map
- exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {
- return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
- return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length);
- });
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.reduce-right.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.reduce-right.js ***!
- \*********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $reduceRight = __webpack_require__(/*! ../internals/array-reduce */ "./node_modules/core-js/internals/array-reduce.js").right;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.reduceRicht` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright
- exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
- return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.reduce.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.reduce.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $reduce = __webpack_require__(/*! ../internals/array-reduce */ "./node_modules/core-js/internals/array-reduce.js").left;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.reduce` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce
- exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {
- return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.reverse.js":
- /*!****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.reverse.js ***!
- \****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var floor = Math.floor;
- // `%TypedArray%.prototype.reverse` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse
- exportTypedArrayMethod('reverse', function reverse() {
- var that = this;
- var length = aTypedArray(that).length;
- var middle = floor(length / 2);
- var index = 0;
- var value;
- while (index < middle) {
- value = that[index];
- that[index++] = that[--length];
- that[length] = value;
- } return that;
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.set.js":
- /*!************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.set.js ***!
- \************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toOffset = __webpack_require__(/*! ../internals/to-offset */ "./node_modules/core-js/internals/to-offset.js");
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var FORCED = fails(function () {
- // eslint-disable-next-line no-undef
- new Int8Array(1).set({});
- });
- // `%TypedArray%.prototype.set` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set
- exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
- aTypedArray(this);
- var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
- var length = this.length;
- var src = toObject(arrayLike);
- var len = toLength(src.length);
- var index = 0;
- if (len + offset > length) throw RangeError('Wrong length');
- while (index < len) this[offset + index] = src[index++];
- }, FORCED);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.slice.js":
- /*!**************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.slice.js ***!
- \**************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $slice = [].slice;
- var FORCED = fails(function () {
- // eslint-disable-next-line no-undef
- new Int8Array(1).slice();
- });
- // `%TypedArray%.prototype.slice` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice
- exportTypedArrayMethod('slice', function slice(start, end) {
- var list = $slice.call(aTypedArray(this), start, end);
- var C = speciesConstructor(this, this.constructor);
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- }, FORCED);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.some.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.some.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var $some = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").some;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.some` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some
- exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
- return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.sort.js":
- /*!*************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.sort.js ***!
- \*************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $sort = [].sort;
- // `%TypedArray%.prototype.sort` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort
- exportTypedArrayMethod('sort', function sort(comparefn) {
- return $sort.call(aTypedArray(this), comparefn);
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.subarray.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.subarray.js ***!
- \*****************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "./node_modules/core-js/internals/species-constructor.js");
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.subarray` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray
- exportTypedArrayMethod('subarray', function subarray(begin, end) {
- var O = aTypedArray(this);
- var length = O.length;
- var beginIndex = toAbsoluteIndex(begin, length);
- return new (speciesConstructor(O, O.constructor))(
- O.buffer,
- O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
- toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
- );
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.to-locale-string.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.to-locale-string.js ***!
- \*************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var ArrayBufferViewCore = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var Int8Array = global.Int8Array;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $toLocaleString = [].toLocaleString;
- var $slice = [].slice;
- // iOS Safari 6.x fails here
- var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
- $toLocaleString.call(new Int8Array(1));
- });
- var FORCED = fails(function () {
- return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
- }) || !fails(function () {
- Int8Array.prototype.toLocaleString.call([1, 2]);
- });
- // `%TypedArray%.prototype.toLocaleString` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring
- exportTypedArrayMethod('toLocaleString', function toLocaleString() {
- return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
- }, FORCED);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.to-string.js":
- /*!******************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.to-string.js ***!
- \******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var exportTypedArrayMethod = __webpack_require__(/*! ../internals/array-buffer-view-core */ "./node_modules/core-js/internals/array-buffer-view-core.js").exportTypedArrayMethod;
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var Uint8Array = global.Uint8Array;
- var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
- var arrayToString = [].toString;
- var arrayJoin = [].join;
- if (fails(function () { arrayToString.call({}); })) {
- arrayToString = function toString() {
- return arrayJoin.call(this);
- };
- }
- var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
- // `%TypedArray%.prototype.toString` method
- // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring
- exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);
- /***/ }),
- /***/ "./node_modules/core-js/modules/es.typed-array.uint8-array.js":
- /*!********************************************************************!*\
- !*** ./node_modules/core-js/modules/es.typed-array.uint8-array.js ***!
- \********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var createTypedArrayConstructor = __webpack_require__(/*! ../internals/typed-array-constructor */ "./node_modules/core-js/internals/typed-array-constructor.js");
- // `Uint8Array` constructor
- // https://tc39.github.io/ecma262/#sec-typedarray-objects
- createTypedArrayConstructor('Uint8', function (init) {
- return function Uint8Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ "./node_modules/core-js/modules/web.dom-collections.for-each.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/core-js/modules/web.dom-collections.for-each.js ***!
- \**********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/core-js/internals/dom-iterables.js");
- var forEach = __webpack_require__(/*! ../internals/array-for-each */ "./node_modules/core-js/internals/array-for-each.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
- createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
- } catch (error) {
- CollectionPrototype.forEach = forEach;
- }
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/web.dom-collections.iterator.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/core-js/modules/web.dom-collections.iterator.js ***!
- \**********************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/core-js/internals/dom-iterables.js");
- var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var ArrayValues = ArrayIteratorMethods.values;
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- if (CollectionPrototype) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
- } catch (error) {
- CollectionPrototype[ITERATOR] = ArrayValues;
- }
- if (!CollectionPrototype[TO_STRING_TAG]) {
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
- }
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
- } catch (error) {
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/core-js/modules/web.url-search-params.js":
- /*!***************************************************************!*\
- !*** ./node_modules/core-js/modules/web.url-search-params.js ***!
- \***************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 344:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js");
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
- var USE_NATIVE_URL = __webpack_require__(/*! ../internals/native-url */ "./node_modules/core-js/internals/native-url.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "./node_modules/core-js/internals/redefine-all.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "./node_modules/core-js/internals/create-iterator-constructor.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var hasOwn = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "./node_modules/core-js/internals/function-bind-context.js");
- var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
- var getIterator = __webpack_require__(/*! ../internals/get-iterator */ "./node_modules/core-js/internals/get-iterator.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "./node_modules/core-js/internals/get-iterator-method.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
- var $fetch = getBuiltIn('fetch');
- var Headers = getBuiltIn('Headers');
- var ITERATOR = wellKnownSymbol('iterator');
- var URL_SEARCH_PARAMS = 'URLSearchParams';
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
- var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
- var plus = /\+/g;
- var sequences = Array(4);
- var percentSequence = function (bytes) {
- return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
- };
- var percentDecode = function (sequence) {
- try {
- return decodeURIComponent(sequence);
- } catch (error) {
- return sequence;
- }
- };
- var deserialize = function (it) {
- var result = it.replace(plus, ' ');
- var bytes = 4;
- try {
- return decodeURIComponent(result);
- } catch (error) {
- while (bytes) {
- result = result.replace(percentSequence(bytes--), percentDecode);
- }
- return result;
- }
- };
- var find = /[!'()~]|%20/g;
- var replace = {
- '!': '%21',
- "'": '%27',
- '(': '%28',
- ')': '%29',
- '~': '%7E',
- '%20': '+'
- };
- var replacer = function (match) {
- return replace[match];
- };
- var serialize = function (it) {
- return encodeURIComponent(it).replace(find, replacer);
- };
- var parseSearchParams = function (result, query) {
- if (query) {
- var attributes = query.split('&');
- var index = 0;
- var attribute, entry;
- while (index < attributes.length) {
- attribute = attributes[index++];
- if (attribute.length) {
- entry = attribute.split('=');
- result.push({
- key: deserialize(entry.shift()),
- value: deserialize(entry.join('='))
- });
- }
- }
- }
- };
- var updateSearchParams = function (query) {
- this.entries.length = 0;
- parseSearchParams(this.entries, query);
- };
- var validateArgumentsLength = function (passed, required) {
- if (passed < required) throw TypeError('Not enough arguments');
- };
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
- setInternalState(this, {
- type: URL_SEARCH_PARAMS_ITERATOR,
- iterator: getIterator(getInternalParamsState(params).entries),
- kind: kind
- });
- }, 'Iterator', function next() {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var step = state.iterator.next();
- var entry = step.value;
- if (!step.done) {
- step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
- } return step;
- });
- // `URLSearchParams` constructor
- // https://url.spec.whatwg.org/#interface-urlsearchparams
- var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
- anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- var init = arguments.length > 0 ? arguments[0] : undefined;
- var that = this;
- var entries = [];
- var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
- setInternalState(that, {
- type: URL_SEARCH_PARAMS,
- entries: entries,
- updateURL: function () { /* empty */ },
- updateSearchParams: updateSearchParams
- });
- if (init !== undefined) {
- if (isObject(init)) {
- iteratorMethod = getIteratorMethod(init);
- if (typeof iteratorMethod === 'function') {
- iterator = iteratorMethod.call(init);
- next = iterator.next;
- while (!(step = next.call(iterator)).done) {
- entryIterator = getIterator(anObject(step.value));
- entryNext = entryIterator.next;
- if (
- (first = entryNext.call(entryIterator)).done ||
- (second = entryNext.call(entryIterator)).done ||
- !entryNext.call(entryIterator).done
- ) throw TypeError('Expected sequence with length 2');
- entries.push({ key: first.value + '', value: second.value + '' });
- }
- } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
- } else {
- parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
- }
- }
- };
- var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
- redefineAll(URLSearchParamsPrototype, {
- // `URLSearchParams.prototype.appent` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-append
- append: function append(name, value) {
- validateArgumentsLength(arguments.length, 2);
- var state = getInternalParamsState(this);
- state.entries.push({ key: name + '', value: value + '' });
- state.updateURL();
- },
- // `URLSearchParams.prototype.delete` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
- 'delete': function (name) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index].key === key) entries.splice(index, 1);
- else index++;
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.get` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-get
- get: function get(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) return entries[index].value;
- }
- return null;
- },
- // `URLSearchParams.prototype.getAll` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
- getAll: function getAll(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var result = [];
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) result.push(entries[index].value);
- }
- return result;
- },
- // `URLSearchParams.prototype.has` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-has
- has: function has(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index++].key === key) return true;
- }
- return false;
- },
- // `URLSearchParams.prototype.set` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-set
- set: function set(name, value) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var found = false;
- var key = name + '';
- var val = value + '';
- var index = 0;
- var entry;
- for (; index < entries.length; index++) {
- entry = entries[index];
- if (entry.key === key) {
- if (found) entries.splice(index--, 1);
- else {
- found = true;
- entry.value = val;
- }
- }
- }
- if (!found) entries.push({ key: key, value: val });
- state.updateURL();
- },
- // `URLSearchParams.prototype.sort` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
- sort: function sort() {
- var state = getInternalParamsState(this);
- var entries = state.entries;
- // Array#sort is not stable in some engines
- var slice = entries.slice();
- var entry, entriesIndex, sliceIndex;
- entries.length = 0;
- for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
- entry = slice[sliceIndex];
- for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
- if (entries[entriesIndex].key > entry.key) {
- entries.splice(entriesIndex, 0, entry);
- break;
- }
- }
- if (entriesIndex === sliceIndex) entries.push(entry);
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.forEach` method
- forEach: function forEach(callback /* , thisArg */) {
- var entries = getInternalParamsState(this).entries;
- var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- boundFunction(entry.value, entry.key, this);
- }
- },
- // `URLSearchParams.prototype.keys` method
- keys: function keys() {
- return new URLSearchParamsIterator(this, 'keys');
- },
- // `URLSearchParams.prototype.values` method
- values: function values() {
- return new URLSearchParamsIterator(this, 'values');
- },
- // `URLSearchParams.prototype.entries` method
- entries: function entries() {
- return new URLSearchParamsIterator(this, 'entries');
- }
- }, { enumerable: true });
- // `URLSearchParams.prototype[@@iterator]` method
- redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
- // `URLSearchParams.prototype.toString` method
- // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
- redefine(URLSearchParamsPrototype, 'toString', function toString() {
- var entries = getInternalParamsState(this).entries;
- var result = [];
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- result.push(serialize(entry.key) + '=' + serialize(entry.value));
- } return result.join('&');
- }, { enumerable: true });
- setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- $({ global: true, forced: !USE_NATIVE_URL }, {
- URLSearchParams: URLSearchParamsConstructor
- });
- // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
- // https://github.com/zloirock/core-js/issues/674
- if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
- $({ global: true, enumerable: true, forced: true }, {
- fetch: function fetch(input /* , init */) {
- var args = [input];
- var init, body, headers;
- if (arguments.length > 1) {
- init = arguments[1];
- if (isObject(init)) {
- body = init.body;
- if (classof(body) === URL_SEARCH_PARAMS) {
- headers = init.headers ? new Headers(init.headers) : new Headers();
- if (!headers.has('content-type')) {
- headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
- }
- init = create(init, {
- body: createPropertyDescriptor(0, String(body)),
- headers: createPropertyDescriptor(0, headers)
- });
- }
- }
- args.push(init);
- } return $fetch.apply(this, args);
- }
- });
- }
- module.exports = {
- URLSearchParams: URLSearchParamsConstructor,
- getState: getInternalParamsState
- };
- /***/ }),
- /***/ "./node_modules/core-js/modules/web.url.js":
- /*!*************************************************!*\
- !*** ./node_modules/core-js/modules/web.url.js ***!
- \*************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__ */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __webpack_require__(/*! ../modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js");
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
- var USE_NATIVE_URL = __webpack_require__(/*! ../internals/native-url */ "./node_modules/core-js/internals/native-url.js");
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
- var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js");
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "./node_modules/core-js/internals/an-instance.js");
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
- var assign = __webpack_require__(/*! ../internals/object-assign */ "./node_modules/core-js/internals/object-assign.js");
- var arrayFrom = __webpack_require__(/*! ../internals/array-from */ "./node_modules/core-js/internals/array-from.js");
- var codeAt = __webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").codeAt;
- var toASCII = __webpack_require__(/*! ../internals/string-punycode-to-ascii */ "./node_modules/core-js/internals/string-punycode-to-ascii.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js");
- var URLSearchParamsModule = __webpack_require__(/*! ../modules/web.url-search-params */ "./node_modules/core-js/modules/web.url-search-params.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
- var NativeURL = global.URL;
- var URLSearchParams = URLSearchParamsModule.URLSearchParams;
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
- var setInternalState = InternalStateModule.set;
- var getInternalURLState = InternalStateModule.getterFor('URL');
- var floor = Math.floor;
- var pow = Math.pow;
- var INVALID_AUTHORITY = 'Invalid authority';
- var INVALID_SCHEME = 'Invalid scheme';
- var INVALID_HOST = 'Invalid host';
- var INVALID_PORT = 'Invalid port';
- var ALPHA = /[A-Za-z]/;
- var ALPHANUMERIC = /[\d+-.A-Za-z]/;
- var DIGIT = /\d/;
- var HEX_START = /^(0x|0X)/;
- var OCT = /^[0-7]+$/;
- var DEC = /^\d+$/;
- var HEX = /^[\dA-Fa-f]+$/;
- // eslint-disable-next-line no-control-regex
- var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
- // eslint-disable-next-line no-control-regex
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
- // eslint-disable-next-line no-control-regex
- var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
- // eslint-disable-next-line no-control-regex
- var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
- var EOF;
- var parseHost = function (url, input) {
- var result, codePoints, index;
- if (input.charAt(0) == '[') {
- if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
- result = parseIPv6(input.slice(1, -1));
- if (!result) return INVALID_HOST;
- url.host = result;
- // opaque host
- } else if (!isSpecial(url)) {
- if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
- result = '';
- codePoints = arrayFrom(input);
- for (index = 0; index < codePoints.length; index++) {
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
- }
- url.host = result;
- } else {
- input = toASCII(input);
- if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
- result = parseIPv4(input);
- if (result === null) return INVALID_HOST;
- url.host = result;
- }
- };
- var parseIPv4 = function (input) {
- var parts = input.split('.');
- var partsLength, numbers, index, part, radix, number, ipv4;
- if (parts.length && parts[parts.length - 1] == '') {
- parts.pop();
- }
- partsLength = parts.length;
- if (partsLength > 4) return input;
- numbers = [];
- for (index = 0; index < partsLength; index++) {
- part = parts[index];
- if (part == '') return input;
- radix = 10;
- if (part.length > 1 && part.charAt(0) == '0') {
- radix = HEX_START.test(part) ? 16 : 8;
- part = part.slice(radix == 8 ? 1 : 2);
- }
- if (part === '') {
- number = 0;
- } else {
- if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
- number = parseInt(part, radix);
- }
- numbers.push(number);
- }
- for (index = 0; index < partsLength; index++) {
- number = numbers[index];
- if (index == partsLength - 1) {
- if (number >= pow(256, 5 - partsLength)) return null;
- } else if (number > 255) return null;
- }
- ipv4 = numbers.pop();
- for (index = 0; index < numbers.length; index++) {
- ipv4 += numbers[index] * pow(256, 3 - index);
- }
- return ipv4;
- };
- // eslint-disable-next-line max-statements
- var parseIPv6 = function (input) {
- var address = [0, 0, 0, 0, 0, 0, 0, 0];
- var pieceIndex = 0;
- var compress = null;
- var pointer = 0;
- var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
- var char = function () {
- return input.charAt(pointer);
- };
- if (char() == ':') {
- if (input.charAt(1) != ':') return;
- pointer += 2;
- pieceIndex++;
- compress = pieceIndex;
- }
- while (char()) {
- if (pieceIndex == 8) return;
- if (char() == ':') {
- if (compress !== null) return;
- pointer++;
- pieceIndex++;
- compress = pieceIndex;
- continue;
- }
- value = length = 0;
- while (length < 4 && HEX.test(char())) {
- value = value * 16 + parseInt(char(), 16);
- pointer++;
- length++;
- }
- if (char() == '.') {
- if (length == 0) return;
- pointer -= length;
- if (pieceIndex > 6) return;
- numbersSeen = 0;
- while (char()) {
- ipv4Piece = null;
- if (numbersSeen > 0) {
- if (char() == '.' && numbersSeen < 4) pointer++;
- else return;
- }
- if (!DIGIT.test(char())) return;
- while (DIGIT.test(char())) {
- number = parseInt(char(), 10);
- if (ipv4Piece === null) ipv4Piece = number;
- else if (ipv4Piece == 0) return;
- else ipv4Piece = ipv4Piece * 10 + number;
- if (ipv4Piece > 255) return;
- pointer++;
- }
- address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
- numbersSeen++;
- if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
- }
- if (numbersSeen != 4) return;
- break;
- } else if (char() == ':') {
- pointer++;
- if (!char()) return;
- } else if (char()) return;
- address[pieceIndex++] = value;
- }
- if (compress !== null) {
- swaps = pieceIndex - compress;
- pieceIndex = 7;
- while (pieceIndex != 0 && swaps > 0) {
- swap = address[pieceIndex];
- address[pieceIndex--] = address[compress + swaps - 1];
- address[compress + --swaps] = swap;
- }
- } else if (pieceIndex != 8) return;
- return address;
- };
- var findLongestZeroSequence = function (ipv6) {
- var maxIndex = null;
- var maxLength = 1;
- var currStart = null;
- var currLength = 0;
- var index = 0;
- for (; index < 8; index++) {
- if (ipv6[index] !== 0) {
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- currStart = null;
- currLength = 0;
- } else {
- if (currStart === null) currStart = index;
- ++currLength;
- }
- }
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- return maxIndex;
- };
- var serializeHost = function (host) {
- var result, index, compress, ignore0;
- // ipv4
- if (typeof host == 'number') {
- result = [];
- for (index = 0; index < 4; index++) {
- result.unshift(host % 256);
- host = floor(host / 256);
- } return result.join('.');
- // ipv6
- } else if (typeof host == 'object') {
- result = '';
- compress = findLongestZeroSequence(host);
- for (index = 0; index < 8; index++) {
- if (ignore0 && host[index] === 0) continue;
- if (ignore0) ignore0 = false;
- if (compress === index) {
- result += index ? ':' : '::';
- ignore0 = true;
- } else {
- result += host[index].toString(16);
- if (index < 7) result += ':';
- }
- }
- return '[' + result + ']';
- } return host;
- };
- var C0ControlPercentEncodeSet = {};
- var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
- ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
- });
- var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
- '#': 1, '?': 1, '{': 1, '}': 1
- });
- var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
- '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
- });
- var percentEncode = function (char, set) {
- var code = codeAt(char, 0);
- return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
- };
- var specialSchemes = {
- ftp: 21,
- file: null,
- http: 80,
- https: 443,
- ws: 80,
- wss: 443
- };
- var isSpecial = function (url) {
- return has(specialSchemes, url.scheme);
- };
- var includesCredentials = function (url) {
- return url.username != '' || url.password != '';
- };
- var cannotHaveUsernamePasswordPort = function (url) {
- return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
- };
- var isWindowsDriveLetter = function (string, normalized) {
- var second;
- return string.length == 2 && ALPHA.test(string.charAt(0))
- && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
- };
- var startsWithWindowsDriveLetter = function (string) {
- var third;
- return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
- string.length == 2 ||
- ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
- );
- };
- var shortenURLsPath = function (url) {
- var path = url.path;
- var pathSize = path.length;
- if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
- path.pop();
- }
- };
- var isSingleDot = function (segment) {
- return segment === '.' || segment.toLowerCase() === '%2e';
- };
- var isDoubleDot = function (segment) {
- segment = segment.toLowerCase();
- return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
- };
- // States:
- var SCHEME_START = {};
- var SCHEME = {};
- var NO_SCHEME = {};
- var SPECIAL_RELATIVE_OR_AUTHORITY = {};
- var PATH_OR_AUTHORITY = {};
- var RELATIVE = {};
- var RELATIVE_SLASH = {};
- var SPECIAL_AUTHORITY_SLASHES = {};
- var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
- var AUTHORITY = {};
- var HOST = {};
- var HOSTNAME = {};
- var PORT = {};
- var FILE = {};
- var FILE_SLASH = {};
- var FILE_HOST = {};
- var PATH_START = {};
- var PATH = {};
- var CANNOT_BE_A_BASE_URL_PATH = {};
- var QUERY = {};
- var FRAGMENT = {};
- // eslint-disable-next-line max-statements
- var parseURL = function (url, input, stateOverride, base) {
- var state = stateOverride || SCHEME_START;
- var pointer = 0;
- var buffer = '';
- var seenAt = false;
- var seenBracket = false;
- var seenPasswordToken = false;
- var codePoints, char, bufferCodePoints, failure;
- if (!stateOverride) {
- url.scheme = '';
- url.username = '';
- url.password = '';
- url.host = null;
- url.port = null;
- url.path = [];
- url.query = null;
- url.fragment = null;
- url.cannotBeABaseURL = false;
- input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
- }
- input = input.replace(TAB_AND_NEW_LINE, '');
- codePoints = arrayFrom(input);
- while (pointer <= codePoints.length) {
- char = codePoints[pointer];
- switch (state) {
- case SCHEME_START:
- if (char && ALPHA.test(char)) {
- buffer += char.toLowerCase();
- state = SCHEME;
- } else if (!stateOverride) {
- state = NO_SCHEME;
- continue;
- } else return INVALID_SCHEME;
- break;
- case SCHEME:
- if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
- buffer += char.toLowerCase();
- } else if (char == ':') {
- if (stateOverride && (
- (isSpecial(url) != has(specialSchemes, buffer)) ||
- (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
- (url.scheme == 'file' && !url.host)
- )) return;
- url.scheme = buffer;
- if (stateOverride) {
- if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
- return;
- }
- buffer = '';
- if (url.scheme == 'file') {
- state = FILE;
- } else if (isSpecial(url) && base && base.scheme == url.scheme) {
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
- } else if (isSpecial(url)) {
- state = SPECIAL_AUTHORITY_SLASHES;
- } else if (codePoints[pointer + 1] == '/') {
- state = PATH_OR_AUTHORITY;
- pointer++;
- } else {
- url.cannotBeABaseURL = true;
- url.path.push('');
- state = CANNOT_BE_A_BASE_URL_PATH;
- }
- } else if (!stateOverride) {
- buffer = '';
- state = NO_SCHEME;
- pointer = 0;
- continue;
- } else return INVALID_SCHEME;
- break;
- case NO_SCHEME:
- if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
- if (base.cannotBeABaseURL && char == '#') {
- url.scheme = base.scheme;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- url.cannotBeABaseURL = true;
- state = FRAGMENT;
- break;
- }
- state = base.scheme == 'file' ? FILE : RELATIVE;
- continue;
- case SPECIAL_RELATIVE_OR_AUTHORITY:
- if (char == '/' && codePoints[pointer + 1] == '/') {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- pointer++;
- } else {
- state = RELATIVE;
- continue;
- } break;
- case PATH_OR_AUTHORITY:
- if (char == '/') {
- state = AUTHORITY;
- break;
- } else {
- state = PATH;
- continue;
- }
- case RELATIVE:
- url.scheme = base.scheme;
- if (char == EOF) {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '/' || (char == '\\' && isSpecial(url))) {
- state = RELATIVE_SLASH;
- } else if (char == '?') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.path.pop();
- state = PATH;
- continue;
- } break;
- case RELATIVE_SLASH:
- if (isSpecial(url) && (char == '/' || char == '\\')) {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- } else if (char == '/') {
- state = AUTHORITY;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- state = PATH;
- continue;
- } break;
- case SPECIAL_AUTHORITY_SLASHES:
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
- pointer++;
- break;
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
- if (char != '/' && char != '\\') {
- state = AUTHORITY;
- continue;
- } break;
- case AUTHORITY:
- if (char == '@') {
- if (seenAt) buffer = '%40' + buffer;
- seenAt = true;
- bufferCodePoints = arrayFrom(buffer);
- for (var i = 0; i < bufferCodePoints.length; i++) {
- var codePoint = bufferCodePoints[i];
- if (codePoint == ':' && !seenPasswordToken) {
- seenPasswordToken = true;
- continue;
- }
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
- if (seenPasswordToken) url.password += encodedCodePoints;
- else url.username += encodedCodePoints;
- }
- buffer = '';
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (seenAt && buffer == '') return INVALID_AUTHORITY;
- pointer -= arrayFrom(buffer).length + 1;
- buffer = '';
- state = HOST;
- } else buffer += char;
- break;
- case HOST:
- case HOSTNAME:
- if (stateOverride && url.scheme == 'file') {
- state = FILE_HOST;
- continue;
- } else if (char == ':' && !seenBracket) {
- if (buffer == '') return INVALID_HOST;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PORT;
- if (stateOverride == HOSTNAME) return;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (isSpecial(url) && buffer == '') return INVALID_HOST;
- if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PATH_START;
- if (stateOverride) return;
- continue;
- } else {
- if (char == '[') seenBracket = true;
- else if (char == ']') seenBracket = false;
- buffer += char;
- } break;
- case PORT:
- if (DIGIT.test(char)) {
- buffer += char;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url)) ||
- stateOverride
- ) {
- if (buffer != '') {
- var port = parseInt(buffer, 10);
- if (port > 0xFFFF) return INVALID_PORT;
- url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
- buffer = '';
- }
- if (stateOverride) return;
- state = PATH_START;
- continue;
- } else return INVALID_PORT;
- break;
- case FILE:
- url.scheme = 'file';
- if (char == '/' || char == '\\') state = FILE_SLASH;
- else if (base && base.scheme == 'file') {
- if (char == EOF) {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '?') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- url.host = base.host;
- url.path = base.path.slice();
- shortenURLsPath(url);
- }
- state = PATH;
- continue;
- }
- } else {
- state = PATH;
- continue;
- } break;
- case FILE_SLASH:
- if (char == '/' || char == '\\') {
- state = FILE_HOST;
- break;
- }
- if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
- else url.host = base.host;
- }
- state = PATH;
- continue;
- case FILE_HOST:
- if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
- state = PATH;
- } else if (buffer == '') {
- url.host = '';
- if (stateOverride) return;
- state = PATH_START;
- } else {
- failure = parseHost(url, buffer);
- if (failure) return failure;
- if (url.host == 'localhost') url.host = '';
- if (stateOverride) return;
- buffer = '';
- state = PATH_START;
- } continue;
- } else buffer += char;
- break;
- case PATH_START:
- if (isSpecial(url)) {
- state = PATH;
- if (char != '/' && char != '\\') continue;
- } else if (!stateOverride && char == '?') {
- url.query = '';
- state = QUERY;
- } else if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- state = PATH;
- if (char != '/') continue;
- } break;
- case PATH:
- if (
- char == EOF || char == '/' ||
- (char == '\\' && isSpecial(url)) ||
- (!stateOverride && (char == '?' || char == '#'))
- ) {
- if (isDoubleDot(buffer)) {
- shortenURLsPath(url);
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else if (isSingleDot(buffer)) {
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else {
- if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
- if (url.host) url.host = '';
- buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
- }
- url.path.push(buffer);
- }
- buffer = '';
- if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
- while (url.path.length > 1 && url.path[0] === '') {
- url.path.shift();
- }
- }
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- }
- } else {
- buffer += percentEncode(char, pathPercentEncodeSet);
- } break;
- case CANNOT_BE_A_BASE_URL_PATH:
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case QUERY:
- if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- if (char == "'" && isSpecial(url)) url.query += '%27';
- else if (char == '#') url.query += '%23';
- else url.query += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case FRAGMENT:
- if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
- break;
- }
- pointer++;
- }
- };
- // `URL` constructor
- // https://url.spec.whatwg.org/#url-class
- var URLConstructor = function URL(url /* , base */) {
- var that = anInstance(this, URLConstructor, 'URL');
- var base = arguments.length > 1 ? arguments[1] : undefined;
- var urlString = String(url);
- var state = setInternalState(that, { type: 'URL' });
- var baseState, failure;
- if (base !== undefined) {
- if (base instanceof URLConstructor) baseState = getInternalURLState(base);
- else {
- failure = parseURL(baseState = {}, String(base));
- if (failure) throw TypeError(failure);
- }
- }
- failure = parseURL(state, urlString, null, baseState);
- if (failure) throw TypeError(failure);
- var searchParams = state.searchParams = new URLSearchParams();
- var searchParamsState = getInternalSearchParamsState(searchParams);
- searchParamsState.updateSearchParams(state.query);
- searchParamsState.updateURL = function () {
- state.query = String(searchParams) || null;
- };
- if (!DESCRIPTORS) {
- that.href = serializeURL.call(that);
- that.origin = getOrigin.call(that);
- that.protocol = getProtocol.call(that);
- that.username = getUsername.call(that);
- that.password = getPassword.call(that);
- that.host = getHost.call(that);
- that.hostname = getHostname.call(that);
- that.port = getPort.call(that);
- that.pathname = getPathname.call(that);
- that.search = getSearch.call(that);
- that.searchParams = getSearchParams.call(that);
- that.hash = getHash.call(that);
- }
- };
- var URLPrototype = URLConstructor.prototype;
- var serializeURL = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var username = url.username;
- var password = url.password;
- var host = url.host;
- var port = url.port;
- var path = url.path;
- var query = url.query;
- var fragment = url.fragment;
- var output = scheme + ':';
- if (host !== null) {
- output += '//';
- if (includesCredentials(url)) {
- output += username + (password ? ':' + password : '') + '@';
- }
- output += serializeHost(host);
- if (port !== null) output += ':' + port;
- } else if (scheme == 'file') output += '//';
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- if (query !== null) output += '?' + query;
- if (fragment !== null) output += '#' + fragment;
- return output;
- };
- var getOrigin = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var port = url.port;
- if (scheme == 'blob') try {
- return new URL(scheme.path[0]).origin;
- } catch (error) {
- return 'null';
- }
- if (scheme == 'file' || !isSpecial(url)) return 'null';
- return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
- };
- var getProtocol = function () {
- return getInternalURLState(this).scheme + ':';
- };
- var getUsername = function () {
- return getInternalURLState(this).username;
- };
- var getPassword = function () {
- return getInternalURLState(this).password;
- };
- var getHost = function () {
- var url = getInternalURLState(this);
- var host = url.host;
- var port = url.port;
- return host === null ? ''
- : port === null ? serializeHost(host)
- : serializeHost(host) + ':' + port;
- };
- var getHostname = function () {
- var host = getInternalURLState(this).host;
- return host === null ? '' : serializeHost(host);
- };
- var getPort = function () {
- var port = getInternalURLState(this).port;
- return port === null ? '' : String(port);
- };
- var getPathname = function () {
- var url = getInternalURLState(this);
- var path = url.path;
- return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- };
- var getSearch = function () {
- var query = getInternalURLState(this).query;
- return query ? '?' + query : '';
- };
- var getSearchParams = function () {
- return getInternalURLState(this).searchParams;
- };
- var getHash = function () {
- var fragment = getInternalURLState(this).fragment;
- return fragment ? '#' + fragment : '';
- };
- var accessorDescriptor = function (getter, setter) {
- return { get: getter, set: setter, configurable: true, enumerable: true };
- };
- if (DESCRIPTORS) {
- defineProperties(URLPrototype, {
- // `URL.prototype.href` accessors pair
- // https://url.spec.whatwg.org/#dom-url-href
- href: accessorDescriptor(serializeURL, function (href) {
- var url = getInternalURLState(this);
- var urlString = String(href);
- var failure = parseURL(url, urlString);
- if (failure) throw TypeError(failure);
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.origin` getter
- // https://url.spec.whatwg.org/#dom-url-origin
- origin: accessorDescriptor(getOrigin),
- // `URL.prototype.protocol` accessors pair
- // https://url.spec.whatwg.org/#dom-url-protocol
- protocol: accessorDescriptor(getProtocol, function (protocol) {
- var url = getInternalURLState(this);
- parseURL(url, String(protocol) + ':', SCHEME_START);
- }),
- // `URL.prototype.username` accessors pair
- // https://url.spec.whatwg.org/#dom-url-username
- username: accessorDescriptor(getUsername, function (username) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(username));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.username = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.password` accessors pair
- // https://url.spec.whatwg.org/#dom-url-password
- password: accessorDescriptor(getPassword, function (password) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(password));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.password = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.host` accessors pair
- // https://url.spec.whatwg.org/#dom-url-host
- host: accessorDescriptor(getHost, function (host) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(host), HOST);
- }),
- // `URL.prototype.hostname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hostname
- hostname: accessorDescriptor(getHostname, function (hostname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(hostname), HOSTNAME);
- }),
- // `URL.prototype.port` accessors pair
- // https://url.spec.whatwg.org/#dom-url-port
- port: accessorDescriptor(getPort, function (port) {
- var url = getInternalURLState(this);
- if (cannotHaveUsernamePasswordPort(url)) return;
- port = String(port);
- if (port == '') url.port = null;
- else parseURL(url, port, PORT);
- }),
- // `URL.prototype.pathname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-pathname
- pathname: accessorDescriptor(getPathname, function (pathname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- url.path = [];
- parseURL(url, pathname + '', PATH_START);
- }),
- // `URL.prototype.search` accessors pair
- // https://url.spec.whatwg.org/#dom-url-search
- search: accessorDescriptor(getSearch, function (search) {
- var url = getInternalURLState(this);
- search = String(search);
- if (search == '') {
- url.query = null;
- } else {
- if ('?' == search.charAt(0)) search = search.slice(1);
- url.query = '';
- parseURL(url, search, QUERY);
- }
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.searchParams` getter
- // https://url.spec.whatwg.org/#dom-url-searchparams
- searchParams: accessorDescriptor(getSearchParams),
- // `URL.prototype.hash` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hash
- hash: accessorDescriptor(getHash, function (hash) {
- var url = getInternalURLState(this);
- hash = String(hash);
- if (hash == '') {
- url.fragment = null;
- return;
- }
- if ('#' == hash.charAt(0)) hash = hash.slice(1);
- url.fragment = '';
- parseURL(url, hash, FRAGMENT);
- })
- });
- }
- // `URL.prototype.toJSON` method
- // https://url.spec.whatwg.org/#dom-url-tojson
- redefine(URLPrototype, 'toJSON', function toJSON() {
- return serializeURL.call(this);
- }, { enumerable: true });
- // `URL.prototype.toString` method
- // https://url.spec.whatwg.org/#URL-stringification-behavior
- redefine(URLPrototype, 'toString', function toString() {
- return serializeURL.call(this);
- }, { enumerable: true });
- if (NativeURL) {
- var nativeCreateObjectURL = NativeURL.createObjectURL;
- var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
- // `URL.createObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
- // eslint-disable-next-line no-unused-vars
- if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
- return nativeCreateObjectURL.apply(NativeURL, arguments);
- });
- // `URL.revokeObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
- // eslint-disable-next-line no-unused-vars
- if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
- return nativeRevokeObjectURL.apply(NativeURL, arguments);
- });
- }
- setToStringTag(URLConstructor, 'URL');
- $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
- URL: URLConstructor
- });
- /***/ }),
- /***/ "./node_modules/debug/src/browser.js":
- /*!*******************************************!*\
- !*** ./node_modules/debug/src/browser.js ***!
- \*******************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_exports__, module, __webpack_require__ */
- /*! CommonJS bailout: module.exports.humanize(...) prevents optimization as module.exports is passed as call context at 142:8-31 */
- /*! CommonJS bailout: exports is used directly at 245:37-44 */
- /*! CommonJS bailout: module.exports is used directly at 245:0-14 */
- /*! CommonJS bailout: module.exports is used directly at 247:21-35 */
- /***/ ((module, exports, __webpack_require__) => {
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- /* eslint-env browser */
- /**
- * This is the web browser implementation of `debug()`.
- */
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- /**
- * Colors.
- */
- exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
- ];
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
- // eslint-disable-next-line complexity
- function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
- }
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
- if (!this.useColors) {
- return;
- }
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
- args.splice(lastC, 0, c);
- }
- /**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
- exports.log = console.debug || console.log || (() => {});
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
- function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
- return r;
- }
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
- function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
- module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports);
- const {formatters} = module.exports;
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- /***/ }),
- /***/ "./node_modules/debug/src/common.js":
- /*!******************************************!*\
- !*** ./node_modules/debug/src/common.js ***!
- \******************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 264:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- /**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- */
- function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
- Object.keys(env).forEach(key => {
- createDebug[key] = env[key];
- });
- /**
- * Active `debug` instances.
- */
- createDebug.instances = [];
- /**
- * The currently active debug mode names, and names to skip.
- */
- createDebug.names = [];
- createDebug.skips = [];
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
- createDebug.formatters = {};
- /**
- * Selects a color for a debug namespace
- * @param {String} namespace The namespace string for the for the debug instance to be colored
- * @return {Number|String} An ANSI color code for the given namespace
- * @api private
- */
- function selectColor(namespace) {
- let hash = 0;
- for (let i = 0; i < namespace.length; i++) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
- function createDebug(namespace) {
- let prevTime;
- function debug(...args) {
- // Disabled?
- if (!debug.enabled) {
- return;
- }
- const self = debug;
- // Set `diff` timestamp
- const curr = Number(new Date());
- const ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
- if (typeof args[0] !== 'string') {
- // Anything else let's inspect with %O
- args.unshift('%O');
- }
- // Apply any `formatters` transformations
- let index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
- // If we encounter an escaped % then don't increase the array index
- if (match === '%%') {
- return match;
- }
- index++;
- const formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- const val = args[index];
- match = formatter.call(self, val);
- // Now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- // Apply env-specific formatting (colors, etc.)
- createDebug.formatArgs.call(self, args);
- const logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
- debug.namespace = namespace;
- debug.enabled = createDebug.enabled(namespace);
- debug.useColors = createDebug.useColors();
- debug.color = createDebug.selectColor(namespace);
- debug.destroy = destroy;
- debug.extend = extend;
- // Env-specific initialization logic for debug instances
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
- createDebug.instances.push(debug);
- return debug;
- }
- function destroy() {
- const index = createDebug.instances.indexOf(this);
- if (index !== -1) {
- createDebug.instances.splice(index, 1);
- return true;
- }
- return false;
- }
- function extend(namespace, delimiter) {
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.names = [];
- createDebug.skips = [];
- let i;
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- const len = split.length;
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- // ignore empty strings
- continue;
- }
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- for (i = 0; i < createDebug.instances.length; i++) {
- const instance = createDebug.instances[i];
- instance.enabled = createDebug.enabled(instance.namespace);
- }
- }
- /**
- * Disable debug output.
- *
- * @return {String} namespaces
- * @api public
- */
- function disable() {
- const namespaces = [
- ...createDebug.names.map(toNamespace),
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
- ].join(',');
- createDebug.enable('');
- return namespaces;
- }
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
- let i;
- let len;
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Convert regexp to namespace
- *
- * @param {RegExp} regxep
- * @return {String} namespace
- * @api private
- */
- function toNamespace(regexp) {
- return regexp.toString()
- .substring(2, regexp.toString().length - 2)
- .replace(/\.\*\?$/, '*');
- }
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
- createDebug.enable(createDebug.load());
- return createDebug;
- }
- module.exports = setup;
- /***/ }),
- /***/ "./node_modules/events/events.js":
- /*!***************************************!*\
- !*** ./node_modules/events/events.js ***!
- \***************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 56:0-14 */
- /***/ ((module) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- var R = typeof Reflect === 'object' ? Reflect : null
- var ReflectApply = R && typeof R.apply === 'function'
- ? R.apply
- : function ReflectApply(target, receiver, args) {
- return Function.prototype.apply.call(target, receiver, args);
- }
- var ReflectOwnKeys
- if (R && typeof R.ownKeys === 'function') {
- ReflectOwnKeys = R.ownKeys
- } else if (Object.getOwnPropertySymbols) {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target)
- .concat(Object.getOwnPropertySymbols(target));
- };
- } else {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target);
- };
- }
- function ProcessEmitWarning(warning) {
- if (console && console.warn) console.warn(warning);
- }
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
- return value !== value;
- }
- function EventEmitter() {
- EventEmitter.init.call(this);
- }
- module.exports = EventEmitter;
- module.exports.once = once;
- // Backwards-compat with node 0.10.x
- EventEmitter.EventEmitter = EventEmitter;
- EventEmitter.prototype._events = undefined;
- EventEmitter.prototype._eventsCount = 0;
- EventEmitter.prototype._maxListeners = undefined;
- // By default EventEmitters will print a warning if more than 10 listeners are
- // added to it. This is a useful default which helps finding memory leaks.
- var defaultMaxListeners = 10;
- function checkListener(listener) {
- if (typeof listener !== 'function') {
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
- }
- }
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
- enumerable: true,
- get: function() {
- return defaultMaxListeners;
- },
- set: function(arg) {
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
- }
- defaultMaxListeners = arg;
- }
- });
- EventEmitter.init = function() {
- if (this._events === undefined ||
- this._events === Object.getPrototypeOf(this)._events) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- }
- this._maxListeners = this._maxListeners || undefined;
- };
- // Obviously not all Emitters should be limited to 10. This function allows
- // that to be increased. Set to zero for unlimited.
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
- }
- this._maxListeners = n;
- return this;
- };
- function _getMaxListeners(that) {
- if (that._maxListeners === undefined)
- return EventEmitter.defaultMaxListeners;
- return that._maxListeners;
- }
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
- return _getMaxListeners(this);
- };
- EventEmitter.prototype.emit = function emit(type) {
- var args = [];
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
- var doError = (type === 'error');
- var events = this._events;
- if (events !== undefined)
- doError = (doError && events.error === undefined);
- else if (!doError)
- return false;
- // If there is no 'error' event listener then throw.
- if (doError) {
- var er;
- if (args.length > 0)
- er = args[0];
- if (er instanceof Error) {
- // Note: The comments on the `throw` lines are intentional, they show
- // up in Node's output if this results in an unhandled exception.
- throw er; // Unhandled 'error' event
- }
- // At least give some kind of context to the user
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
- err.context = er;
- throw err; // Unhandled 'error' event
- }
- var handler = events[type];
- if (handler === undefined)
- return false;
- if (typeof handler === 'function') {
- ReflectApply(handler, this, args);
- } else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- ReflectApply(listeners[i], this, args);
- }
- return true;
- };
- function _addListener(target, type, listener, prepend) {
- var m;
- var events;
- var existing;
- checkListener(listener);
- events = target._events;
- if (events === undefined) {
- events = target._events = Object.create(null);
- target._eventsCount = 0;
- } else {
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (events.newListener !== undefined) {
- target.emit('newListener', type,
- listener.listener ? listener.listener : listener);
- // Re-assign `events` because a newListener handler could have caused the
- // this._events to be assigned to a new object
- events = target._events;
- }
- existing = events[type];
- }
- if (existing === undefined) {
- // Optimize the case of one listener. Don't need the extra array object.
- existing = events[type] = listener;
- ++target._eventsCount;
- } else {
- if (typeof existing === 'function') {
- // Adding the second element, need to change to array.
- existing = events[type] =
- prepend ? [listener, existing] : [existing, listener];
- // If we've already got an array, just append.
- } else if (prepend) {
- existing.unshift(listener);
- } else {
- existing.push(listener);
- }
- // Check for listener leak
- m = _getMaxListeners(target);
- if (m > 0 && existing.length > m && !existing.warned) {
- existing.warned = true;
- // No error code for this since it is a Warning
- // eslint-disable-next-line no-restricted-syntax
- var w = new Error('Possible EventEmitter memory leak detected. ' +
- existing.length + ' ' + String(type) + ' listeners ' +
- 'added. Use emitter.setMaxListeners() to ' +
- 'increase limit');
- w.name = 'MaxListenersExceededWarning';
- w.emitter = target;
- w.type = type;
- w.count = existing.length;
- ProcessEmitWarning(w);
- }
- }
- return target;
- }
- EventEmitter.prototype.addListener = function addListener(type, listener) {
- return _addListener(this, type, listener, false);
- };
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
- EventEmitter.prototype.prependListener =
- function prependListener(type, listener) {
- return _addListener(this, type, listener, true);
- };
- function onceWrapper() {
- if (!this.fired) {
- this.target.removeListener(this.type, this.wrapFn);
- this.fired = true;
- if (arguments.length === 0)
- return this.listener.call(this.target);
- return this.listener.apply(this.target, arguments);
- }
- }
- function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
- var wrapped = onceWrapper.bind(state);
- wrapped.listener = listener;
- state.wrapFn = wrapped;
- return wrapped;
- }
- EventEmitter.prototype.once = function once(type, listener) {
- checkListener(listener);
- this.on(type, _onceWrap(this, type, listener));
- return this;
- };
- EventEmitter.prototype.prependOnceListener =
- function prependOnceListener(type, listener) {
- checkListener(listener);
- this.prependListener(type, _onceWrap(this, type, listener));
- return this;
- };
- // Emits a 'removeListener' event if and only if the listener was removed.
- EventEmitter.prototype.removeListener =
- function removeListener(type, listener) {
- var list, events, position, i, originalListener;
- checkListener(listener);
- events = this._events;
- if (events === undefined)
- return this;
- list = events[type];
- if (list === undefined)
- return this;
- if (list === listener || list.listener === listener) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else {
- delete events[type];
- if (events.removeListener)
- this.emit('removeListener', type, list.listener || listener);
- }
- } else if (typeof list !== 'function') {
- position = -1;
- for (i = list.length - 1; i >= 0; i--) {
- if (list[i] === listener || list[i].listener === listener) {
- originalListener = list[i].listener;
- position = i;
- break;
- }
- }
- if (position < 0)
- return this;
- if (position === 0)
- list.shift();
- else {
- spliceOne(list, position);
- }
- if (list.length === 1)
- events[type] = list[0];
- if (events.removeListener !== undefined)
- this.emit('removeListener', type, originalListener || listener);
- }
- return this;
- };
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.removeAllListeners =
- function removeAllListeners(type) {
- var listeners, events, i;
- events = this._events;
- if (events === undefined)
- return this;
- // not listening for removeListener, no need to emit
- if (events.removeListener === undefined) {
- if (arguments.length === 0) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- } else if (events[type] !== undefined) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else
- delete events[type];
- }
- return this;
- }
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- var keys = Object.keys(events);
- var key;
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = Object.create(null);
- this._eventsCount = 0;
- return this;
- }
- listeners = events[type];
- if (typeof listeners === 'function') {
- this.removeListener(type, listeners);
- } else if (listeners !== undefined) {
- // LIFO order
- for (i = listeners.length - 1; i >= 0; i--) {
- this.removeListener(type, listeners[i]);
- }
- }
- return this;
- };
- function _listeners(target, type, unwrap) {
- var events = target._events;
- if (events === undefined)
- return [];
- var evlistener = events[type];
- if (evlistener === undefined)
- return [];
- if (typeof evlistener === 'function')
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
- return unwrap ?
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
- }
- EventEmitter.prototype.listeners = function listeners(type) {
- return _listeners(this, type, true);
- };
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
- return _listeners(this, type, false);
- };
- EventEmitter.listenerCount = function(emitter, type) {
- if (typeof emitter.listenerCount === 'function') {
- return emitter.listenerCount(type);
- } else {
- return listenerCount.call(emitter, type);
- }
- };
- EventEmitter.prototype.listenerCount = listenerCount;
- function listenerCount(type) {
- var events = this._events;
- if (events !== undefined) {
- var evlistener = events[type];
- if (typeof evlistener === 'function') {
- return 1;
- } else if (evlistener !== undefined) {
- return evlistener.length;
- }
- }
- return 0;
- }
- EventEmitter.prototype.eventNames = function eventNames() {
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
- };
- function arrayClone(arr, n) {
- var copy = new Array(n);
- for (var i = 0; i < n; ++i)
- copy[i] = arr[i];
- return copy;
- }
- function spliceOne(list, index) {
- for (; index + 1 < list.length; index++)
- list[index] = list[index + 1];
- list.pop();
- }
- function unwrapListeners(arr) {
- var ret = new Array(arr.length);
- for (var i = 0; i < ret.length; ++i) {
- ret[i] = arr[i].listener || arr[i];
- }
- return ret;
- }
- function once(emitter, name) {
- return new Promise(function (resolve, reject) {
- function errorListener(err) {
- emitter.removeListener(name, resolver);
- reject(err);
- }
- function resolver() {
- if (typeof emitter.removeListener === 'function') {
- emitter.removeListener('error', errorListener);
- }
- resolve([].slice.call(arguments));
- };
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
- if (name !== 'error') {
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
- }
- });
- }
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
- if (typeof emitter.on === 'function') {
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
- }
- }
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
- if (typeof emitter.on === 'function') {
- if (flags.once) {
- emitter.once(name, listener);
- } else {
- emitter.on(name, listener);
- }
- } else if (typeof emitter.addEventListener === 'function') {
- // EventTarget does not have `error` event semantics like Node
- // EventEmitters, we do not listen for `error` events here.
- emitter.addEventListener(name, function wrapListener(arg) {
- // IE does not have builtin `{ once: true }` support so we
- // have to do it manually.
- if (flags.once) {
- emitter.removeEventListener(name, wrapListener);
- }
- listener(arg);
- });
- } else {
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
- }
- }
- /***/ }),
- /***/ "./node_modules/hash-base/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/hash-base/index.js ***!
- \*****************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 95:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/hash-base/node_modules/safe-buffer/index.js").Buffer
- var Transform = __webpack_require__(/*! readable-stream */ "./node_modules/hash-base/node_modules/readable-stream/readable-browser.js").Transform
- var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")
- function throwIfNotStringOrBuffer (val, prefix) {
- if (!Buffer.isBuffer(val) && typeof val !== 'string') {
- throw new TypeError(prefix + ' must be a string or a buffer')
- }
- }
- function HashBase (blockSize) {
- Transform.call(this)
- this._block = Buffer.allocUnsafe(blockSize)
- this._blockSize = blockSize
- this._blockOffset = 0
- this._length = [0, 0, 0, 0]
- this._finalized = false
- }
- inherits(HashBase, Transform)
- HashBase.prototype._transform = function (chunk, encoding, callback) {
- var error = null
- try {
- this.update(chunk, encoding)
- } catch (err) {
- error = err
- }
- callback(error)
- }
- HashBase.prototype._flush = function (callback) {
- var error = null
- try {
- this.push(this.digest())
- } catch (err) {
- error = err
- }
- callback(error)
- }
- HashBase.prototype.update = function (data, encoding) {
- throwIfNotStringOrBuffer(data, 'Data')
- if (this._finalized) throw new Error('Digest already called')
- if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
- // consume data
- var block = this._block
- var offset = 0
- while (this._blockOffset + data.length - offset >= this._blockSize) {
- for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
- this._update()
- this._blockOffset = 0
- }
- while (offset < data.length) block[this._blockOffset++] = data[offset++]
- // update length
- for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
- this._length[j] += carry
- carry = (this._length[j] / 0x0100000000) | 0
- if (carry > 0) this._length[j] -= 0x0100000000 * carry
- }
- return this
- }
- HashBase.prototype._update = function () {
- throw new Error('_update is not implemented')
- }
- HashBase.prototype.digest = function (encoding) {
- if (this._finalized) throw new Error('Digest already called')
- this._finalized = true
- var digest = this._digest()
- if (encoding !== undefined) digest = digest.toString(encoding)
- // reset state
- this._block.fill(0)
- this._blockOffset = 0
- for (var i = 0; i < 4; ++i) this._length[i] = 0
- return digest
- }
- HashBase.prototype._digest = function () {
- throw new Error('_digest is not implemented')
- }
- module.exports = HashBase
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/errors-browser.js ***!
- \*******************************************************************************/
- /*! default exports */
- /*! export codes [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: module */
- /***/ ((module) => {
- "use strict";
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var codes = {};
- function createErrorType(code, message, Base) {
- if (!Base) {
- Base = Error;
- }
- function getMessage(arg1, arg2, arg3) {
- if (typeof message === 'string') {
- return message;
- } else {
- return message(arg1, arg2, arg3);
- }
- }
- var NodeError =
- /*#__PURE__*/
- function (_Base) {
- _inheritsLoose(NodeError, _Base);
- function NodeError(arg1, arg2, arg3) {
- return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
- }
- return NodeError;
- }(Base);
- NodeError.prototype.name = Base.name;
- NodeError.prototype.code = code;
- codes[code] = NodeError;
- } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
- function oneOf(expected, thing) {
- if (Array.isArray(expected)) {
- var len = expected.length;
- expected = expected.map(function (i) {
- return String(i);
- });
- if (len > 2) {
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
- } else if (len === 2) {
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
- } else {
- return "of ".concat(thing, " ").concat(expected[0]);
- }
- } else {
- return "of ".concat(thing, " ").concat(String(expected));
- }
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
- function startsWith(str, search, pos) {
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
- function endsWith(str, search, this_len) {
- if (this_len === undefined || this_len > str.length) {
- this_len = str.length;
- }
- return str.substring(this_len - search.length, this_len) === search;
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
- function includes(str, search, start) {
- if (typeof start !== 'number') {
- start = 0;
- }
- if (start + search.length > str.length) {
- return false;
- } else {
- return str.indexOf(search, start) !== -1;
- }
- }
- createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
- return 'The value "' + value + '" is invalid for option "' + name + '"';
- }, TypeError);
- createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
- // determiner: 'must be' or 'must not be'
- var determiner;
- if (typeof expected === 'string' && startsWith(expected, 'not ')) {
- determiner = 'must not be';
- expected = expected.replace(/^not /, '');
- } else {
- determiner = 'must be';
- }
- var msg;
- if (endsWith(name, ' argument')) {
- // For cases like 'first argument'
- msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- } else {
- var type = includes(name, '.') ? 'property' : 'argument';
- msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- }
- msg += ". Received type ".concat(typeof actual);
- return msg;
- }, TypeError);
- createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
- createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
- return 'The ' + name + ' method is not implemented';
- });
- createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
- createErrorType('ERR_STREAM_DESTROYED', function (name) {
- return 'Cannot call ' + name + ' after a stream was destroyed';
- });
- createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
- createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
- createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
- createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
- createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
- return 'Unknown encoding: ' + arg;
- }, TypeError);
- createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
- module.exports.codes = codes;
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js ***!
- \***********************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 40:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a duplex stream is just a stream that is both readable and writable.
- // Since JS doesn't have multiple prototypal inheritance, this class
- // prototypally inherits from Readable, and then parasitically from
- // Writable.
- /*<replacement>*/
- var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- keys.push(key);
- }
- return keys;
- };
- /*</replacement>*/
- module.exports = Duplex;
- var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js");
- var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable);
- {
- // Allow the keys array to be GC'ed.
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
- }
- }
- function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
- this.allowHalfOpen = true;
- if (options) {
- if (options.readable === false) this.readable = false;
- if (options.writable === false) this.writable = false;
- if (options.allowHalfOpen === false) {
- this.allowHalfOpen = false;
- this.once('end', onend);
- }
- }
- }
- Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- });
- Object.defineProperty(Duplex.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- Object.defineProperty(Duplex.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- }); // the no-half-open enforcer
- function onend() {
- // If the writable side ended, then we're ok.
- if (this._writableState.ended) return; // no more data can be written.
- // But allow more writes to happen in this tick.
- process.nextTick(onEndNT, this);
- }
- function onEndNT(self) {
- self.end();
- }
- Object.defineProperty(Duplex.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined || this._writableState === undefined) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (this._readableState === undefined || this._writableState === undefined) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
- });
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js ***!
- \****************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a passthrough stream.
- // basically just the most minimal sort of Transform stream.
- // Every written chunk gets output as-is.
- module.exports = PassThrough;
- var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform);
- function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
- Transform.call(this, options);
- }
- PassThrough.prototype._transform = function (chunk, encoding, cb) {
- cb(null, chunk);
- };
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js ***!
- \*************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- module.exports = Readable;
- /*<replacement>*/
- var Duplex;
- /*</replacement>*/
- Readable.ReadableState = ReadableState;
- /*<replacement>*/
- var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
- var EElistenerCount = function EElistenerCount(emitter, type) {
- return emitter.listeners(type).length;
- };
- /*</replacement>*/
- /*<replacement>*/
- var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
- /*</replacement>*/
- var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
- var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- /*<replacement>*/
- var debugUtil = __webpack_require__(/*! util */ "?0bed");
- var debug;
- if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
- } else {
- debug = function debug() {};
- }
- /*</replacement>*/
- var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js");
- var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js");
- var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js"),
- getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.
- var StringDecoder;
- var createReadableStreamAsyncIterator;
- var from;
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream);
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
- function prependListener(emitter, event, fn) {
- // Sadly this is not cacheable as some libraries bundle their own
- // event emitter implementation with them.
- 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
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- 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]];
- }
- function ReadableState(options, stream, isDuplex) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
- options = options || {}; // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted
- // immediately, or on a later tick. We set this to true at first, because
- // any actions that shouldn't happen until "later" should generally also
- // not happen before the first read call.
- this.sync = true; // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
- this.paused = true; // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')
- this.autoDestroy = !!options.autoDestroy; // has it been destroyed
- this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
- }
- function Readable(options) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
- if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
- // the ReadableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- this._readableState = new ReadableState(options, this, isDuplex); // legacy
- this.readable = true;
- if (options) {
- if (typeof options.read === 'function') this._read = options.read;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- }
- Stream.call(this);
- }
- Object.defineProperty(Readable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._readableState) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- }
- });
- Readable.prototype.destroy = destroyImpl.destroy;
- Readable.prototype._undestroy = destroyImpl.undestroy;
- Readable.prototype._destroy = function (err, cb) {
- cb(err);
- }; // Manually shove something into the read() buffer.
- // This returns true if the highWaterMark has not been hit yet,
- // similar to how Writable.write() returns true if you should
- // write() some more.
- Readable.prototype.push = function (chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
- if (!state.objectMode) {
- if (typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = '';
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
- }; // Unshift should *always* be something directly out of read()
- Readable.prototype.unshift = function (chunk) {
- return readableAddChunk(this, chunk, null, true, false);
- };
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- debug('readableAddChunk', chunk);
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
- if (er) {
- errorOrDestroy(stream, er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (addToFront) {
- if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
- } else if (state.destroyed) {
- return false;
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- maybeReadMore(stream, state);
- }
- } // We can push more data if we are below the highWaterMark.
- // Also, if we have no data yet, we can stand some more bytes.
- // This is to work around cases where hwm=0, such as the repl.
- return !state.ended && (state.length < state.highWaterMark || state.length === 0);
- }
- function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- state.awaitDrain = 0;
- stream.emit('data', chunk);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
- if (state.needReadable) emitReadable(stream);
- }
- maybeReadMore(stream, state);
- }
- function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
- }
- return er;
- }
- Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
- }; // backwards compatibility.
- Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
- var decoder = new StringDecoder(enc);
- this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
- this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:
- var p = this._readableState.buffer.head;
- var content = '';
- while (p !== null) {
- content += decoder.write(p.data);
- p = p.next;
- }
- this._readableState.buffer.clear();
- if (content !== '') this._readableState.buffer.push(content);
- this._readableState.length = content.length;
- return this;
- }; // Don't raise the hwm > 1GB
- var MAX_HWM = 0x40000000;
- function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
- } // This function is designed to be inlinable, so please take care when making
- // changes to the function body.
- function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- } // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n; // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
- } // you can override either this method, or the async _read(n) below.
- Readable.prototype.read = function (n) {
- debug('read', n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
- if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
- return null;
- }
- n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
- return null;
- } // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
- debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- } // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading) {
- doRead = false;
- debug('reading or ended', doRead);
- } else if (doRead) {
- debug('do read');
- state.reading = true;
- state.sync = true; // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true; // call internal read method
- this._read(state.highWaterMark);
- state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
- }
- var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
- if (ret === null) {
- state.needReadable = state.length <= state.highWaterMark;
- n = 0;
- } else {
- state.length -= n;
- state.awaitDrain = 0;
- }
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
- if (ret !== null) this.emit('data', ret);
- return ret;
- };
- function onEofChunk(stream, state) {
- debug('onEofChunk');
- if (state.ended) return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
- if (state.sync) {
- // if we are sync, wait until next tick to emit the data.
- // Otherwise we risk emitting data in the flow()
- // the readable code triggers during a read() call
- emitReadable(stream);
- } else {
- // emit 'readable' now to make sure it gets picked up.
- state.needReadable = false;
- if (!state.emittedReadable) {
- state.emittedReadable = true;
- emitReadable_(stream);
- }
- }
- } // Don't emit readable right away in sync mode, because this can trigger
- // another read() call => stack overflow. This way, it might trigger
- // a nextTick recursion warning, but that's not so bad.
- function emitReadable(stream) {
- var state = stream._readableState;
- debug('emitReadable', state.needReadable, state.emittedReadable);
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- process.nextTick(emitReadable_, stream);
- }
- }
- function emitReadable_(stream) {
- var state = stream._readableState;
- debug('emitReadable_', state.destroyed, state.length, state.ended);
- if (!state.destroyed && (state.length || state.ended)) {
- stream.emit('readable');
- state.emittedReadable = false;
- } // The stream needs another readable event if
- // 1. It is not flowing, as the flow mechanism will take
- // care of it.
- // 2. It is not ended.
- // 3. It is below the highWaterMark, so we can schedule
- // another readable later.
- state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
- flow(stream);
- } // at this point, the user has presumably seen the 'readable' event,
- // and called read() to consume some data. that may have triggered
- // in turn another _read(n) call, in which case reading = true if
- // it's in progress.
- // However, if we're not ended, or reading, and the length < hwm,
- // then go ahead and try to read some more preemptively.
- function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- process.nextTick(maybeReadMore_, stream, state);
- }
- }
- function maybeReadMore_(stream, state) {
- // Attempt to read more data if we should.
- //
- // The conditions for reading more data are (one of):
- // - Not enough data buffered (state.length < state.highWaterMark). The loop
- // is responsible for filling the buffer with enough data if such data
- // is available. If highWaterMark is 0 and we are not in the flowing mode
- // we should _not_ attempt to buffer any extra data. We'll get more data
- // when the stream consumer calls read() instead.
- // - No data in the buffer, and the stream is in flowing mode. In this mode
- // the loop below is responsible for ensuring read() is called. Failing to
- // call read here would abort the flow and there's no other mechanism for
- // continuing the flow if the stream consumer has just subscribed to the
- // 'data' event.
- //
- // In addition to the above conditions to keep reading data, the following
- // conditions prevent the data from being read:
- // - The stream has ended (state.ended).
- // - There is already a pending 'read' operation (state.reading). This is a
- // case where the the stream has called the implementation defined _read()
- // method, but they are processing the call asynchronously and have _not_
- // called push() with new data. In this case we skip performing more
- // read()s. The execution ends in this method again after the _read() ends
- // up calling push() with more data.
- while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
- var len = state.length;
- debug('maybeReadMore read 0');
- stream.read(0);
- if (len === state.length) // didn't get any data, stop spinning.
- break;
- }
- state.readingMore = false;
- } // abstract method. to be overridden in specific implementation classes.
- // call cb(er, data) where data is <= n in length.
- // for virtual (non-string, non-buffer) streams, "length" is somewhat
- // arbitrary, and perhaps not very meaningful.
- Readable.prototype._read = function (n) {
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
- };
- Readable.prototype.pipe = function (dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
- dest.on('unpipe', onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug('onunpipe');
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
- function onend() {
- debug('onend');
- dest.end();
- } // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
- var cleanedUp = false;
- function cleanup() {
- debug('cleanup'); // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', unpipe);
- src.removeListener('data', ondata);
- cleanedUp = true; // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
- }
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- var ret = dest.write(chunk);
- debug('dest.write', ret);
- if (ret === false) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', state.awaitDrain);
- state.awaitDrain++;
- }
- src.pause();
- }
- } // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
- } // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
- function unpipe() {
- debug('unpipe');
- src.unpipe(dest);
- } // tell the dest that it's being piped to
- dest.emit('pipe', src); // start the flow if it hasn't been started already.
- if (!state.flowing) {
- debug('pipe resume');
- src.resume();
- }
- return dest;
- };
- function pipeOnDrain(src) {
- return function pipeOnDrainFunctionResult() {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
- }
- Readable.prototype.unpipe = function (dest) {
- var state = this._readableState;
- var unpipeInfo = {
- hasUnpiped: false
- }; // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this; // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
- if (!dest) dest = state.pipes; // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest) dest.emit('unpipe', this, unpipeInfo);
- return this;
- } // slow case. multiple pipe destinations.
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- for (var i = 0; i < len; i++) {
- dests[i].emit('unpipe', this, {
- hasUnpiped: false
- });
- }
- return this;
- } // try to find the right one.
- var index = indexOf(state.pipes, dest);
- if (index === -1) return this;
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
- dest.emit('unpipe', this, unpipeInfo);
- return this;
- }; // set up data events if they are asked for
- // Ensure readable listeners eventually get something
- Readable.prototype.on = function (ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
- var state = this._readableState;
- if (ev === 'data') {
- // update readableListening so that resume() may be a no-op
- // a few lines down. This is needed to support once('readable').
- state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused
- if (state.flowing !== false) this.resume();
- } else if (ev === 'readable') {
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.flowing = false;
- state.emittedReadable = false;
- debug('on readable', state.length, state.reading);
- if (state.length) {
- emitReadable(this);
- } else if (!state.reading) {
- process.nextTick(nReadingNextTick, this);
- }
- }
- }
- return res;
- };
- Readable.prototype.addListener = Readable.prototype.on;
- Readable.prototype.removeListener = function (ev, fn) {
- var res = Stream.prototype.removeListener.call(this, ev, fn);
- if (ev === 'readable') {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- Readable.prototype.removeAllListeners = function (ev) {
- var res = Stream.prototype.removeAllListeners.apply(this, arguments);
- if (ev === 'readable' || ev === undefined) {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- function updateReadableListening(self) {
- var state = self._readableState;
- state.readableListening = self.listenerCount('readable') > 0;
- if (state.resumeScheduled && !state.paused) {
- // flowing needs to be set to true now, otherwise
- // the upcoming resume will not flow.
- state.flowing = true; // crude way to check if we should resume
- } else if (self.listenerCount('data') > 0) {
- self.resume();
- }
- }
- function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
- } // pause() and resume() are remnants of the legacy readable stream API
- // If the user uses them, then switch into old mode.
- Readable.prototype.resume = function () {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume'); // we flow only if there is no one listening
- // for readable, but we still have to call
- // resume()
- state.flowing = !state.readableListening;
- resume(this, state);
- }
- state.paused = false;
- return this;
- };
- function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- process.nextTick(resume_, stream, state);
- }
- }
- function resume_(stream, state) {
- debug('resume', state.reading);
- if (!state.reading) {
- stream.read(0);
- }
- state.resumeScheduled = false;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
- }
- Readable.prototype.pause = function () {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (this._readableState.flowing !== false) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- this._readableState.paused = true;
- return this;
- };
- function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null) {
- ;
- }
- } // wrap an old-style stream as the async data source.
- // This is *not* part of the readable stream interface.
- // It is an ugly unfortunate mess of history.
- Readable.prototype.wrap = function (stream) {
- var _this = this;
- var state = this._readableState;
- var paused = false;
- stream.on('end', function () {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) _this.push(chunk);
- }
- _this.push(null);
- });
- stream.on('data', function (chunk) {
- debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- }); // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function methodWrap(method) {
- return function methodWrapReturnFunction() {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- } // proxy certain important events.
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- } // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- this._read = function (n) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
- return this;
- };
- if (typeof Symbol === 'function') {
- Readable.prototype[Symbol.asyncIterator] = function () {
- if (createReadableStreamAsyncIterator === undefined) {
- createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js");
- }
- return createReadableStreamAsyncIterator(this);
- };
- }
- Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.highWaterMark;
- }
- });
- Object.defineProperty(Readable.prototype, 'readableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState && this._readableState.buffer;
- }
- });
- Object.defineProperty(Readable.prototype, 'readableFlowing', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.flowing;
- },
- set: function set(state) {
- if (this._readableState) {
- this._readableState.flowing = state;
- }
- }
- }); // exposed for testing purposes only.
- Readable._fromList = fromList;
- Object.defineProperty(Readable.prototype, 'readableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.length;
- }
- }); // Pluck off n bytes from an array of buffers.
- // Length is the combined lengths of all the buffers in the list.
- // This function is designed to be inlinable, so please take care when making
- // changes to the function body.
- function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
- var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = state.buffer.consume(n, state.decoder);
- }
- return ret;
- }
- function endReadable(stream) {
- var state = stream._readableState;
- debug('endReadable', state.endEmitted);
- if (!state.endEmitted) {
- state.ended = true;
- process.nextTick(endReadableNT, state, stream);
- }
- }
- function endReadableNT(state, stream) {
- debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the writable side is ready for autoDestroy as well
- var wState = stream._writableState;
- if (!wState || wState.autoDestroy && wState.finished) {
- stream.destroy();
- }
- }
- }
- }
- if (typeof Symbol === 'function') {
- Readable.from = function (iterable, opts) {
- if (from === undefined) {
- from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js");
- }
- return from(Readable, iterable, opts);
- };
- }
- function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
- }
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js ***!
- \**************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 64:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a transform stream is a readable/writable stream where you do
- // something with the data. Sometimes it's called a "filter",
- // but that's not a great name for it, since that implies a thing where
- // some bits pass through, and others are simply ignored. (That would
- // be a valid example of a transform, of course.)
- //
- // While the output is causally related to the input, it's not a
- // necessarily symmetric or synchronous transformation. For example,
- // a zlib stream might take multiple plain-text writes(), and then
- // emit a single compressed chunk some time in the future.
- //
- // Here's how this works:
- //
- // The Transform stream has all the aspects of the readable and writable
- // stream classes. When you write(chunk), that calls _write(chunk,cb)
- // internally, and returns false if there's a lot of pending writes
- // buffered up. When you call read(), that calls _read(n) until
- // there's enough pending readable data buffered up.
- //
- // In a transform stream, the written data is placed in a buffer. When
- // _read(n) is called, it transforms the queued up data, calling the
- // buffered _write cb's as it consumes chunks. If consuming a single
- // written chunk would result in multiple output chunks, then the first
- // outputted bit calls the readcb, and subsequent chunks just go into
- // the read buffer, and will cause it to emit 'readable' if necessary.
- //
- // This way, back-pressure is actually determined by the reading side,
- // since _read has to be called to start processing a new chunk. However,
- // a pathological inflate type of transform can cause excessive buffering
- // here. For example, imagine a stream where every byte of input is
- // interpreted as an integer from 0-255, and then results in that many
- // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
- // 1kb of data being output. In this case, you could write a very small
- // amount of input, and end up with a very large amount of output. In
- // such a pathological inflating mechanism, there'd be no way to tell
- // the system to stop doing the transform. A single 4MB write could
- // cause the system to run out of memory.
- //
- // However, even in such a pathological case, only a single written chunk
- // would be consumed, and then the rest would wait (un-transformed) until
- // the results of the previous transformed chunk were consumed.
- module.exports = Transform;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
- ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
- var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex);
- function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
- var cb = ts.writecb;
- if (cb === null) {
- return this.emit('error', new ERR_MULTIPLE_CALLBACK());
- }
- ts.writechunk = null;
- ts.writecb = null;
- if (data != null) // single equals check for both `null` and `undefined`
- this.push(data);
- cb(er);
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
- }
- function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
- Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- }; // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
- if (typeof options.flush === 'function') this._flush = options.flush;
- } // When the writable side finishes, then flush out anything remaining.
- this.on('prefinish', prefinish);
- }
- function prefinish() {
- var _this = this;
- if (typeof this._flush === 'function' && !this._readableState.destroyed) {
- this._flush(function (er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
- }
- Transform.prototype.push = function (chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
- }; // This is the part where you do stuff!
- // override this function in implementation classes.
- // 'chunk' is an input chunk.
- //
- // Call `push(newChunk)` to pass along transformed output
- // to the readable side. You may call 'push' zero or more times.
- //
- // Call `cb(err)` when you are done with this chunk. If you pass
- // an error, then that'll put the hurt on the whole operation. If you
- // never call cb(), then you'll never get another chunk.
- Transform.prototype._transform = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
- };
- Transform.prototype._write = function (chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
- }
- }; // Doesn't matter what the args are here.
- // _transform does all the work.
- // That we got here means that the readable side wants more data.
- Transform.prototype._read = function (n) {
- var ts = this._transformState;
- if (ts.writechunk !== null && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
- };
- Transform.prototype._destroy = function (err, cb) {
- Duplex.prototype._destroy.call(this, err, function (err2) {
- cb(err2);
- });
- };
- function done(stream, er, data) {
- if (er) return stream.emit('error', er);
- if (data != null) // single equals check for both `null` and `undefined`
- stream.push(data); // TODO(BridgeAR): Write a test for these two error cases
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
- if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
- return stream.push(null);
- }
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js ***!
- \*************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // A bit simpler than readable streams.
- // Implement an async ._write(chunk, encoding, cb), and it'll handle all
- // the drain event emission and buffering.
- module.exports = Writable;
- /* <replacement> */
- function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
- } // It seems a linked list but it is not
- // there will be only 2 of these for each stream
- function CorkedRequest(state) {
- var _this = this;
- this.next = null;
- this.entry = null;
- this.finish = function () {
- onCorkedFinish(_this, state);
- };
- }
- /* </replacement> */
- /*<replacement>*/
- var Duplex;
- /*</replacement>*/
- Writable.WritableState = WritableState;
- /*<replacement>*/
- var internalUtil = {
- deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js")
- };
- /*</replacement>*/
- /*<replacement>*/
- var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
- /*</replacement>*/
- var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
- var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js");
- var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js"),
- getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
- ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
- ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
- ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream);
- function nop() {}
- function WritableState(options, stream, isDuplex) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
- options = options || {}; // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream,
- // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called
- this.finalCalled = false; // drain event flag.
- this.needDrain = false; // at the start of calling end()
- this.ending = false; // when end() has been called, and returned
- this.ended = false; // when 'finish' is emitted
- this.finished = false; // has it been destroyed
- this.destroyed = false; // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0; // a flag to see when we're in the middle of a write.
- this.writing = false; // when true all writes will be buffered until .uncork() call
- this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true; // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
- onwrite(stream, er);
- }; // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null; // the amount that is being written when _write is called.
- this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false; // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')
- this.autoDestroy = !!options.autoDestroy; // count buffered requests
- this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
- }
- WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
- };
- (function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function writableStateBufferGetter() {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
- });
- } catch (_) {}
- })(); // Test _writableState for inheritance to account for Duplex streams,
- // whose prototype chain only points to Readable.
- var realHasInstance;
- if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function value(object) {
- if (realHasInstance.call(this, object)) return true;
- if (this !== Writable) return false;
- return object && object._writableState instanceof WritableState;
- }
- });
- } else {
- realHasInstance = function realHasInstance(object) {
- return object instanceof this;
- };
- }
- function Writable(options) {
- 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.
- // `realHasInstance` is necessary because using plain `instanceof`
- // would return false, as no `_writableState` property is attached.
- // Trying to use the custom `instanceof` for Writable here will also break the
- // Node.js LazyTransform implementation, which has a non-trivial getter for
- // `_writableState` that would lead to infinite recursion.
- // Checking for a Stream.Duplex instance is faster here instead of inside
- // the WritableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
- this._writableState = new WritableState(options, this, isDuplex); // legacy.
- this.writable = true;
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
- if (typeof options.writev === 'function') this._writev = options.writev;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- if (typeof options.final === 'function') this._final = options.final;
- }
- Stream.call(this);
- } // Otherwise people can pipe Writable streams, which is just wrong.
- Writable.prototype.pipe = function () {
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
- };
- function writeAfterEnd(stream, cb) {
- var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- } // Checks that a user-supplied chunk is valid, especially for the particular
- // mode the stream is in. Currently this means that `null` is never accepted
- // and undefined/non-string values are only allowed in object mode.
- function validChunk(stream, state, chunk, cb) {
- var er;
- if (chunk === null) {
- er = new ERR_STREAM_NULL_VALUES();
- } else if (typeof chunk !== 'string' && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
- }
- if (er) {
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- return false;
- }
- return true;
- }
- Writable.prototype.write = function (chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
- if (typeof cb !== 'function') cb = nop;
- if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
- }
- return ret;
- };
- Writable.prototype.cork = function () {
- this._writableState.corked++;
- };
- Writable.prototype.uncork = function () {
- var state = this._writableState;
- if (state.corked) {
- state.corked--;
- if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
- }
- };
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- 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);
- this._writableState.defaultEncoding = encoding;
- return this;
- };
- Object.defineProperty(Writable.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
- }
- Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- }); // if we're already writing something, then just put this
- // in the queue, and wait our turn. Otherwise, call _write
- // If we return false, then we need a drain event, so set that flag.
- function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = 'buffer';
- chunk = newChunk;
- }
- }
- var len = state.objectMode ? 1 : chunk.length;
- state.length += len;
- var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk: chunk,
- encoding: encoding,
- isBuf: isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
- return ret;
- }
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- 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);
- state.sync = false;
- }
- function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) {
- // defer the callback if we are being called synchronously
- // to avoid piling up things on the stack
- process.nextTick(cb, er); // this can emit finish, and it will always happen
- // after error
- process.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- } else {
- // the caller expect this to happen before if
- // it is async
- cb(er);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er); // this can emit finish, but finish must
- // always follow error
- finishMaybe(stream, state);
- }
- }
- function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
- }
- function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
- if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
- onwriteStateUpdate(state);
- if (er) onwriteError(stream, state, sync, er, cb);else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state) || stream.destroyed;
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
- if (sync) {
- process.nextTick(afterWrite, stream, state, finished, cb);
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
- }
- function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
- } // Must force callback to be called on nextTick, so that we don't
- // emit 'drain' before the write() consumer gets the 'false' return
- // value, and has a chance to attach a 'drain' listener.
- function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
- } // if there's something in the buffer waiting, then process it
- function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
- // Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf) allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
- doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- // Slow case, write chunks one-by-one
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- break;
- }
- }
- if (entry === null) state.lastBufferedRequest = null;
- }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
- }
- Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
- };
- Writable.prototype._writev = null;
- Writable.prototype.end = function (chunk, encoding, cb) {
- var state = this._writableState;
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- } // ignore unnecessary end() calls.
- if (!state.ending) endWritable(this, state, cb);
- return this;
- };
- Object.defineProperty(Writable.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- });
- function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
- }
- function callFinal(stream, state) {
- stream._final(function (err) {
- state.pendingcb--;
- if (err) {
- errorOrDestroy(stream, err);
- }
- state.prefinished = true;
- stream.emit('prefinish');
- finishMaybe(stream, state);
- });
- }
- function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === 'function' && !state.destroyed) {
- state.pendingcb++;
- state.finalCalled = true;
- process.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit('prefinish');
- }
- }
- }
- function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit('finish');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the readable side is ready for autoDestroy as well
- var rState = stream._readableState;
- if (!rState || rState.autoDestroy && rState.endEmitted) {
- stream.destroy();
- }
- }
- }
- }
- return need;
- }
- function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
- }
- state.ended = true;
- stream.writable = false;
- }
- function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- } // reuse the free corkReq.
- state.corkedRequestsFree.next = corkReq;
- }
- Object.defineProperty(Writable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._writableState === undefined) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._writableState) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._writableState.destroyed = value;
- }
- });
- Writable.prototype.destroy = destroyImpl.destroy;
- Writable.prototype._undestroy = destroyImpl.undestroy;
- Writable.prototype._destroy = function (err, cb) {
- cb(err);
- };
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js":
- /*!****************************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js ***!
- \****************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 207:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- var _Object$setPrototypeO;
- 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; }
- var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
- var kLastResolve = Symbol('lastResolve');
- var kLastReject = Symbol('lastReject');
- var kError = Symbol('error');
- var kEnded = Symbol('ended');
- var kLastPromise = Symbol('lastPromise');
- var kHandlePromise = Symbol('handlePromise');
- var kStream = Symbol('stream');
- function createIterResult(value, done) {
- return {
- value: value,
- done: done
- };
- }
- function readAndResolve(iter) {
- var resolve = iter[kLastResolve];
- if (resolve !== null) {
- var data = iter[kStream].read(); // we defer if data is null
- // we can be expecting either 'end' or
- // 'error'
- if (data !== null) {
- iter[kLastPromise] = null;
- iter[kLastResolve] = null;
- iter[kLastReject] = null;
- resolve(createIterResult(data, false));
- }
- }
- }
- function onReadable(iter) {
- // we wait for the next tick, because it might
- // emit an error with process.nextTick
- process.nextTick(readAndResolve, iter);
- }
- function wrapForNext(lastPromise, iter) {
- return function (resolve, reject) {
- lastPromise.then(function () {
- if (iter[kEnded]) {
- resolve(createIterResult(undefined, true));
- return;
- }
- iter[kHandlePromise](resolve, reject);
- }, reject);
- };
- }
- var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
- var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
- get stream() {
- return this[kStream];
- },
- next: function next() {
- var _this = this;
- // if we have detected an error in the meanwhile
- // reject straight away
- var error = this[kError];
- if (error !== null) {
- return Promise.reject(error);
- }
- if (this[kEnded]) {
- return Promise.resolve(createIterResult(undefined, true));
- }
- if (this[kStream].destroyed) {
- // We need to defer via nextTick because if .destroy(err) is
- // called, the error will be emitted via nextTick, and
- // we cannot guarantee that there is no error lingering around
- // waiting to be emitted.
- return new Promise(function (resolve, reject) {
- process.nextTick(function () {
- if (_this[kError]) {
- reject(_this[kError]);
- } else {
- resolve(createIterResult(undefined, true));
- }
- });
- });
- } // if we have multiple next() calls
- // we will wait for the previous Promise to finish
- // this logic is optimized to support for await loops,
- // where next() is only called once at a time
- var lastPromise = this[kLastPromise];
- var promise;
- if (lastPromise) {
- promise = new Promise(wrapForNext(lastPromise, this));
- } else {
- // fast path needed to support multiple this.push()
- // without triggering the next() queue
- var data = this[kStream].read();
- if (data !== null) {
- return Promise.resolve(createIterResult(data, false));
- }
- promise = new Promise(this[kHandlePromise]);
- }
- this[kLastPromise] = promise;
- return promise;
- }
- }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
- return this;
- }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
- var _this2 = this;
- // destroy(err, cb) is a private API
- // we can guarantee we have that here, because we control the
- // Readable class this is attached to
- return new Promise(function (resolve, reject) {
- _this2[kStream].destroy(null, function (err) {
- if (err) {
- reject(err);
- return;
- }
- resolve(createIterResult(undefined, true));
- });
- });
- }), _Object$setPrototypeO), AsyncIteratorPrototype);
- var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
- var _Object$create;
- var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
- value: stream,
- writable: true
- }), _defineProperty(_Object$create, kLastResolve, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kLastReject, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kError, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kEnded, {
- value: stream._readableState.endEmitted,
- writable: true
- }), _defineProperty(_Object$create, kHandlePromise, {
- value: function value(resolve, reject) {
- var data = iterator[kStream].read();
- if (data) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(data, false));
- } else {
- iterator[kLastResolve] = resolve;
- iterator[kLastReject] = reject;
- }
- },
- writable: true
- }), _Object$create));
- iterator[kLastPromise] = null;
- finished(stream, function (err) {
- if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
- var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise
- // returned by next() and store the error
- if (reject !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- reject(err);
- }
- iterator[kError] = err;
- return;
- }
- var resolve = iterator[kLastResolve];
- if (resolve !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(undefined, true));
- }
- iterator[kEnded] = true;
- });
- stream.on('readable', onReadable.bind(null, iterator));
- return iterator;
- };
- module.exports = createReadableStreamAsyncIterator;
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js":
- /*!*************************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js ***!
- \*************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 27:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var _require = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js"),
- Buffer = _require.Buffer;
- var _require2 = __webpack_require__(/*! util */ "?0bed"),
- inspect = _require2.inspect;
- var custom = inspect && inspect.custom || 'inspect';
- function copyBuffer(src, target, offset) {
- Buffer.prototype.copy.call(src, target, offset);
- }
- module.exports =
- /*#__PURE__*/
- function () {
- function BufferList() {
- _classCallCheck(this, BufferList);
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
- _createClass(BufferList, [{
- key: "push",
- value: function push(v) {
- var entry = {
- data: v,
- next: null
- };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
- }
- }, {
- key: "unshift",
- value: function unshift(v) {
- var entry = {
- data: v,
- next: this.head
- };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
- }
- }, {
- key: "shift",
- value: function shift() {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
- }
- }, {
- key: "clear",
- value: function clear() {
- this.head = this.tail = null;
- this.length = 0;
- }
- }, {
- key: "join",
- value: function join(s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }
- return ret;
- }
- }, {
- key: "concat",
- value: function concat(n) {
- if (this.length === 0) return Buffer.alloc(0);
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- } // Consumes a specified amount of bytes or characters from the buffered data.
- }, {
- key: "consume",
- value: function consume(n, hasStrings) {
- var ret;
- if (n < this.head.data.length) {
- // `slice` is the same for buffers and strings.
- ret = this.head.data.slice(0, n);
- this.head.data = this.head.data.slice(n);
- } else if (n === this.head.data.length) {
- // First chunk is a perfect match.
- ret = this.shift();
- } else {
- // Result spans more than one buffer.
- ret = hasStrings ? this._getString(n) : this._getBuffer(n);
- }
- return ret;
- }
- }, {
- key: "first",
- value: function first() {
- return this.head.data;
- } // Consumes a specified amount of characters from the buffered data.
- }, {
- key: "_getString",
- value: function _getString(n) {
- var p = this.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- } // Consumes a specified amount of bytes from the buffered data.
- }, {
- key: "_getBuffer",
- value: function _getBuffer(n) {
- var ret = Buffer.allocUnsafe(n);
- var p = this.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- } // Make sure the linked list only shows the minimal necessary information.
- }, {
- key: custom,
- value: function value(_, options) {
- return inspect(this, _objectSpread({}, options, {
- // Only inspect one level.
- depth: 0,
- // It should not recurse.
- customInspect: false
- }));
- }
- }]);
- return BufferList;
- }();
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
- \*********************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 101:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // undocumented cb() API, needed for core, not for public API
- function destroy(err, cb) {
- var _this = this;
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err) {
- if (!this._writableState) {
- process.nextTick(emitErrorNT, this, err);
- } else if (!this._writableState.errorEmitted) {
- this._writableState.errorEmitted = true;
- process.nextTick(emitErrorNT, this, err);
- }
- }
- return this;
- } // we set destroyed to true before firing error callbacks in order
- // to make it re-entrance safe in case destroy() is called within callbacks
- if (this._readableState) {
- this._readableState.destroyed = true;
- } // if this is a duplex stream mark the writable part as destroyed as well
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
- this._destroy(err || null, function (err) {
- if (!cb && err) {
- if (!_this._writableState) {
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else if (!_this._writableState.errorEmitted) {
- _this._writableState.errorEmitted = true;
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- } else if (cb) {
- process.nextTick(emitCloseNT, _this);
- cb(err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- });
- return this;
- }
- function emitErrorAndCloseNT(self, err) {
- emitErrorNT(self, err);
- emitCloseNT(self);
- }
- function emitCloseNT(self) {
- if (self._writableState && !self._writableState.emitClose) return;
- if (self._readableState && !self._readableState.emitClose) return;
- self.emit('close');
- }
- function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finalCalled = false;
- this._writableState.prefinished = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
- }
- function emitErrorNT(self, err) {
- self.emit('error', err);
- }
- function errorOrDestroy(stream, err) {
- // We have tests that rely on errors being emitted
- // in the same tick, so changing this is semver major.
- // For now when you opt-in to autoDestroy we allow
- // the error to be emitted nextTick. In a future
- // semver major update we should change the default to this.
- var rState = stream._readableState;
- var wState = stream._writableState;
- if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
- }
- module.exports = {
- destroy: destroy,
- undestroy: undestroy,
- errorOrDestroy: errorOrDestroy
- };
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js":
- /*!***************************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***!
- \***************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Ported from https://github.com/mafintosh/end-of-stream with
- // permission from the author, Mathias Buus (@mafintosh).
- var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE;
- function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- callback.apply(this, args);
- };
- }
- function noop() {}
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
- }
- function eos(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
- callback = once(callback || noop);
- var readable = opts.readable || opts.readable !== false && stream.readable;
- var writable = opts.writable || opts.writable !== false && stream.writable;
- var onlegacyfinish = function onlegacyfinish() {
- if (!stream.writable) onfinish();
- };
- var writableEnded = stream._writableState && stream._writableState.finished;
- var onfinish = function onfinish() {
- writable = false;
- writableEnded = true;
- if (!readable) callback.call(stream);
- };
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
- var onend = function onend() {
- readable = false;
- readableEnded = true;
- if (!writable) callback.call(stream);
- };
- var onerror = function onerror(err) {
- callback.call(stream, err);
- };
- var onclose = function onclose() {
- var err;
- if (readable && !readableEnded) {
- if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- if (writable && !writableEnded) {
- if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- };
- var onrequest = function onrequest() {
- stream.req.on('finish', onfinish);
- };
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();else stream.on('request', onrequest);
- } else if (writable && !stream._writableState) {
- // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', onerror);
- stream.on('close', onclose);
- return function () {
- stream.removeListener('complete', onfinish);
- stream.removeListener('abort', onclose);
- stream.removeListener('request', onrequest);
- if (stream.req) stream.req.removeListener('finish', onfinish);
- stream.removeListener('end', onlegacyfinish);
- stream.removeListener('close', onlegacyfinish);
- stream.removeListener('finish', onfinish);
- stream.removeListener('end', onend);
- stream.removeListener('error', onerror);
- stream.removeListener('close', onclose);
- };
- }
- module.exports = eos;
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js":
- /*!**************************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js ***!
- \**************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function () {
- throw new Error('Readable.from is not available in the browser')
- };
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js":
- /*!**********************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js ***!
- \**********************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 97:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Ported from https://github.com/mafintosh/pump with
- // permission from the author, Mathias Buus (@mafintosh).
- var eos;
- function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- callback.apply(void 0, arguments);
- };
- }
- var _require$codes = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes,
- ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
- function noop(err) {
- // Rethrow the error if it exists to avoid swallowing it
- if (err) throw err;
- }
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
- }
- function destroyer(stream, reading, writing, callback) {
- callback = once(callback);
- var closed = false;
- stream.on('close', function () {
- closed = true;
- });
- if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
- eos(stream, {
- readable: reading,
- writable: writing
- }, function (err) {
- if (err) return callback(err);
- closed = true;
- callback();
- });
- var destroyed = false;
- return function (err) {
- if (closed) return;
- if (destroyed) return;
- destroyed = true; // request.destroy just do .end - .abort is what we want
- if (isRequest(stream)) return stream.abort();
- if (typeof stream.destroy === 'function') return stream.destroy();
- callback(err || new ERR_STREAM_DESTROYED('pipe'));
- };
- }
- function call(fn) {
- fn();
- }
- function pipe(from, to) {
- return from.pipe(to);
- }
- function popCallback(streams) {
- if (!streams.length) return noop;
- if (typeof streams[streams.length - 1] !== 'function') return noop;
- return streams.pop();
- }
- function pipeline() {
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
- streams[_key] = arguments[_key];
- }
- var callback = popCallback(streams);
- if (Array.isArray(streams[0])) streams = streams[0];
- if (streams.length < 2) {
- throw new ERR_MISSING_ARGS('streams');
- }
- var error;
- var destroys = streams.map(function (stream, i) {
- var reading = i < streams.length - 1;
- var writing = i > 0;
- return destroyer(stream, reading, writing, function (err) {
- if (!error) error = err;
- if (err) destroys.forEach(call);
- if (reading) return;
- destroys.forEach(call);
- callback(error);
- });
- });
- return streams.reduce(pipe);
- }
- module.exports = pipeline;
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js ***!
- \*******************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ERR_INVALID_OPT_VALUE = __webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE;
- function highWaterMarkFrom(options, isDuplex, duplexKey) {
- return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
- }
- function getHighWaterMark(state, options, duplexKey, isDuplex) {
- var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
- if (hwm != null) {
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
- var name = isDuplex ? duplexKey : 'highWaterMark';
- throw new ERR_INVALID_OPT_VALUE(name, hwm);
- }
- return Math.floor(hwm);
- } // Default value
- return state.objectMode ? 16 : 16 * 1024;
- }
- module.exports = {
- getHighWaterMark: getHighWaterMark
- };
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
- /*!****************************************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
- \****************************************************************************************************/
- /*! dynamic exports */
- /*! exports [maybe provided (runtime-defined)] [no usage info] */
- /*! runtime requirements: module, __webpack_require__ */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/readable-stream/readable-browser.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/readable-stream/readable-browser.js ***!
- \*********************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_exports__, module, __webpack_require__ */
- /*! CommonJS bailout: exports is used directly at 1:0-7 */
- /*! CommonJS bailout: exports is used directly at 2:17-24 */
- /*! CommonJS bailout: exports is used directly at 3:19-26 */
- /***/ ((module, exports, __webpack_require__) => {
- exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js");
- exports.Stream = exports;
- exports.Readable = exports;
- exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js");
- exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js");
- exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js");
- exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js");
- 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");
- exports.pipeline = __webpack_require__(/*! ./lib/internal/streams/pipeline.js */ "./node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js");
- /***/ }),
- /***/ "./node_modules/hash-base/node_modules/safe-buffer/index.js":
- /*!******************************************************************!*\
- !*** ./node_modules/hash-base/node_modules/safe-buffer/index.js ***!
- \******************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_exports__, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 13:2-16 */
- /*! CommonJS bailout: exports is used directly at 16:20-27 */
- /***/ ((module, exports, __webpack_require__) => {
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
- /* eslint-disable node/no-deprecated-api */
- var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
- var Buffer = buffer.Buffer
- // alternative to using Object.keys for old browsers
- function copyProps (src, dst) {
- for (var key in src) {
- dst[key] = src[key]
- }
- }
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module.exports = buffer
- } else {
- // Copy properties from require('buffer')
- copyProps(buffer, exports)
- exports.Buffer = SafeBuffer
- }
- function SafeBuffer (arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length)
- }
- SafeBuffer.prototype = Object.create(Buffer.prototype)
- // Copy static methods from Buffer
- copyProps(Buffer, SafeBuffer)
- SafeBuffer.from = function (arg, encodingOrOffset, length) {
- if (typeof arg === 'number') {
- throw new TypeError('Argument must not be a number')
- }
- return Buffer(arg, encodingOrOffset, length)
- }
- SafeBuffer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- var buf = Buffer(size)
- if (fill !== undefined) {
- if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- } else {
- buf.fill(0)
- }
- return buf
- }
- SafeBuffer.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return Buffer(size)
- }
- SafeBuffer.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return buffer.SlowBuffer(size)
- }
- /***/ }),
- /***/ "./node_modules/ieee754/index.js":
- /*!***************************************!*\
- !*** ./node_modules/ieee754/index.js ***!
- \***************************************/
- /*! default exports */
- /*! export read [provided] [no usage info] [missing usage info prevents renaming] */
- /*! export write [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_exports__ */
- /***/ ((__unused_webpack_module, exports) => {
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
- i += d
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
- }
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
- value = Math.abs(value)
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
- buffer[offset + i - d] |= s * 128
- }
- /***/ }),
- /***/ "./node_modules/inherits/inherits_browser.js":
- /*!***************************************************!*\
- !*** ./node_modules/inherits/inherits_browser.js ***!
- \***************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 3:2-16 */
- /*! CommonJS bailout: module.exports is used directly at 18:2-16 */
- /***/ ((module) => {
- if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- })
- }
- };
- } else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/md5.js/index.js":
- /*!**************************************!*\
- !*** ./node_modules/md5.js/index.js ***!
- \**************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 146:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")
- var HashBase = __webpack_require__(/*! hash-base */ "./node_modules/hash-base/index.js")
- var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer
- var ARRAY16 = new Array(16)
- function MD5 () {
- HashBase.call(this, 64)
- // state
- this._a = 0x67452301
- this._b = 0xefcdab89
- this._c = 0x98badcfe
- this._d = 0x10325476
- }
- inherits(MD5, HashBase)
- MD5.prototype._update = function () {
- var M = ARRAY16
- for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
- var a = this._a
- var b = this._b
- var c = this._c
- var d = this._d
- a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
- d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
- c = fnF(c, d, a, b, M[2], 0x242070db, 17)
- b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
- a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
- d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
- c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
- b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
- a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
- d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
- c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
- b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
- a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
- d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
- c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
- b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
- a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
- d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
- c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
- b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
- a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
- d = fnG(d, a, b, c, M[10], 0x02441453, 9)
- c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
- b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
- a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
- d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
- c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
- b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
- a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
- d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
- c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
- b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
- a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
- d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
- c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
- b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
- a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
- d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
- c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
- b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
- a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
- d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
- c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
- b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
- a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
- d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
- c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
- b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
- a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
- d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
- c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
- b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
- a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
- d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
- c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
- b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
- a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
- d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
- c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
- b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
- a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
- d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
- c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
- b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
- this._a = (this._a + a) | 0
- this._b = (this._b + b) | 0
- this._c = (this._c + c) | 0
- this._d = (this._d + d) | 0
- }
- MD5.prototype._digest = function () {
- // create padding and handle blocks
- this._block[this._blockOffset++] = 0x80
- if (this._blockOffset > 56) {
- this._block.fill(0, this._blockOffset, 64)
- this._update()
- this._blockOffset = 0
- }
- this._block.fill(0, this._blockOffset, 56)
- this._block.writeUInt32LE(this._length[0], 56)
- this._block.writeUInt32LE(this._length[1], 60)
- this._update()
- // produce result
- var buffer = Buffer.allocUnsafe(16)
- buffer.writeInt32LE(this._a, 0)
- buffer.writeInt32LE(this._b, 4)
- buffer.writeInt32LE(this._c, 8)
- buffer.writeInt32LE(this._d, 12)
- return buffer
- }
- function rotl (x, n) {
- return (x << n) | (x >>> (32 - n))
- }
- function fnF (a, b, c, d, m, k, s) {
- return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
- }
- function fnG (a, b, c, d, m, k, s) {
- return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
- }
- function fnH (a, b, c, d, m, k, s) {
- return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
- }
- function fnI (a, b, c, d, m, k, s) {
- return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
- }
- module.exports = MD5
- /***/ }),
- /***/ "./node_modules/ms/index.js":
- /*!**********************************!*\
- !*** ./node_modules/ms/index.js ***!
- \**********************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
- /***/ ((module) => {
- /**
- * Helpers.
- */
- var s = 1000;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var w = d * 7;
- var y = d * 365.25;
- /**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
- module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
- };
- /**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- 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(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
- }
- /**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
- function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
- }
- /**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
- function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
- }
- return ms + ' ms';
- }
- /**
- * Pluralization helper.
- */
- function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
- }
- /***/ }),
- /***/ "./node_modules/process/browser.js":
- /*!*****************************************!*\
- !*** ./node_modules/process/browser.js ***!
- \*****************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 2:14-28 */
- /***/ ((module) => {
- // shim for using process in browser
- var process = module.exports = {};
- // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
- var cachedSetTimeout;
- var cachedClearTimeout;
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- } ())
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // 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
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // 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.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
- function noop() {}
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function (name) { return [] }
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
- /***/ }),
- /***/ "./node_modules/safe-buffer/index.js":
- /*!*******************************************!*\
- !*** ./node_modules/safe-buffer/index.js ***!
- \*******************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_exports__, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 12:2-16 */
- /*! CommonJS bailout: exports is used directly at 15:20-27 */
- /***/ ((module, exports, __webpack_require__) => {
- /* eslint-disable node/no-deprecated-api */
- var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
- var Buffer = buffer.Buffer
- // alternative to using Object.keys for old browsers
- function copyProps (src, dst) {
- for (var key in src) {
- dst[key] = src[key]
- }
- }
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module.exports = buffer
- } else {
- // Copy properties from require('buffer')
- copyProps(buffer, exports)
- exports.Buffer = SafeBuffer
- }
- function SafeBuffer (arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length)
- }
- // Copy static methods from Buffer
- copyProps(Buffer, SafeBuffer)
- SafeBuffer.from = function (arg, encodingOrOffset, length) {
- if (typeof arg === 'number') {
- throw new TypeError('Argument must not be a number')
- }
- return Buffer(arg, encodingOrOffset, length)
- }
- SafeBuffer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- var buf = Buffer(size)
- if (fill !== undefined) {
- if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- } else {
- buf.fill(0)
- }
- return buf
- }
- SafeBuffer.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return Buffer(size)
- }
- SafeBuffer.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return buffer.SlowBuffer(size)
- }
- /***/ }),
- /***/ "./node_modules/stream-browserify/index.js":
- /*!*************************************************!*\
- !*** ./node_modules/stream-browserify/index.js ***!
- \*************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 22:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- module.exports = Stream;
- var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
- var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");
- inherits(Stream, EE);
- Stream.Readable = __webpack_require__(/*! readable-stream/lib/_stream_readable.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js");
- Stream.Writable = __webpack_require__(/*! readable-stream/lib/_stream_writable.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js");
- Stream.Duplex = __webpack_require__(/*! readable-stream/lib/_stream_duplex.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
- Stream.Transform = __webpack_require__(/*! readable-stream/lib/_stream_transform.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js");
- Stream.PassThrough = __webpack_require__(/*! readable-stream/lib/_stream_passthrough.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js");
- 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")
- Stream.pipeline = __webpack_require__(/*! readable-stream/lib/internal/streams/pipeline.js */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js")
- // Backwards-compat with node 0.4.x
- Stream.Stream = Stream;
- // old-style streams. Note that the pipe method (the only relevant
- // part of this class) is overridden in the Readable class.
- function Stream() {
- EE.call(this);
- }
- Stream.prototype.pipe = function(dest, options) {
- var source = this;
- function ondata(chunk) {
- if (dest.writable) {
- if (false === dest.write(chunk) && source.pause) {
- source.pause();
- }
- }
- }
- source.on('data', ondata);
- function ondrain() {
- if (source.readable && source.resume) {
- source.resume();
- }
- }
- dest.on('drain', ondrain);
- // If the 'end' option is not supplied, dest.end() will be called when
- // source gets the 'end' or 'close' events. Only dest.end() once.
- if (!dest._isStdio && (!options || options.end !== false)) {
- source.on('end', onend);
- source.on('close', onclose);
- }
- var didOnEnd = false;
- function onend() {
- if (didOnEnd) return;
- didOnEnd = true;
- dest.end();
- }
- function onclose() {
- if (didOnEnd) return;
- didOnEnd = true;
- if (typeof dest.destroy === 'function') dest.destroy();
- }
- // don't leave dangling pipes when there are errors.
- function onerror(er) {
- cleanup();
- if (EE.listenerCount(this, 'error') === 0) {
- throw er; // Unhandled stream error in pipe.
- }
- }
- source.on('error', onerror);
- dest.on('error', onerror);
- // remove all the event listeners that were added.
- function cleanup() {
- source.removeListener('data', ondata);
- dest.removeListener('drain', ondrain);
- source.removeListener('end', onend);
- source.removeListener('close', onclose);
- source.removeListener('error', onerror);
- dest.removeListener('error', onerror);
- source.removeListener('end', cleanup);
- source.removeListener('close', cleanup);
- dest.removeListener('close', cleanup);
- }
- source.on('end', cleanup);
- source.on('close', cleanup);
- dest.on('close', cleanup);
- dest.emit('pipe', source);
- // Allow for unix-like usage: A.pipe(B).pipe(C)
- return dest;
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js ***!
- \***************************************************************************************/
- /*! default exports */
- /*! export codes [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: module */
- /***/ ((module) => {
- "use strict";
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var codes = {};
- function createErrorType(code, message, Base) {
- if (!Base) {
- Base = Error;
- }
- function getMessage(arg1, arg2, arg3) {
- if (typeof message === 'string') {
- return message;
- } else {
- return message(arg1, arg2, arg3);
- }
- }
- var NodeError =
- /*#__PURE__*/
- function (_Base) {
- _inheritsLoose(NodeError, _Base);
- function NodeError(arg1, arg2, arg3) {
- return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
- }
- return NodeError;
- }(Base);
- NodeError.prototype.name = Base.name;
- NodeError.prototype.code = code;
- codes[code] = NodeError;
- } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
- function oneOf(expected, thing) {
- if (Array.isArray(expected)) {
- var len = expected.length;
- expected = expected.map(function (i) {
- return String(i);
- });
- if (len > 2) {
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
- } else if (len === 2) {
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
- } else {
- return "of ".concat(thing, " ").concat(expected[0]);
- }
- } else {
- return "of ".concat(thing, " ").concat(String(expected));
- }
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
- function startsWith(str, search, pos) {
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
- function endsWith(str, search, this_len) {
- if (this_len === undefined || this_len > str.length) {
- this_len = str.length;
- }
- return str.substring(this_len - search.length, this_len) === search;
- } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
- function includes(str, search, start) {
- if (typeof start !== 'number') {
- start = 0;
- }
- if (start + search.length > str.length) {
- return false;
- } else {
- return str.indexOf(search, start) !== -1;
- }
- }
- createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
- return 'The value "' + value + '" is invalid for option "' + name + '"';
- }, TypeError);
- createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
- // determiner: 'must be' or 'must not be'
- var determiner;
- if (typeof expected === 'string' && startsWith(expected, 'not ')) {
- determiner = 'must not be';
- expected = expected.replace(/^not /, '');
- } else {
- determiner = 'must be';
- }
- var msg;
- if (endsWith(name, ' argument')) {
- // For cases like 'first argument'
- msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- } else {
- var type = includes(name, '.') ? 'property' : 'argument';
- msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- }
- msg += ". Received type ".concat(typeof actual);
- return msg;
- }, TypeError);
- createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
- createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
- return 'The ' + name + ' method is not implemented';
- });
- createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
- createErrorType('ERR_STREAM_DESTROYED', function (name) {
- return 'Cannot call ' + name + ' after a stream was destroyed';
- });
- createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
- createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
- createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
- createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
- createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
- return 'Unknown encoding: ' + arg;
- }, TypeError);
- createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
- module.exports.codes = codes;
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js ***!
- \*******************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 40:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a duplex stream is just a stream that is both readable and writable.
- // Since JS doesn't have multiple prototypal inheritance, this class
- // prototypally inherits from Readable, and then parasitically from
- // Writable.
- /*<replacement>*/
- var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- keys.push(key);
- }
- return keys;
- };
- /*</replacement>*/
- module.exports = Duplex;
- var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js");
- var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable);
- {
- // Allow the keys array to be GC'ed.
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
- }
- }
- function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
- this.allowHalfOpen = true;
- if (options) {
- if (options.readable === false) this.readable = false;
- if (options.writable === false) this.writable = false;
- if (options.allowHalfOpen === false) {
- this.allowHalfOpen = false;
- this.once('end', onend);
- }
- }
- }
- Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- });
- Object.defineProperty(Duplex.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- Object.defineProperty(Duplex.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- }); // the no-half-open enforcer
- function onend() {
- // If the writable side ended, then we're ok.
- if (this._writableState.ended) return; // no more data can be written.
- // But allow more writes to happen in this tick.
- process.nextTick(onEndNT, this);
- }
- function onEndNT(self) {
- self.end();
- }
- Object.defineProperty(Duplex.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined || this._writableState === undefined) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (this._readableState === undefined || this._writableState === undefined) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
- });
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js":
- /*!************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js ***!
- \************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a passthrough stream.
- // basically just the most minimal sort of Transform stream.
- // Every written chunk gets output as-is.
- module.exports = PassThrough;
- var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform);
- function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
- Transform.call(this, options);
- }
- PassThrough.prototype._transform = function (chunk, encoding, cb) {
- cb(null, chunk);
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js ***!
- \*********************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 23:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- module.exports = Readable;
- /*<replacement>*/
- var Duplex;
- /*</replacement>*/
- Readable.ReadableState = ReadableState;
- /*<replacement>*/
- var EE = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
- var EElistenerCount = function EElistenerCount(emitter, type) {
- return emitter.listeners(type).length;
- };
- /*</replacement>*/
- /*<replacement>*/
- var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
- /*</replacement>*/
- var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
- var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- /*<replacement>*/
- var debugUtil = __webpack_require__(/*! util */ "?0bed");
- var debug;
- if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
- } else {
- debug = function debug() {};
- }
- /*</replacement>*/
- var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js");
- var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js");
- var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"),
- getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.
- var StringDecoder;
- var createReadableStreamAsyncIterator;
- var from;
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream);
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
- function prependListener(emitter, event, fn) {
- // Sadly this is not cacheable as some libraries bundle their own
- // event emitter implementation with them.
- 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
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- 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]];
- }
- function ReadableState(options, stream, isDuplex) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
- options = options || {}; // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted
- // immediately, or on a later tick. We set this to true at first, because
- // any actions that shouldn't happen until "later" should generally also
- // not happen before the first read call.
- this.sync = true; // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
- this.paused = true; // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')
- this.autoDestroy = !!options.autoDestroy; // has it been destroyed
- this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
- }
- function Readable(options) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
- if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
- // the ReadableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- this._readableState = new ReadableState(options, this, isDuplex); // legacy
- this.readable = true;
- if (options) {
- if (typeof options.read === 'function') this._read = options.read;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- }
- Stream.call(this);
- }
- Object.defineProperty(Readable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._readableState) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- }
- });
- Readable.prototype.destroy = destroyImpl.destroy;
- Readable.prototype._undestroy = destroyImpl.undestroy;
- Readable.prototype._destroy = function (err, cb) {
- cb(err);
- }; // Manually shove something into the read() buffer.
- // This returns true if the highWaterMark has not been hit yet,
- // similar to how Writable.write() returns true if you should
- // write() some more.
- Readable.prototype.push = function (chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
- if (!state.objectMode) {
- if (typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = '';
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
- }; // Unshift should *always* be something directly out of read()
- Readable.prototype.unshift = function (chunk) {
- return readableAddChunk(this, chunk, null, true, false);
- };
- function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- debug('readableAddChunk', chunk);
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
- if (er) {
- errorOrDestroy(stream, er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (addToFront) {
- if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
- } else if (state.destroyed) {
- return false;
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- maybeReadMore(stream, state);
- }
- } // We can push more data if we are below the highWaterMark.
- // Also, if we have no data yet, we can stand some more bytes.
- // This is to work around cases where hwm=0, such as the repl.
- return !state.ended && (state.length < state.highWaterMark || state.length === 0);
- }
- function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- state.awaitDrain = 0;
- stream.emit('data', chunk);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
- if (state.needReadable) emitReadable(stream);
- }
- maybeReadMore(stream, state);
- }
- function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
- }
- return er;
- }
- Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
- }; // backwards compatibility.
- Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
- var decoder = new StringDecoder(enc);
- this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
- this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:
- var p = this._readableState.buffer.head;
- var content = '';
- while (p !== null) {
- content += decoder.write(p.data);
- p = p.next;
- }
- this._readableState.buffer.clear();
- if (content !== '') this._readableState.buffer.push(content);
- this._readableState.length = content.length;
- return this;
- }; // Don't raise the hwm > 1GB
- var MAX_HWM = 0x40000000;
- function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
- } // This function is designed to be inlinable, so please take care when making
- // changes to the function body.
- function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- } // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n; // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
- } // you can override either this method, or the async _read(n) below.
- Readable.prototype.read = function (n) {
- debug('read', n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
- if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
- return null;
- }
- n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
- return null;
- } // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
- debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- } // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading) {
- doRead = false;
- debug('reading or ended', doRead);
- } else if (doRead) {
- debug('do read');
- state.reading = true;
- state.sync = true; // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true; // call internal read method
- this._read(state.highWaterMark);
- state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
- }
- var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
- if (ret === null) {
- state.needReadable = state.length <= state.highWaterMark;
- n = 0;
- } else {
- state.length -= n;
- state.awaitDrain = 0;
- }
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
- if (ret !== null) this.emit('data', ret);
- return ret;
- };
- function onEofChunk(stream, state) {
- debug('onEofChunk');
- if (state.ended) return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
- if (state.sync) {
- // if we are sync, wait until next tick to emit the data.
- // Otherwise we risk emitting data in the flow()
- // the readable code triggers during a read() call
- emitReadable(stream);
- } else {
- // emit 'readable' now to make sure it gets picked up.
- state.needReadable = false;
- if (!state.emittedReadable) {
- state.emittedReadable = true;
- emitReadable_(stream);
- }
- }
- } // Don't emit readable right away in sync mode, because this can trigger
- // another read() call => stack overflow. This way, it might trigger
- // a nextTick recursion warning, but that's not so bad.
- function emitReadable(stream) {
- var state = stream._readableState;
- debug('emitReadable', state.needReadable, state.emittedReadable);
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- process.nextTick(emitReadable_, stream);
- }
- }
- function emitReadable_(stream) {
- var state = stream._readableState;
- debug('emitReadable_', state.destroyed, state.length, state.ended);
- if (!state.destroyed && (state.length || state.ended)) {
- stream.emit('readable');
- state.emittedReadable = false;
- } // The stream needs another readable event if
- // 1. It is not flowing, as the flow mechanism will take
- // care of it.
- // 2. It is not ended.
- // 3. It is below the highWaterMark, so we can schedule
- // another readable later.
- state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
- flow(stream);
- } // at this point, the user has presumably seen the 'readable' event,
- // and called read() to consume some data. that may have triggered
- // in turn another _read(n) call, in which case reading = true if
- // it's in progress.
- // However, if we're not ended, or reading, and the length < hwm,
- // then go ahead and try to read some more preemptively.
- function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- process.nextTick(maybeReadMore_, stream, state);
- }
- }
- function maybeReadMore_(stream, state) {
- // Attempt to read more data if we should.
- //
- // The conditions for reading more data are (one of):
- // - Not enough data buffered (state.length < state.highWaterMark). The loop
- // is responsible for filling the buffer with enough data if such data
- // is available. If highWaterMark is 0 and we are not in the flowing mode
- // we should _not_ attempt to buffer any extra data. We'll get more data
- // when the stream consumer calls read() instead.
- // - No data in the buffer, and the stream is in flowing mode. In this mode
- // the loop below is responsible for ensuring read() is called. Failing to
- // call read here would abort the flow and there's no other mechanism for
- // continuing the flow if the stream consumer has just subscribed to the
- // 'data' event.
- //
- // In addition to the above conditions to keep reading data, the following
- // conditions prevent the data from being read:
- // - The stream has ended (state.ended).
- // - There is already a pending 'read' operation (state.reading). This is a
- // case where the the stream has called the implementation defined _read()
- // method, but they are processing the call asynchronously and have _not_
- // called push() with new data. In this case we skip performing more
- // read()s. The execution ends in this method again after the _read() ends
- // up calling push() with more data.
- while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
- var len = state.length;
- debug('maybeReadMore read 0');
- stream.read(0);
- if (len === state.length) // didn't get any data, stop spinning.
- break;
- }
- state.readingMore = false;
- } // abstract method. to be overridden in specific implementation classes.
- // call cb(er, data) where data is <= n in length.
- // for virtual (non-string, non-buffer) streams, "length" is somewhat
- // arbitrary, and perhaps not very meaningful.
- Readable.prototype._read = function (n) {
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
- };
- Readable.prototype.pipe = function (dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
- dest.on('unpipe', onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug('onunpipe');
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
- function onend() {
- debug('onend');
- dest.end();
- } // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
- var cleanedUp = false;
- function cleanup() {
- debug('cleanup'); // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', unpipe);
- src.removeListener('data', ondata);
- cleanedUp = true; // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
- }
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- var ret = dest.write(chunk);
- debug('dest.write', ret);
- if (ret === false) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', state.awaitDrain);
- state.awaitDrain++;
- }
- src.pause();
- }
- } // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
- } // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
- function unpipe() {
- debug('unpipe');
- src.unpipe(dest);
- } // tell the dest that it's being piped to
- dest.emit('pipe', src); // start the flow if it hasn't been started already.
- if (!state.flowing) {
- debug('pipe resume');
- src.resume();
- }
- return dest;
- };
- function pipeOnDrain(src) {
- return function pipeOnDrainFunctionResult() {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
- }
- Readable.prototype.unpipe = function (dest) {
- var state = this._readableState;
- var unpipeInfo = {
- hasUnpiped: false
- }; // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this; // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
- if (!dest) dest = state.pipes; // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest) dest.emit('unpipe', this, unpipeInfo);
- return this;
- } // slow case. multiple pipe destinations.
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- for (var i = 0; i < len; i++) {
- dests[i].emit('unpipe', this, {
- hasUnpiped: false
- });
- }
- return this;
- } // try to find the right one.
- var index = indexOf(state.pipes, dest);
- if (index === -1) return this;
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
- dest.emit('unpipe', this, unpipeInfo);
- return this;
- }; // set up data events if they are asked for
- // Ensure readable listeners eventually get something
- Readable.prototype.on = function (ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
- var state = this._readableState;
- if (ev === 'data') {
- // update readableListening so that resume() may be a no-op
- // a few lines down. This is needed to support once('readable').
- state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused
- if (state.flowing !== false) this.resume();
- } else if (ev === 'readable') {
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.flowing = false;
- state.emittedReadable = false;
- debug('on readable', state.length, state.reading);
- if (state.length) {
- emitReadable(this);
- } else if (!state.reading) {
- process.nextTick(nReadingNextTick, this);
- }
- }
- }
- return res;
- };
- Readable.prototype.addListener = Readable.prototype.on;
- Readable.prototype.removeListener = function (ev, fn) {
- var res = Stream.prototype.removeListener.call(this, ev, fn);
- if (ev === 'readable') {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- Readable.prototype.removeAllListeners = function (ev) {
- var res = Stream.prototype.removeAllListeners.apply(this, arguments);
- if (ev === 'readable' || ev === undefined) {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
- };
- function updateReadableListening(self) {
- var state = self._readableState;
- state.readableListening = self.listenerCount('readable') > 0;
- if (state.resumeScheduled && !state.paused) {
- // flowing needs to be set to true now, otherwise
- // the upcoming resume will not flow.
- state.flowing = true; // crude way to check if we should resume
- } else if (self.listenerCount('data') > 0) {
- self.resume();
- }
- }
- function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
- } // pause() and resume() are remnants of the legacy readable stream API
- // If the user uses them, then switch into old mode.
- Readable.prototype.resume = function () {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume'); // we flow only if there is no one listening
- // for readable, but we still have to call
- // resume()
- state.flowing = !state.readableListening;
- resume(this, state);
- }
- state.paused = false;
- return this;
- };
- function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- process.nextTick(resume_, stream, state);
- }
- }
- function resume_(stream, state) {
- debug('resume', state.reading);
- if (!state.reading) {
- stream.read(0);
- }
- state.resumeScheduled = false;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
- }
- Readable.prototype.pause = function () {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (this._readableState.flowing !== false) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- this._readableState.paused = true;
- return this;
- };
- function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null) {
- ;
- }
- } // wrap an old-style stream as the async data source.
- // This is *not* part of the readable stream interface.
- // It is an ugly unfortunate mess of history.
- Readable.prototype.wrap = function (stream) {
- var _this = this;
- var state = this._readableState;
- var paused = false;
- stream.on('end', function () {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) _this.push(chunk);
- }
- _this.push(null);
- });
- stream.on('data', function (chunk) {
- debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- }); // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function methodWrap(method) {
- return function methodWrapReturnFunction() {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- } // proxy certain important events.
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- } // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- this._read = function (n) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
- return this;
- };
- if (typeof Symbol === 'function') {
- Readable.prototype[Symbol.asyncIterator] = function () {
- if (createReadableStreamAsyncIterator === undefined) {
- createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js");
- }
- return createReadableStreamAsyncIterator(this);
- };
- }
- Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.highWaterMark;
- }
- });
- Object.defineProperty(Readable.prototype, 'readableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState && this._readableState.buffer;
- }
- });
- Object.defineProperty(Readable.prototype, 'readableFlowing', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.flowing;
- },
- set: function set(state) {
- if (this._readableState) {
- this._readableState.flowing = state;
- }
- }
- }); // exposed for testing purposes only.
- Readable._fromList = fromList;
- Object.defineProperty(Readable.prototype, 'readableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.length;
- }
- }); // Pluck off n bytes from an array of buffers.
- // Length is the combined lengths of all the buffers in the list.
- // This function is designed to be inlinable, so please take care when making
- // changes to the function body.
- function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
- var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = state.buffer.consume(n, state.decoder);
- }
- return ret;
- }
- function endReadable(stream) {
- var state = stream._readableState;
- debug('endReadable', state.endEmitted);
- if (!state.endEmitted) {
- state.ended = true;
- process.nextTick(endReadableNT, state, stream);
- }
- }
- function endReadableNT(state, stream) {
- debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the writable side is ready for autoDestroy as well
- var wState = stream._writableState;
- if (!wState || wState.autoDestroy && wState.finished) {
- stream.destroy();
- }
- }
- }
- }
- if (typeof Symbol === 'function') {
- Readable.from = function (iterable, opts) {
- if (from === undefined) {
- from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js");
- }
- return from(Readable, iterable, opts);
- };
- }
- function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
- }
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js":
- /*!**********************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js ***!
- \**********************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 64:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // a transform stream is a readable/writable stream where you do
- // something with the data. Sometimes it's called a "filter",
- // but that's not a great name for it, since that implies a thing where
- // some bits pass through, and others are simply ignored. (That would
- // be a valid example of a transform, of course.)
- //
- // While the output is causally related to the input, it's not a
- // necessarily symmetric or synchronous transformation. For example,
- // a zlib stream might take multiple plain-text writes(), and then
- // emit a single compressed chunk some time in the future.
- //
- // Here's how this works:
- //
- // The Transform stream has all the aspects of the readable and writable
- // stream classes. When you write(chunk), that calls _write(chunk,cb)
- // internally, and returns false if there's a lot of pending writes
- // buffered up. When you call read(), that calls _read(n) until
- // there's enough pending readable data buffered up.
- //
- // In a transform stream, the written data is placed in a buffer. When
- // _read(n) is called, it transforms the queued up data, calling the
- // buffered _write cb's as it consumes chunks. If consuming a single
- // written chunk would result in multiple output chunks, then the first
- // outputted bit calls the readcb, and subsequent chunks just go into
- // the read buffer, and will cause it to emit 'readable' if necessary.
- //
- // This way, back-pressure is actually determined by the reading side,
- // since _read has to be called to start processing a new chunk. However,
- // a pathological inflate type of transform can cause excessive buffering
- // here. For example, imagine a stream where every byte of input is
- // interpreted as an integer from 0-255, and then results in that many
- // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
- // 1kb of data being output. In this case, you could write a very small
- // amount of input, and end up with a very large amount of output. In
- // such a pathological inflating mechanism, there'd be no way to tell
- // the system to stop doing the transform. A single 4MB write could
- // cause the system to run out of memory.
- //
- // However, even in such a pathological case, only a single written chunk
- // would be consumed, and then the rest would wait (un-transformed) until
- // the results of the previous transformed chunk were consumed.
- module.exports = Transform;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
- ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
- var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex);
- function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
- var cb = ts.writecb;
- if (cb === null) {
- return this.emit('error', new ERR_MULTIPLE_CALLBACK());
- }
- ts.writechunk = null;
- ts.writecb = null;
- if (data != null) // single equals check for both `null` and `undefined`
- this.push(data);
- cb(er);
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
- }
- function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
- Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- }; // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
- if (typeof options.flush === 'function') this._flush = options.flush;
- } // When the writable side finishes, then flush out anything remaining.
- this.on('prefinish', prefinish);
- }
- function prefinish() {
- var _this = this;
- if (typeof this._flush === 'function' && !this._readableState.destroyed) {
- this._flush(function (er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
- }
- Transform.prototype.push = function (chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
- }; // This is the part where you do stuff!
- // override this function in implementation classes.
- // 'chunk' is an input chunk.
- //
- // Call `push(newChunk)` to pass along transformed output
- // to the readable side. You may call 'push' zero or more times.
- //
- // Call `cb(err)` when you are done with this chunk. If you pass
- // an error, then that'll put the hurt on the whole operation. If you
- // never call cb(), then you'll never get another chunk.
- Transform.prototype._transform = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
- };
- Transform.prototype._write = function (chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
- }
- }; // Doesn't matter what the args are here.
- // _transform does all the work.
- // That we got here means that the readable side wants more data.
- Transform.prototype._read = function (n) {
- var ts = this._transformState;
- if (ts.writechunk !== null && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
- };
- Transform.prototype._destroy = function (err, cb) {
- Duplex.prototype._destroy.call(this, err, function (err2) {
- cb(err2);
- });
- };
- function done(stream, er, data) {
- if (er) return stream.emit('error', er);
- if (data != null) // single equals check for both `null` and `undefined`
- stream.push(data); // TODO(BridgeAR): Write a test for these two error cases
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
- if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
- return stream.push(null);
- }
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js ***!
- \*********************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 26:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- // A bit simpler than readable streams.
- // Implement an async ._write(chunk, encoding, cb), and it'll handle all
- // the drain event emission and buffering.
- module.exports = Writable;
- /* <replacement> */
- function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
- } // It seems a linked list but it is not
- // there will be only 2 of these for each stream
- function CorkedRequest(state) {
- var _this = this;
- this.next = null;
- this.entry = null;
- this.finish = function () {
- onCorkedFinish(_this, state);
- };
- }
- /* </replacement> */
- /*<replacement>*/
- var Duplex;
- /*</replacement>*/
- Writable.WritableState = WritableState;
- /*<replacement>*/
- var internalUtil = {
- deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js")
- };
- /*</replacement>*/
- /*<replacement>*/
- var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js");
- /*</replacement>*/
- var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer;
- var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
- function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
- }
- function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
- }
- var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js");
- var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"),
- getHighWaterMark = _require.getHighWaterMark;
- var _require$codes = __webpack_require__(/*! ../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
- ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
- ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
- ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
- var errorOrDestroy = destroyImpl.errorOrDestroy;
- __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream);
- function nop() {}
- function WritableState(options, stream, isDuplex) {
- Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js");
- options = options || {}; // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream,
- // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called
- this.finalCalled = false; // drain event flag.
- this.needDrain = false; // at the start of calling end()
- this.ending = false; // when end() has been called, and returned
- this.ended = false; // when 'finish' is emitted
- this.finished = false; // has it been destroyed
- this.destroyed = false; // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0; // a flag to see when we're in the middle of a write.
- this.writing = false; // when true all writes will be buffered until .uncork() call
- this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true; // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
- onwrite(stream, er);
- }; // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null; // the amount that is being written when _write is called.
- this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false; // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')
- this.autoDestroy = !!options.autoDestroy; // count buffered requests
- this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
- }
- WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
- };
- (function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function writableStateBufferGetter() {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
- });
- } catch (_) {}
- })(); // Test _writableState for inheritance to account for Duplex streams,
- // whose prototype chain only points to Readable.
- var realHasInstance;
- if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function value(object) {
- if (realHasInstance.call(this, object)) return true;
- if (this !== Writable) return false;
- return object && object._writableState instanceof WritableState;
- }
- });
- } else {
- realHasInstance = function realHasInstance(object) {
- return object instanceof this;
- };
- }
- function Writable(options) {
- 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.
- // `realHasInstance` is necessary because using plain `instanceof`
- // would return false, as no `_writableState` property is attached.
- // Trying to use the custom `instanceof` for Writable here will also break the
- // Node.js LazyTransform implementation, which has a non-trivial getter for
- // `_writableState` that would lead to infinite recursion.
- // Checking for a Stream.Duplex instance is faster here instead of inside
- // the WritableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
- this._writableState = new WritableState(options, this, isDuplex); // legacy.
- this.writable = true;
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
- if (typeof options.writev === 'function') this._writev = options.writev;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- if (typeof options.final === 'function') this._final = options.final;
- }
- Stream.call(this);
- } // Otherwise people can pipe Writable streams, which is just wrong.
- Writable.prototype.pipe = function () {
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
- };
- function writeAfterEnd(stream, cb) {
- var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- } // Checks that a user-supplied chunk is valid, especially for the particular
- // mode the stream is in. Currently this means that `null` is never accepted
- // and undefined/non-string values are only allowed in object mode.
- function validChunk(stream, state, chunk, cb) {
- var er;
- if (chunk === null) {
- er = new ERR_STREAM_NULL_VALUES();
- } else if (typeof chunk !== 'string' && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
- }
- if (er) {
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- return false;
- }
- return true;
- }
- Writable.prototype.write = function (chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
- if (typeof cb !== 'function') cb = nop;
- if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
- }
- return ret;
- };
- Writable.prototype.cork = function () {
- this._writableState.corked++;
- };
- Writable.prototype.uncork = function () {
- var state = this._writableState;
- if (state.corked) {
- state.corked--;
- if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
- }
- };
- Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- 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);
- this._writableState.defaultEncoding = encoding;
- return this;
- };
- Object.defineProperty(Writable.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
- });
- function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
- }
- Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
- }); // if we're already writing something, then just put this
- // in the queue, and wait our turn. Otherwise, call _write
- // If we return false, then we need a drain event, so set that flag.
- function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = 'buffer';
- chunk = newChunk;
- }
- }
- var len = state.objectMode ? 1 : chunk.length;
- state.length += len;
- var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk: chunk,
- encoding: encoding,
- isBuf: isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
- return ret;
- }
- function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- 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);
- state.sync = false;
- }
- function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) {
- // defer the callback if we are being called synchronously
- // to avoid piling up things on the stack
- process.nextTick(cb, er); // this can emit finish, and it will always happen
- // after error
- process.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- } else {
- // the caller expect this to happen before if
- // it is async
- cb(er);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er); // this can emit finish, but finish must
- // always follow error
- finishMaybe(stream, state);
- }
- }
- function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
- }
- function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
- if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
- onwriteStateUpdate(state);
- if (er) onwriteError(stream, state, sync, er, cb);else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state) || stream.destroyed;
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
- if (sync) {
- process.nextTick(afterWrite, stream, state, finished, cb);
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
- }
- function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
- } // Must force callback to be called on nextTick, so that we don't
- // emit 'drain' before the write() consumer gets the 'false' return
- // value, and has a chance to attach a 'drain' listener.
- function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
- } // if there's something in the buffer waiting, then process it
- function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
- // Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf) allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
- doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- // Slow case, write chunks one-by-one
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- break;
- }
- }
- if (entry === null) state.lastBufferedRequest = null;
- }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
- }
- Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
- };
- Writable.prototype._writev = null;
- Writable.prototype.end = function (chunk, encoding, cb) {
- var state = this._writableState;
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- } // ignore unnecessary end() calls.
- if (!state.ending) endWritable(this, state, cb);
- return this;
- };
- Object.defineProperty(Writable.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
- });
- function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
- }
- function callFinal(stream, state) {
- stream._final(function (err) {
- state.pendingcb--;
- if (err) {
- errorOrDestroy(stream, err);
- }
- state.prefinished = true;
- stream.emit('prefinish');
- finishMaybe(stream, state);
- });
- }
- function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === 'function' && !state.destroyed) {
- state.pendingcb++;
- state.finalCalled = true;
- process.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit('prefinish');
- }
- }
- }
- function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit('finish');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the readable side is ready for autoDestroy as well
- var rState = stream._readableState;
- if (!rState || rState.autoDestroy && rState.endEmitted) {
- stream.destroy();
- }
- }
- }
- }
- return need;
- }
- function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
- }
- state.ended = true;
- stream.writable = false;
- }
- function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- } // reuse the free corkReq.
- state.corkedRequestsFree.next = corkReq;
- }
- Object.defineProperty(Writable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._writableState === undefined) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._writableState) {
- return;
- } // backward compatibility, the user is explicitly
- // managing destroyed
- this._writableState.destroyed = value;
- }
- });
- Writable.prototype.destroy = destroyImpl.destroy;
- Writable.prototype._undestroy = destroyImpl.undestroy;
- Writable.prototype._destroy = function (err, cb) {
- cb(err);
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js":
- /*!************************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js ***!
- \************************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 207:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- var _Object$setPrototypeO;
- 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; }
- var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
- var kLastResolve = Symbol('lastResolve');
- var kLastReject = Symbol('lastReject');
- var kError = Symbol('error');
- var kEnded = Symbol('ended');
- var kLastPromise = Symbol('lastPromise');
- var kHandlePromise = Symbol('handlePromise');
- var kStream = Symbol('stream');
- function createIterResult(value, done) {
- return {
- value: value,
- done: done
- };
- }
- function readAndResolve(iter) {
- var resolve = iter[kLastResolve];
- if (resolve !== null) {
- var data = iter[kStream].read(); // we defer if data is null
- // we can be expecting either 'end' or
- // 'error'
- if (data !== null) {
- iter[kLastPromise] = null;
- iter[kLastResolve] = null;
- iter[kLastReject] = null;
- resolve(createIterResult(data, false));
- }
- }
- }
- function onReadable(iter) {
- // we wait for the next tick, because it might
- // emit an error with process.nextTick
- process.nextTick(readAndResolve, iter);
- }
- function wrapForNext(lastPromise, iter) {
- return function (resolve, reject) {
- lastPromise.then(function () {
- if (iter[kEnded]) {
- resolve(createIterResult(undefined, true));
- return;
- }
- iter[kHandlePromise](resolve, reject);
- }, reject);
- };
- }
- var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
- var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
- get stream() {
- return this[kStream];
- },
- next: function next() {
- var _this = this;
- // if we have detected an error in the meanwhile
- // reject straight away
- var error = this[kError];
- if (error !== null) {
- return Promise.reject(error);
- }
- if (this[kEnded]) {
- return Promise.resolve(createIterResult(undefined, true));
- }
- if (this[kStream].destroyed) {
- // We need to defer via nextTick because if .destroy(err) is
- // called, the error will be emitted via nextTick, and
- // we cannot guarantee that there is no error lingering around
- // waiting to be emitted.
- return new Promise(function (resolve, reject) {
- process.nextTick(function () {
- if (_this[kError]) {
- reject(_this[kError]);
- } else {
- resolve(createIterResult(undefined, true));
- }
- });
- });
- } // if we have multiple next() calls
- // we will wait for the previous Promise to finish
- // this logic is optimized to support for await loops,
- // where next() is only called once at a time
- var lastPromise = this[kLastPromise];
- var promise;
- if (lastPromise) {
- promise = new Promise(wrapForNext(lastPromise, this));
- } else {
- // fast path needed to support multiple this.push()
- // without triggering the next() queue
- var data = this[kStream].read();
- if (data !== null) {
- return Promise.resolve(createIterResult(data, false));
- }
- promise = new Promise(this[kHandlePromise]);
- }
- this[kLastPromise] = promise;
- return promise;
- }
- }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
- return this;
- }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
- var _this2 = this;
- // destroy(err, cb) is a private API
- // we can guarantee we have that here, because we control the
- // Readable class this is attached to
- return new Promise(function (resolve, reject) {
- _this2[kStream].destroy(null, function (err) {
- if (err) {
- reject(err);
- return;
- }
- resolve(createIterResult(undefined, true));
- });
- });
- }), _Object$setPrototypeO), AsyncIteratorPrototype);
- var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
- var _Object$create;
- var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
- value: stream,
- writable: true
- }), _defineProperty(_Object$create, kLastResolve, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kLastReject, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kError, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kEnded, {
- value: stream._readableState.endEmitted,
- writable: true
- }), _defineProperty(_Object$create, kHandlePromise, {
- value: function value(resolve, reject) {
- var data = iterator[kStream].read();
- if (data) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(data, false));
- } else {
- iterator[kLastResolve] = resolve;
- iterator[kLastReject] = reject;
- }
- },
- writable: true
- }), _Object$create));
- iterator[kLastPromise] = null;
- finished(stream, function (err) {
- if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
- var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise
- // returned by next() and store the error
- if (reject !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- reject(err);
- }
- iterator[kError] = err;
- return;
- }
- var resolve = iterator[kLastResolve];
- if (resolve !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(undefined, true));
- }
- iterator[kEnded] = true;
- });
- stream.on('readable', onReadable.bind(null, iterator));
- return iterator;
- };
- module.exports = createReadableStreamAsyncIterator;
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js":
- /*!*********************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js ***!
- \*********************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__ */
- /*! CommonJS bailout: module.exports is used directly at 27:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var _require = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js"),
- Buffer = _require.Buffer;
- var _require2 = __webpack_require__(/*! util */ "?0bed"),
- inspect = _require2.inspect;
- var custom = inspect && inspect.custom || 'inspect';
- function copyBuffer(src, target, offset) {
- Buffer.prototype.copy.call(src, target, offset);
- }
- module.exports =
- /*#__PURE__*/
- function () {
- function BufferList() {
- _classCallCheck(this, BufferList);
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
- _createClass(BufferList, [{
- key: "push",
- value: function push(v) {
- var entry = {
- data: v,
- next: null
- };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
- }
- }, {
- key: "unshift",
- value: function unshift(v) {
- var entry = {
- data: v,
- next: this.head
- };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
- }
- }, {
- key: "shift",
- value: function shift() {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
- }
- }, {
- key: "clear",
- value: function clear() {
- this.head = this.tail = null;
- this.length = 0;
- }
- }, {
- key: "join",
- value: function join(s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }
- return ret;
- }
- }, {
- key: "concat",
- value: function concat(n) {
- if (this.length === 0) return Buffer.alloc(0);
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- } // Consumes a specified amount of bytes or characters from the buffered data.
- }, {
- key: "consume",
- value: function consume(n, hasStrings) {
- var ret;
- if (n < this.head.data.length) {
- // `slice` is the same for buffers and strings.
- ret = this.head.data.slice(0, n);
- this.head.data = this.head.data.slice(n);
- } else if (n === this.head.data.length) {
- // First chunk is a perfect match.
- ret = this.shift();
- } else {
- // Result spans more than one buffer.
- ret = hasStrings ? this._getString(n) : this._getBuffer(n);
- }
- return ret;
- }
- }, {
- key: "first",
- value: function first() {
- return this.head.data;
- } // Consumes a specified amount of characters from the buffered data.
- }, {
- key: "_getString",
- value: function _getString(n) {
- var p = this.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- } // Consumes a specified amount of bytes from the buffered data.
- }, {
- key: "_getBuffer",
- value: function _getBuffer(n) {
- var ret = Buffer.allocUnsafe(n);
- var p = this.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- } // Make sure the linked list only shows the minimal necessary information.
- }, {
- key: custom,
- value: function value(_, options) {
- return inspect(this, _objectSpread({}, options, {
- // Only inspect one level.
- depth: 0,
- // It should not recurse.
- customInspect: false
- }));
- }
- }]);
- return BufferList;
- }();
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js":
- /*!*****************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
- \*****************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 101:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* provided dependency */ var process = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
- // undocumented cb() API, needed for core, not for public API
- function destroy(err, cb) {
- var _this = this;
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err) {
- if (!this._writableState) {
- process.nextTick(emitErrorNT, this, err);
- } else if (!this._writableState.errorEmitted) {
- this._writableState.errorEmitted = true;
- process.nextTick(emitErrorNT, this, err);
- }
- }
- return this;
- } // we set destroyed to true before firing error callbacks in order
- // to make it re-entrance safe in case destroy() is called within callbacks
- if (this._readableState) {
- this._readableState.destroyed = true;
- } // if this is a duplex stream mark the writable part as destroyed as well
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
- this._destroy(err || null, function (err) {
- if (!cb && err) {
- if (!_this._writableState) {
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else if (!_this._writableState.errorEmitted) {
- _this._writableState.errorEmitted = true;
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- } else if (cb) {
- process.nextTick(emitCloseNT, _this);
- cb(err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- });
- return this;
- }
- function emitErrorAndCloseNT(self, err) {
- emitErrorNT(self, err);
- emitCloseNT(self);
- }
- function emitCloseNT(self) {
- if (self._writableState && !self._writableState.emitClose) return;
- if (self._readableState && !self._readableState.emitClose) return;
- self.emit('close');
- }
- function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finalCalled = false;
- this._writableState.prefinished = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
- }
- function emitErrorNT(self, err) {
- self.emit('error', err);
- }
- function errorOrDestroy(stream, err) {
- // We have tests that rely on errors being emitted
- // in the same tick, so changing this is semver major.
- // For now when you opt-in to autoDestroy we allow
- // the error to be emitted nextTick. In a future
- // semver major update we should change the default to this.
- var rState = stream._readableState;
- var wState = stream._writableState;
- if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
- }
- module.exports = {
- destroy: destroy,
- undestroy: undestroy,
- errorOrDestroy: errorOrDestroy
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js":
- /*!***********************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***!
- \***********************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 104:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Ported from https://github.com/mafintosh/end-of-stream with
- // permission from the author, Mathias Buus (@mafintosh).
- var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE;
- function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- callback.apply(this, args);
- };
- }
- function noop() {}
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
- }
- function eos(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
- callback = once(callback || noop);
- var readable = opts.readable || opts.readable !== false && stream.readable;
- var writable = opts.writable || opts.writable !== false && stream.writable;
- var onlegacyfinish = function onlegacyfinish() {
- if (!stream.writable) onfinish();
- };
- var writableEnded = stream._writableState && stream._writableState.finished;
- var onfinish = function onfinish() {
- writable = false;
- writableEnded = true;
- if (!readable) callback.call(stream);
- };
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
- var onend = function onend() {
- readable = false;
- readableEnded = true;
- if (!writable) callback.call(stream);
- };
- var onerror = function onerror(err) {
- callback.call(stream, err);
- };
- var onclose = function onclose() {
- var err;
- if (readable && !readableEnded) {
- if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- if (writable && !writableEnded) {
- if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- };
- var onrequest = function onrequest() {
- stream.req.on('finish', onfinish);
- };
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();else stream.on('request', onrequest);
- } else if (writable && !stream._writableState) {
- // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', onerror);
- stream.on('close', onclose);
- return function () {
- stream.removeListener('complete', onfinish);
- stream.removeListener('abort', onclose);
- stream.removeListener('request', onrequest);
- if (stream.req) stream.req.removeListener('finish', onfinish);
- stream.removeListener('end', onlegacyfinish);
- stream.removeListener('close', onlegacyfinish);
- stream.removeListener('finish', onfinish);
- stream.removeListener('end', onend);
- stream.removeListener('error', onerror);
- stream.removeListener('close', onclose);
- };
- }
- module.exports = eos;
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js":
- /*!**********************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js ***!
- \**********************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module */
- /*! CommonJS bailout: module.exports is used directly at 1:0-14 */
- /***/ ((module) => {
- module.exports = function () {
- throw new Error('Readable.from is not available in the browser')
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js":
- /*!******************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js ***!
- \******************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 97:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // Ported from https://github.com/mafintosh/pump with
- // permission from the author, Mathias Buus (@mafintosh).
- var eos;
- function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- callback.apply(void 0, arguments);
- };
- }
- var _require$codes = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes,
- ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
- function noop(err) {
- // Rethrow the error if it exists to avoid swallowing it
- if (err) throw err;
- }
- function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
- }
- function destroyer(stream, reading, writing, callback) {
- callback = once(callback);
- var closed = false;
- stream.on('close', function () {
- closed = true;
- });
- if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js");
- eos(stream, {
- readable: reading,
- writable: writing
- }, function (err) {
- if (err) return callback(err);
- closed = true;
- callback();
- });
- var destroyed = false;
- return function (err) {
- if (closed) return;
- if (destroyed) return;
- destroyed = true; // request.destroy just do .end - .abort is what we want
- if (isRequest(stream)) return stream.abort();
- if (typeof stream.destroy === 'function') return stream.destroy();
- callback(err || new ERR_STREAM_DESTROYED('pipe'));
- };
- }
- function call(fn) {
- fn();
- }
- function pipe(from, to) {
- return from.pipe(to);
- }
- function popCallback(streams) {
- if (!streams.length) return noop;
- if (typeof streams[streams.length - 1] !== 'function') return noop;
- return streams.pop();
- }
- function pipeline() {
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
- streams[_key] = arguments[_key];
- }
- var callback = popCallback(streams);
- if (Array.isArray(streams[0])) streams = streams[0];
- if (streams.length < 2) {
- throw new ERR_MISSING_ARGS('streams');
- }
- var error;
- var destroys = streams.map(function (stream, i) {
- var reading = i < streams.length - 1;
- var writing = i > 0;
- return destroyer(stream, reading, writing, function (err) {
- if (!error) error = err;
- if (err) destroys.forEach(call);
- if (reading) return;
- destroys.forEach(call);
- callback(error);
- });
- });
- return streams.reduce(pipe);
- }
- module.exports = pipeline;
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js":
- /*!***************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js ***!
- \***************************************************************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: __webpack_require__, module */
- /*! CommonJS bailout: module.exports is used directly at 25:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ERR_INVALID_OPT_VALUE = __webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE;
- function highWaterMarkFrom(options, isDuplex, duplexKey) {
- return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
- }
- function getHighWaterMark(state, options, duplexKey, isDuplex) {
- var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
- if (hwm != null) {
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
- var name = isDuplex ? duplexKey : 'highWaterMark';
- throw new ERR_INVALID_OPT_VALUE(name, hwm);
- }
- return Math.floor(hwm);
- } // Default value
- return state.objectMode ? 16 : 16 * 1024;
- }
- module.exports = {
- getHighWaterMark: getHighWaterMark
- };
- /***/ }),
- /***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
- /*!************************************************************************************************************!*\
- !*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
- \************************************************************************************************************/
- /*! dynamic exports */
- /*! exports [maybe provided (runtime-defined)] [no usage info] */
- /*! runtime requirements: module, __webpack_require__ */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;
- /***/ }),
- /***/ "./node_modules/string_decoder/lib/string_decoder.js":
- /*!***********************************************************!*\
- !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
- \***********************************************************/
- /*! default exports */
- /*! export StringDecoder [provided] [no usage info] [missing usage info prevents renaming] */
- /*! other exports [not provided] [no usage info] */
- /*! runtime requirements: __webpack_require__, __webpack_exports__ */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // 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:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // 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.
- /*<replacement>*/
- var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
- /*</replacement>*/
- var isEncoding = Buffer.isEncoding || function (encoding) {
- encoding = '' + encoding;
- switch (encoding && encoding.toLowerCase()) {
- 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':
- return true;
- default:
- return false;
- }
- };
- function _normalizeEncoding(enc) {
- if (!enc) return 'utf8';
- var retried;
- while (true) {
- switch (enc) {
- case 'utf8':
- case 'utf-8':
- return 'utf8';
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return 'utf16le';
- case 'latin1':
- case 'binary':
- return 'latin1';
- case 'base64':
- case 'ascii':
- case 'hex':
- return enc;
- default:
- if (retried) return; // undefined
- enc = ('' + enc).toLowerCase();
- retried = true;
- }
- }
- };
- // Do not cache `Buffer.isEncoding` when checking encoding names as some
- // modules monkey-patch it to support additional encodings
- function normalizeEncoding(enc) {
- var nenc = _normalizeEncoding(enc);
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
- return nenc || enc;
- }
- // StringDecoder provides an interface for efficiently splitting a series of
- // buffers into a series of JS strings without breaking apart multi-byte
- // characters.
- exports.StringDecoder = StringDecoder;
- function StringDecoder(encoding) {
- this.encoding = normalizeEncoding(encoding);
- var nb;
- switch (this.encoding) {
- case 'utf16le':
- this.text = utf16Text;
- this.end = utf16End;
- nb = 4;
- break;
- case 'utf8':
- this.fillLast = utf8FillLast;
- nb = 4;
- break;
- case 'base64':
- this.text = base64Text;
- this.end = base64End;
- nb = 3;
- break;
- default:
- this.write = simpleWrite;
- this.end = simpleEnd;
- return;
- }
- this.lastNeed = 0;
- this.lastTotal = 0;
- this.lastChar = Buffer.allocUnsafe(nb);
- }
- StringDecoder.prototype.write = function (buf) {
- if (buf.length === 0) return '';
- var r;
- var i;
- if (this.lastNeed) {
- r = this.fillLast(buf);
- if (r === undefined) return '';
- i = this.lastNeed;
- this.lastNeed = 0;
- } else {
- i = 0;
- }
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
- return r || '';
- };
- StringDecoder.prototype.end = utf8End;
- // Returns only complete characters in a Buffer
- StringDecoder.prototype.text = utf8Text;
- // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
- StringDecoder.prototype.fillLast = function (buf) {
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
- this.lastNeed -= buf.length;
- };
- // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
- // continuation byte. If an invalid byte is detected, -2 is returned.
- function utf8CheckByte(byte) {
- 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;
- return byte >> 6 === 0x02 ? -1 : -2;
- }
- // Checks at most 3 bytes at the end of a Buffer in order to detect an
- // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
- // needed to complete the UTF-8 character (if applicable) are returned.
- function utf8CheckIncomplete(self, buf, i) {
- var j = buf.length - 1;
- if (j < i) return 0;
- var nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 1;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 2;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) {
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
- }
- return nb;
- }
- return 0;
- }
- // Validates as many continuation bytes for a multi-byte UTF-8 character as
- // needed or are available. If we see a non-continuation byte where we expect
- // one, we "replace" the validated continuation bytes we've seen so far with
- // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
- // behavior. The continuation byte check is included three times in the case
- // where all of the continuation bytes for a character exist in the same buffer.
- // It is also done this way as a slight performance increase instead of using a
- // loop.
- function utf8CheckExtraBytes(self, buf, p) {
- if ((buf[0] & 0xC0) !== 0x80) {
- self.lastNeed = 0;
- return '\ufffd';
- }
- if (self.lastNeed > 1 && buf.length > 1) {
- if ((buf[1] & 0xC0) !== 0x80) {
- self.lastNeed = 1;
- return '\ufffd';
- }
- if (self.lastNeed > 2 && buf.length > 2) {
- if ((buf[2] & 0xC0) !== 0x80) {
- self.lastNeed = 2;
- return '\ufffd';
- }
- }
- }
- }
- // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
- function utf8FillLast(buf) {
- var p = this.lastTotal - this.lastNeed;
- var r = utf8CheckExtraBytes(this, buf, p);
- if (r !== undefined) return r;
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, p, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, p, 0, buf.length);
- this.lastNeed -= buf.length;
- }
- // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
- // partial character, the character's bytes are buffered until the required
- // number of bytes are available.
- function utf8Text(buf, i) {
- var total = utf8CheckIncomplete(this, buf, i);
- if (!this.lastNeed) return buf.toString('utf8', i);
- this.lastTotal = total;
- var end = buf.length - (total - this.lastNeed);
- buf.copy(this.lastChar, 0, end);
- return buf.toString('utf8', i, end);
- }
- // For UTF-8, a replacement character is added when ending on a partial
- // character.
- function utf8End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + '\ufffd';
- return r;
- }
- // UTF-16LE typically needs two bytes per character, but even if we have an even
- // number of bytes available, we need to check if we end on a leading/high
- // surrogate. In that case, we need to wait for the next two bytes in order to
- // decode the last character properly.
- function utf16Text(buf, i) {
- if ((buf.length - i) % 2 === 0) {
- var r = buf.toString('utf16le', i);
- if (r) {
- var c = r.charCodeAt(r.length - 1);
- if (c >= 0xD800 && c <= 0xDBFF) {
- this.lastNeed = 2;
- this.lastTotal = 4;
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- return r.slice(0, -1);
- }
- }
- return r;
- }
- this.lastNeed = 1;
- this.lastTotal = 2;
- this.lastChar[0] = buf[buf.length - 1];
- return buf.toString('utf16le', i, buf.length - 1);
- }
- // For UTF-16LE we do not explicitly append special replacement characters if we
- // end on a partial character, we simply let v8 handle that.
- function utf16End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) {
- var end = this.lastTotal - this.lastNeed;
- return r + this.lastChar.toString('utf16le', 0, end);
- }
- return r;
- }
- function base64Text(buf, i) {
- var n = (buf.length - i) % 3;
- if (n === 0) return buf.toString('base64', i);
- this.lastNeed = 3 - n;
- this.lastTotal = 3;
- if (n === 1) {
- this.lastChar[0] = buf[buf.length - 1];
- } else {
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- }
- return buf.toString('base64', i, buf.length - n);
- }
- function base64End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
- return r;
- }
- // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
- function simpleWrite(buf) {
- return buf.toString(this.encoding);
- }
- function simpleEnd(buf) {
- return buf && buf.length ? this.write(buf) : '';
- }
- /***/ }),
- /***/ "./node_modules/util-deprecate/browser.js":
- /*!************************************************!*\
- !*** ./node_modules/util-deprecate/browser.js ***!
- \************************************************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: module, __webpack_require__.g, __webpack_require__.* */
- /*! CommonJS bailout: module.exports is used directly at 6:0-14 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- /**
- * Module exports.
- */
- module.exports = deprecate;
- /**
- * Mark that a method should not be used.
- * Returns a modified function which warns once by default.
- *
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
- *
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
- * will throw an Error when invoked.
- *
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
- * will invoke `console.trace()` instead of `console.error()`.
- *
- * @param {Function} fn - the function to deprecate
- * @param {String} msg - the string to print to the console when `fn` is invoked
- * @returns {Function} a new "deprecated" version of `fn`
- * @api public
- */
- function deprecate (fn, msg) {
- if (config('noDeprecation')) {
- return fn;
- }
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config('throwDeprecation')) {
- throw new Error(msg);
- } else if (config('traceDeprecation')) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
- return deprecated;
- }
- /**
- * Checks `localStorage` for boolean values for the given `name`.
- *
- * @param {String} name
- * @returns {Boolean}
- * @api private
- */
- function config (name) {
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
- try {
- if (!__webpack_require__.g.localStorage) return false;
- } catch (_) {
- return false;
- }
- var val = __webpack_require__.g.localStorage[name];
- if (null == val) return false;
- return String(val).toLowerCase() === 'true';
- }
- /***/ }),
- /***/ "?0bed":
- /*!**********************!*\
- !*** util (ignored) ***!
- \**********************/
- /*! unknown exports (runtime-defined) */
- /*! runtime requirements: */
- /***/ (() => {
- /* (ignored) */
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ if(__webpack_module_cache__[moduleId]) {
- /******/ return __webpack_module_cache__[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ // no module.id needed
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/compat get default export */
- /******/ (() => {
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = (module) => {
- /******/ var getter = module && module.__esModule ?
- /******/ () => module['default'] :
- /******/ () => module;
- /******/ __webpack_require__.d(getter, { a: getter });
- /******/ return getter;
- /******/ };
- /******/ })();
- /******/
- /******/ /* webpack/runtime/define property getters */
- /******/ (() => {
- /******/ // define getter functions for harmony exports
- /******/ __webpack_require__.d = (exports, definition) => {
- /******/ for(var key in definition) {
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ })();
- /******/
- /******/ /* webpack/runtime/global */
- /******/ (() => {
- /******/ __webpack_require__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ })();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ (() => {
- /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
- /******/ })();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ (() => {
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = (exports) => {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ })();
- /******/
- /************************************************************************/
- /******/ // module exports must be returned from runtime so entry inlining is disabled
- /******/ // startup
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__("./lib/index.browser.ts");
- /******/ })()
- ;
|